Introduce concept of Process Resources (PR_MEM), implement necessary syscalls
All checks were successful
Build documentation / build-and-deploy (push) Successful in 42s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 42s
This commit is contained in:
14
init/init.c
14
init/init.c
@@ -1,12 +1,18 @@
|
||||
#include <limits.h>
|
||||
#include <m/mem.h>
|
||||
#include <m/proc.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string/string.h>
|
||||
|
||||
void app_main (void) {
|
||||
m_proc_map (M_PROC_MAP_BASE, 1, PM_PRESENT | PM_RW | PM_USER);
|
||||
uintptr_t out_paddr;
|
||||
int mem_rid = m_proc_create_resource_mem (16, RV_PRIVATE, &out_paddr);
|
||||
|
||||
memset ((void*)M_PROC_MAP_BASE, 0, M_PAGE_SIZE);
|
||||
m_proc_map (out_paddr, M_PROC_MAP_BASE, 16, PM_PRESENT | PM_RW | PM_USER);
|
||||
|
||||
m_proc_unmap (M_PROC_MAP_BASE, 1);
|
||||
memset ((void*)M_PROC_MAP_BASE, 0, M_PAGE_SIZE * 16);
|
||||
|
||||
m_proc_unmap (M_PROC_MAP_BASE, 16);
|
||||
|
||||
m_proc_drop_resource (mem_rid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user