ARM: Mes C Library: Add compile stub for mmap.
* include/linux/arm/syscall.h (SYS_mmap2, SYS_munmap): New macro. * lib/linux/mmap.c (mmap)[SYS_mmap2]: Compile stub for missing SYS_mmap.
This commit is contained in:
parent
cadc4f46ac
commit
4cd248d2bb
|
@ -83,4 +83,9 @@
|
|||
#define SYS_readlink 0x55
|
||||
#define SYS_mknod 0x0e
|
||||
|
||||
// gcc-4.6.4
|
||||
//#define SYS_mmap 0x09
|
||||
#define SYS_mmap2 0xc0
|
||||
#define SYS_munmap 0x5b
|
||||
|
||||
#endif // __MES_LINUX_ARM_SYSCALL_H
|
||||
|
|
|
@ -22,8 +22,25 @@
|
|||
#include <syscall.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#if SYS_mmap
|
||||
|
||||
void *
|
||||
mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
|
||||
{
|
||||
return (void *)_sys_call6 (SYS_mmap, (long) addr, (long) len, (int) prot, (int) flags, (int) fd, (long) offset);
|
||||
}
|
||||
|
||||
#elif SYS_mmap2
|
||||
|
||||
#include <assert.h>
|
||||
#include <mes/lib.h>
|
||||
|
||||
void *
|
||||
mmap (void *addr, size_t len, int prot, int flags, int fd, off_t offset)
|
||||
{
|
||||
eputs ("TODO: mmap/mmap2\n");
|
||||
assert(0);
|
||||
return (void *)_sys_call6 (SYS_mmap2, (long) addr, (long) len, (int) prot, (int) flags, (int) fd, (long) offset);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue