sched: core: added irqsave to spinlocks

Spin locks:
Changed most spinlocks from spin_lock and spin_unlock to
spin_lock_irqsave and spin_unlock_irqrestore respectively. Spin locks
which have been changed are about to edit the queue pointers of a run
queue and interrupts might change these aswell (event signals etc..).
Therefore, when editing these queue's interrupts should be excluded.

Thread queue's:
Added thread queue's as a build option to Kconfig. Thread queue's are
required by event mutexes, but otherwise they should be an optional
feature which can be picked if preferred.

Signed-off-by: Michel Megens <dev@michelmegens.net>
sched: core: added evm signal function

rq_signal_event_queue:
This function signals the queue of a thread if it has been signaled by
an IRQ (i.e. struct thread::ec has been incremented). This function is
called by rq_schedule to handle evm's (Event Mutexes).

raw_rq_add_thread:
Removed this bit of code:

if(tp->on_rq && test_bit(THREAD_RUNNING_FLAG, &tp->flags))
	err = raw_rq_remove_thread_noresched(tp->rq, tp);

It would create a massive bug on SMP systems if you were to try and add
a thread to a run queue while its on the run queue of another CPU.
Moving threads to other run queue's should be done by the IDLE balancer
only.
Changed the return value from `int' to `void'.

raw_queue_remove_thread:
Removed:

if(test_bit(THREAD_RUNNING_FLAG, &tp->flags))
	raw_rq_add_thread(sched_get_cpu_rq(), tp)

It was causing trouble for event queue's. Readding threads which come
off an event queue should be readded manually at all times. Also changed
the return value of raw_queue_remove_thread from `int' to `void'.

Signed-off-by: Michel Megens <dev@michelmegens.net>