From b6496c9378a90dd64c626500049cdf4911b1ea7c Mon Sep 17 00:00:00 2001 From: TomAwezome Date: Sat, 4 Dec 2021 05:07:38 -0500 Subject: [PATCH] Update IntEntrySet calls to use new IntEntryAlloc system. --- src/Demo/Lectures/InterruptDemo.CC | 2 +- src/Demo/MultiCore/Interrupts.CC | 13 ++++++++----- src/Home/Net/Drivers/E1000.CC | 5 ----- src/Home/Net/Drivers/PCNet.CC | 5 ----- src/Home/Net/Utilities/Net.HH | 16 +--------------- 5 files changed, 10 insertions(+), 31 deletions(-) diff --git a/src/Demo/Lectures/InterruptDemo.CC b/src/Demo/Lectures/InterruptDemo.CC index d6d30083..21185e99 100755 --- a/src/Demo/Lectures/InterruptDemo.CC +++ b/src/Demo/Lectures/InterruptDemo.CC @@ -1,5 +1,5 @@ //This is the software interrupt num -//we will use. See $LK,"Software Int's",A="MN:I_WAKE"$ for +//we will use. See $LK,"Software Int's",A="MN:I_USER"$ for //picking a num. Nums are subject to change. #define I_F_UNARY_MINUS I_USER diff --git a/src/Demo/MultiCore/Interrupts.CC b/src/Demo/MultiCore/Interrupts.CC index bf182946..1705569e 100755 --- a/src/Demo/MultiCore/Interrupts.CC +++ b/src/Demo/MultiCore/Interrupts.CC @@ -6,18 +6,21 @@ interrupt U0 IntBeepOn() interrupt U0 IntBeepOff() { - *(dev.uncached_alias+LAPIC_EOI)(U32 *) = 0; + *(dev.uncached_alias + LAPIC_EOI)(U32 *) = 0; Sound; } U0 IntTest() {//Modify interrupt descriptor table use by all cores. - IntEntrySet(I_USER, &IntBeepOn, IDTET_TRAP); - IntEntrySet(I_USER + 1, &IntBeepOff, IDTET_TRAP); + I64 int_on = IntEntryAlloc, + int_off = IntEntryAlloc; + + IntEntrySet(int_on, &IntBeepOn, IDTET_TRAP); + IntEntrySet(int_off, &IntBeepOff, IDTET_TRAP); //Issue interupt to core1 - MPInt(I_USER, 1); + MPInt(int_on, 1); Sleep(1000); - MPInt(I_USER + 1, 1); + MPInt(int_off, 1); } IntTest; diff --git a/src/Home/Net/Drivers/E1000.CC b/src/Home/Net/Drivers/E1000.CC index a7ecb2fc..0496d601 100755 --- a/src/Home/Net/Drivers/E1000.CC +++ b/src/Home/Net/Drivers/E1000.CC @@ -442,11 +442,6 @@ U0 PCIInterruptsReroute(I64 base) U0 E1000InterruptsSetup() { // .. ? -/* IntEntrySet(I_E1000_0, &E1000IRQ); - IntEntrySet(I_E1000_1, &E1000IRQ); - IntEntrySet(I_E1000_2, &E1000IRQ); - IntEntrySet(I_E1000_3, &E1000IRQ); - PCIInterruptsReroute(I_E1000_0);*/ I64 irq, i; for (i = 0; i < 4; i++) diff --git a/src/Home/Net/Drivers/PCNet.CC b/src/Home/Net/Drivers/PCNet.CC index b9823656..5f25ed4b 100755 --- a/src/Home/Net/Drivers/PCNet.CC +++ b/src/Home/Net/Drivers/PCNet.CC @@ -617,11 +617,6 @@ U0 PCIInterruptsReroute(I64 base) U0 PCNetInterruptsSetup() { // todo: comments explaining process -/* IntEntrySet(I_PCNET0, &PCNetIRQ); - IntEntrySet(I_PCNET1, &PCNetIRQ); - IntEntrySet(I_PCNET2, &PCNetIRQ); - IntEntrySet(I_PCNET3, &PCNetIRQ); - PCIInterruptsReroute(I_PCNET0);*/ I64 irq, i; for (i = 0; i < 4; i++) diff --git a/src/Home/Net/Utilities/Net.HH b/src/Home/Net/Utilities/Net.HH index 0c503a99..61101864 100755 --- a/src/Home/Net/Utilities/Net.HH +++ b/src/Home/Net/Utilities/Net.HH @@ -20,24 +20,10 @@ #define IP_ADDRESS_LENGTH 4 -/* PCNet reroutes PCI interrupts to software. See $LK,"PCNet",A="FF:C:/Home/Net/Drivers/PCNet.CC,irq = "$. +/* NICs reroute PCI interrupts to software. See $LK,"PCNet",A="FF:C:/Home/Net/Drivers/PCNet.CC,irq = "$. Net Handler interrupt is generated whenever an entry is pushed to the NetQueue. See $LK,"NetHandler",A="FF:C:/Home/Net/Utilities/NetHandler.CC,I_NETHANDLER"$. */ -/* -#define I_PCNET0 I_USER + 0 -#define I_PCNET1 I_USER + 1 -#define I_PCNET2 I_USER + 2 -#define I_PCNET3 I_USER + 3 - -#define I_E1000_0 I_USER + 0 -#define I_E1000_1 I_USER + 1 -#define I_E1000_2 I_USER + 2 -#define I_E1000_3 I_USER + 3 - -#define I_NETHANDLER I_USER + 4 -*/ - DefinePrint("I_NETHANDLER", "%d", IntEntryAlloc); #define INT_DEST_CPU 0