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