[all-commits] [llvm/llvm-project] ec62bf: [libc] Move the implementation of mmap and munmap ...

Siva Chandra via All-commits all-commits at lists.llvm.org
Fri Jan 24 15:43:04 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ec62bf2fd3284c9a525011b191c4960fce01dca7
      https://github.com/llvm/llvm-project/commit/ec62bf2fd3284c9a525011b191c4960fce01dca7
  Author: Siva Chandra Reddy <sivachandra at google.com>
  Date:   2020-01-24 (Fri, 24 Jan 2020)

  Changed paths:
    M libc/config/linux/CMakeLists.txt
    M libc/config/linux/platfrom_defs.h.inc
    A libc/config/linux/syscall.h.def
    M libc/include/CMakeLists.txt
    M libc/src/CMakeLists.txt
    M libc/src/sys/mman/CMakeLists.txt
    A libc/src/sys/mman/linux/CMakeLists.txt
    A libc/src/sys/mman/linux/mmap.cpp
    A libc/src/sys/mman/linux/munmap.cpp
    R libc/src/sys/mman/mmap.cpp
    R libc/src/sys/mman/munmap.cpp
    R libc/src/unistd/CMakeLists.txt
    R libc/src/unistd/syscall.h.def
    M libc/test/config/linux/x86_64/CMakeLists.txt
    M libc/test/config/linux/x86_64/syscall_test.cpp
    M libc/test/src/sys/mman/CMakeLists.txt
    A libc/test/src/sys/mman/linux/CMakeLists.txt
    A libc/test/src/sys/mman/linux/mmap_test.cpp
    R libc/test/src/sys/mman/mmap_test.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list