From d14187ea96c5fffe96d317b91279d25547eec582 Mon Sep 17 00:00:00 2001 From: pointer-to-bios Date: Mon, 12 Feb 2024 02:59:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=E7=AC=A6=E5=8F=B7=E5=91=BD?= =?UTF-8?q?=E5=90=8D=EF=BC=8C=E5=90=8C=E6=AD=A5=E5=87=BD=E6=95=B0=E7=9A=84?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=EF=BC=8C=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E5=AE=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/kernel/arch/x86_64/interrupt.h | 3 ++- include/kernel/arch/x86_64/memm.h | 2 +- include/libk/lst.h | 2 +- include/utils.h | 8 -------- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/include/kernel/arch/x86_64/interrupt.h b/include/kernel/arch/x86_64/interrupt.h index e4110a2..fb6b536 100644 --- a/include/kernel/arch/x86_64/interrupt.h +++ b/include/kernel/arch/x86_64/interrupt.h @@ -2,6 +2,7 @@ #define X86_64_INTERRUPT_H 1 #include +#include typedef struct __gate_descriptor_t { @@ -11,7 +12,7 @@ typedef struct __gate_descriptor_t u16 offset_23; u32 offset_4567; u32 reserved; -} gate_descriptor_t; +} DISALIGNED gate_descriptor_t; // interrupt stack table,每个表项都指向tss // 需要加载寄存器IA32_INTERRUPT_SSP_TABLE diff --git a/include/kernel/arch/x86_64/memm.h b/include/kernel/arch/x86_64/memm.h index a8594ee..65401f0 100644 --- a/include/kernel/arch/x86_64/memm.h +++ b/include/kernel/arch/x86_64/memm.h @@ -15,7 +15,7 @@ typedef enum __memm_page_size extern u64 PML4[512]; -#define MEMM_PAGE_TABLE_FLAGS_AREA ((u64)0xfff) +#define MEMM_PAGE_TABLE_FLAGS_MASK ((u64)0xfff) /* 页对齐掩码 */ #define MEMM_4K_ALIGN_MASK ((u64)0xfff) diff --git a/include/libk/lst.h b/include/libk/lst.h index 4cc7e4d..205217c 100644 --- a/include/libk/lst.h +++ b/include/libk/lst.h @@ -33,7 +33,7 @@ bool lst_remove(lst_iterator_t *lst, usize left, usize right, bool force); /* 在`lst`中添加一个线段[left,right) force=true时忽略已经存在于`lst`中的线段 -force=false时若有存在于`lst`中的线段,只添加这些部分之外的线段,返回false,否则返回true +force=false时若有存在于`lst`中的线段,不添加任何线段,返回false,否则返回true */ bool lst_add(lst_iterator_t *lst, usize left, usize right, bool force); diff --git a/include/utils.h b/include/utils.h index 4050e10..f312325 100644 --- a/include/utils.h +++ b/include/utils.h @@ -3,14 +3,6 @@ #include -#define UTILS_BIT_GET(byte, bit) ((byte) & (1 << (bit))) -#define UTILS_BIT_SET(byte, bit) ((byte) |= (1 << (bit))); -#define UTILS_BIT_RESET(byte, bit) ((byte) &= ~(1 << (bit))); - -#define UTILS_BITMAP_GET(map, bit) (((u8 *)(map))[bit / 8] & (1 << ((bit) % 8))) -#define UTILS_BITMAP_SET(map, bit) (((u8 *)(map))[bit / 8] |= (1 << ((bit) % 8))); -#define UTILS_BITMAP_RESET(map, bit) (((u8 *)(map))[bit / 8] &= ~(1 << ((bit) % 8))); - #define DISALIGNED __attribute__((packed)) #endif