mirror of
https://github.com/drasko/codezero.git
synced 2026-02-27 17:23:13 +01:00
Added new routines that map and check the validity of user buffers.
mmap uses this mechanism to get arguments. It needs to be tested.
This commit is contained in:
@@ -23,27 +23,12 @@ struct sys_mmap_args {
|
||||
off_t offset;
|
||||
};
|
||||
|
||||
void *sys_mmap(struct tcb *sender, void *start, size_t length, int prot,
|
||||
int flags, int fd, off_t pfn);
|
||||
|
||||
void *sys_mmap(struct tcb *task, struct sys_mmap_args *args);
|
||||
int sys_munmap(struct tcb *sender, void *vaddr, unsigned long size);
|
||||
int sys_msync(struct tcb *task, void *start, unsigned long length, int flags);
|
||||
|
||||
struct sys_shmat_args {
|
||||
l4id_t shmid;
|
||||
const void *shmaddr;
|
||||
int shmflg;
|
||||
};
|
||||
|
||||
void *sys_shmat(struct tcb *requester, l4id_t shmid, const void *shmaddr, int shmflg);
|
||||
void *sys_shmat(struct tcb *task, l4id_t shmid, const void *shmadr, int shmflg);
|
||||
int sys_shmdt(struct tcb *requester, const void *shmaddr);
|
||||
|
||||
struct sys_shmget_args {
|
||||
key_t key;
|
||||
int size;
|
||||
int shmflg;
|
||||
};
|
||||
|
||||
int sys_shmget(key_t key, int size, int shmflg);
|
||||
|
||||
int sys_fork(struct tcb *parent);
|
||||
|
||||
12
tasks/mm0/include/user.h
Normal file
12
tasks/mm0/include/user.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef __USER_H__
|
||||
#define __USER_H__
|
||||
|
||||
#include <task.h>
|
||||
|
||||
int pager_validate_user_range(struct tcb *user, void *userptr, unsigned long size,
|
||||
unsigned int vm_flags);
|
||||
void *pager_validate_map_user_range(struct tcb *user, void *userptr,
|
||||
unsigned long size, unsigned int vm_flags);
|
||||
void pager_unmap_user_range(void *mapped_ptr, unsigned long size);
|
||||
|
||||
#endif /* __USER_H__ */
|
||||
Reference in New Issue
Block a user