Changes in kernel/arch/ia64/src/start.S [fe7abd0:acee917] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/src/start.S
rfe7abd0 racee917 32 32 #include <mm/asid.h> 33 33 34 #define RR_MASK 35 #define RID_SHIFT 36 #define PS_SHIFT 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 0x00100000F000067134 #define RR_MASK (0xFFFFFFFF00000002) 35 #define RID_SHIFT 8 36 #define PS_SHIFT 2 37 38 #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 #58 49 kernel_image_start: 59 50 .auto 60 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 61 65 mov psr.l = r0 62 66 srlz.i 63 67 srlz.d 64 68 65 69 # Fill TR.i and TR.d using Region Register #VRN_KERNEL 66 70 67 71 movl r8 = (VRN_KERNEL << VRN_SHIFT) 68 72 mov r9 = rr[r8] 69 73 70 74 movl r10 = (RR_MASK) 71 75 and r9 = r10, r9 72 movl r10 = (( (RID_KERNEL7)<< RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT))73 or r9 = r10, r974 76 movl r10 = ((RID_KERNEL << RID_SHIFT) | (KERNEL_PAGE_WIDTH << PS_SHIFT)) 77 or r9 = r10, r9 78 75 79 mov rr[r8] = r9 76 80 77 81 movl r8 = (VRN_KERNEL << VRN_SHIFT) 78 82 mov cr.ifa = r8 79 83 80 84 mov r11 = cr.itir 81 85 movl r10 = (KERNEL_PAGE_WIDTH << PS_SHIFT) 82 86 or r10 = r10, r11 83 87 mov cr.itir = r10 84 88 85 89 movl r10 = (KERNEL_TRANSLATION_I) 86 90 itr.i itr[r0] = r10 87 91 movl r10 = (KERNEL_TRANSLATION_D) 88 92 itr.d dtr[r0] = r10 89 93 90 94 movl r7 = 1 91 95 movl r8 = (VRN_KERNEL << VRN_SHIFT) | VIO_OFFSET … … 93 97 movl r10 = (KERNEL_TRANSLATION_VIO) 94 98 itr.d dtr[r7] = r10 95 99 96 100 mov r11 = cr.itir 97 101 movl r10 = ~0xfc … … 100 104 or r10 = r10, r11 101 105 mov cr.itir = r10 102 106 103 107 movl r7 = 2 104 108 movl r8 = (VRN_KERNEL << VRN_SHIFT) | IO_OFFSET … … 106 110 movl r10 = (KERNEL_TRANSLATION_IO) 107 111 itr.d dtr[r7] = r10 108 109 # Setup mapping for fi rmware area (also SAPIC)110 112 113 # Setup mapping for fimware arrea (also SAPIC) 114 111 115 mov r11 = cr.itir 112 116 movl r10 = ~0xfc … … 115 119 or r10 = r10, r11 116 120 mov cr.itir = r10 117 121 118 122 movl r7 = 3 119 123 movl r8 = (VRN_KERNEL << VRN_SHIFT) | FW_OFFSET … … 121 125 movl r10 = (KERNEL_TRANSLATION_FW) 122 126 itr.d dtr[r7] = r10 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 127 131 128 # Initialize PSR 132 129 133 130 movl r10 = (PSR_DT_MASK | PSR_RT_MASK | PSR_IT_MASK | PSR_IC_MASK) /* Enable paging */ 134 131 mov r9 = psr 135 132 136 133 or r10 = r10, r9 137 134 mov cr.ipsr = r10 … … 141 138 srlz.d 142 139 srlz.i 143 140 144 141 .explicit 145 142 146 143 /* 147 144 * Return From Interrupt is the only way to … … 150 147 rfi ;; 151 148 149 152 150 .global paging_start 153 151 paging_start: 154 152 155 153 /* 156 154 * Now we are paging. 157 155 */ 158 156 159 157 # Switch to register bank 1 160 158 bsw.1 159 160 #ifdef CONFIG_SMP 161 # Am I BSP or AP? 162 movl r20 = bsp_started ;; 163 ld8 r20 = [r20] ;; 164 cmp.eq p3, p2 = r20, r0 ;; 165 #else 166 cmp.eq p3, p2 = r0, r0 ;; /* you are BSP */ 167 #endif /* CONFIG_SMP */ 161 168 162 169 # Initialize register stack … … 165 172 mov ar.bspstore = r8 166 173 loadrs 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 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 175 179 # Initialize gp (Global Pointer) register 176 movl gp = kernel_image_start 177 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 180 movl r20 = (VRN_KERNEL << VRN_SHIFT);; 181 or r20 = r20,r1;; 182 movl r1 = _hardcoded_load_address 183 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 186 200 ssm (1 << 19) ;; /* Disable f32 - f127 */ 187 201 srlz.i 188 202 srlz.d ;; 189 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 190 215 br.call.sptk.many b0 = arch_pre_main 191 0: 192 br.call.sptk.many b0 = main_bsp 216 217 movl r18 = main_bsp ;; 218 mov b1 = r18 ;; 219 br.call.sptk.many b0 = b1 220 193 221 0: 194 222 br 0b 223 224 #ifdef CONFIG_SMP 225 226 .align 4096 227 kernel_image_ap_start: 228 .auto 229 230 # Identify self(CPU) in OS structures by ID / EID 231 232 mov r9 = cr64 233 mov r10 = 1 234 movl r12 = 0xffffffff 235 movl r8 = cpu_by_id_eid_list 236 and r8 = r8, r12 237 shr r9 = r9, 16 238 add r8 = r8, r9 239 st1 [r8] = r10 240 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_loop 245 and r11 = r11, r12 246 mov b1 = r11 247 248 ld1 r20 = [r8] ;; 249 movl r21 = 3 ;; 250 cmp.eq p2, p3 = r20, r21 ;; 251 (p3) br.call.sptk.many b0 = b1 252 253 movl r11 = kernel_image_start 254 and r11 = r11, r12 255 mov b1 = r11 256 br.call.sptk.many b0 = b1 257 258 .align 16 259 .global bsp_started 260 bsp_started: 261 .space 8 262 263 .align 4096 264 .global cpu_by_id_eid_list 265 cpu_by_id_eid_list: 266 .space 65536 267 268 #endif /* CONFIG_SMP */
Note:
See TracChangeset
for help on using the changeset viewer.