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