X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fidt.c;fp=palacios%2Fsrc%2Fgeekos%2Fidt.c;h=0000000000000000000000000000000000000000;hp=37c7fd0e4f0d53cff3d0f72bfc8581681374a097;hb=ddc16b0737cf58f7aa90a69c6652cdf4090aec51;hpb=626595465a2c6987606a6bc697df65130ad8c2d3 diff --git a/palacios/src/geekos/idt.c b/palacios/src/geekos/idt.c deleted file mode 100644 index 37c7fd0..0000000 --- a/palacios/src/geekos/idt.c +++ /dev/null @@ -1,171 +0,0 @@ -/* - * GeekOS IDT initialization code - * Copyright (c) 2001, David H. Hovemeyer - * $Revision: 1.1 $ - * - * This is free software. You are permitted to use, - * redistribute, and modify it as specified in the file "COPYING". - */ - -#include -#include -#include -#include - -/* ---------------------------------------------------------------------- - * Private data and functions - * ---------------------------------------------------------------------- */ - -/* - * Allocated - */ -//static union IDT_Descriptor s_IDT[ NUM_IDT_ENTRIES ]; -static union IDT_Descriptor *s_IDT = (union IDT_Descriptor *)IDT_LOCATION; - - -/* - * These symbols are defined in lowlevel.asm, and define the - * size of the interrupt entry point table and the sizes - * of the individual entry points. This gives us sufficient - * information to build the IDT. - */ -extern char g_entryPointTableStart, g_entryPointTableEnd; -extern int g_handlerSizeNoErr, g_handlerSizeErr; - -/* - * Table of C interrupt handler functions. - * Note that this is public only because it is used - * in lowlevel.asm. Other code should not refer to it. - */ -Interrupt_Handler g_interruptTable[ NUM_IDT_ENTRIES ]; - - - -void DumpIDT() -{ - int i; - Print("IDT Contents:\n"); - - for (i=0;i> 16; - - /* Install the new table in the IDTR. */ - Load_IDTR(limitAndBase); -} - -/* - * Initialize an interrupt gate with given handler address - * and descriptor privilege level. - */ -void Init_Interrupt_Gate(union IDT_Descriptor* desc, ulong_t addr, - int dpl) -{ - desc->ig.offsetLow = addr & 0xffff; - desc->ig.segmentSelector = KERNEL_CS; - desc->ig.reserved = 0; - desc->ig.signature = 0x70; /* == 01110000b */ - desc->ig.dpl = dpl; - desc->ig.present = 1; - desc->ig.offsetHigh = addr >> 16; -} - -/* - * Install a C handler function for given interrupt. - * This is a lower-level notion than an "IRQ", which specifically - * means an interrupt triggered by external hardware. - * This function can install a handler for ANY interrupt. - */ -void Install_Interrupt_Handler(int interrupt, Interrupt_Handler handler) -{ - KASSERT(interrupt >= 0 && interrupt < NUM_IDT_ENTRIES); - g_interruptTable[interrupt] = handler; -}