summaryrefslogtreecommitdiff
path: root/ioapic.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-08-08 19:58:06 +0000
committerrtm <rtm>2006-08-08 19:58:06 +0000
commit0e84a0ec6e7893dad13dff9a958c5bc987b79c82 (patch)
tree5739d0a2af8277db7a47c74e52975d9e9d81cef7 /ioapic.c
parente8d11c2e846ad15b32caacc8a919722b76d00f79 (diff)
downloadxv6-labs-0e84a0ec6e7893dad13dff9a958c5bc987b79c82.tar.gz
xv6-labs-0e84a0ec6e7893dad13dff9a958c5bc987b79c82.tar.bz2
xv6-labs-0e84a0ec6e7893dad13dff9a958c5bc987b79c82.zip
fix race in holding() check in acquire()
give cpu1 a TSS and gdt for when it enters scheduler() and a pseudo proc[] entry for each cpu cpu0 waits for each other cpu to start up read() for files
Diffstat (limited to 'ioapic.c')
-rw-r--r--ioapic.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ioapic.c b/ioapic.c
index 776f895..b926863 100644
--- a/ioapic.c
+++ b/ioapic.c
@@ -65,7 +65,7 @@ ioapic_init(void)
}
void
-ioapic_enable (int irq, int cpu)
+ioapic_enable (int irq, int cpunum)
{
uint l, h;
struct ioapic *io;
@@ -76,7 +76,7 @@ ioapic_enable (int irq, int cpu)
ioapic_write(io, IOAPIC_REDTBL_LO(irq), l);
h = ioapic_read(io, IOAPIC_REDTBL_HI(irq));
h &= ~IOART_DEST;
- h |= (cpu << APIC_ID_SHIFT); // for fun, disk interrupts to cpu 1
+ h |= (cpunum << APIC_ID_SHIFT); // for fun, disk interrupts to cpu 1
ioapic_write(io, IOAPIC_REDTBL_HI(irq), h);
- cprintf("intr %d: lo 0x%x hi 0x%x\n", irq, l, h);
+ cprintf("cpu%d: intr %d: lo 0x%x hi 0x%x\n", cpu(), irq, l, h);
}