Let the user application decide upon the resource ID (RID)
All checks were successful
Build documentation / build-and-deploy (push) Successful in 22s

This commit is contained in:
2026-01-14 23:19:39 +01:00
parent 7cd5623d36
commit ebd9f0cac6
8 changed files with 28 additions and 24 deletions

View File

@@ -42,10 +42,9 @@ struct proc* proc_from_elf (uint8_t* elf_contents) {
return NULL;
}
int kstk_rid = atomic_fetch_add (&proc->rids, 1);
struct proc_resource_mem_init kstk_mem_init = {.pages = KSTACK_SIZE / PAGE_SIZE};
struct proc_resource* kstk_r =
proc_create_resource (proc, kstk_rid, PR_MEM, RV_PRIVATE, (void*)&kstk_mem_init);
proc_create_resource (proc, 0, PR_MEM, RV_PRIVATE, (void*)&kstk_mem_init);
if (kstk_r == NULL) {
pmm_free (proc->pd->cr3_paddr, 1);
free (proc->pd);
@@ -55,10 +54,9 @@ struct proc* proc_from_elf (uint8_t* elf_contents) {
proc->pdata.kernel_stack = kstk_r->u.mem.paddr + (uintptr_t)hhdm->offset + KSTACK_SIZE;
int ustk_rid = atomic_fetch_add (&proc->rids, 1);
struct proc_resource_mem_init ustk_mem_init = {.pages = USTACK_SIZE / PAGE_SIZE};
struct proc_resource* ustk_r =
proc_create_resource (proc, ustk_rid, PR_MEM, RV_PRIVATE, (void*)&ustk_mem_init);
proc_create_resource (proc, 1, PR_MEM, RV_PRIVATE, (void*)&ustk_mem_init);
if (ustk_r == NULL) {
kstk_r->ops.cleanup (proc, kstk_r);
free (kstk_r);