Changes in kernel/arch/ia64/src/start.S [acee917:fe7abd0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/start.S
racee917 rfe7abd0 32 32 #include <mm/asid.h> 33 33 34 #define RR_MASK (0xFFFFFFFF00000002)35 #define RID_SHIFT 36 #define PS_SHIFT 34 #define RR_MASK (0xFFFFFFFF00000002) 35 #define RID_SHIFT 8 36 #define PS_SHIFT 2 37 37 38 #define KERNEL_TRANSLATION_I 39 #define KERNEL_TRANSLATION_D 40 #define KERNEL_TRANSLATION_VIO 41 #define KERNEL_TRANSLATION_IO 0x00100FFFFC00067142 #define KERNEL_TRANSLATION_FW 0x00100000F000067138 #define KERNEL_TRANSLATION_I 0x0010000000000661 39 #define KERNEL_TRANSLATION_D 0x0010000000000661 40 #define KERNEL_TRANSLATION_VIO 0x0010000000000671 41 #define KERNEL_TRANSLATION_IO 0x00100FFFFC000671 42 #define KERNEL_TRANSLATION_FW 0x00100000F0000671 43 43 44 44 .section K_TEXT_START, "ax" … … 47 47 48 48 stack0: 49 50 # 51 # Kernel entry point. 52 # 53 # This is where we are passed control from the boot code. 54 # Register contents: 55 # 56 # r2 Address of the boot code's bootinfo structure. 57 # 49 58 kernel_image_start: 50 59 .auto 51 52 #ifdef CONFIG_SMP 53 # Identify self(CPU) in OS structures by ID / EID 54 55 mov r9 = cr64 56 mov r10 = 1 57 movl r12 = 0xffffffff 58 movl r8 = cpu_by_id_eid_list 59 and r8 = r8, r12 60 shr r9 = r9, 16 61 add r8 = r8, r9 62 st1 [r8] = r10 63 #endif 64 60 65 61 mov psr.l = r0 66 62 srlz.i 67 63 srlz.d 68 64 69 65 # Fill TR.i and TR.d using Region Register #VRN_KERNEL 70 66 71 67 movl r8 = (VRN_KERNEL << VRN_SHIFT) 72 68 mov r9 = rr[r8] 73 69 74 70 movl r10 = (RR_MASK) 75 71 and r9 = r10, r9 76 movl r10 = (( RID_KERNEL<< RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT))77 or 78 72 movl r10 = (((RID_KERNEL7) << RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT)) 73 or r9 = r10, r9 74 79 75 mov rr[r8] = r9 80 76 81 77 movl r8 = (VRN_KERNEL << VRN_SHIFT) 82 78 mov cr.ifa = r8 83 79 84 80 mov r11 = cr.itir 85 81 movl r10 = (KERNEL_PAGE_WIDTH << PS_SHIFT) 86 82 or r10 = r10, r11 87 83 mov cr.itir = r10 88 84 89 85 movl r10 = (KERNEL_TRANSLATION_I) 90 86 itr.i itr[r0] = r10 91 87 movl r10 = (KERNEL_TRANSLATION_D) 92 88 itr.d dtr[r0] = r10 93 89 94 90 movl r7 = 1 95 91 movl r8 = (VRN_KERNEL << VRN_SHIFT) | VIO_OFFSET … … 97 93 movl r10 = (KERNEL_TRANSLATION_VIO) 98 94 itr.d dtr[r7] = r10 99 95 100 96 mov r11 = cr.itir 101 97 movl r10 = ~0xfc … … 104 100 or r10 = r10, r11 105 101 mov cr.itir = r10 106 102 107 103 movl r7 = 2 108 104 movl r8 = (VRN_KERNEL << VRN_SHIFT) | IO_OFFSET … … 110 106 movl r10 = (KERNEL_TRANSLATION_IO) 111 107 itr.d dtr[r7] = r10 112 113 # Setup mapping for fi mware arrea (also SAPIC)114 108 109 # Setup mapping for firmware area (also SAPIC) 110 115 111 mov r11 = cr.itir 116 112 movl r10 = ~0xfc … … 119 115 or r10 = r10, r11 120 116 mov cr.itir = r10 121 117 122 118 movl r7 = 3 123 119 movl r8 = (VRN_KERNEL << VRN_SHIFT) | FW_OFFSET … … 125 121 movl r10 = (KERNEL_TRANSLATION_FW) 126 122 itr.d dtr[r7] = r10 127 123 124 # Initialize DSR 125 126 movl r10 = (DCR_DP_MASK | DCR_DK_MASK | DCR_DX_MASK | DCR_DR_MASK | DCR_DA_MASK | DCR_DD_MASK | DCR_LC_MASK) 127 mov r9 = cr.dcr 128 or r10 = r10, r9 129 mov cr.dcr = r10 130 128 131 # Initialize PSR 129 132 130 133 movl r10 = (PSR_DT_MASK | PSR_RT_MASK | PSR_IT_MASK | PSR_IC_MASK) /* Enable paging */ 131 134 mov r9 = psr 132 135 133 136 or r10 = r10, r9 134 137 mov cr.ipsr = r10 … … 138 141 srlz.d 139 142 srlz.i 140 143 141 144 .explicit 142 145 143 146 /* 144 147 * Return From Interrupt is the only way to … … 147 150 rfi ;; 148 151 149 150 152 .global paging_start 151 153 paging_start: 152 154 153 155 /* 154 156 * Now we are paging. 155 157 */ 156 158 157 159 # Switch to register bank 1 158 160 bsw.1 159 160 #ifdef CONFIG_SMP161 # Am I BSP or AP?162 movl r20 = bsp_started ;;163 ld8 r20 = [r20] ;;164 cmp.eq p3, p2 = r20, r0 ;;165 #else166 cmp.eq p3, p2 = r0, r0 ;; /* you are BSP */167 #endif /* CONFIG_SMP */168 161 169 162 # Initialize register stack … … 172 165 mov ar.bspstore = r8 173 166 loadrs 174 175 # Initialize memory stack to some sane value 176 movl r12 = stack0 ;; 177 add r12 = -16, r12 /* allocate a scratch area on the stack */ 178 167 168 # 169 # Initialize memory stack to some sane value and allocate a scratch are 170 # on it. 171 # 172 movl sp = stack0 ;; 173 add sp = -16, sp 174 179 175 # Initialize gp (Global Pointer) register 180 movl r20 = (VRN_KERNEL << VRN_SHIFT);; 181 or r20 = r20,r1;; 182 movl r1 = _hardcoded_load_address 176 movl gp = kernel_image_start 183 177 184 /* 185 * Initialize hardcoded_* variables. Do only BSP 186 */ 187 (p3) movl r14 = _hardcoded_ktext_size 188 (p3) movl r15 = _hardcoded_kdata_size 189 (p3) movl r16 = _hardcoded_load_address ;; 190 (p3) addl r17 = @gprel(hardcoded_ktext_size), gp 191 (p3) addl r18 = @gprel(hardcoded_kdata_size), gp 192 (p3) addl r19 = @gprel(hardcoded_load_address), gp 193 (p3) addl r21 = @gprel(bootinfo), gp 194 ;; 195 (p3) st8 [r17] = r14 196 (p3) st8 [r18] = r15 197 (p3) st8 [r19] = r16 198 (p3) st8 [r21] = r20 199 178 # 179 # Initialize bootinfo on BSP. 180 # 181 movl r20 = (VRN_KERNEL << VRN_SHIFT) ;; 182 or r20 = r20, r2 ;; 183 addl r21 = @gprel(bootinfo), gp ;; 184 st8 [r21] = r20 185 200 186 ssm (1 << 19) ;; /* Disable f32 - f127 */ 201 187 srlz.i 202 188 srlz.d ;; 203 204 #ifdef CONFIG_SMP 205 (p2) movl r18 = main_ap ;; 206 (p2) mov b1 = r18 ;; 207 (p2) br.call.sptk.many b0 = b1 208 209 # Mark that BSP is on 210 mov r20 = 1 ;; 211 movl r21 = bsp_started ;; 212 st8 [r21] = r20 ;; 213 #endif 214 189 215 190 br.call.sptk.many b0 = arch_pre_main 216 217 movl r18 = main_bsp ;; 218 mov b1 = r18 ;; 219 br.call.sptk.many b0 = b1 220 191 0: 192 br.call.sptk.many b0 = main_bsp 221 193 0: 222 194 br 0b 223 224 #ifdef CONFIG_SMP225 226 .align 4096227 kernel_image_ap_start:228 .auto229 230 # Identify self(CPU) in OS structures by ID / EID231 232 mov r9 = cr64233 mov r10 = 1234 movl r12 = 0xffffffff235 movl r8 = cpu_by_id_eid_list236 and r8 = r8, r12237 shr r9 = r9, 16238 add r8 = r8, r9239 st1 [r8] = r10240 241 # Wait for wakeup synchro signal (#3 in cpu_by_id_eid_list)242 243 kernel_image_ap_start_loop:244 movl r11 = kernel_image_ap_start_loop245 and r11 = r11, r12246 mov b1 = r11247 248 ld1 r20 = [r8] ;;249 movl r21 = 3 ;;250 cmp.eq p2, p3 = r20, r21 ;;251 (p3) br.call.sptk.many b0 = b1252 253 movl r11 = kernel_image_start254 and r11 = r11, r12255 mov b1 = r11256 br.call.sptk.many b0 = b1257 258 .align 16259 .global bsp_started260 bsp_started:261 .space 8262 263 .align 4096264 .global cpu_by_id_eid_list265 cpu_by_id_eid_list:266 .space 65536267 268 #endif /* CONFIG_SMP */
Note:
See TracChangeset
for help on using the changeset viewer.