Replace some uses of check() with expect()
This commit is contained in:
parent
bb92480aa3
commit
bed29e71af
@ -80,7 +80,7 @@ static void set_base(GDTEntry* entry, u32 base)
|
||||
|
||||
static void set_limit(GDTEntry* entry, u32 limit)
|
||||
{
|
||||
check(limit <= 0xFFFFF);
|
||||
expect(limit <= 0xFFFFF, "Limit too big for a GDT entry");
|
||||
entry->limit0 = limit & 0xFFFF;
|
||||
entry->limit1_flags = (entry->limit1_flags & 0xF0) | ((limit >> 16) & 0xF);
|
||||
}
|
||||
@ -208,7 +208,7 @@ struct IDTR
|
||||
static void idt_add_handler(short num, void* handler, u8 type_attr)
|
||||
{
|
||||
check(handler != nullptr);
|
||||
check(num < 256);
|
||||
expect(num < 256, "IDT can only hold up to 256 entries");
|
||||
IDTEntry* entry_for_handler = &idt[num];
|
||||
entry_for_handler->selector = 0x08;
|
||||
entry_for_handler->type_attr = type_attr;
|
||||
|
@ -64,7 +64,7 @@ static bool is_block_free(HeapBlock* block)
|
||||
|
||||
static usize space_available(HeapBlock* block)
|
||||
{
|
||||
check(!is_block_free(block));
|
||||
expect(!is_block_free(block), "Attempting to split a free block");
|
||||
return block->full_size - block->req_size;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user