diff options
Diffstat (limited to 'src/gdt.h')
-rw-r--r-- | src/gdt.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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)); + } }; |