From 1ec0947b9eaf472be56bcd7d04cb3fadc78945ed Mon Sep 17 00:00:00 2001 From: acevest Date: Thu, 12 Oct 2023 08:39:02 +0800 Subject: [PATCH] fix typo --- Makefile | 2 +- include/buffer.h | 10 ++++++++++ {fs => kernel}/buffer.c | 6 ++++++ kernel/sched.c | 4 ++-- kernel/setup.c | 2 +- kernel/syscall.c | 2 +- 6 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 include/buffer.h rename {fs => kernel}/buffer.c (80%) diff --git a/Makefile b/Makefile index 1ef9436..533d351 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ CFLAGS += -fno-omit-frame-pointer # 禁用控制流保护: Control-Flow Enforcement Technology (CET) CFLAGS += -fcf-protection=none CFLAGS += -DNR_TTYS=3 -CFLAGS += -DFIX_SYSENTER_ESP_MODE=1 +CFLAGS += -DFIXED_SYSENTER_ESP_MODE=1 CFLAGS += -DENABLE_BOOT_WAIT=0 SYSTEMMAP = System.map diff --git a/include/buffer.h b/include/buffer.h new file mode 100644 index 0000000..fe84e13 --- /dev/null +++ b/include/buffer.h @@ -0,0 +1,10 @@ +/* + * ------------------------------------------------------------------------ + * File Name: buffer.h + * Author: Zhao Yanbai + * 2023-10-11 23:47:15 Wednesday CST + * Description: none + * ------------------------------------------------------------------------ + */ + +#pragma once diff --git a/fs/buffer.c b/kernel/buffer.c similarity index 80% rename from fs/buffer.c rename to kernel/buffer.c index c6d01af..18b7c9b 100644 --- a/fs/buffer.c +++ b/kernel/buffer.c @@ -6,3 +6,9 @@ * Description: none * ------------------------------------------------------------------------ */ + +typedef struct buffer { + // +} buffer_t; + +void init_buffer() {} diff --git a/kernel/sched.c b/kernel/sched.c index 9c8aa3e..50bdb3d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -77,7 +77,7 @@ void init_root_task() { root_task.cr3 = va2pa((unsigned long)(init_pgd)); tss.esp0 = root_task.esp0; -#if FIX_SYSENTER_ESP_MODE +#if FIXED_SYSENTER_ESP_MODE // do nothing #else wrmsr(MSR_SYSENTER_ESP, root_task.esp0, 0); @@ -109,7 +109,7 @@ task_union *alloc_task_union() { void switch_to() { LoadCR3(current->cr3); tss.esp0 = current->esp0; -#if FIX_SYSENTER_ESP_MODE +#if FIXED_SYSENTER_ESP_MODE // do nothing #else wrmsr(MSR_SYSENTER_ESP, current->esp0, 0); diff --git a/kernel/setup.c b/kernel/setup.c index c8fad04..cfda533 100644 --- a/kernel/setup.c +++ b/kernel/setup.c @@ -46,7 +46,7 @@ const char *version = "KERNEL v" VERSION " @" BUILDER void setup_kernel() { printk("sysenter esp mode: %s\n", -#if FIX_SYSENTER_ESP_MODE +#if FIXED_SYSENTER_ESP_MODE "fixed to &tss.esp0" #else "use task union stack" diff --git a/kernel/syscall.c b/kernel/syscall.c index a6d4414..9979ce1 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -27,7 +27,7 @@ unsigned long sysc_handler_table[SYSC_NUM]; void setup_sysc() { wrmsr(MSR_SYSENTER_CS, SELECTOR_KRNL_CS, 0); wrmsr(MSR_SYSENTER_EIP, syscall_entry, 0); -#if FIX_SYSENTER_ESP_MODE +#if FIXED_SYSENTER_ESP_MODE wrmsr(MSR_SYSENTER_ESP, &(tss.esp0), 0); #endif init_sysc_handler_table(); -- 2.44.0