diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-15 21:07:59 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-15 21:07:59 +0200 |
commit | 8b88f3f7fd143fc542a5118d50a7a981464270d5 (patch) | |
tree | 86b4ca2b14b3594d3eaa7ff449db72920cad2b70 /src/gdt.h | |
parent | Enable ThinLTO (diff) | |
download | kernel.cpp-8b88f3f7fd143fc542a5118d50a7a981464270d5.tar.xz |
Fix compile failure without -O2
Linking fails without lto on
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)); + } }; |