Changes in boot/arch/ppc32/loader/asm.S [7b187ef:e731b0d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/ppc32/loader/asm.S
r7b187ef re731b0d 29 29 #include "asm.h" 30 30 #include "regname.h" 31 #include "ofwarch.h" 31 32 32 33 .macro SMC_COHERENCY addr … … 45 46 46 47 .macro TLB_FLUSH reg 47 tlbie \reg 48 addi \reg, \reg, 0x1000 48 li \reg, 0 49 sync 50 51 .rept 64 52 tlbie \reg 53 addi \reg, \reg, 0x1000 54 .endr 55 56 eieio 57 tlbsync 58 sync 49 59 .endm 50 60 … … 54 64 .global memcpy 55 65 .global jump_to_kernel 66 .global balloc_base 56 67 57 68 halt: … … 62 73 addi r6, r3, -4 63 74 addi r4, r4, -4 64 beq 75 beq 2f 65 76 66 77 andi. r0, r6, 3 … … 69 80 70 81 1: 71 72 lwz r7, 4(r4) 73 lwzu r8, 8(r4) 74 stw r7, 4(r6) 75 stwu r8, 8(r6) 76 bdnz 1b 77 78 andi. r5, r5, 7 82 lwz r7, 4(r4) 83 lwzu r8, 8(r4) 84 stw r7, 4(r6) 85 stwu r8, 8(r6) 86 bdnz 1b 87 88 andi. r5, r5, 7 79 89 80 90 2: 81 82 cmplwi 0, r5, 4 83 blt 3f 84 85 lwzu r0, 4(r4) 86 addi r5, r5, -4 87 stwu r0, 4(r6) 91 cmplwi 0, r5, 4 92 blt 3f 93 94 lwzu r0, 4(r4) 95 addi r5, r5, -4 96 stwu r0, 4(r6) 88 97 89 98 3: 90 91 cmpwi 0, r5, 0 92 beqlr 93 mtctr r5 94 addi r4, r4, 3 95 addi r6, r6, 3 99 cmpwi 0, r5, 0 100 beqlr 101 mtctr r5 102 addi r4, r4, 3 103 addi r6, r6, 3 96 104 97 105 4: 98 99 lbzu r0, 1(r4) 100 stbu r0, 1(r6) 101 bdnz 4b 102 blr 106 lbzu r0, 1(r4) 107 stbu r0, 1(r6) 108 bdnz 4b 109 blr 103 110 104 111 5: 105 106 subfic r0, r0, 4 107 mtctr r0 112 subfic r0, r0, 4 113 mtctr r0 108 114 109 115 6: 110 111 lbz r7, 4(r4) 112 addi r4, r4, 1 113 stb r7, 4(r6) 114 addi r6, r6, 1 115 bdnz 6b 116 subf r5, r0, r5 117 rlwinm. r7, r5, 32-3, 3, 31 118 beq 2b 119 mtctr r7 120 b 1b 121 116 lbz r7, 4(r4) 117 addi r4, r4, 1 118 stb r7, 4(r6) 119 addi r6, r6, 1 120 bdnz 6b 121 subf r5, r0, r5 122 rlwinm. r7, r5, 32-3, 3, 31 123 beq 2b 124 mtctr r7 125 b 1b 122 126 123 127 jump_to_kernel: … … 128 132 # r6 = bytes to copy 129 133 # r7 = real_mode (pa) 130 # r8 = framebuffer (pa)131 # r9 = scanline132 134 133 135 # disable interrupts … … 153 155 rfi 154 156 157 .align PAGE_WIDTH 158 balloc_base: 159 .fill BALLOC_MAX_SIZE 160 155 161 .section REALMODE, "ax" 162 156 163 .align PAGE_WIDTH 157 164 .global real_mode 158 159 165 real_mode: 160 166 161 167 # copy kernel to proper location 162 168 # 169 # r3 = bootinfo (pa) 170 # r4 = bootinfo_size 163 171 # r5 = trans (pa) 164 172 # r6 = bytes to copy 165 # r8 = framebuffer (pa)166 # r9 = scanline167 173 168 174 li r31, PAGE_SIZE >> 2 … … 343 349 # flush TLB 344 350 345 li r31, 0346 sync347 348 351 TLB_FLUSH r31 349 TLB_FLUSH r31350 TLB_FLUSH r31351 TLB_FLUSH r31352 TLB_FLUSH r31353 TLB_FLUSH r31354 TLB_FLUSH r31355 TLB_FLUSH r31356 357 TLB_FLUSH r31358 TLB_FLUSH r31359 TLB_FLUSH r31360 TLB_FLUSH r31361 TLB_FLUSH r31362 TLB_FLUSH r31363 TLB_FLUSH r31364 TLB_FLUSH r31365 366 TLB_FLUSH r31367 TLB_FLUSH r31368 TLB_FLUSH r31369 TLB_FLUSH r31370 TLB_FLUSH r31371 TLB_FLUSH r31372 TLB_FLUSH r31373 TLB_FLUSH r31374 375 TLB_FLUSH r31376 TLB_FLUSH r31377 TLB_FLUSH r31378 TLB_FLUSH r31379 TLB_FLUSH r31380 TLB_FLUSH r31381 TLB_FLUSH r31382 TLB_FLUSH r31383 384 TLB_FLUSH r31385 TLB_FLUSH r31386 TLB_FLUSH r31387 TLB_FLUSH r31388 TLB_FLUSH r31389 TLB_FLUSH r31390 TLB_FLUSH r31391 TLB_FLUSH r31392 393 TLB_FLUSH r31394 TLB_FLUSH r31395 TLB_FLUSH r31396 TLB_FLUSH r31397 TLB_FLUSH r31398 TLB_FLUSH r31399 TLB_FLUSH r31400 TLB_FLUSH r31401 402 TLB_FLUSH r31403 TLB_FLUSH r31404 TLB_FLUSH r31405 TLB_FLUSH r31406 TLB_FLUSH r31407 TLB_FLUSH r31408 TLB_FLUSH r31409 TLB_FLUSH r31410 411 TLB_FLUSH r31412 TLB_FLUSH r31413 TLB_FLUSH r31414 TLB_FLUSH r31415 TLB_FLUSH r31416 TLB_FLUSH r31417 TLB_FLUSH r31418 TLB_FLUSH r31419 420 eieio421 tlbsync422 sync423 352 424 353 # start the kernel 425 354 # 426 # pc = KERNEL_START_ADDR355 # pc = PA2KA(BOOT_OFFSET) 427 356 # r3 = bootinfo (pa) 428 # sprg0 = KA2PA(KERNEL_START_ADDR)357 # sprg0 = BOOT_OFFSET 429 358 # sprg3 = physical memory size 430 359 # sp = 0 (pa) 431 360 432 lis r31, KERNEL_START_ADDR@ha 433 addi r31, r31, KERNEL_START_ADDR@l 434 361 lis r31, PA2KA(BOOT_OFFSET)@ha 362 addi r31, r31, PA2KA(BOOT_OFFSET)@l 435 363 mtspr srr0, r31 436 364 437 subis r31, r31, 0x8000 365 lis r31, BOOT_OFFSET@ha 366 addi r31, r31, BOOT_OFFSET@l 438 367 mtsprg0 r31 439 368 … … 454 383 .global trans 455 384 trans: 456 .space (TRANS_SIZE * TRANS_ITEM_SIZE) 385 .rept TRANS_SIZE 386 .int 0 387 .endr
Note:
See TracChangeset
for help on using the changeset viewer.