xref: /xnu-11215/osfmk/arm/data.s (revision 8d741a5d)
1/*
2 * Copyright (c) 2007-2021 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28#include <arm64/asm.h>
29#include <arm64/proc_reg.h>
30#include "assym.s"
31
32#if CONFIG_SPTM
33#include <sptm/sptm_xnu.h>
34#endif /* CONFIG_SPTM */
35
36#if defined(__arm64__)
37/* We're fine, use adrp, add */
38#else
39#error Unknown architecture.
40#endif
41
42	.section __BOOTDATA, __data					// Aligned data
43
44	.align 14
45
46	.globl EXT(intstack_low_guard)
47LEXT(intstack_low_guard)
48	.space (PAGE_MAX_SIZE_NUM)
49
50	/* IRQ stack */
51	.globl  EXT(intstack)						// Boot processor IRQ stack
52LEXT(intstack)
53	.space	(INTSTACK_SIZE_NUM)
54	.globl  EXT(intstack_top)
55LEXT(intstack_top)
56
57	.globl EXT(intstack_high_guard)
58LEXT(intstack_high_guard)
59	.space (PAGE_MAX_SIZE_NUM)
60
61/* Low guard for fiq/exception stack is shared w/ interrupt stack high guard */
62
63#ifdef __arm64__
64	.global EXT(excepstack)
65LEXT(excepstack)
66	.space	(EXCEPSTACK_SIZE_NUM)
67	.globl	EXT(excepstack_top)
68LEXT(excepstack_top)
69
70	.globl EXT(excepstack_high_guard)
71LEXT(excepstack_high_guard)
72	.space (PAGE_MAX_SIZE_NUM)
73
74#endif
75
76
77// Must align to 16K here, due to <rdar://problem/33268668>
78        .global EXT(kd_early_buffer)
79        .align 14
80LEXT(kd_early_buffer) // space for kdebug's early event buffer
81        .space 16*1024,0
82
83	.section __DATA, __data						// Aligned data
84	.align	3							// unsigned long long aligned Section
85	.globl	EXT(RTClockData)
86LEXT(RTClockData)							// Real Time clock area
87	.space	RTCLOCKDataSize_NUM,0					// (filled with 0s)
88
89#if TRASH_VFP_ON_SAVE
90	.align  4
91	.globl  EXT(vfptrash_data)
92LEXT(vfptrash_data)
93	.fill   64, 4, 0xca55e77e
94#endif
95
96#if __arm64__
97
98#if defined(KERNEL_INTEGRITY_KTRR) || defined(KERNEL_INTEGRITY_CTRR)
99#if CONFIG_SPTM
100        .section __DATA_SPTM, __const
101        .align 14
102        /* reserve a page for xnu-CTRR covered SPTM data */
103        .space 16*1024,0
104#else
105        .section __DATA, __const
106        .align 14
107#endif /* CONFIG_SPTM */
108/* reserve space for read only page tables */
109LEXT(ropagetable_begin)
110#if XNU_TARGET_OS_OSX
111		// A big auxKC might need more page tables, especially because
112	    // it's not block mapped.
113	    // Note that we don't distuinguish between KASAN or not: With
114	    // a KASAN kernel, the effective auxKC limit is smaller.
115		.space 20*16*1024,0
116#elif KASAN
117        .space 16*16*1024,0
118#else
119        .space 14*16*1024,0
120#endif
121#else
122LEXT(ropagetable_begin)
123#endif /* defined(KERNEL_INTEGRITY_KTRR) || defined(KERNEL_INTEGRITY_CTRR) */
124
125LEXT(ropagetable_end)
126
127        .globl EXT(ropagetable_begin)
128        .globl EXT(ropagetable_end)
129#endif /* __arm64__ */
130
131/* vim: set ts=4: */
132