aboutsummaryrefslogtreecommitdiff
path: root/src/gdt.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gdt.h')
-rw-r--r--src/gdt.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gdt.h b/src/gdt.h
index 6aeaa33..4deeec3 100644
--- a/src/gdt.h
+++ b/src/gdt.h
@@ -95,11 +95,13 @@ public:
unsigned int base_31_24 : 8 = 0; // high bits of segment address
} __attribute__((packed));
- enum SegmentMap { null0, kcode, kdata };
+ enum SegmentMap { null0 = 0, kcode = 1, kdata = 2 };
GDT();
~GDT() = default;
- uint16_t descriptor(SegmentMap) const;
+ static constexpr uint16_t descriptor(GDT::SegmentMap i) {
+ return static_cast<uint16_t>(i * sizeof(SegmentDescriptor));
+ }
};