Rev 1854 | Rev 1860 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1854 | Rev 1856 | ||
|---|---|---|---|
| Line 39... | Line 39... | ||
| 39 | 39 | ||
| 40 | #include <arch/stack.h> |
40 | #include <arch/stack.h> |
| 41 | #include <arch/arch.h> |
41 | #include <arch/arch.h> |
| 42 | 42 | ||
| 43 | #define TT_CLEAN_WINDOW 0x24 |
43 | #define TT_CLEAN_WINDOW 0x24 |
| 44 | #define TT_SPILL_0_NORMAL 0x80 |
44 | #define TT_SPILL_0_NORMAL 0x80 /* kernel spills */ |
| - | 45 | #define TT_SPILL_1_NORMAL 0x84 /* userspace spills */ |
|
| - | 46 | #define TT_SPILL_2_NORMAL 0x88 /* spills to userspace window buffer */ |
|
| - | 47 | #define TT_SPILL_0_OTHER 0xa0 /* spills to userspace window buffer */ |
|
| 45 | #define TT_FILL_0_NORMAL 0xc0 |
48 | #define TT_FILL_0_NORMAL 0xc0 /* kernel fills */ |
| - | 49 | #define TT_FILL_1_NORMAL 0xc4 /* userspace fills */ |
|
| 46 | 50 | ||
| 47 | #define REGWIN_HANDLER_SIZE 128 |
51 | #define REGWIN_HANDLER_SIZE 128 |
| 48 | 52 | ||
| 49 | #define CLEAN_WINDOW_HANDLER_SIZE REGWIN_HANDLER_SIZE |
53 | #define CLEAN_WINDOW_HANDLER_SIZE REGWIN_HANDLER_SIZE |
| 50 | #define SPILL_HANDLER_SIZE REGWIN_HANDLER_SIZE |
54 | #define SPILL_HANDLER_SIZE REGWIN_HANDLER_SIZE |
| Line 96... | Line 100... | ||
| 96 | 100 | ||
| 97 | /* |
101 | /* |
| 98 | * Macro used by the userspace during normal spills. |
102 | * Macro used by the userspace during normal spills. |
| 99 | */ |
103 | */ |
| 100 | .macro SPILL_NORMAL_HANDLER_USERSPACE |
104 | .macro SPILL_NORMAL_HANDLER_USERSPACE |
| 101 | wr ASI_AIUP, %asi |
105 | wr %g0, ASI_AIUP, %asi |
| 102 | stxa %l0, [%sp + STACK_BIAS + L0_OFFSET] %asi |
106 | stxa %l0, [%sp + STACK_BIAS + L0_OFFSET] %asi |
| 103 | stxa %l1, [%sp + STACK_BIAS + L1_OFFSET] %asi |
107 | stxa %l1, [%sp + STACK_BIAS + L1_OFFSET] %asi |
| 104 | stxa %l2, [%sp + STACK_BIAS + L2_OFFSET] %asi |
108 | stxa %l2, [%sp + STACK_BIAS + L2_OFFSET] %asi |
| 105 | stxa %l3, [%sp + STACK_BIAS + L3_OFFSET] %asi |
109 | stxa %l3, [%sp + STACK_BIAS + L3_OFFSET] %asi |
| 106 | stxa %l4, [%sp + STACK_BIAS + L4_OFFSET] %asi |
110 | stxa %l4, [%sp + STACK_BIAS + L4_OFFSET] %asi |
| Line 118... | Line 122... | ||
| 118 | saved |
122 | saved |
| 119 | retry |
123 | retry |
| 120 | .endm |
124 | .endm |
| 121 | 125 | ||
| 122 | /* |
126 | /* |
| 123 | * Macro used by the userspace during other spills. |
127 | * Macro used to spill userspace window to userspace window buffer. |
| - | 128 | * It can be either triggered from preemptible_handler doing SAVE |
|
| - | 129 | * at (TL=1) or from normal kernel code doing SAVE when OTHERWIN>0 |
|
| - | 130 | * at (TL=0). |
|
| 124 | */ |
131 | */ |
| 125 | .macro SPILL_OTHER_HANDLER_USERSPACE |
132 | .macro SPILL_TO_USPACE_WINDOW_BUFFER |
| 126 | wr ASI_AIUS, %asi |
- | |
| 127 | stxa %l0, [%sp + STACK_BIAS + L0_OFFSET] %asi |
133 | stx %l0, [%g7 + L0_OFFSET] |
| 128 | stxa %l1, [%sp + STACK_BIAS + L1_OFFSET] %asi |
134 | stx %l1, [%g7 + L1_OFFSET] |
| 129 | stxa %l2, [%sp + STACK_BIAS + L2_OFFSET] %asi |
135 | stx %l2, [%g7 + L2_OFFSET] |
| 130 | stxa %l3, [%sp + STACK_BIAS + L3_OFFSET] %asi |
136 | stx %l3, [%g7 + L3_OFFSET] |
| 131 | stxa %l4, [%sp + STACK_BIAS + L4_OFFSET] %asi |
137 | stx %l4, [%g7 + L4_OFFSET] |
| 132 | stxa %l5, [%sp + STACK_BIAS + L5_OFFSET] %asi |
138 | stx %l5, [%g7 + L5_OFFSET] |
| 133 | stxa %l6, [%sp + STACK_BIAS + L6_OFFSET] %asi |
139 | stx %l6, [%g7 + L6_OFFSET] |
| 134 | stxa %l7, [%sp + STACK_BIAS + L7_OFFSET] %asi |
140 | stx %l7, [%g7 + L7_OFFSET] |
| 135 | stxa %i0, [%sp + STACK_BIAS + I0_OFFSET] %asi |
141 | stx %i0, [%g7 + I0_OFFSET] |
| 136 | stxa %i1, [%sp + STACK_BIAS + I1_OFFSET] %asi |
142 | stx %i1, [%g7 + I1_OFFSET] |
| 137 | stxa %i2, [%sp + STACK_BIAS + I2_OFFSET] %asi |
143 | stx %i2, [%g7 + I2_OFFSET] |
| 138 | stxa %i3, [%sp + STACK_BIAS + I3_OFFSET] %asi |
144 | stx %i3, [%g7 + I3_OFFSET] |
| 139 | stxa %i4, [%sp + STACK_BIAS + I4_OFFSET] %asi |
145 | stx %i4, [%g7 + I4_OFFSET] |
| 140 | stxa %i5, [%sp + STACK_BIAS + I5_OFFSET] %asi |
146 | stx %i5, [%g7 + I5_OFFSET] |
| 141 | stxa %i6, [%sp + STACK_BIAS + I6_OFFSET] %asi |
147 | stx %i6, [%g7 + I6_OFFSET] |
| 142 | stxa %i7, [%sp + STACK_BIAS + I7_OFFSET] %asi |
148 | stx %i7, [%g7 + I7_OFFSET] |
| - | 149 | add %g7, STACK_WINDOW_SAVE_AREA_SIZE, %g7 |
|
| 143 | saved |
150 | saved |
| 144 | retry |
151 | retry |
| 145 | .endm |
152 | .endm |
| 146 | 153 | ||
| 147 | 154 | ||
| Line 171... | Line 178... | ||
| 171 | 178 | ||
| 172 | /* |
179 | /* |
| 173 | * Macro used by the userspace during normal fills. |
180 | * Macro used by the userspace during normal fills. |
| 174 | */ |
181 | */ |
| 175 | .macro FILL_NORMAL_HANDLER_USERSPACE |
182 | .macro FILL_NORMAL_HANDLER_USERSPACE |
| 176 | wr ASI_AIUP, %asi |
183 | wr %g0, ASI_AIUP, %asi |
| 177 | ldxa [%sp + STACK_BIAS + L0_OFFSET] %asi, %l0 |
- | |
| 178 | ldxa [%sp + STACK_BIAS + L1_OFFSET] %asi, %l1 |
- | |
| 179 | ldxa [%sp + STACK_BIAS + L2_OFFSET] %asi, %l2 |
- | |
| 180 | ldxa [%sp + STACK_BIAS + L3_OFFSET] %asi, %l3 |
- | |
| 181 | ldxa [%sp + STACK_BIAS + L4_OFFSET] %asi, %l4 |
- | |
| 182 | ldxa [%sp + STACK_BIAS + L5_OFFSET] %asi, %l5 |
- | |
| 183 | ldxa [%sp + STACK_BIAS + L6_OFFSET] %asi, %l6 |
- | |
| 184 | ldxa [%sp + STACK_BIAS + L7_OFFSET] %asi, %l7 |
- | |
| 185 | ldxa [%sp + STACK_BIAS + I0_OFFSET] %asi, %i0 |
- | |
| 186 | ldxa [%sp + STACK_BIAS + I1_OFFSET] %asi, %i1 |
- | |
| 187 | ldxa [%sp + STACK_BIAS + I2_OFFSET] %asi, %i2 |
- | |
| 188 | ldxa [%sp + STACK_BIAS + I3_OFFSET] %asi, %i3 |
- | |
| 189 | ldxa [%sp + STACK_BIAS + I4_OFFSET] %asi, %i4 |
- | |
| 190 | ldxa [%sp + STACK_BIAS + I5_OFFSET] %asi, %i5 |
- | |
| 191 | ldxa [%sp + STACK_BIAS + I6_OFFSET] %asi, %i6 |
- | |
| 192 | ldxa [%sp + STACK_BIAS + I7_OFFSET] %asi, %i7 |
- | |
| 193 | restored |
- | |
| 194 | retry |
- | |
| 195 | .endm |
- | |
| 196 | - | ||
| 197 | /* |
- | |
| 198 | * Macro used by the userspace during other fills. |
- | |
| 199 | */ |
- | |
| 200 | .macro FILL_OTHER_HANDLER_USERSPACE |
- | |
| 201 | wr ASI_AIUS, %asi |
- | |
| 202 | ldxa [%sp + STACK_BIAS + L0_OFFSET] %asi, %l0 |
184 | ldxa [%sp + STACK_BIAS + L0_OFFSET] %asi, %l0 |
| 203 | ldxa [%sp + STACK_BIAS + L1_OFFSET] %asi, %l1 |
185 | ldxa [%sp + STACK_BIAS + L1_OFFSET] %asi, %l1 |
| 204 | ldxa [%sp + STACK_BIAS + L2_OFFSET] %asi, %l2 |
186 | ldxa [%sp + STACK_BIAS + L2_OFFSET] %asi, %l2 |
| 205 | ldxa [%sp + STACK_BIAS + L3_OFFSET] %asi, %l3 |
187 | ldxa [%sp + STACK_BIAS + L3_OFFSET] %asi, %l3 |
| 206 | ldxa [%sp + STACK_BIAS + L4_OFFSET] %asi, %l4 |
188 | ldxa [%sp + STACK_BIAS + L4_OFFSET] %asi, %l4 |