summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/powerpc/mm/subpage_prot.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-03-18 17:48:59 +0100
committerLinus Walleij <linus.walleij@linaro.org>2018-03-18 17:48:59 +0100
commit95260c17b27e4bdacf85022e629fb701b42cc190 (patch)
treecfc6963180d99e5f36752ca028821aaa109e860d /tools/testing/selftests/powerpc/mm/subpage_prot.c
parent4f9a4cd66c1201ce2b26ba895b2be63b8b38bb68 (diff)
parent0c8efd610b58cb23cefdfa12015799079aef94ae (diff)
downloadop-kernel-dev-95260c17b27e4bdacf85022e629fb701b42cc190.zip
op-kernel-dev-95260c17b27e4bdacf85022e629fb701b42cc190.tar.gz
Merge tag 'v4.16-rc5' into devel
Linux 4.16-rc5 merged into the GPIO devel branch to resolve a nasty conflict between fixes and devel in the RCAR driver. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'tools/testing/selftests/powerpc/mm/subpage_prot.c')
-rw-r--r--tools/testing/selftests/powerpc/mm/subpage_prot.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/mm/subpage_prot.c b/tools/testing/selftests/powerpc/mm/subpage_prot.c
index 35ade74..3ae77ba 100644
--- a/tools/testing/selftests/powerpc/mm/subpage_prot.c
+++ b/tools/testing/selftests/powerpc/mm/subpage_prot.c
@@ -135,6 +135,16 @@ static int run_test(void *addr, unsigned long size)
return 0;
}
+static int syscall_available(void)
+{
+ int rc;
+
+ errno = 0;
+ rc = syscall(__NR_subpage_prot, 0, 0, 0);
+
+ return rc == 0 || (errno != ENOENT && errno != ENOSYS);
+}
+
int test_anon(void)
{
unsigned long align;
@@ -145,6 +155,8 @@ int test_anon(void)
void *mallocblock;
unsigned long mallocsize;
+ SKIP_IF(!syscall_available());
+
if (getpagesize() != 0x10000) {
fprintf(stderr, "Kernel page size must be 64K!\n");
return 1;
@@ -180,6 +192,8 @@ int test_file(void)
off_t filesize;
int fd;
+ SKIP_IF(!syscall_available());
+
fd = open(file_name, O_RDWR);
if (fd == -1) {
perror("failed to open file");
OpenPOWER on IntegriCloud