forked from swiftlang/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc] Move the implementation of mmap and munmap into a linux specif…
…ic 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
- Loading branch information
Siva Chandra Reddy
committed
Jan 24, 2020
1 parent
96f3ea0
commit ec62bf2
Showing
15 changed files
with
75 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
add_gen_header( | ||
linux_syscall_h | ||
DEF_FILE syscall.h.def | ||
GEN_HDR syscall.h | ||
PARAMS | ||
inline_syscalls=${LIBC_TARGET_MACHINE}/syscall.h.inc | ||
DATA_FILES | ||
${LIBC_TARGET_MACHINE}/syscall.h.inc | ||
) | ||
|
||
add_subdirectory(x86_64) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ add_gen_header( | |
GEN_HDR sys/mman.h | ||
DEPENDS | ||
libc_posix_types_h | ||
llvm_libc_common_h | ||
) | ||
|
||
add_gen_header( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,3 @@ | ||
#TODO: The sources and target listed here should ideally live in config/linux. | ||
|
||
add_entrypoint_object( | ||
mmap | ||
SRCS | ||
mmap.cpp | ||
HDRS | ||
mmap.h | ||
DEPENDS | ||
sys_mman_h | ||
sys_syscall_h | ||
syscall_impl_h | ||
__errno_location | ||
) | ||
|
||
add_entrypoint_object( | ||
munmap | ||
SRCS | ||
munmap.cpp | ||
HDRS | ||
munmap.h | ||
DEPENDS | ||
sys_mman_h | ||
sys_syscall_h | ||
syscall_impl_h | ||
__errno_location | ||
) | ||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS}) | ||
add_subdirectory(${LIBC_TARGET_OS}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
add_entrypoint_object( | ||
mmap | ||
SRCS | ||
mmap.cpp | ||
HDRS | ||
../mmap.h | ||
DEPENDS | ||
sys_mman_h | ||
sys_syscall_h | ||
linux_syscall_h | ||
__errno_location | ||
) | ||
|
||
add_entrypoint_object( | ||
munmap | ||
SRCS | ||
munmap.cpp | ||
HDRS | ||
../munmap.h | ||
DEPENDS | ||
sys_mman_h | ||
sys_syscall_h | ||
linux_syscall_h | ||
__errno_location | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,3 @@ | ||
add_libc_testsuite(libc_sys_mman_unittests) | ||
|
||
add_libc_unittest( | ||
mmap_test | ||
SUITE | ||
libc_sys_mman_unittests | ||
SRCS | ||
mmap_test.cpp | ||
DEPENDS | ||
errno_h | ||
sys_mman_h | ||
mmap | ||
munmap | ||
__errno_location | ||
) | ||
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS}) | ||
add_subdirectory(${LIBC_TARGET_OS}) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
add_libc_testsuite(libc_sys_mman_unittests) | ||
|
||
add_libc_unittest( | ||
mmap_test | ||
SUITE | ||
libc_sys_mman_unittests | ||
SRCS | ||
mmap_test.cpp | ||
DEPENDS | ||
errno_h | ||
sys_mman_h | ||
mmap | ||
munmap | ||
__errno_location | ||
) |
File renamed without changes.