All checks were successful
Build documentation / build-and-deploy (push) Successful in 22s
29 lines
611 B
C
29 lines
611 B
C
#include <limits.h>
|
|
#include <m/proc.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <string/string.h>
|
|
|
|
char c = 'a';
|
|
|
|
void app_main (void) {
|
|
uintptr_t out_paddr;
|
|
int mem_rid = proc_create_resource_mem (100, 16, RV_PRIVATE, &out_paddr);
|
|
|
|
proc_map (out_paddr, PROC_MAP_BASE, 16, PM_PRESENT | PM_RW | PM_USER);
|
|
|
|
memset ((void*)PROC_MAP_BASE, 0, PAGE_SIZE * 16);
|
|
|
|
proc_unmap (PROC_MAP_BASE, 16);
|
|
|
|
proc_drop_resource (mem_rid);
|
|
|
|
proc_test ('a');
|
|
|
|
int mutex_rid = proc_create_resource_mutex (101, RV_PRIVATE);
|
|
|
|
proc_mutex_lock (mutex_rid);
|
|
proc_test ('b');
|
|
proc_mutex_unlock (mutex_rid);
|
|
}
|