diff options
| author | Alexey Gavrilov <90127298+rebovas@users.noreply.github.com> | 2024-05-24 14:33:19 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-24 14:33:19 +0700 |
| commit | dc0b89fa63a181bd4add318bfd7a46344702f4e7 (patch) | |
| tree | 48e25b199ae3459e12c7202f7b18a37cd087bf9b /arch/x86/idt/Idt.h | |
| parent | 0a50b1758fd3da118408fd724825d0a50a9ecf17 (diff) | |
| parent | 5fbf41e967ed8e413ecf1e6abb72e8d285169df4 (diff) | |
Pic + Tuple + refactor PrimaryInitialization class
Diffstat (limited to 'arch/x86/idt/Idt.h')
| -rw-r--r-- | arch/x86/idt/Idt.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/x86/idt/Idt.h b/arch/x86/idt/Idt.h index 7370526..3054fd5 100644 --- a/arch/x86/idt/Idt.h +++ b/arch/x86/idt/Idt.h @@ -35,8 +35,9 @@ class DescInterrupt32 void setOffset(uint32 offset); void setGateType(uint8 gateType); void setDpl(uint8 dpl); - uint64 getDescriptor(); - static DescInterrupt32 InterruptKernelLong(uint32 offset, + uint64 getDescriptor() const; + uint32 getOffset() const; + static DescInterrupt32 InterruptKernelLong(uint32 offset, uint16 selector); static DescInterrupt32 TrapKernelLong(uint32 offset, uint16 selector); @@ -47,7 +48,7 @@ class MngIdt { private: const static uint8 reservedIntSize = 12; - constexpr static uint8 reservedInts[reservedIntSize] = + constexpr static uint8 reservedInts[reservedIntSize] = { 9, 15, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; @@ -58,7 +59,12 @@ class MngIdt static bool isInitialize; static bool idtLoaded; uint8 currIdx; + // Start number of interrupts that service IRQ + // Accpet this number as first interrupt descriptor + // with dpl = 2 or 3 (drivers) + uint8 irqInterruptStart; public: + const static uint8 firstSystemIntNumber = 0x20; MngIdt(); MngIdt(const MngIdt &) = delete; bool addDescriptor(DescInterrupt32 desc); @@ -66,6 +72,8 @@ class MngIdt bool canDescriptorWrite(uint8 idx); bool loadIdt(); static MngIdt &getInstance(); + uint8 getIrqInterruptStart(); + bool isInterruptSet(uint8 numberInterrupt); }; extern MngIdt mngIdt; |
