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:
Jan Nieuwenhuizen 2019-03-03 18:09:08 +01:00
parent cadc4f46ac
commit 4cd248d2bb
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 22 additions and 0 deletions

View File

@ -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

View File

@ -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