Skip to content

Commit

Permalink
hugemmap15: Use TST_TEST_TCONF() for unsupported archs
Browse files Browse the repository at this point in the history
15625f6 broke LTP build at least on riscv32 and mipsel32
(and for any new arch in the future). Replace #error directive with
TST_TEST_TCONF() fixes that.

Fixes: 15625f6 ("Hugetlb: Migrating libhugetlbfs icache-hygiene")
Reviewed-by: Cyril Hrubis <[email protected]>
Signed-off-by: Petr Vorel <[email protected]>
  • Loading branch information
pevik committed Jan 26, 2023
1 parent 982a13d commit 1106777
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions testcases/kernel/mem/hugetlb/hugemmap/hugemmap15.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
/*
* Copyright (C) 2005-2006 David Gibson & Adam Litke, IBM Corporation.
* Copyright (c) Linux Test Project, 2022-2023
* Author: David Gibson & Adam Litke
*/

Expand All @@ -19,6 +20,13 @@
*/

#define _GNU_SOURCE
#include "hugetlb.h"

#if defined(__powerpc__) || defined(__powerpc64__) || defined(__ia64__) || \
defined(__s390__) || defined(__s390x__) || defined(__sparc__) || \
defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64) || \
defined(__i386__) || defined(__x86_64__) || defined(__arm__)

#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
Expand All @@ -30,8 +38,6 @@
#include <sys/param.h>
#include <sys/types.h>

#include "hugetlb.h"

#define SUCC_JMP 1
#define FAIL_JMP 2
#define COPY_SIZE 128
Expand Down Expand Up @@ -142,8 +148,6 @@ static void sig_handler(int signum, siginfo_t *si, void *uc)
siglongjmp(sig_escape, FAIL_JMP + SIGSEGV);
}
#endif
#else
#error "Need to setup signal conditions for this arch"
#endif
}

Expand Down Expand Up @@ -241,3 +245,6 @@ static struct tst_test test = {
.test_all = run_test,
.hugepages = {3, TST_NEEDS},
};
#else
TST_TEST_TCONF("Signal handler for this architecture hasn't been written");
#endif

0 comments on commit 1106777

Please sign in to comment.