xref: /xnu-8020.140.41/tests/jumbo_va_spaces_28530648.c (revision 27b03b360a988dfd3dfdf34262bb0042026747cc) !
1*27b03b36SApple OSS Distributions #include <stdio.h>
2*27b03b36SApple OSS Distributions #include <errno.h>
3*27b03b36SApple OSS Distributions #include <string.h>
4*27b03b36SApple OSS Distributions #include <unistd.h>
5*27b03b36SApple OSS Distributions #include <sys/mman.h>
6*27b03b36SApple OSS Distributions 
7*27b03b36SApple OSS Distributions #include <darwintest.h>
8*27b03b36SApple OSS Distributions #include <darwintest_utils.h>
9*27b03b36SApple OSS Distributions 
10*27b03b36SApple OSS Distributions #include "jumbo_va_spaces_common.h"
11*27b03b36SApple OSS Distributions 
12*27b03b36SApple OSS Distributions T_GLOBAL_META(
13*27b03b36SApple OSS Distributions 	T_META_NAMESPACE("xnu.vm"),
14*27b03b36SApple OSS Distributions 	T_META_RADAR_COMPONENT_NAME("xnu"),
15*27b03b36SApple OSS Distributions 	T_META_RADAR_COMPONENT_VERSION("VM"),
16*27b03b36SApple OSS Distributions 	T_META_RUN_CONCURRENTLY(true));
17*27b03b36SApple OSS Distributions 
18*27b03b36SApple OSS Distributions T_DECL(TESTNAME,
19*27b03b36SApple OSS Distributions 	"Verify that a required entitlement is present in order to be granted an extra-large "
20*27b03b36SApple OSS Distributions 	"VA space on arm64",
21*27b03b36SApple OSS Distributions 	T_META_CHECK_LEAKS(false))
22*27b03b36SApple OSS Distributions {
23*27b03b36SApple OSS Distributions 	if (!dt_64_bit_kernel()) {
24*27b03b36SApple OSS Distributions 		T_SKIP("This test is only applicable to arm64");
25*27b03b36SApple OSS Distributions 	}
26*27b03b36SApple OSS Distributions 
27*27b03b36SApple OSS Distributions #if defined(ENTITLED)
28*27b03b36SApple OSS Distributions 	verify_jumbo_va(true);
29*27b03b36SApple OSS Distributions #else
30*27b03b36SApple OSS Distributions 	verify_jumbo_va(false);
31*27b03b36SApple OSS Distributions #endif
32*27b03b36SApple OSS Distributions }
33