diff options
author | Bernd Schmidt <bernds_cb1@t-online.de> | 2007-11-22 17:28:22 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds_cb1@t-online.de> | 2007-11-22 17:28:22 +0000 |
commit | c5b7f28ab5791bd321a63b4a56ea5199fe2d9615 (patch) | |
tree | 3d6633d2e73b8c9332a2b53ae4091b1f84a625f9 /libc/sysdeps/linux/bfin/mmap.c | |
parent | 1a98c1f87e98ea3cf3f2e41b63ce1ee7fc14fc52 (diff) |
Add Blackfin specific mmap implementation using sys_mmap2.
Diffstat (limited to 'libc/sysdeps/linux/bfin/mmap.c')
-rw-r--r-- | libc/sysdeps/linux/bfin/mmap.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/bfin/mmap.c b/libc/sysdeps/linux/bfin/mmap.c new file mode 100644 index 000000000..41140df0e --- /dev/null +++ b/libc/sysdeps/linux/bfin/mmap.c @@ -0,0 +1,24 @@ +/* Use new style mmap for bfin */ + +#include <unistd.h> +#include <errno.h> +#include <sys/mman.h> +#include <sys/syscall.h> +#include <asm/page.h> + +#define __NR___syscall_mmap2 __NR_mmap2 +inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, + size_t, len, int, prot, int, flags, int, fd, off_t, offset); + +libc_hidden_proto(mmap) + +__ptr_t mmap(__ptr_t addr, size_t len, int prot, + int flags, int fd, __off_t offset) +{ + if (offset & ~PAGE_MASK) { + return NULL; + } + return __syscall_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); +} + +libc_hidden_def(mmap) |