[libc] Move the implementation of mmap and munmap into a linux specific area.
authorSiva Chandra Reddy <sivachandra@google.com>
Tue, 7 Jan 2020 21:46:12 +0000 (13:46 -0800)
committerSiva Chandra Reddy <sivachandra@google.com>
Fri, 24 Jan 2020 23:42:28 +0000 (15:42 -0800)
commitec62bf2fd3284c9a525011b191c4960fce01dca7
tree99d720ff978f2c389ae7ecf070184856f2a4c173
parent96f3ea0d21b48ca088355db10d4d1a2e9bc9f884
[libc] Move the implementation of mmap and munmap into a linux specific area.

This allows us to get rid of the PAGE_SIZE macro and use EXEC_PAGESIZE
from linux/param.h.

Few other points about this change:
1. The linux syscall functions have been moved into a linux specific area
instead of src/unistd/syscall.h. The Linux syscall function from unistd.h
is a public vararg function. What we have currently are linux speciif internal
overloaded C++ functions. So, moving them to a Linux only area is more
meaningful.
2. The implementations of mmap and munmap are now in a 'linux' directory
within src/sys/mman. The idea here is that platform specific
implementations will live in a platform specific subdirectories like these.
Infrastructure common to a platform will live in the platform's config
directory. For example, the linux syscall implementations live in
config/linux.

Reviewers: abrachet

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D73302
15 files changed:
libc/config/linux/CMakeLists.txt
libc/config/linux/platfrom_defs.h.inc
libc/config/linux/syscall.h.def [moved from libc/src/unistd/syscall.h.def with 100% similarity]
libc/include/CMakeLists.txt
libc/src/CMakeLists.txt
libc/src/sys/mman/CMakeLists.txt
libc/src/sys/mman/linux/CMakeLists.txt [new file with mode: 0644]
libc/src/sys/mman/linux/mmap.cpp [moved from libc/src/sys/mman/mmap.cpp with 79% similarity]
libc/src/sys/mman/linux/munmap.cpp [moved from libc/src/sys/mman/munmap.cpp with 81% similarity]
libc/src/unistd/CMakeLists.txt [deleted file]
libc/test/config/linux/x86_64/CMakeLists.txt
libc/test/config/linux/x86_64/syscall_test.cpp
libc/test/src/sys/mman/CMakeLists.txt
libc/test/src/sys/mman/linux/CMakeLists.txt [new file with mode: 0644]
libc/test/src/sys/mman/linux/mmap_test.cpp [moved from libc/test/src/sys/mman/mmap_test.cpp with 100% similarity]