remove newlines in assert

This commit is contained in:
2026-10-13 23:01:41 +02:00
parent 2a3bc68ba7
commit 56d43a94a9
8 changed files with 16 additions and 16 deletions
+6 -6
View File
@@ -66,7 +66,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_
// since we're likely going to map it at a different base address.
mem_hhdm_base = tmp_hhdm;
assert(pmap_new_kernel(&kernel_vma.pmap, 0) == 0, "Unable to allocate the kernel page table\n");
assert(pmap_new_kernel(&kernel_vma.pmap, 0) == 0, "Unable to allocate the kernel page table");
tailq_init(&kernel_vma.mappings);
// text
@@ -79,7 +79,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_
PTE_READ | PTE_EXEC,
CACHE_ANY
);
assert(!status, "Failed to map %p with error %i\n", p, status);
assert(!status, "Failed to map %p with error %i", p, status);
}
// rodata
@@ -92,7 +92,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_
PTE_READ,
CACHE_ANY
);
assert(!status, "Failed to map %p with error %i\n", p, status);
assert(!status, "Failed to map %p with error %i", p, status);
}
// data
@@ -105,7 +105,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_
PTE_READ | PTE_WRITE,
CACHE_ANY
);
assert(!status, "Failed to map %p with error %i\n", p, status);
assert(!status, "Failed to map %p with error %i", p, status);
}
// The kernel address space is divided into 4 segments.
@@ -124,7 +124,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_
uintptr_t vaddr = (uintptr_t)(map[i].address + p + tmp_hhdm);
phys_t paddr = (phys_t)(map[i].address + p);
errno_t status = pmap_map(&kernel_vma.pmap, vaddr, paddr, PTE_READ | PTE_WRITE, CACHE_ANY);
assert(!status, "Failed to map HHDM page %p to %p with error %i\n", (void*)vaddr, (void*)paddr, status);
assert(!status, "Failed to map HHDM page %p to %p with error %i", (void*)vaddr, (void*)paddr, status);
}
}
mem_hhdm_base = tmp_hhdm;
@@ -152,7 +152,7 @@ void mem_init(struct phys_mem* map, size_t map_len, uintptr_t kernel_virt, phys_
for (size_t page = 0; page < length; page += pgsz) {
phys_t paddr;
assert(!mem_phys_alloc(1, 0, &paddr), "Failed to allocate memory for PFNDB!\n");
assert(!mem_phys_alloc(1, 0, &paddr), "Failed to allocate memory for PFNDB!");
assert(
!pmap_map(&kernel_vma.pmap, vaddr + page, paddr, PTE_READ | PTE_WRITE, CACHE_ANY),
"Failed to map PFNDB memory"
+1 -1
View File
@@ -112,7 +112,7 @@ bool vma_page_fault(struct vma* v, const struct vma_fault_info* info) {
if (still_valid) {
errno_t status =
pmap_map(&v->pmap, faulty_page * page_size, vm_page_addr(page), prot_to_pte(v, prot), CACHE_ANY);
assert(status == 0, "Failed to map a demand-loaded page\n");
assert(status == 0, "Failed to map a demand-loaded page");
}
spin_unlock(&v->lock);
+3 -3
View File
@@ -37,11 +37,11 @@ void sched_to_user_context(uintptr_t ctx) {
void sched_init(struct scheduler* sched) {
struct task* idle_task;
assert(task_create("idle", &kernel_vma, idle_func, 0, &idle_task) == 0, "Unable to create idle task!\n");
assert(task_create("idle", &kernel_vma, idle_func, 0, &idle_task) == 0, "Unable to create idle task!");
sched->idle_task = idle_task;
struct task* boot_task = mem_alloc(sizeof(struct task), 0);
assert(boot_task != nullptr, "Unable to create boot task!\n");
assert(boot_task != nullptr, "Unable to create boot task!");
strncpy(boot_task->name, "boot", sizeof(boot_task->name));
boot_task->space = &kernel_vma;
sched->current = boot_task;
@@ -52,7 +52,7 @@ void sched_init(struct scheduler* sched) {
}
void sched_add_task(struct scheduler* sched, struct task* task) {
assert(task != nullptr, "Tried to add NULL to the run queue\n");
assert(task != nullptr, "Tried to add NULL to the run queue");
task->state = TASK_STATE_READY;
tailq_insert_tail(&sched->run_queue, task, next);
}