Changeset 1787e527 in mainline for boot/arch/sparc64/loader/asm.S
- Timestamp:
- 2009-11-16T21:22:54Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5ebdf94
- Parents:
- fcbd1be (diff), 9c70ed6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/arch/sparc64/loader/asm.S
rfcbd1be r1787e527 31 31 #include <register.h> 32 32 33 .register 34 .register 33 .register %g2, #scratch 34 .register %g3, #scratch 35 35 36 36 .text … … 43 43 ba %xcc, halt 44 44 nop 45 46 memcpy: 47 mov %o0, %o3 ! save dst 48 add %o1, 7, %g1 49 and %g1, -8, %g1 50 cmp %o1, %g1 51 be,pn %xcc, 3f 52 add %o0, 7, %g1 53 mov 0, %g3 45 54 46 memcpy: 47 mov %o0, %o3 ! save dst 48 add %o1, 7, %g1 49 and %g1, -8, %g1 50 cmp %o1, %g1 51 be,pn %xcc, 3f 52 add %o0, 7, %g1 53 mov 0, %g3 54 0: 55 brz,pn %o2, 2f 56 mov 0, %g2 57 1: 58 ldub [%g3 + %o1], %g1 59 add %g2, 1, %g2 60 cmp %o2, %g2 61 stb %g1, [%g3 + %o0] 62 bne,pt %xcc, 1b 63 mov %g2, %g3 64 2: 65 jmp %o7 + 8 ! exit point 66 mov %o3, %o0 67 3: 68 and %g1, -8, %g1 69 cmp %o0, %g1 70 bne,pt %xcc, 0b 71 mov 0, %g3 72 srlx %o2, 3, %g4 73 brz,pn %g4, 5f 74 mov 0, %g5 75 4: 76 sllx %g3, 3, %g2 77 add %g5, 1, %g3 78 ldx [%o1 + %g2], %g1 79 mov %g3, %g5 80 cmp %g4, %g3 81 bne,pt %xcc, 4b 82 stx %g1, [%o0 + %g2] 83 5: 84 and %o2, 7, %o2 85 brz,pn %o2, 2b 86 sllx %g4, 3, %g1 87 mov 0, %g2 88 add %g1, %o0, %o0 89 add %g1, %o1, %g4 90 mov 0, %g3 91 6: 92 ldub [%g2 + %g4], %g1 93 stb %g1, [%g2 + %o0] 94 add %g3, 1, %g2 95 cmp %o2, %g2 96 bne,pt %xcc, 6b 97 mov %g2, %g3 98 99 jmp %o7 + 8 ! exit point 100 mov %o3, %o0 55 0: 56 brz,pn %o2, 2f 57 mov 0, %g2 58 59 1: 60 ldub [%g3 + %o1], %g1 61 add %g2, 1, %g2 62 cmp %o2, %g2 63 stb %g1, [%g3 + %o0] 64 bne,pt %xcc, 1b 65 mov %g2, %g3 66 67 2: 68 jmp %o7 + 8 ! exit point 69 mov %o3, %o0 70 71 3: 72 and %g1, -8, %g1 73 cmp %o0, %g1 74 bne,pt %xcc, 0b 75 mov 0, %g3 76 srlx %o2, 3, %g4 77 brz,pn %g4, 5f 78 mov 0, %g5 79 80 4: 81 sllx %g3, 3, %g2 82 add %g5, 1, %g3 83 ldx [%o1 + %g2], %g1 84 mov %g3, %g5 85 cmp %g4, %g3 86 bne,pt %xcc, 4b 87 stx %g1, [%o0 + %g2] 88 89 5: 90 and %o2, 7, %o2 91 brz,pn %o2, 2b 92 sllx %g4, 3, %g1 93 mov 0, %g2 94 add %g1, %o0, %o0 95 add %g1, %o1, %g4 96 mov 0, %g3 97 98 6: 99 ldub [%g2 + %g4], %g1 100 stb %g1, [%g2 + %o0] 101 add %g3, 1, %g2 102 cmp %o2, %g2 103 bne,pt %xcc, 6b 104 mov %g2, %g3 105 106 jmp %o7 + 8 ! exit point 107 mov %o3, %o0 101 108 102 109 jump_to_kernel: … … 107 114 * 3. Flush instruction pipeline. 108 115 */ 109 116 110 117 /* 111 118 * US3 processors have a write-invalidate cache, so explicitly 112 119 * invalidating it is not required. Whether to invalidate I-cache 113 * or not is decided according to the value of the global114 * "subarchitecture" variable (set in the bootstrap).120 * or not is decided according to the value of the 5th argument 121 * (subarchitecture). 115 122 */ 116 set subarchitecture, %g2 117 ldub [%g2], %g2 118 cmp %g2, 3 123 cmp %i4, 3 119 124 be %xcc, 1f 120 125 nop 121 0: 122 call icache_flush 123 nop 124 1: 125 membar #StoreStore 126 127 0: 128 call icache_flush 129 nop 130 131 1: 132 membar #StoreStore 126 133 127 134 /* 128 135 * Flush the instruction pipeline. 129 136 */ 130 flush 131 137 flush %i7 138 132 139 mov %o0, %l1 133 140 mov %o1, %o0 134 141 mov %o2, %o1 135 142 mov %o3, %o2 136 jmp %l1 143 jmp %l1 ! jump to kernel 137 144 nop 138 145 139 #define ICACHE_SIZE 140 #define ICACHE_LINE_SIZE 141 #define ICACHE_SET_BIT 142 #define ASI_ICACHE_TAG 146 #define ICACHE_SIZE 8192 147 #define ICACHE_LINE_SIZE 32 148 #define ICACHE_SET_BIT (1 << 13) 149 #define ASI_ICACHE_TAG 0x67 143 150 144 151 # Flush I-cache 145 152 icache_flush: 146 set ((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1 147 stxa %g0, [%g1] ASI_ICACHE_TAG 148 0: membar #Sync 149 subcc %g1, ICACHE_LINE_SIZE, %g1 150 bnz,pt %xcc, 0b 151 stxa %g0, [%g1] ASI_ICACHE_TAG 152 membar #Sync 153 set ((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1 154 stxa %g0, [%g1] ASI_ICACHE_TAG 155 156 0: 157 membar #Sync 158 subcc %g1, ICACHE_LINE_SIZE, %g1 159 bnz,pt %xcc, 0b 160 161 stxa %g0, [%g1] ASI_ICACHE_TAG 162 membar #Sync 153 163 retl 154 164 ! SF Erratum #51 155 165 nop 166 156 167 .global ofw 157 168 ofw: … … 159 170 set ofw_cif, %l0 160 171 ldx [%l0], %l0 161 172 162 173 rdpr %pstate, %l1 163 174 and %l1, ~PSTATE_AM_BIT, %l2 164 175 wrpr %l2, 0, %pstate 165 176 166 177 jmpl %l0, %o7 167 178 mov %i0, %o0 168 179 169 180 wrpr %l1, 0, %pstate 170 181 171 182 ret 172 183 restore %o0, 0, %o0
Note:
See TracChangeset
for help on using the changeset viewer.