Implement proc_map () and proc_unmap () syscalls
All checks were successful
Build documentation / build-and-deploy (push) Successful in 21s

This commit is contained in:
2026-01-06 23:32:11 +01:00
parent 9f107a1a5e
commit 28aef30f77
15 changed files with 155 additions and 18 deletions

13
libmsl/m/mem.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef _LIBMSL_M_MEM_H
#define _LIBMSL_M_MEM_H
#if defined(__x86_64__)
#define M_PROC_MAP_BASE 0x0000700000000000
#define M_PAGE_SIZE 4096
#endif
#define PM_PRESENT (1 << 0)
#define PM_RW (1 << 1)
#define PM_USER (1 << 2)
#endif // _LIBMSL_M_MEM_H

View File

@@ -1,6 +1,16 @@
#include <m/syscall.h>
#include <m/syscall_defs.h>
#include <stddef.h>
#include <stdint.h>
int m_proc_quit (void) { return m_syscall (SYS_PROC_QUIT, 0, 0, 0, 0, 0, 0); }
int m_proc_test (void) { return m_syscall (SYS_PROC_TEST, 0, 0, 0, 0, 0, 0); }
int m_proc_map (uintptr_t vaddr, size_t pages, uint32_t flags) {
return m_syscall (SYS_PROC_MAP, vaddr, (uintptr_t)pages, (uintptr_t)flags, 0, 0, 0);
}
int m_proc_unmap (uintptr_t vaddr, size_t pages) {
return m_syscall (SYS_PROC_UNMAP, vaddr, (uintptr_t)pages, 0, 0, 0, 0);
}

View File

@@ -1,8 +1,12 @@
#ifndef _LIBMSL_M_PROC_H
#define _LIBMSL_M_PROC_H
int m_proc_quit (void);
#include <stddef.h>
#include <stdint.h>
int m_proc_quit (void);
int m_proc_test (void);
int m_proc_map (uintptr_t vaddr, size_t pages, uint32_t flags);
int m_proc_unmap (uintptr_t vaddr, size_t pages);
#endif // _LIBMSL_M_PROC_H