Rev 1071 | Rev 1146 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1071 | Rev 1075 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | .space (L1_CACHE_LINES * L1_CACHE_BYTES) |
35 | .space (L1_CACHE_LINES * L1_CACHE_BYTES) |
36 | 36 | ||
37 | .text |
37 | .text |
38 | 38 | ||
39 | .global halt |
39 | .global halt |
- | 40 | .global memcpy |
|
40 | .global jump_to_kernel |
41 | .global jump_to_kernel |
41 | 42 | ||
42 | halt: |
43 | halt: |
43 | b halt |
44 | b halt |
44 | 45 | ||
- | 46 | memcpy: |
|
- | 47 | srwi. r7, r5, 3 |
|
- | 48 | addi r6, r3, -4 |
|
- | 49 | addi r4, r4, -4 |
|
- | 50 | beq 2f |
|
- | 51 | ||
- | 52 | andi. r0, r6, 3 |
|
- | 53 | mtctr r7 |
|
- | 54 | bne 5f |
|
- | 55 | ||
- | 56 | 1: |
|
- | 57 | ||
- | 58 | lwz r7, 4(r4) |
|
- | 59 | lwzu r8, 8(r4) |
|
- | 60 | stw r7, 4(r6) |
|
- | 61 | stwu r8, 8(r6) |
|
- | 62 | bdnz 1b |
|
- | 63 | ||
- | 64 | andi. r5, r5, 7 |
|
- | 65 | ||
- | 66 | 2: |
|
- | 67 | ||
- | 68 | cmplwi 0, r5, 4 |
|
- | 69 | blt 3f |
|
- | 70 | ||
- | 71 | lwzu r0, 4(r4) |
|
- | 72 | addi r5, r5, -4 |
|
- | 73 | stwu r0, 4(r6) |
|
- | 74 | ||
- | 75 | 3: |
|
- | 76 | ||
- | 77 | cmpwi 0, r5, 0 |
|
- | 78 | beqlr |
|
- | 79 | mtctr r5 |
|
- | 80 | addi r4, r4, 3 |
|
- | 81 | addi r6, r6, 3 |
|
- | 82 | ||
- | 83 | 4: |
|
- | 84 | ||
- | 85 | lbzu r0, 1(r4) |
|
- | 86 | stbu r0, 1(r6) |
|
- | 87 | bdnz 4b |
|
- | 88 | blr |
|
- | 89 | ||
- | 90 | 5: |
|
- | 91 | ||
- | 92 | subfic r0, r0, 4 |
|
- | 93 | mtctr r0 |
|
- | 94 | ||
- | 95 | 6: |
|
- | 96 | ||
- | 97 | lbz r7, 4(r4) |
|
- | 98 | addi r4, r4, 1 |
|
- | 99 | stb r7, 4(r6) |
|
- | 100 | addi r6, r6, 1 |
|
- | 101 | bdnz 6b |
|
- | 102 | subf r5, r0, r5 |
|
- | 103 | rlwinm. r7, r5, 32-3, 3, 31 |
|
- | 104 | beq 2b |
|
- | 105 | mtctr r7 |
|
- | 106 | b 1b |
|
- | 107 | ||
- | 108 | ||
45 | jump_to_kernel: |
109 | jump_to_kernel: |
46 | 110 | ||
47 | # r3 = memmap (pa) |
111 | # r3 = memmap (pa) |
48 | # r4 = trans (pa) |
112 | # r4 = trans (pa) |
49 | # r5 = kernel size |
113 | # r5 = kernel size |