From b9b7841dc3f940a839632db84f35bf6332deadf1 Mon Sep 17 00:00:00 2001 From: Jacek Galowicz Date: Fri, 15 Apr 2011 15:08:41 +0200 Subject: [PATCH] Moved IDT related structs from idt.c to idt.h. --- arch/x86/include/asm/idt.h | 34 ++++++++++++++++++++++++++++++++++ arch/x86/kernel/idt.c | 32 -------------------------------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/arch/x86/include/asm/idt.h b/arch/x86/include/asm/idt.h index c589c682..a43d4383 100644 --- a/arch/x86/include/asm/idt.h +++ b/arch/x86/include/asm/idt.h @@ -63,6 +63,40 @@ extern "C" { #endif +/** @brief Defines an IDT entry + * + * This structure defines interrupt descriptor table entries.\n + * They consist of the handling function's base address, some flags + * and a segment selector. + */ +typedef struct { + /// Handler function's lower 16 address bits + unsigned short base_lo; + /// Handler function's segment selector. + unsigned short sel; + /// These bits are reserved by Intel + unsigned char always0; + /// These 8 bits contain flags. Exact use depends on the type of interrupt gate. + unsigned char flags; + /// Higher 16 bits of handler function's base address + unsigned short base_hi; +} __attribute__ ((packed)) idt_entry_t; + + +/** @brief Defines the idt pointer structure. + * + * This structure keeps information about + * base address and size of the interrupt descriptor table. + */ +typedef struct { + /// Size of the IDT in bytes (not the number of entries!) + unsigned short limit; + /// Base address of the IDT + unsigned int base; +} __attribute__ ((packed)) idt_ptr_t; + + + /** @brief Installs IDT * * The installation involves the following steps: diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c index d2fa1095..fd8156c4 100644 --- a/arch/x86/kernel/idt.c +++ b/arch/x86/kernel/idt.c @@ -31,38 +31,6 @@ #include #include -/** @brief Defines an IDT entry - * - * This structure defines interrupt descriptor table entries.\n - * They consist of the handling function's base address, some flags - * and a segment selector. - */ -typedef struct { - /// Handler function's lower 16 address bits - unsigned short base_lo; - /// Handler function's segment selector. - unsigned short sel; - /// These bits are reserved by Intel - unsigned char always0; - /// These 8 bits contain flags. Exact use depends on the type of interrupt gate. - unsigned char flags; - /// Higher 16 bits of handler function's base address - unsigned short base_hi; -} __attribute__ ((packed)) idt_entry_t; - - -/** @brief Defines the idt pointer structure. - * - * This structure keeps information about - * base address and size of the interrupt descriptor table. - */ -typedef struct { - /// Size of the IDT in bytes (not the number of entries!) - unsigned short limit; - /// Base address of the IDT - unsigned int base; -} __attribute__ ((packed)) idt_ptr_t; - /* * Declare an IDT of 256 entries. Although we will only use the * first 32 entries in this tutorial, the rest exists as a bit