summaryrefslogtreecommitdiffstats
path: root/arch/x86/gdt/Gdt.h
diff options
context:
space:
mode:
authorAlexey Gavrilov <rebovas@yahoo.com>2024-03-31 14:39:51 +0700
committerAlexey Gavrilov <rebovas@yahoo.com>2024-03-31 14:39:51 +0700
commit49cfee4e370892df8404e56d53b04dde196f82f2 (patch)
treed309b630a161823c79dab9a48f67a41a40d76b24 /arch/x86/gdt/Gdt.h
parenta276644952ed018e77ca64181059434a6bc4ee62 (diff)
IDT + uintptr update
Diffstat (limited to 'arch/x86/gdt/Gdt.h')
-rwxr-xr-xarch/x86/gdt/Gdt.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/arch/x86/gdt/Gdt.h b/arch/x86/gdt/Gdt.h
index 6667d93..321d67c 100755
--- a/arch/x86/gdt/Gdt.h
+++ b/arch/x86/gdt/Gdt.h
@@ -2,6 +2,7 @@
#define GDT_H
#include <types.h>
+#include <MemoryOperations.h>
// Define access options
@@ -59,7 +60,7 @@ class DescSeg32 // Segment descriptor
#ifdef __cplusplus
extern "C" {
#endif
-extern void SWITCHTOGDT(uint64 pointer);
+extern void SWITCHTOGDT(uint64 descriptor);
#ifdef __cplusplus
};
#endif
@@ -67,17 +68,23 @@ extern void SWITCHTOGDT(uint64 pointer);
class MngGdt
{
private:
- const static uint8 size = 10;
- static uint64 gdt[size];
- uint8 currIdx;
- bool isGdtLoaded;
+ const static uint8 size = 10;
+ static uint64 gdt[size];
+ static bool isInitialize;
+ static bool gdtLoaded;
+ uint16 codeSegmentKern;
+ uint8 currIdx;
+ MngGdt &operator=(const MngGdt &) = default;
public:
- MngGdt();
- void operator=(const MngGdt& src);
- bool addDescriptor(uint64 desc); // 0 - not set descriptor, 1 - set
- bool loadGdt(); // 0 - if GDT is not loaded, 1 - loaded
- bool getIsGdtLoaded();
+ MngGdt();
+ MngGdt(const MngGdt &) = delete;
+ bool addDescriptor(uint64 desc); // 0 - not set descriptor, 1 - set
+ bool loadGdt(); // 0 - if GDT is not loaded, 1 - loaded
+ uint16 getCodeSegmentKernel();
+ static MngGdt &getInstance();
};
+extern MngGdt mngGdt;
+
#endif