]>
Commit | Line | Data |
---|---|---|
66d6a793 LK |
1 | /* i386/gdb.h - i386 specific definitions for the remote GDB stub */ |
2 | /* | |
3 | * Copyright (C) 2006 Lubomir Kundrak | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License as published by | |
7 | * the Free Software Foundation; either version 2 of the License, or | |
8 | * (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with this program; if not, write to the Free Software | |
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
18 | */ | |
19 | ||
20 | #ifndef GRUB_GDB_CPU_HEADER | |
21 | #define GRUB_GDB_CPU_HEADER 1 | |
22 | ||
23 | #define GRUB_GDB_LAST_TRAP 31 | |
24 | /* You may have to edit the bottom of machdep.S when adjusting | |
25 | GRUB_GDB_LAST_TRAP. */ | |
26 | #define GRUB_MACHINE_NR_REGS 16 | |
27 | ||
28 | #define EAX 0 | |
29 | #define ECX 1 | |
30 | #define EDX 2 | |
31 | #define EBX 3 | |
32 | #define ESP 4 | |
33 | #define EBP 5 | |
34 | #define ESI 6 | |
35 | #define EDI 7 | |
36 | #define EIP 8 | |
37 | #define EFLAGS 9 | |
38 | #define CS 10 | |
39 | #define SS 11 | |
40 | #define DS 12 | |
41 | #define ES 13 | |
42 | #define FS 14 | |
43 | #define GS 15 | |
44 | ||
45 | #define PC EIP | |
46 | #define FP EBP | |
47 | #define SP ESP | |
48 | #define PS EFLAGS | |
49 | ||
1948a3b7 | 50 | #ifndef ASM_FILE |
66d6a793 LK |
51 | |
52 | #include <grub/gdb.h> | |
53 | ||
54 | #define GRUB_CPU_TRAP_GATE 15 | |
55 | ||
56 | struct grub_cpu_interrupt_gate | |
57 | { | |
58 | grub_uint16_t offset_lo; | |
59 | grub_uint16_t selector; | |
60 | grub_uint8_t unused; | |
61 | grub_uint8_t gate; | |
62 | grub_uint16_t offset_hi; | |
63 | } __attribute__ ((packed)); | |
64 | ||
65 | struct grub_cpu_idt_descriptor | |
66 | { | |
67 | grub_uint16_t limit; | |
68 | grub_uint32_t base; | |
69 | } __attribute__ ((packed)); | |
70 | ||
71 | extern void (*grub_gdb_trapvec[]) (void); | |
66d6a793 LK |
72 | void grub_gdb_idtinit (void); |
73 | void grub_gdb_idtrestore (void); | |
dd07e0c4 | 74 | void grub_gdb_trap (int trap_no) __attribute__ ((regparm(3))); |
66d6a793 LK |
75 | |
76 | #endif /* ! ASM */ | |
77 | #endif /* ! GRUB_GDB_CPU_HEADER */ | |
78 |