Rev 1021 | Rev 1121 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1021 | Rev 1094 | ||
---|---|---|---|
Line 119... | Line 119... | ||
119 | rdmsr |
119 | rdmsr |
120 | ret |
120 | ret |
121 | 121 | ||
122 | # Push all general purpose registers on stack except %rbp, %rsp |
122 | # Push all general purpose registers on stack except %rbp, %rsp |
123 | .macro save_all_gpr |
123 | .macro save_all_gpr |
124 | movq %rbp, IOFFSET_RBP(%rsp) |
- | |
125 | movq %rax, IOFFSET_RAX(%rsp) |
124 | movq %rax, IOFFSET_RAX(%rsp) |
126 | movq %rbx, IOFFSET_RBX(%rsp) |
- | |
127 | movq %rcx, IOFFSET_RCX(%rsp) |
125 | movq %rcx, IOFFSET_RCX(%rsp) |
128 | movq %rdx, IOFFSET_RDX(%rsp) |
126 | movq %rdx, IOFFSET_RDX(%rsp) |
129 | movq %rsi, IOFFSET_RSI(%rsp) |
127 | movq %rsi, IOFFSET_RSI(%rsp) |
130 | movq %rdi, IOFFSET_RDI(%rsp) |
128 | movq %rdi, IOFFSET_RDI(%rsp) |
131 | movq %r8, IOFFSET_R8(%rsp) |
129 | movq %r8, IOFFSET_R8(%rsp) |
132 | movq %r9, IOFFSET_R9(%rsp) |
130 | movq %r9, IOFFSET_R9(%rsp) |
133 | movq %r10, IOFFSET_R10(%rsp) |
131 | movq %r10, IOFFSET_R10(%rsp) |
134 | movq %r11, IOFFSET_R11(%rsp) |
132 | movq %r11, IOFFSET_R11(%rsp) |
- | 133 | #ifdef CONFIG_DEBUG_ALLREGS |
|
- | 134 | movq %rbx, IOFFSET_RBX(%rsp) |
|
- | 135 | movq %rbp, IOFFSET_RBP(%rsp) |
|
135 | movq %r12, IOFFSET_R12(%rsp) |
136 | movq %r12, IOFFSET_R12(%rsp) |
136 | movq %r13, IOFFSET_R13(%rsp) |
137 | movq %r13, IOFFSET_R13(%rsp) |
137 | movq %r14, IOFFSET_R14(%rsp) |
138 | movq %r14, IOFFSET_R14(%rsp) |
138 | movq %r15, IOFFSET_R15(%rsp) |
139 | movq %r15, IOFFSET_R15(%rsp) |
- | 140 | #endif |
|
139 | .endm |
141 | .endm |
140 | 142 | ||
141 | .macro restore_all_gpr |
143 | .macro restore_all_gpr |
142 | movq IOFFSET_RBP(%rsp), %rbp |
- | |
143 | movq IOFFSET_RAX(%rsp), %rax |
144 | movq IOFFSET_RAX(%rsp), %rax |
144 | movq IOFFSET_RBX(%rsp), %rbx |
- | |
145 | movq IOFFSET_RCX(%rsp), %rcx |
145 | movq IOFFSET_RCX(%rsp), %rcx |
146 | movq IOFFSET_RDX(%rsp), %rdx |
146 | movq IOFFSET_RDX(%rsp), %rdx |
147 | movq IOFFSET_RSI(%rsp), %rsi |
147 | movq IOFFSET_RSI(%rsp), %rsi |
148 | movq IOFFSET_RDI(%rsp), %rdi |
148 | movq IOFFSET_RDI(%rsp), %rdi |
149 | movq IOFFSET_R8(%rsp), %r8 |
149 | movq IOFFSET_R8(%rsp), %r8 |
150 | movq IOFFSET_R9(%rsp), %r9 |
150 | movq IOFFSET_R9(%rsp), %r9 |
151 | movq IOFFSET_R10(%rsp), %r10 |
151 | movq IOFFSET_R10(%rsp), %r10 |
152 | movq IOFFSET_R11(%rsp), %r11 |
152 | movq IOFFSET_R11(%rsp), %r11 |
- | 153 | #ifdef CONFIG_DEBUG_ALLREGS |
|
- | 154 | movq IOFFSET_RBX(%rsp), %rbx |
|
- | 155 | movq IOFFSET_RBP(%rsp), %rbp |
|
153 | movq IOFFSET_R12(%rsp), %r12 |
156 | movq IOFFSET_R12(%rsp), %r12 |
154 | movq IOFFSET_R13(%rsp), %r13 |
157 | movq IOFFSET_R13(%rsp), %r13 |
155 | movq IOFFSET_R14(%rsp), %r14 |
158 | movq IOFFSET_R14(%rsp), %r14 |
156 | movq IOFFSET_R15(%rsp), %r15 |
159 | movq IOFFSET_R15(%rsp), %r15 |
- | 160 | #endif |
|
157 | .endm |
161 | .endm |
158 | 162 | ||
- | 163 | #ifdef CONFIG_DEBUG_ALLREGS |
|
- | 164 | # define INTERRUPT_ALIGN 256 |
|
- | 165 | #else |
|
- | 166 | # define INTERRUPT_ALIGN 128 |
|
- | 167 | #endif |
|
- | 168 | ||
159 | ## Declare interrupt handlers |
169 | ## Declare interrupt handlers |
160 | # |
170 | # |
161 | # Declare interrupt handlers for n interrupt |
171 | # Declare interrupt handlers for n interrupt |
162 | # vectors starting at vector i. |
172 | # vectors starting at vector i. |
163 | # |
173 | # |
Line 178... | Line 188... | ||
178 | .if (1 << \i) & ERROR_WORD_INTERRUPT_LIST |
188 | .if (1 << \i) & ERROR_WORD_INTERRUPT_LIST |
179 | /* |
189 | /* |
180 | * Version with error word. |
190 | * Version with error word. |
181 | */ |
191 | */ |
182 | subq $IREGISTER_SPACE, %rsp |
192 | subq $IREGISTER_SPACE, %rsp |
183 | nop |
- | |
184 | nop |
- | |
185 | nop |
- | |
186 | .else |
193 | .else |
187 | /* |
194 | /* |
188 | * Version without error word, |
195 | * Version without error word, |
189 | */ |
196 | */ |
190 | subq $(IREGISTER_SPACE+8), %rsp |
197 | subq $(IREGISTER_SPACE+8), %rsp |
Line 205... | Line 212... | ||
205 | restore_all_gpr |
212 | restore_all_gpr |
206 | # $8 = Skip error word |
213 | # $8 = Skip error word |
207 | addq $(IREGISTER_SPACE+8), %rsp |
214 | addq $(IREGISTER_SPACE+8), %rsp |
208 | iretq |
215 | iretq |
209 | 216 | ||
- | 217 | .align INTERRUPT_ALIGN |
|
210 | .if (\n-\i)-1 |
218 | .if (\n-\i)-1 |
211 | handler "(\i+1)",\n |
219 | handler "(\i+1)",\n |
212 | .endif |
220 | .endif |
213 | .endm |
221 | .endm |
214 | 222 | ||
- | 223 | .align INTERRUPT_ALIGN |
|
215 | interrupt_handlers: |
224 | interrupt_handlers: |
216 | h_start: |
225 | h_start: |
217 | handler 0 IDT_ITEMS |
226 | handler 0 IDT_ITEMS |
218 | h_end: |
227 | h_end: |
219 | 228 |