tools/headers: Synchronize kernel ABI headers
After the SPDX license tags were added a number of tooling headers got out of
sync with their kernel variants, generating lots of build warnings.
Sync them:
- tools/arch/x86/include/asm/disabled-features.h,
tools/arch/x86/include/asm/required-features.h,
tools/include/linux/hash.h:
Remove the SPDX tag where the kernel version does not have it.
- tools/include/asm-generic/bitops/__fls.h,
tools/include/asm-generic/bitops/arch_hweight.h,
tools/include/asm-generic/bitops/const_hweight.h,
tools/include/asm-generic/bitops/fls.h,
tools/include/asm-generic/bitops/fls64.h,
tools/include/uapi/asm-generic/ioctls.h,
tools/include/uapi/asm-generic/mman-common.h,
tools/include/uapi/sound/asound.h,
tools/include/uapi/linux/kvm.h,
tools/include/uapi/linux/perf_event.h,
tools/include/uapi/linux/sched.h,
tools/include/uapi/linux/vhost.h,
tools/include/uapi/sound/asound.h:
Add the SPDX tag of the respective kernel header.
- tools/include/uapi/linux/bpf_common.h,
tools/include/uapi/linux/fcntl.h,
tools/include/uapi/linux/hw_breakpoint.h,
tools/include/uapi/linux/mman.h,
tools/include/uapi/linux/stat.h,
Change the tag to the kernel header version:
-/* SPDX-License-Identifier: GPL-2.0 */
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Also sync other header details:
- include/uapi/sound/asound.h:
Fix pointless end of line whitespace noise the header grew in this cycle.
- tools/arch/x86/lib/memcpy_64.S:
Sync the code and add tools/include/asm/export.h with dummy wrappers
to support building the kernel side code in a tooling header environment.
- tools/include/uapi/asm-generic/mman.h,
tools/include/uapi/linux/bpf.h:
Sync other details that don't impact tooling's use of the ABIs.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-11-03 11:18:37 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
2016-09-12 12:54:29 +00:00
|
|
|
#ifndef _UAPI_LINUX_MMAN_H
|
|
|
|
#define _UAPI_LINUX_MMAN_H
|
|
|
|
|
2017-09-13 07:38:23 +00:00
|
|
|
#include <asm/mman.h>
|
|
|
|
#include <asm-generic/hugetlb_encode.h>
|
2016-09-12 12:54:29 +00:00
|
|
|
|
2020-04-14 12:04:53 +00:00
|
|
|
#define MREMAP_MAYMOVE 1
|
|
|
|
#define MREMAP_FIXED 2
|
|
|
|
#define MREMAP_DONTUNMAP 4
|
2016-09-12 12:54:29 +00:00
|
|
|
|
|
|
|
#define OVERCOMMIT_GUESS 0
|
|
|
|
#define OVERCOMMIT_ALWAYS 1
|
|
|
|
#define OVERCOMMIT_NEVER 2
|
|
|
|
|
tools headers uapi: Sync asm-generic/mman-common.h and linux/mman.h
To deal with the move of some defines from asm-generic/mmap-common.h to
linux/mman.h done in:
746c9398f5ac ("arch: move common mmap flags to linux/mman.h")
The generated mmap_flags array stays the same:
$ tools/perf/trace/beauty/mmap_flags.sh
static const char *mmap_flags[] = {
[ilog2(0x40) + 1] = "32BIT",
[ilog2(0x01) + 1] = "SHARED",
[ilog2(0x02) + 1] = "PRIVATE",
[ilog2(0x10) + 1] = "FIXED",
[ilog2(0x20) + 1] = "ANONYMOUS",
[ilog2(0x100000) + 1] = "FIXED_NOREPLACE",
[ilog2(0x0100) + 1] = "GROWSDOWN",
[ilog2(0x0800) + 1] = "DENYWRITE",
[ilog2(0x1000) + 1] = "EXECUTABLE",
[ilog2(0x2000) + 1] = "LOCKED",
[ilog2(0x4000) + 1] = "NORESERVE",
[ilog2(0x8000) + 1] = "POPULATE",
[ilog2(0x10000) + 1] = "NONBLOCK",
[ilog2(0x20000) + 1] = "STACK",
[ilog2(0x40000) + 1] = "HUGETLB",
[ilog2(0x80000) + 1] = "SYNC",
};
$
And to have the system's sys/mman.h find the definition of MAP_SHARED
and MAP_PRIVATE, make sure they are defined in the tools/ mman-common.h
in a way that keeps it the same as the kernel's, need for keeping the
Android's NDK cross build working.
This silences these perf build warnings:
Warning: Kernel ABI header at 'tools/include/uapi/asm-generic/mman-common.h' differs from latest version at 'include/uapi/asm-generic/mman-common.h'
diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h
Warning: Kernel ABI header at 'tools/include/uapi/linux/mman.h' differs from latest version at 'include/uapi/linux/mman.h'
diff -u tools/include/uapi/linux/mman.h include/uapi/linux/mman.h
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-h80ycpc6pedg9s5z2rwpy6ws@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2019-03-25 17:06:07 +00:00
|
|
|
#define MAP_SHARED 0x01 /* Share changes */
|
|
|
|
#define MAP_PRIVATE 0x02 /* Changes are private */
|
|
|
|
#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
|
|
|
|
|
2017-09-13 07:38:23 +00:00
|
|
|
/*
|
|
|
|
* Huge page size encoding when MAP_HUGETLB is specified, and a huge page
|
|
|
|
* size other than the default is desired. See hugetlb_encode.h.
|
|
|
|
* All known huge page size encodings are provided here. It is the
|
|
|
|
* responsibility of the application to know which sizes are supported on
|
|
|
|
* the running system. See mmap(2) man page for details.
|
|
|
|
*/
|
|
|
|
#define MAP_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT
|
|
|
|
#define MAP_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK
|
|
|
|
|
2020-10-19 16:36:41 +00:00
|
|
|
#define MAP_HUGE_16KB HUGETLB_FLAG_ENCODE_16KB
|
2017-09-13 07:38:23 +00:00
|
|
|
#define MAP_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB
|
|
|
|
#define MAP_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB
|
|
|
|
#define MAP_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB
|
|
|
|
#define MAP_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB
|
|
|
|
#define MAP_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB
|
|
|
|
#define MAP_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB
|
2018-10-30 19:50:08 +00:00
|
|
|
#define MAP_HUGE_32MB HUGETLB_FLAG_ENCODE_32MB
|
2017-09-13 07:38:23 +00:00
|
|
|
#define MAP_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB
|
2018-10-30 19:50:08 +00:00
|
|
|
#define MAP_HUGE_512MB HUGETLB_FLAG_ENCODE_512MB
|
2017-09-13 07:38:23 +00:00
|
|
|
#define MAP_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB
|
|
|
|
#define MAP_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB
|
|
|
|
#define MAP_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB
|
|
|
|
|
2016-09-12 12:54:29 +00:00
|
|
|
#endif /* _UAPI_LINUX_MMAN_H */
|