From d94ffac4a584dc7a4f6f2ec567b8caab05ce9253 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 6 May 2020 19:04:05 +0200 Subject: New build parameters and shared includes This changes many files but I've just applied some replace commands.. So - nothing special! --- src/kernel/gdt/gdt.c | 74 ++++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'src/kernel/gdt/gdt.c') diff --git a/src/kernel/gdt/gdt.c b/src/kernel/gdt/gdt.c index 4e8428f..616fb25 100644 --- a/src/kernel/gdt/gdt.c +++ b/src/kernel/gdt/gdt.c @@ -1,8 +1,8 @@ #include -#include -#include -#include -#include +#include +#include +#include +#include struct gdt_entry { unsigned short limit_low; @@ -22,40 +22,40 @@ struct gdt_entry gdt[6]; struct gdt_ptr gp; struct tss_entry_struct { - uint32_t prev_tss; - uint32_t esp0; - uint32_t ss0; - uint32_t esp1; - uint32_t ss1; - uint32_t esp2; - uint32_t ss2; - uint32_t cr3; - uint32_t eip; - uint32_t eflags; - uint32_t eax; - uint32_t ecx; - uint32_t edx; - uint32_t ebx; - uint32_t esp; - uint32_t ebp; - uint32_t esi; - uint32_t edi; - uint32_t es; - uint32_t cs; - uint32_t ss; - uint32_t ds; - uint32_t fs; - uint32_t gs; - uint32_t ldt; - uint16_t trap; - uint16_t iomap_base; + u32 prev_tss; + u32 esp0; + u32 ss0; + u32 esp1; + u32 ss1; + u32 esp2; + u32 ss2; + u32 cr3; + u32 eip; + u32 eflags; + u32 eax; + u32 ecx; + u32 edx; + u32 ebx; + u32 esp; + u32 ebp; + u32 esi; + u32 edi; + u32 es; + u32 cs; + u32 ss; + u32 ds; + u32 fs; + u32 gs; + u32 ldt; + u16 trap; + u16 iomap_base; } __attribute__((packed)); struct tss_entry_struct tss_entry; extern void gdt_flush(); -void gdt_set_gate(int32_t num, uint32_t base, uint32_t limit, uint8_t access, uint8_t gran) +void gdt_set_gate(s32 num, u32 base, u32 limit, u8 access, u8 gran) { // Set descriptor base address gdt[num].base_low = (unsigned short)(base & 0xFFFF); @@ -71,7 +71,7 @@ void gdt_set_gate(int32_t num, uint32_t base, uint32_t limit, uint8_t access, ui gdt[num].access = access; } -extern uint32_t stack_hold; +extern u32 stack_hold; void gdt_install() { @@ -107,10 +107,10 @@ void gdt_install() info("Installed Global Descriptor Table"); } -void tss_write(int32_t num, uint16_t ss0, uint32_t esp0) +void tss_write(s32 num, u16 ss0, u32 esp0) { - uint32_t base = (uint32_t)&tss_entry; - uint32_t limit = base + sizeof(tss_entry); + u32 base = (u32)&tss_entry; + u32 limit = base + sizeof(tss_entry); gdt_set_gate(num, base, limit, 0xE9, 0x00); @@ -127,7 +127,7 @@ void tss_flush() asm volatile("ltr %%ax" : : "a"(0x2B)); } -void set_kernel_stack(uintptr_t stack) +void set_kernel_stack(u32 stack) { tss_entry.esp0 = stack; } \ No newline at end of file -- cgit v1.2.3