diff options
| author | Alexey Gavrilov <rebovas@yahoo.com> | 2024-05-24 14:07:47 +0700 |
|---|---|---|
| committer | Alexey Gavrilov <rebovas@yahoo.com> | 2024-05-24 14:07:47 +0700 |
| commit | 5fbf41e967ed8e413ecf1e6abb72e8d285169df4 (patch) | |
| tree | 48e25b199ae3459e12c7202f7b18a37cd087bf9b /arch/x86/PrimaryInit.h | |
| parent | 0a50b1758fd3da118408fd724825d0a50a9ecf17 (diff) | |
Pic + Tuple + refactor PrimaryInitialization class
Diffstat (limited to 'arch/x86/PrimaryInit.h')
| -rw-r--r-- | arch/x86/PrimaryInit.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/x86/PrimaryInit.h b/arch/x86/PrimaryInit.h index 540ad41..239595d 100644 --- a/arch/x86/PrimaryInit.h +++ b/arch/x86/PrimaryInit.h @@ -1,10 +1,49 @@ #include "gdt/Gdt.h" #include "io/VGADisplay.h" #include "idt/Idt.h" +#include "ic/Pic.h" +#include <containers/Tuple.h> +struct InterruptFrame +{ +#ifdef X86_64 + uint64 ip; + uint64 cs; + uint64 flags; +#else + uint32 ip; + uint32 cs; + uint32 flags; +#endif +}; + +using isr = void (*)(const InterruptFrame *frame); +using isrExc= void (*)(const InterruptFrame *frame, uword errorCode); +using null = decltype(nullptr); +using InterruptFuncs = parameters<repeat<8, isr>::toList, + isrExc, + null, + repeat<5, isrExc>::toList, + null, + isr, + isrExc, + repeat<3, isr>::toList, + isrExc, + repeat<10, null>::toList, + repeat<2, isr>::toList + >::submitTo<Tuple>; +struct isrPerform +{ + static void perform(isr funp, DescInterrupt32 &desc); + static void perform(isrExc funp, DescInterrupt32 &desc); + static void perform(null null, DescInterrupt32 &desc); +}; + class PrimaryInitialization { + private: + SingletonPic picSingle; protected: virtual void processorInitialize(); virtual void devicesInitialize(); |
