Rev 1860 | Rev 1865 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1860 | Rev 1864 | ||
---|---|---|---|
Line 148... | Line 148... | ||
148 | 148 | ||
149 | /** Switch to userspace. |
149 | /** Switch to userspace. |
150 | * |
150 | * |
151 | * %o0 Userspace entry address. |
151 | * %o0 Userspace entry address. |
152 | * %o1 Userspace stack pointer address. |
152 | * %o1 Userspace stack pointer address. |
- | 153 | * %o2 Userspace address of uarg structure. |
|
153 | */ |
154 | */ |
154 | .global switch_to_userspace |
155 | .global switch_to_userspace |
155 | switch_to_userspace: |
156 | switch_to_userspace: |
156 | flushw |
157 | flushw |
157 | wrpr %g0, 0, %cleanwin ! avoid information leak |
158 | wrpr %g0, 0, %cleanwin ! avoid information leak |
158 | save %o1, -STACK_WINDOW_SAVE_AREA_SIZE, %sp |
159 | save %o1, -STACK_WINDOW_SAVE_AREA_SIZE, %sp |
159 | 160 | ||
- | 161 | mov %i3, %o0 ! uarg |
|
- | 162 | ||
160 | clr %i2 |
163 | clr %i2 |
161 | clr %i3 |
164 | clr %i3 |
162 | clr %i4 |
165 | clr %i4 |
163 | clr %i5 |
166 | clr %i5 |
164 | clr %i6 |
167 | clr %i6 |
Line 176... | Line 179... | ||
176 | */ |
179 | */ |
177 | wr %g0, ASI_DMMU, %asi |
180 | wr %g0, ASI_DMMU, %asi |
178 | ldxa [VA_SECONDARY_CONTEXT_REG] %asi, %g1 |
181 | ldxa [VA_SECONDARY_CONTEXT_REG] %asi, %g1 |
179 | stxa %g1, [VA_PRIMARY_CONTEXT_REG] %asi |
182 | stxa %g1, [VA_PRIMARY_CONTEXT_REG] %asi |
180 | flush %i7 |
183 | flush %i7 |
- | 184 | ||
- | 185 | /* |
|
- | 186 | * Spills and fills will be handled by the userspace handlers. |
|
- | 187 | */ |
|
- | 188 | wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(1), %wstate |
|
181 | 189 | ||
182 | done ! jump to userspace |
190 | done ! jump to userspace |