重构内存分配器、增加中断支持、整理rust运行时环境 #4

Merged
pointer-to-bios merged 39 commits from downstream into main 2024-04-11 00:36:14 +08:00
4 changed files with 4 additions and 11 deletions
Showing only changes of commit d14187ea96 - Show all commits

View File

@ -2,6 +2,7 @@
#define X86_64_INTERRUPT_H 1
#include <types.h>
#include <utils.h>
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

View File

@ -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)

View File

@ -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`线线falsetrue
force=false时若有存在于`lst`线线falsetrue
*/
bool lst_add(lst_iterator_t *lst, usize left, usize right, bool force);

View File

@ -3,14 +3,6 @@
#include <types.h>
#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