#include <u.h>
#include <libc.h>
#include <ureg.h>
#include "linuxsys.h"
#include "linux.h"
struct mmap_arg_struct {
ulong addr;
ulong len;
ulong prot;
ulong flags;
ulong fd;
ulong offset;
};
SYSCALL(sys_mprotect)
{
RETURN(0);
}
SYSCALL(sys_mmap2)
{
ulong addr;
int len;
ulong prot;
ulong flags;
int fd;
ulong pgoff;
addr = ARG1;
len = ARG2;
prot = ARG3;
flags = ARG4;
fd = ARG5;
pgoff = ARG6;
DPRINT("mmap2(%lux, %d, %lux, %lux, %d, %lud)...",
addr, len, prot, flags, fd, pgoff);
RETURN((ulong)mmap((void*)addr, len, prot, flags, fd, pgoff*PAGE_SIZE));
}
SYSCALL(sys_old_mmap)
{
struct mmap_arg_struct *a;
a = (struct mmap_arg_struct*)ARG1;
DPRINT("old_mmap(%lux, %d, %lux, %lux, %d, %d)...",
a->addr, (int)a->len, a->prot, a->flags, (int)a->fd,
(int)a->offset);
RETURN((ulong)mmap((void*)a->addr, a->len, a->prot, a->flags, a->fd, a->offset));
}
SYSCALL(sys_munmap)
{
void *p;
int n;
p = (void*)ARG1;
n = ARG2;
DPRINT("munmap(%p, %d)...", p, n);
RETURN(munmap(p, n));
}
SYSCALL(sys_msync)
{
void *a;
a = (void*)ARG1;
RETURN(msync(a));
}
SYSCALL(sys_brk)
{
ulong bk = ARG1;
DPRINT("brk(0x%lux)...", bk);
if(bk)
brk((void*)bk);
RETURN(sbrk(0));
}
|