head.S (e2a6a3aafa9862c4a4b59f2a59b8f923d64a680e) | head.S (5ffb04f6690d71fab241b3562ebf52b893ac4ff1) |
---|---|
1/* 2 * linux/arch/arm/boot/compressed/head.S 3 * 4 * Copyright (C) 1996-2002 Russell King 5 * Copyright (C) 2004 Hyok S. Choi (MPU support) 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 234 unchanged lines hidden (view full) --- 243#else 244 ldr r1, =0xd00dfeed 245#endif 246 cmp lr, r1 247 bne dtb_check_done @ not found 248 249 mov r8, r6 @ use the appended device tree 250 | 1/* 2 * linux/arch/arm/boot/compressed/head.S 3 * 4 * Copyright (C) 1996-2002 Russell King 5 * Copyright (C) 2004 Hyok S. Choi (MPU support) 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 234 unchanged lines hidden (view full) --- 243#else 244 ldr r1, =0xd00dfeed 245#endif 246 cmp lr, r1 247 bne dtb_check_done @ not found 248 249 mov r8, r6 @ use the appended device tree 250 |
251 /* 252 * Make sure that the DTB doesn't end up in the final 253 * kernel's .bss area. To do so, we adjust the decompressed 254 * kernel size to compensate if that .bss size is larger 255 * than the relocated code. 256 */ 257 ldr r5, =_kernel_bss_size 258 adr r1, wont_overwrite 259 sub r1, r6, r1 260 subs r1, r5, r1 261 addhi r9, r9, r1 262 |
|
251 /* Get the dtb's size */ 252 ldr r5, [r6, #4] 253#ifndef __ARMEB__ 254 /* convert r5 (dtb size) to little endian */ 255 eor r1, r5, r5, ror #16 256 bic r1, r1, #0x00ff0000 257 mov r5, r5, ror #8 258 eor r5, r5, r1, lsr #8 --- 12 unchanged lines hidden (view full) --- 271 272/* 273 * Check to see if we will overwrite ourselves. 274 * r4 = final kernel address 275 * r9 = size of decompressed image 276 * r10 = end of this image, including bss/stack/malloc space if non XIP 277 * We basically want: 278 * r4 - 16k page directory >= r10 -> OK | 263 /* Get the dtb's size */ 264 ldr r5, [r6, #4] 265#ifndef __ARMEB__ 266 /* convert r5 (dtb size) to little endian */ 267 eor r1, r5, r5, ror #16 268 bic r1, r1, #0x00ff0000 269 mov r5, r5, ror #8 270 eor r5, r5, r1, lsr #8 --- 12 unchanged lines hidden (view full) --- 283 284/* 285 * Check to see if we will overwrite ourselves. 286 * r4 = final kernel address 287 * r9 = size of decompressed image 288 * r10 = end of this image, including bss/stack/malloc space if non XIP 289 * We basically want: 290 * r4 - 16k page directory >= r10 -> OK |
279 * r4 + image length <= current position (pc) -> OK | 291 * r4 + image length <= address of wont_overwrite -> OK |
280 */ 281 add r10, r10, #16384 282 cmp r4, r10 283 bhs wont_overwrite 284 add r10, r4, r9 | 292 */ 293 add r10, r10, #16384 294 cmp r4, r10 295 bhs wont_overwrite 296 add r10, r4, r9 |
285 ARM( cmp r10, pc ) 286 THUMB( mov lr, pc ) 287 THUMB( cmp r10, lr ) | 297 adr r9, wont_overwrite 298 cmp r10, r9 |
288 bls wont_overwrite 289 290/* 291 * Relocate ourselves past the end of the decompressed kernel. 292 * r6 = _edata 293 * r10 = end of the decompressed kernel 294 * Because we always copy ahead, we need to do it from the end and go 295 * backward in case the source and destination overlap. --- 888 unchanged lines hidden --- | 299 bls wont_overwrite 300 301/* 302 * Relocate ourselves past the end of the decompressed kernel. 303 * r6 = _edata 304 * r10 = end of the decompressed kernel 305 * Because we always copy ahead, we need to do it from the end and go 306 * backward in case the source and destination overlap. --- 888 unchanged lines hidden --- |