Rev 3386 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3386 | Rev 4153 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
29 | #define IREGISTER_SPACE 120 |
29 | #define IREGISTER_SPACE 72 |
30 | 30 | ||
31 | #define IOFFSET_RAX 0x0 |
31 | #define IOFFSET_RAX 0x0 |
32 | #define IOFFSET_RBX 0x8 |
32 | #define IOFFSET_RCX 0x8 |
33 | #define IOFFSET_RCX 0x10 |
33 | #define IOFFSET_RDX 0x10 |
34 | #define IOFFSET_RDX 0x18 |
34 | #define IOFFSET_RSI 0x18 |
35 | #define IOFFSET_RSI 0x20 |
35 | #define IOFFSET_RDI 0x20 |
36 | #define IOFFSET_RDI 0x28 |
36 | #define IOFFSET_R8 0x28 |
37 | #define IOFFSET_R8 0x30 |
- | |
38 | #define IOFFSET_R9 0x38 |
37 | #define IOFFSET_R9 0x30 |
39 | #define IOFFSET_R10 0x40 |
38 | #define IOFFSET_R10 0x38 |
40 | #define IOFFSET_R11 0x48 |
39 | #define IOFFSET_R11 0x40 |
41 | #define IOFFSET_R12 0x50 |
- | |
42 | #define IOFFSET_R13 0x58 |
- | |
43 | #define IOFFSET_R14 0x60 |
- | |
44 | #define IOFFSET_R15 0x68 |
- | |
45 | #define IOFFSET_RBP 0x70 |
- | |
46 | 40 | ||
47 | # Mask for interrupts 0 - 31 (bits 0 - 31) where 0 means that int has no error word |
41 | # Mask for interrupts 0 - 31 (bits 0 - 31) where 0 means that int has no error word |
48 | # and 1 means interrupt with error word |
42 | # and 1 means interrupt with error word |
49 | #define ERROR_WORD_INTERRUPT_LIST 0x00027D00 |
43 | #define ERROR_WORD_INTERRUPT_LIST 0x00027D00 |
50 | 44 | ||
Line 171... | Line 165... | ||
171 | read_efer_flag: |
165 | read_efer_flag: |
172 | movq $0xc0000080, %rcx |
166 | movq $0xc0000080, %rcx |
173 | rdmsr |
167 | rdmsr |
174 | ret |
168 | ret |
175 | 169 | ||
176 | # Push all general purpose registers on stack except %rbp, %rsp |
170 | # Push all volatile general purpose registers on stack |
177 | .macro save_all_gpr |
171 | .macro save_all_gpr |
178 | movq %rax, IOFFSET_RAX(%rsp) |
172 | movq %rax, IOFFSET_RAX(%rsp) |
179 | movq %rcx, IOFFSET_RCX(%rsp) |
173 | movq %rcx, IOFFSET_RCX(%rsp) |
180 | movq %rdx, IOFFSET_RDX(%rsp) |
174 | movq %rdx, IOFFSET_RDX(%rsp) |
181 | movq %rsi, IOFFSET_RSI(%rsp) |
175 | movq %rsi, IOFFSET_RSI(%rsp) |
182 | movq %rdi, IOFFSET_RDI(%rsp) |
176 | movq %rdi, IOFFSET_RDI(%rsp) |
183 | movq %r8, IOFFSET_R8(%rsp) |
177 | movq %r8, IOFFSET_R8(%rsp) |
184 | movq %r9, IOFFSET_R9(%rsp) |
178 | movq %r9, IOFFSET_R9(%rsp) |
185 | movq %r10, IOFFSET_R10(%rsp) |
179 | movq %r10, IOFFSET_R10(%rsp) |
186 | movq %r11, IOFFSET_R11(%rsp) |
180 | movq %r11, IOFFSET_R11(%rsp) |
187 | #ifdef CONFIG_DEBUG_ALLREGS |
- | |
188 | movq %rbx, IOFFSET_RBX(%rsp) |
- | |
189 | movq %rbp, IOFFSET_RBP(%rsp) |
- | |
190 | movq %r12, IOFFSET_R12(%rsp) |
- | |
191 | movq %r13, IOFFSET_R13(%rsp) |
- | |
192 | movq %r14, IOFFSET_R14(%rsp) |
- | |
193 | movq %r15, IOFFSET_R15(%rsp) |
- | |
194 | #endif |
- | |
195 | .endm |
181 | .endm |
196 | 182 | ||
197 | .macro restore_all_gpr |
183 | .macro restore_all_gpr |
198 | movq IOFFSET_RAX(%rsp), %rax |
184 | movq IOFFSET_RAX(%rsp), %rax |
199 | movq IOFFSET_RCX(%rsp), %rcx |
185 | movq IOFFSET_RCX(%rsp), %rcx |
Line 202... | Line 188... | ||
202 | movq IOFFSET_RDI(%rsp), %rdi |
188 | movq IOFFSET_RDI(%rsp), %rdi |
203 | movq IOFFSET_R8(%rsp), %r8 |
189 | movq IOFFSET_R8(%rsp), %r8 |
204 | movq IOFFSET_R9(%rsp), %r9 |
190 | movq IOFFSET_R9(%rsp), %r9 |
205 | movq IOFFSET_R10(%rsp), %r10 |
191 | movq IOFFSET_R10(%rsp), %r10 |
206 | movq IOFFSET_R11(%rsp), %r11 |
192 | movq IOFFSET_R11(%rsp), %r11 |
207 | #ifdef CONFIG_DEBUG_ALLREGS |
- | |
208 | movq IOFFSET_RBX(%rsp), %rbx |
- | |
209 | movq IOFFSET_RBP(%rsp), %rbp |
- | |
210 | movq IOFFSET_R12(%rsp), %r12 |
- | |
211 | movq IOFFSET_R13(%rsp), %r13 |
- | |
212 | movq IOFFSET_R14(%rsp), %r14 |
- | |
213 | movq IOFFSET_R15(%rsp), %r15 |
- | |
214 | #endif |
- | |
215 | .endm |
193 | .endm |
216 | 194 | ||
217 | #ifdef CONFIG_DEBUG_ALLREGS |
- | |
218 | # define INTERRUPT_ALIGN 256 |
- | |
219 | #else |
- | |
220 | # define INTERRUPT_ALIGN 128 |
195 | #define INTERRUPT_ALIGN 128 |
221 | #endif |
- | |
222 | 196 | ||
223 | ## Declare interrupt handlers |
197 | ## Declare interrupt handlers |
224 | # |
198 | # |
225 | # Declare interrupt handlers for n interrupt |
199 | # Declare interrupt handlers for n interrupt |
226 | # vectors starting at vector i. |
200 | # vectors starting at vector i. |