Rev 1787 | Rev 1854 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1787 | Rev 1852 | ||
|---|---|---|---|
| Line 36... | Line 36... | ||
| 36 | 36 | ||
| 37 | #ifndef __sparc64_REGWIN_H__ |
37 | #ifndef __sparc64_REGWIN_H__ |
| 38 | #define __sparc64_REGWIN_H__ |
38 | #define __sparc64_REGWIN_H__ |
| 39 | 39 | ||
| 40 | #include <arch/stack.h> |
40 | #include <arch/stack.h> |
| - | 41 | #include <arch/arch.h> |
|
| 41 | 42 | ||
| 42 | #define TT_CLEAN_WINDOW 0x24 |
43 | #define TT_CLEAN_WINDOW 0x24 |
| 43 | #define TT_SPILL_0_NORMAL 0x80 |
44 | #define TT_SPILL_0_NORMAL 0x80 |
| 44 | #define TT_FILL_0_NORMAL 0xc0 |
45 | #define TT_FILL_0_NORMAL 0xc0 |
| 45 | 46 | ||
| Line 47... | Line 48... | ||
| 47 | 48 | ||
| 48 | #define CLEAN_WINDOW_HANDLER_SIZE REGWIN_HANDLER_SIZE |
49 | #define CLEAN_WINDOW_HANDLER_SIZE REGWIN_HANDLER_SIZE |
| 49 | #define SPILL_HANDLER_SIZE REGWIN_HANDLER_SIZE |
50 | #define SPILL_HANDLER_SIZE REGWIN_HANDLER_SIZE |
| 50 | #define FILL_HANDLER_SIZE REGWIN_HANDLER_SIZE |
51 | #define FILL_HANDLER_SIZE REGWIN_HANDLER_SIZE |
| 51 | 52 | ||
| - | 53 | #define NWINDOW 8 |
|
| - | 54 | ||
| 52 | /** Window Save Area offsets. */ |
55 | /* Window Save Area offsets. */ |
| 53 | #define L0_OFFSET 0 |
56 | #define L0_OFFSET 0 |
| 54 | #define L1_OFFSET 8 |
57 | #define L1_OFFSET 8 |
| 55 | #define L2_OFFSET 16 |
58 | #define L2_OFFSET 16 |
| 56 | #define L3_OFFSET 24 |
59 | #define L3_OFFSET 24 |
| 57 | #define L4_OFFSET 32 |
60 | #define L4_OFFSET 32 |
| Line 66... | Line 69... | ||
| 66 | #define I5_OFFSET 104 |
69 | #define I5_OFFSET 104 |
| 67 | #define I6_OFFSET 112 |
70 | #define I6_OFFSET 112 |
| 68 | #define I7_OFFSET 120 |
71 | #define I7_OFFSET 120 |
| 69 | 72 | ||
| 70 | #ifdef __ASM__ |
73 | #ifdef __ASM__ |
| - | 74 | ||
| - | 75 | /* |
|
| - | 76 | * Macro used by the nucleus and the primary context 0 during normal and other spills. |
|
| - | 77 | */ |
|
| 71 | .macro SPILL_NORMAL_HANDLER |
78 | .macro SPILL_NORMAL_HANDLER_KERNEL |
| 72 | stx %l0, [%sp + STACK_BIAS + L0_OFFSET] |
79 | stx %l0, [%sp + STACK_BIAS + L0_OFFSET] |
| 73 | stx %l1, [%sp + STACK_BIAS + L1_OFFSET] |
80 | stx %l1, [%sp + STACK_BIAS + L1_OFFSET] |
| 74 | stx %l2, [%sp + STACK_BIAS + L2_OFFSET] |
81 | stx %l2, [%sp + STACK_BIAS + L2_OFFSET] |
| 75 | stx %l3, [%sp + STACK_BIAS + L3_OFFSET] |
82 | stx %l3, [%sp + STACK_BIAS + L3_OFFSET] |
| 76 | stx %l4, [%sp + STACK_BIAS + L4_OFFSET] |
83 | stx %l4, [%sp + STACK_BIAS + L4_OFFSET] |
| Line 87... | Line 94... | ||
| 87 | stx %i7, [%sp + STACK_BIAS + I7_OFFSET] |
94 | stx %i7, [%sp + STACK_BIAS + I7_OFFSET] |
| 88 | saved |
95 | saved |
| 89 | retry |
96 | retry |
| 90 | .endm |
97 | .endm |
| 91 | 98 | ||
| - | 99 | /* |
|
| - | 100 | * Macro used by the userspace during normal spills. |
|
| - | 101 | */ |
|
| - | 102 | .macro SPILL_NORMAL_HANDLER_USERSPACE |
|
| - | 103 | wr ASI_AIUP, %asi |
|
| - | 104 | stxa %l0, [%sp + STACK_BIAS + L0_OFFSET] %asi |
|
| - | 105 | stxa %l1, [%sp + STACK_BIAS + L1_OFFSET] %asi |
|
| - | 106 | stxa %l2, [%sp + STACK_BIAS + L2_OFFSET] %asi |
|
| - | 107 | stxa %l3, [%sp + STACK_BIAS + L3_OFFSET] %asi |
|
| - | 108 | stxa %l4, [%sp + STACK_BIAS + L4_OFFSET] %asi |
|
| - | 109 | stxa %l5, [%sp + STACK_BIAS + L5_OFFSET] %asi |
|
| - | 110 | stxa %l6, [%sp + STACK_BIAS + L6_OFFSET] %asi |
|
| - | 111 | stxa %l7, [%sp + STACK_BIAS + L7_OFFSET] %asi |
|
| - | 112 | stxa %i0, [%sp + STACK_BIAS + I0_OFFSET] %asi |
|
| - | 113 | stxa %i1, [%sp + STACK_BIAS + I1_OFFSET] %asi |
|
| - | 114 | stxa %i2, [%sp + STACK_BIAS + I2_OFFSET] %asi |
|
| - | 115 | stxa %i3, [%sp + STACK_BIAS + I3_OFFSET] %asi |
|
| - | 116 | stxa %i4, [%sp + STACK_BIAS + I4_OFFSET] %asi |
|
| - | 117 | stxa %i5, [%sp + STACK_BIAS + I5_OFFSET] %asi |
|
| - | 118 | stxa %i6, [%sp + STACK_BIAS + I6_OFFSET] %asi |
|
| - | 119 | stxa %i7, [%sp + STACK_BIAS + I7_OFFSET] %asi |
|
| - | 120 | saved |
|
| - | 121 | retry |
|
| - | 122 | .endm |
|
| - | 123 | ||
| - | 124 | /* |
|
| - | 125 | * Macro used by the userspace during other spills. |
|
| - | 126 | */ |
|
| - | 127 | .macro SPILL_OTHER_HANDLER_USERSPACE |
|
| - | 128 | wr ASI_AIUS, %asi |
|
| - | 129 | stxa %l0, [%sp + STACK_BIAS + L0_OFFSET] %asi |
|
| - | 130 | stxa %l1, [%sp + STACK_BIAS + L1_OFFSET] %asi |
|
| - | 131 | stxa %l2, [%sp + STACK_BIAS + L2_OFFSET] %asi |
|
| - | 132 | stxa %l3, [%sp + STACK_BIAS + L3_OFFSET] %asi |
|
| - | 133 | stxa %l4, [%sp + STACK_BIAS + L4_OFFSET] %asi |
|
| - | 134 | stxa %l5, [%sp + STACK_BIAS + L5_OFFSET] %asi |
|
| - | 135 | stxa %l6, [%sp + STACK_BIAS + L6_OFFSET] %asi |
|
| - | 136 | stxa %l7, [%sp + STACK_BIAS + L7_OFFSET] %asi |
|
| - | 137 | stxa %i0, [%sp + STACK_BIAS + I0_OFFSET] %asi |
|
| - | 138 | stxa %i1, [%sp + STACK_BIAS + I1_OFFSET] %asi |
|
| - | 139 | stxa %i2, [%sp + STACK_BIAS + I2_OFFSET] %asi |
|
| - | 140 | stxa %i3, [%sp + STACK_BIAS + I3_OFFSET] %asi |
|
| - | 141 | stxa %i4, [%sp + STACK_BIAS + I4_OFFSET] %asi |
|
| - | 142 | stxa %i5, [%sp + STACK_BIAS + I5_OFFSET] %asi |
|
| - | 143 | stxa %i6, [%sp + STACK_BIAS + I6_OFFSET] %asi |
|
| - | 144 | stxa %i7, [%sp + STACK_BIAS + I7_OFFSET] %asi |
|
| - | 145 | saved |
|
| - | 146 | retry |
|
| - | 147 | .endm |
|
| - | 148 | ||
| - | 149 | ||
| - | 150 | /* |
|
| - | 151 | * Macro used by the nucleus and the primary context 0 during normal fills. |
|
| - | 152 | */ |
|
| 92 | .macro FILL_NORMAL_HANDLER |
153 | .macro FILL_NORMAL_HANDLER_KERNEL |
| 93 | ldx [%sp + STACK_BIAS + L0_OFFSET], %l0 |
154 | ldx [%sp + STACK_BIAS + L0_OFFSET], %l0 |
| 94 | ldx [%sp + STACK_BIAS + L1_OFFSET], %l1 |
155 | ldx [%sp + STACK_BIAS + L1_OFFSET], %l1 |
| 95 | ldx [%sp + STACK_BIAS + L2_OFFSET], %l2 |
156 | ldx [%sp + STACK_BIAS + L2_OFFSET], %l2 |
| 96 | ldx [%sp + STACK_BIAS + L3_OFFSET], %l3 |
157 | ldx [%sp + STACK_BIAS + L3_OFFSET], %l3 |
| 97 | ldx [%sp + STACK_BIAS + L4_OFFSET], %l4 |
158 | ldx [%sp + STACK_BIAS + L4_OFFSET], %l4 |
| Line 108... | Line 169... | ||
| 108 | ldx [%sp + STACK_BIAS + I7_OFFSET], %i7 |
169 | ldx [%sp + STACK_BIAS + I7_OFFSET], %i7 |
| 109 | restored |
170 | restored |
| 110 | retry |
171 | retry |
| 111 | .endm |
172 | .endm |
| 112 | 173 | ||
| - | 174 | /* |
|
| - | 175 | * Macro used by the userspace during normal fills. |
|
| - | 176 | */ |
|
| - | 177 | .macro FILL_NORMAL_HANDLER_USERSPACE |
|
| - | 178 | wr ASI_AIUP, %asi |
|
| - | 179 | ldxa [%sp + STACK_BIAS + L0_OFFSET] %asi, %l0 |
|
| - | 180 | ldxa [%sp + STACK_BIAS + L1_OFFSET] %asi, %l1 |
|
| - | 181 | ldxa [%sp + STACK_BIAS + L2_OFFSET] %asi, %l2 |
|
| - | 182 | ldxa [%sp + STACK_BIAS + L3_OFFSET] %asi, %l3 |
|
| - | 183 | ldxa [%sp + STACK_BIAS + L4_OFFSET] %asi, %l4 |
|
| - | 184 | ldxa [%sp + STACK_BIAS + L5_OFFSET] %asi, %l5 |
|
| - | 185 | ldxa [%sp + STACK_BIAS + L6_OFFSET] %asi, %l6 |
|
| - | 186 | ldxa [%sp + STACK_BIAS + L7_OFFSET] %asi, %l7 |
|
| - | 187 | ldxa [%sp + STACK_BIAS + I0_OFFSET] %asi, %i0 |
|
| - | 188 | ldxa [%sp + STACK_BIAS + I1_OFFSET] %asi, %i1 |
|
| - | 189 | ldxa [%sp + STACK_BIAS + I2_OFFSET] %asi, %i2 |
|
| - | 190 | ldxa [%sp + STACK_BIAS + I3_OFFSET] %asi, %i3 |
|
| - | 191 | ldxa [%sp + STACK_BIAS + I4_OFFSET] %asi, %i4 |
|
| - | 192 | ldxa [%sp + STACK_BIAS + I5_OFFSET] %asi, %i5 |
|
| - | 193 | ldxa [%sp + STACK_BIAS + I6_OFFSET] %asi, %i6 |
|
| - | 194 | ldxa [%sp + STACK_BIAS + I7_OFFSET] %asi, %i7 |
|
| - | 195 | restored |
|
| - | 196 | retry |
|
| - | 197 | .endm |
|
| - | 198 | ||
| - | 199 | /* |
|
| - | 200 | * Macro used by the userspace during other fills. |
|
| - | 201 | */ |
|
| - | 202 | .macro FILL_OTHER_HANDLER_USERSPACE |
|
| - | 203 | wr ASI_AIUS, %asi |
|
| - | 204 | ldxa [%sp + STACK_BIAS + L0_OFFSET] %asi, %l0 |
|
| - | 205 | ldxa [%sp + STACK_BIAS + L1_OFFSET] %asi, %l1 |
|
| - | 206 | ldxa [%sp + STACK_BIAS + L2_OFFSET] %asi, %l2 |
|
| - | 207 | ldxa [%sp + STACK_BIAS + L3_OFFSET] %asi, %l3 |
|
| - | 208 | ldxa [%sp + STACK_BIAS + L4_OFFSET] %asi, %l4 |
|
| - | 209 | ldxa [%sp + STACK_BIAS + L5_OFFSET] %asi, %l5 |
|
| - | 210 | ldxa [%sp + STACK_BIAS + L6_OFFSET] %asi, %l6 |
|
| - | 211 | ldxa [%sp + STACK_BIAS + L7_OFFSET] %asi, %l7 |
|
| - | 212 | ldxa [%sp + STACK_BIAS + I0_OFFSET] %asi, %i0 |
|
| - | 213 | ldxa [%sp + STACK_BIAS + I1_OFFSET] %asi, %i1 |
|
| - | 214 | ldxa [%sp + STACK_BIAS + I2_OFFSET] %asi, %i2 |
|
| - | 215 | ldxa [%sp + STACK_BIAS + I3_OFFSET] %asi, %i3 |
|
| - | 216 | ldxa [%sp + STACK_BIAS + I4_OFFSET] %asi, %i4 |
|
| - | 217 | ldxa [%sp + STACK_BIAS + I5_OFFSET] %asi, %i5 |
|
| - | 218 | ldxa [%sp + STACK_BIAS + I6_OFFSET] %asi, %i6 |
|
| - | 219 | ldxa [%sp + STACK_BIAS + I7_OFFSET] %asi, %i7 |
|
| - | 220 | restored |
|
| - | 221 | retry |
|
| - | 222 | .endm |
|
| - | 223 | ||
| 113 | .macro CLEAN_WINDOW_HANDLER |
224 | .macro CLEAN_WINDOW_HANDLER |
| 114 | rdpr %cleanwin, %l0 |
225 | rdpr %cleanwin, %l0 |
| 115 | add %l0, 1, %l0 |
226 | add %l0, 1, %l0 |
| 116 | wrpr %l0, 0, %cleanwin |
227 | wrpr %l0, 0, %cleanwin |
| 117 | mov %r0, %l0 |
228 | mov %r0, %l0 |