xref: /xnu-8020.140.41/tests/vm/mixed_pagesize.c (revision 27b03b360a988dfd3dfdf34262bb0042026747cc)
1*27b03b36SApple OSS Distributions #include <mach/vm_page_size.h>
2*27b03b36SApple OSS Distributions #include <stdio.h>
3*27b03b36SApple OSS Distributions 
4*27b03b36SApple OSS Distributions int
main(int argc __unused,char ** argv __unused)5*27b03b36SApple OSS Distributions main(int argc __unused, char **argv __unused)
6*27b03b36SApple OSS Distributions {
7*27b03b36SApple OSS Distributions 	/*
8*27b03b36SApple OSS Distributions 	 * This test should have been launched with the 4K pagesize flag.
9*27b03b36SApple OSS Distributions 	 * Verify that the page size globals were set.
10*27b03b36SApple OSS Distributions 	 */
11*27b03b36SApple OSS Distributions 	if (vm_page_shift != 12) {
12*27b03b36SApple OSS Distributions 		fprintf(stderr, "Expected: vm_page_shift == 12. Actual: vm_page_shift == %d\n", vm_page_shift);
13*27b03b36SApple OSS Distributions 		return 1;
14*27b03b36SApple OSS Distributions 	}
15*27b03b36SApple OSS Distributions 	if (vm_page_size != 4096) {
16*27b03b36SApple OSS Distributions 		fprintf(stderr, "Expected: vm_page_size == 4096. Actual: vm_page_shift == %zu\n", vm_page_size);
17*27b03b36SApple OSS Distributions 		return 1;
18*27b03b36SApple OSS Distributions 	}
19*27b03b36SApple OSS Distributions 	if (vm_page_mask != 4095) {
20*27b03b36SApple OSS Distributions 		fprintf(stderr, "Expected: vm_page_mask == 4095. Actual: vm_page_mask == %zu\n", vm_page_mask);
21*27b03b36SApple OSS Distributions 		return 1;
22*27b03b36SApple OSS Distributions 	}
23*27b03b36SApple OSS Distributions 	return 0;
24*27b03b36SApple OSS Distributions }
25