42 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2 3#define FAIL_TEST_IF_FALSE(test_passed) \4 do { \5 if (!(test_passed)) { \6 ksft_test_result_fail("%s: line:%d\n", \7 __func__, __LINE__); \8 return; \9 } \10 } while (0)11 12#define SKIP_TEST_IF_FALSE(test_passed) \13 do { \14 if (!(test_passed)) { \15 ksft_test_result_skip("%s: line:%d\n", \16 __func__, __LINE__); \17 return; \18 } \19 } while (0)20 21#define REPORT_TEST_PASS() ksft_test_result_pass("%s\n", __func__)22 23#ifndef PKEY_DISABLE_ACCESS24#define PKEY_DISABLE_ACCESS 0x125#endif26 27#ifndef PKEY_DISABLE_WRITE28#define PKEY_DISABLE_WRITE 0x229#endif30 31#ifndef PKEY_BITS_PER_PKEY32#define PKEY_BITS_PER_PKEY 233#endif34 35#ifndef PKEY_MASK36#define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)37#endif38 39#ifndef u6440#define u64 unsigned long long41#endif42