fix: the correct way to detect ahci LBA48 support
[lunaix-os.git] / lunaix-os / kernel / asm / x86 / gdt.c
index 1bd1c0028a77679cbfe7a439584c3b83d7682659..4c4dd54b330c61355260514cd42e445f3a367c33 100644 (file)
@@ -1,14 +1,17 @@
 #include <arch/x86/gdt.h>
 #include <arch/x86/tss.h>
-#include <stdint.h>
+#include <lunaix/types.h>
 
 #define GDT_ENTRY 6
 
 uint64_t _gdt[GDT_ENTRY];
 uint16_t _gdt_limit = sizeof(_gdt) - 1;
 
-void _set_gdt_entry(uint32_t index, uint32_t base, uint32_t limit, uint32_t flags) {
-    _gdt[index] = SEG_BASE_H(base) | flags | SEG_LIM_H(limit) | SEG_BASE_M(base);
+void
+_set_gdt_entry(u32_t index, u32_t base, u32_t limit, u32_t flags)
+{
+    _gdt[index] =
+      SEG_BASE_H(base) | flags | SEG_LIM_H(limit) | SEG_BASE_M(base);
     _gdt[index] <<= 32;
     _gdt[index] |= SEG_BASE_L(base) | SEG_LIM_L(limit);
 }
@@ -16,7 +19,8 @@ void _set_gdt_entry(uint32_t index, uint32_t base, uint32_t limit, uint32_t flag
 extern struct x86_tss _tss;
 
 void
-_init_gdt() {
+_init_gdt()
+{
     _set_gdt_entry(0, 0, 0, 0);
     _set_gdt_entry(1, 0, 0xfffff, SEG_R0_CODE);
     _set_gdt_entry(2, 0, 0xfffff, SEG_R0_DATA);