X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fintr.c;h=2ec1f1b5eb311b02ddafe4281a01b7593e6dc3ad;hb=6e968b9e724d9626ed6bdf2119ac7de6a5248f14;hp=194670875146752d75d85ca4113a26dba4aa4c97;hpb=e253f9a0cad14f636a51f6211308491ab19dfbe5;p=bootcensus
diff --git a/src/intr.c b/src/intr.c
index 1946708..2ec1f1b 100644
--- a/src/intr.c
+++ b/src/intr.c
@@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#include
+#include "config.h"
#include "intr.h"
#include "desc.h"
#include "segm.h"
@@ -151,12 +152,17 @@ void dispatch_intr(struct intr_frame frm)
void init_pic(void)
{
+ prog_pic(IRQ_OFFSET);
+}
+
+void prog_pic(int offs)
+{
/* send ICW1 saying we'll follow with ICW4 later on */
outb(ICW1_INIT | ICW1_ICW4_NEEDED, PIC1_CMD);
outb(ICW1_INIT | ICW1_ICW4_NEEDED, PIC2_CMD);
/* send ICW2 with IRQ remapping */
- outb(IRQ_OFFSET, PIC1_DATA);
- outb(IRQ_OFFSET + 8, PIC2_DATA);
+ outb(offs, PIC1_DATA);
+ outb(offs + 8, PIC2_DATA);
/* send ICW3 to setup the master/slave relationship */
/* ... set bit3 = 3rd interrupt input has a slave */
outb(4, PIC1_DATA);
@@ -257,3 +263,10 @@ void end_of_irq(int irq)
set_intr_flag(intr_state);
}
+
+#ifdef ENABLE_GDB_STUB
+void exceptionHandler(int id, void (*func)())
+{
+ set_intr_entry(id, func);
+}
+#endif