syscall: add mmap and munmap
This commit is contained in:
parent
7919839bfc
commit
0870bd8737
6 changed files with 41 additions and 4 deletions
|
|
@ -17,6 +17,8 @@
|
|||
#define PAGE_PWT 0x8
|
||||
#define PAGE_PCD 0x10
|
||||
|
||||
#define MAP_ANONYMOUS 0x20
|
||||
|
||||
#ifndef __ASM__
|
||||
|
||||
#define ALIGN(_a) __attribute__((aligned(_a)))
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue