syscall: add mmap and munmap

This commit is contained in:
Michael Shaw 2025-03-05 20:43:14 -05:00
commit 0870bd8737
6 changed files with 41 additions and 4 deletions

View file

@ -17,6 +17,8 @@
#define PAGE_PWT 0x8
#define PAGE_PCD 0x10
#define MAP_ANONYMOUS 0x20
#ifndef __ASM__
#define ALIGN(_a) __attribute__((aligned(_a)))

View file

@ -56,7 +56,7 @@ void *kmalloc(size_t size, uint64_t flags);
void *kzalloc(size_t size, uint64_t flags);
void *krealloc(void *ptr, size_t size, uint64_t flags);
void kfree(void *ptr);
void *umalloc(struct proc *proc, size_t size, uint64_t opts);
void *umalloc(struct proc *proc, size_t size, uint64_t opts, uintptr_t req_addr);
void ufree(struct proc *proc, void *ptr);
void slabtypes_init();

View file

@ -5,11 +5,14 @@
#define SYS_READ 0
#define SYS_WRITE 1
#define SYS_OPEN 2
#define SYS_MMAP 9
#define SYS_MUNMAP 11
#define SYS_FORK 57
#define SYS_EXIT 60
#define SYS_MKDIR 83
#define SYS_MKNOD 133
#include <kernel/common.h>
#include <kernel/proc.h>