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