Remove amd64_ platform prefix

This commit is contained in:
2026-02-20 15:33:16 +01:00
parent 4472ad5bb3
commit c68b00f2ea
28 changed files with 236 additions and 246 deletions

View File

@@ -10,8 +10,8 @@
#define TSS_PRESENT 0x89
/* Set a GDT entry */
static void amd64_gdt_set (volatile struct gdt_entry* ent, uint32_t base, uint32_t limit,
uint8_t acc, uint8_t gran) {
static void gdt_set (volatile struct gdt_entry* ent, uint32_t base, uint32_t limit, uint8_t acc,
uint8_t gran) {
ent->baselow = (base & 0xFFFF);
ent->basemid = (base >> 16) & 0xFF;
ent->basehigh = (base >> 24) & 0xFF;
@@ -21,7 +21,7 @@ static void amd64_gdt_set (volatile struct gdt_entry* ent, uint32_t base, uint32
}
/* Initialize GDT and TSS structures for a given CPU */
static void amd64_gdt_init (struct cpu* cpu) {
static void gdt_init (struct cpu* cpu) {
volatile struct tss* tss = &cpu->tss;
volatile struct gdt_extended* gdt = &cpu->gdt;
@@ -36,12 +36,12 @@ static void amd64_gdt_init (struct cpu* cpu) {
uint64_t tssbase = (uint64_t)tss;
uint64_t tsslimit = sizeof (*tss) - 1;
amd64_gdt_set (&gdt->old[0], 0, 0, 0, 0);
amd64_gdt_set (&gdt->old[1], 0, 0xFFFFF, 0x9A, 0xA0);
amd64_gdt_set (&gdt->old[2], 0, 0xFFFFF, 0x92, 0xC0);
amd64_gdt_set (&gdt->old[3], 0, 0xFFFFF, 0xF2, 0xC0);
amd64_gdt_set (&gdt->old[4], 0, 0xFFFFF, 0xFA, 0xA0);
amd64_gdt_set (&gdt->tsslow, (tssbase & 0xFFFFFFFF), tsslimit, TSS_PRESENT | TSS, 0);
gdt_set (&gdt->old[0], 0, 0, 0, 0);
gdt_set (&gdt->old[1], 0, 0xFFFFF, 0x9A, 0xA0);
gdt_set (&gdt->old[2], 0, 0xFFFFF, 0x92, 0xC0);
gdt_set (&gdt->old[3], 0, 0xFFFFF, 0xF2, 0xC0);
gdt_set (&gdt->old[4], 0, 0xFFFFF, 0xFA, 0xA0);
gdt_set (&gdt->tsslow, (tssbase & 0xFFFFFFFF), tsslimit, TSS_PRESENT | TSS, 0);
uint32_t tssbasehigh = (tssbase >> 32);
gdt->tsshigh.limitlow = (tssbasehigh & 0xFFFF);
@@ -80,10 +80,10 @@ static void amd64_gdt_init (struct cpu* cpu) {
* load_idt - Tell whether the IDT needs to be loaded. It only has to be loaded once on
* the BSP
*/
void amd64_init (struct cpu* cpu, bool load_idt) {
amd64_gdt_init (cpu);
void init_gdt_idt (struct cpu* cpu, bool load_idt) {
gdt_init (cpu);
if (load_idt)
amd64_load_idt ();
idt_load ();
else
amd64_intr_init ();
intr_init ();
}