Skip to content

Commit

Permalink
userfaultfd: selftest: headers fixup
Browse files Browse the repository at this point in the history
Depend on "make headers_install" to create proper headers to include and
provide syscall numbers.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Shuah Khan <shuahkh@osg.samsung.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andrea Arcangeli authored and Linus Torvalds committed Sep 22, 2015
1 parent d0a8711 commit 67f6a02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
7 changes: 5 additions & 2 deletions tools/testing/selftests/vm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 0 additions & 10 deletions tools/testing/selftests/vm/userfaultfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,8 @@
#include <linux/userfaultfd.h>

#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;

Expand Down

0 comments on commit 67f6a02

Please sign in to comment.