Converted all wait/wakeup runqueue lock/unlock paths to irq versions.

Irqs can now touch runqueues and do async wakeups. This necessitated
that we implement all wake up wait and runqueue locking work with irqs.

All this, assumes that in an SMP setup we may have cross-cpu wake ups,
runqueue manipulation. If we later decide that we only wake up threads
in the current container, (and lock containers to cpus) we won't really
need spinlocks, or irq disabling anymore. The current set up might be
trivially less responsive, but is more flexible.
This commit is contained in:
Bahadir Balban
2009-12-12 01:20:14 +02:00
parent b1614191b3
commit 32c0bb3a76
11 changed files with 155 additions and 72 deletions

23
conts/libl4/src/irq.c Normal file
View File

@@ -0,0 +1,23 @@
/*
* Functions for userspace irq handling.
*
* Copyright (C) 2009 B Labs Ltd.
*/
#include <l4lib/arch/irq.h>
#include <l4lib/arch/syscalls.h>
#include <l4/api/irq.h>
/*
* Reads the irq notification slot. Destructive atomic read ensures that
* an irq may write to the slot in sync.
*/
int l4_irq_read_blocking(int slot, int irqnum)
{
int irqval = l4_atomic_dest_readb(&l4_get_utcb()->notify[slot]);
if (!irqval)
return l4_irq_control(IRQ_CONTROL_WAIT, 0, irqnum);
else
return irqval;
}