Moved IDT related structs from idt.c to idt.h.
This commit is contained in:
parent
02cf1d87f2
commit
b9b7841dc3
2 changed files with 34 additions and 32 deletions
|
@ -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:
|
||||
|
|
|
@ -31,38 +31,6 @@
|
|||
#include <metalsvm/string.h>
|
||||
#include <asm/idt.h>
|
||||
|
||||
/** @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
|
||||
|
|
Loading…
Add table
Reference in a new issue