From 0e84a0ec6e7893dad13dff9a958c5bc987b79c82 Mon Sep 17 00:00:00 2001 From: rtm Date: Tue, 8 Aug 2006 19:58:06 +0000 Subject: 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 --- ioapic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ioapic.c') 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); } -- cgit v1.2.3