mirror of
https://github.com/drasko/codezero.git
synced 2026-04-04 19:19:03 +02:00
Cleaned up libposix mmap()
Now we have proper setting of errno and using pfn based mmap for both types of mmap calls.
This commit is contained in:
@@ -24,7 +24,7 @@ struct sys_mmap_args {
|
||||
};
|
||||
|
||||
void *sys_mmap(struct tcb *sender, void *start, size_t length, int prot,
|
||||
int flags, int fd, off_t offset);
|
||||
int flags, int fd, off_t pfn);
|
||||
|
||||
int sys_munmap(struct tcb *sender, void *vaddr, unsigned long size);
|
||||
int sys_msync(struct tcb *task, void *start, unsigned long length, int flags);
|
||||
|
||||
@@ -110,17 +110,11 @@ void handle_requests(void)
|
||||
ret = sys_lseek(sender, (int)mr[0], (off_t)mr[1], (int)mr[2]);
|
||||
break;
|
||||
|
||||
case L4_IPC_TAG_MMAP2: {
|
||||
case L4_IPC_TAG_MMAP: {
|
||||
struct sys_mmap_args *args = (struct sys_mmap_args *)mr[0];
|
||||
ret = (int)sys_mmap(sender, args->start, args->length, args->prot,
|
||||
args->flags, args->fd, args->offset);
|
||||
}
|
||||
case L4_IPC_TAG_MMAP: {
|
||||
struct sys_mmap_args *args = (struct sys_mmap_args *)&mr[0];
|
||||
ret = (int)sys_mmap(sender, args->start, args->length, args->prot,
|
||||
args->flags, args->fd, __pfn(args->offset));
|
||||
break;
|
||||
}
|
||||
case L4_IPC_TAG_MUNMAP: {
|
||||
ret = sys_munmap(sender, (void *)mr[0], (unsigned long)mr[1]);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user