Irqs are working. Scheduler modified to come back from no tasks.

- Userspace irq handling for timer.
- If no runnable task is left. scheduler busy loops in user context
  of last runnable task until a new task becomes runnable.
This commit is contained in:
Bahadir Balban
2009-12-14 11:48:40 +02:00
parent d85ccdb3fe
commit 27c0c34e3d
7 changed files with 63 additions and 26 deletions

View File

@@ -18,17 +18,6 @@ static inline void enable_irqs()
);
}
static inline int irqs_enabled()
{
register unsigned int enabled asm("r1");
__asm__ __volatile__(
"mrs r0, cpsr_fc\n"
"tst r0, #0x80\n" /* ARM_IRQ_BIT. See asm.h for TST inst. */
"moveq r1, #1\n"
"movne r1, #0\n"
);
return enabled;
}
static inline void disable_irqs()
{
@@ -39,6 +28,8 @@ static inline void disable_irqs()
);
}
int irqs_enabled();
/* Disable the irqs unconditionally, but also keep the previous state such that
* if it was already disabled before the call, the restore call would retain
* this state. */
@@ -58,13 +49,7 @@ void irq_local_disable_save(unsigned long *state);
/* Simply change it back to original state supplied in @flags. This might enable
* or retain disabled state of the irqs for example. Useful for nested calls. */
static inline void irq_local_restore(unsigned long state)
{
__asm__ __volatile__ (
"msr cpsr_fc, %0\n"
:: "r" (state)
);
}
void irq_local_restore(unsigned long state);
static inline void irq_local_enable()
{

View File

@@ -61,7 +61,7 @@ do { \
(wqh)->sleepers++; \
list_insert_tail(&wq.task_list, \
&(wqh)->task_list); \
printk("(%d) waiting...\n", current->tid); \
/* printk("(%d) waiting...\n", current->tid); */\
sched_prepare_sleep(); \
spin_unlock_irq(&(wqh)->slock, irqsave); \
schedule(); \