mseal_helpers.h 861 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #define FAIL_TEST_IF_FALSE(test_passed) \
  3. do { \
  4. if (!(test_passed)) { \
  5. ksft_test_result_fail("%s: line:%d\n", \
  6. __func__, __LINE__); \
  7. return; \
  8. } \
  9. } while (0)
  10. #define SKIP_TEST_IF_FALSE(test_passed) \
  11. do { \
  12. if (!(test_passed)) { \
  13. ksft_test_result_skip("%s: line:%d\n", \
  14. __func__, __LINE__); \
  15. return; \
  16. } \
  17. } while (0)
  18. #define REPORT_TEST_PASS() ksft_test_result_pass("%s\n", __func__)
  19. #ifndef PKEY_DISABLE_ACCESS
  20. #define PKEY_DISABLE_ACCESS 0x1
  21. #endif
  22. #ifndef PKEY_DISABLE_WRITE
  23. #define PKEY_DISABLE_WRITE 0x2
  24. #endif
  25. #ifndef PKEY_BITS_PER_PKEY
  26. #define PKEY_BITS_PER_PKEY 2
  27. #endif
  28. #ifndef PKEY_MASK
  29. #define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE)
  30. #endif
  31. #ifndef u64
  32. #define u64 unsigned long long
  33. #endif