Rev 3144 | Rev 3672 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3144 | Rev 3146 | ||
---|---|---|---|
Line 97... | Line 97... | ||
97 | jmp %o7 + 8 ! exit point |
97 | jmp %o7 + 8 ! exit point |
98 | mov %o1, %o0 |
98 | mov %o1, %o0 |
99 | 99 | ||
100 | jump_to_kernel: |
100 | jump_to_kernel: |
101 | /* |
101 | /* |
102 | * Make sure that the code we have moved has drained to main memory. |
102 | * We have copied code and now we need to guarantee cache coherence. |
103 | * We have a reason to assume that the I-cache does not include the |
103 | * 1. Make sure that the code we have moved has drained to main memory. |
104 | * code to which we are going to pass control. Hence no I-cache |
104 | * 2. Invalidate I-cache. |
105 | * invalidation. |
105 | * 3. Flush instruction pipeline. |
106 | */ |
106 | */ |
- | 107 | call icache_flush |
|
107 | membar #StoreStore |
108 | membar #StoreStore |
- | 109 | flush %i7 |
|
108 | 110 | ||
109 | mov %o0, %l1 |
111 | mov %o0, %l1 |
110 | mov %o1, %o0 |
112 | mov %o1, %o0 |
111 | mov %o2, %o1 |
113 | mov %o2, %o1 |
112 | mov %o3, %o2 |
114 | mov %o3, %o2 |
113 | jmp %l1 ! jump to kernel |
115 | jmp %l1 ! jump to kernel |
114 | nop |
116 | nop |
115 | 117 | ||
- | 118 | #define ICACHE_SIZE 8192 |
|
- | 119 | #define ICACHE_LINE_SIZE 32 |
|
- | 120 | #define ICACHE_SET_BIT (1 << 13) |
|
- | 121 | #define ASI_ICACHE_TAG 0x67 |
|
- | 122 | ||
- | 123 | # Flush I-cache |
|
- | 124 | icache_flush: |
|
- | 125 | set ((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1 |
|
- | 126 | stxa %g0, [%g1] ASI_ICACHE_TAG |
|
- | 127 | 0: membar #Sync |
|
- | 128 | subcc %g1, ICACHE_LINE_SIZE, %g1 |
|
- | 129 | bnz,pt %xcc, 0b |
|
- | 130 | stxa %g0, [%g1] ASI_ICACHE_TAG |
|
- | 131 | membar #Sync |
|
- | 132 | retl |
|
- | 133 | ! SF Erratum #51 |
|
- | 134 | nop |
|
- | 135 | ||
116 | .global ofw |
136 | .global ofw |
117 | ofw: |
137 | ofw: |
118 | save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp |
138 | save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp |
119 | set ofw_cif, %l0 |
139 | set ofw_cif, %l0 |
120 | ldx [%l0], %l0 |
140 | ldx [%l0], %l0 |