From 6e7a315eb67cb6c113cf37e1d66c4f11a51a2b3e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:29:51 +0200 Subject: Adding upstream version 2.06. Signed-off-by: Daniel Baumann --- include/grub/i386/gdb.h | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 include/grub/i386/gdb.h (limited to 'include/grub/i386/gdb.h') diff --git a/include/grub/i386/gdb.h b/include/grub/i386/gdb.h new file mode 100644 index 0000000..92d2dac --- /dev/null +++ b/include/grub/i386/gdb.h @@ -0,0 +1,78 @@ +/* i386/gdb.h - i386 specific definitions for the remote GDB stub */ +/* + * Copyright (C) 2006 Lubomir Kundrak + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef GRUB_GDB_CPU_HEADER +#define GRUB_GDB_CPU_HEADER 1 + +#define GRUB_GDB_LAST_TRAP 31 +/* You may have to edit the bottom of machdep.S when adjusting + GRUB_GDB_LAST_TRAP. */ +#define GRUB_MACHINE_NR_REGS 16 + +#define EAX 0 +#define ECX 1 +#define EDX 2 +#define EBX 3 +#define ESP 4 +#define EBP 5 +#define ESI 6 +#define EDI 7 +#define EIP 8 +#define EFLAGS 9 +#define CS 10 +#define SS 11 +#define DS 12 +#define ES 13 +#define FS 14 +#define GS 15 + +#define PC EIP +#define FP EBP +#define SP ESP +#define PS EFLAGS + +#ifndef ASM_FILE + +#include + +#define GRUB_CPU_TRAP_GATE 15 + +struct grub_cpu_interrupt_gate +{ + grub_uint16_t offset_lo; + grub_uint16_t selector; + grub_uint8_t unused; + grub_uint8_t gate; + grub_uint16_t offset_hi; +} GRUB_PACKED; + +struct grub_cpu_idt_descriptor +{ + grub_uint16_t limit; + grub_uint32_t base; +} GRUB_PACKED; + +extern void (*grub_gdb_trapvec[]) (void); +void grub_gdb_idtinit (void); +void grub_gdb_idtrestore (void); +void grub_gdb_trap (int trap_no) __attribute__ ((regparm(3))); + +#endif /* ! ASM */ +#endif /* ! GRUB_GDB_CPU_HEADER */ + -- cgit v1.2.3