From: Andrea Arcangeli Date: Tue, 22 Sep 2015 21:58:55 +0000 (-0700) Subject: userfaultfd: selftest: headers fixup X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=67f6a029b2ccf3399783a0ff2f812666f290d94f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git userfaultfd: selftest: headers fixup Depend on "make headers_install" to create proper headers to include and provide syscall numbers. Signed-off-by: Andrea Arcangeli Cc: Dr. David Alan Gilbert Cc: Michael Ellerman Cc: Shuah Khan Cc: Thierry Reding Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile index 949e275f11a6..3c53cac15de1 100644 --- a/tools/testing/selftests/vm/Makefile +++ b/tools/testing/selftests/vm/Makefile @@ -12,8 +12,11 @@ BINARIES += userfaultfd all: $(BINARIES) %: %.c $(CC) $(CFLAGS) -o $@ $^ -lrt -userfaultfd: userfaultfd.c - $(CC) $(CFLAGS) -O2 -o $@ $^ -lpthread +userfaultfd: userfaultfd.c ../../../../usr/include/linux/kernel.h + $(CC) $(CFLAGS) -O2 -o $@ $< -lpthread + +../../../../usr/include/linux/kernel.h: + make -C ../../../.. headers_install TEST_PROGS := run_vmtests TEST_FILES := $(BINARIES) diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c index 59d145f20918..a9e0b9143f06 100644 --- a/tools/testing/selftests/vm/userfaultfd.c +++ b/tools/testing/selftests/vm/userfaultfd.c @@ -67,18 +67,8 @@ #include #ifndef __NR_userfaultfd -#ifdef __x86_64__ -#define __NR_userfaultfd 323 -#elif defined(__i386__) -#define __NR_userfaultfd 374 -#elif defined(__powewrpc__) -#define __NR_userfaultfd 364 -#elif defined(__s390__) -#define __NR_userfaultfd 355 -#else #error "missing __NR_userfaultfd definition" #endif -#endif static unsigned long nr_cpus, nr_pages, nr_pages_per_cpu, page_size;