* grub-core/gdb/i386/machdep.S: Use VARIABLE and EXT_C instead of
hardcoding the relevant info.
This commit is contained in:
parent
56733740ed
commit
70115b995d
2 changed files with 17 additions and 15 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2012-02-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/gdb/i386/machdep.S: Use VARIABLE and EXT_C instead of
|
||||||
|
hardcoding the relevant info.
|
||||||
|
|
||||||
2012-02-29 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-02-29 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/gnulib/argp-fmtstream.c (__argp_get_display_len): Add
|
* grub-core/gnulib/argp-fmtstream.c (__argp_get_display_len): Add
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <grub/cpu/gdb.h>
|
#include <grub/cpu/gdb.h>
|
||||||
|
#include <grub/symbol.h>
|
||||||
|
|
||||||
#define EC_PRESENT 1
|
#define EC_PRESENT 1
|
||||||
#define EC_ABSENT 0
|
#define EC_ABSENT 0
|
||||||
|
@ -30,13 +31,9 @@
|
||||||
|
|
||||||
#define VECTOR 1
|
#define VECTOR 1
|
||||||
|
|
||||||
.globl grub_gdb_trap
|
|
||||||
.globl grub_gdb_regs
|
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
.globl grub_gdb_stack
|
|
||||||
.space GRUB_GDB_STACKSIZE
|
.space GRUB_GDB_STACKSIZE
|
||||||
grub_gdb_stack:
|
VARIABLE(grub_gdb_stack)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Supplemental macros for register saving/restoration
|
* Supplemental macros for register saving/restoration
|
||||||
|
@ -44,22 +41,22 @@ grub_gdb_stack:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.macro save32 reg ndx
|
.macro save32 reg ndx
|
||||||
movl \reg, grub_gdb_regs+(\ndx * 4)
|
movl \reg, EXT_C(grub_gdb_regs)+(\ndx * 4)
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro save16 reg ndx
|
.macro save16 reg ndx
|
||||||
mov $0, %eax
|
mov $0, %eax
|
||||||
movw \reg, grub_gdb_regs+(\ndx * 4)
|
movw \reg, EXT_C(grub_gdb_regs)+(\ndx * 4)
|
||||||
movw %ax, grub_gdb_regs+(\ndx * 4 + 2)
|
movw %ax, EXT_C(grub_gdb_regs)+(\ndx * 4 + 2)
|
||||||
movl grub_gdb_regs+(EAX * 4), %eax
|
movl EXT_C(grub_gdb_regs)+(EAX * 4), %eax
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro load32 ndx reg
|
.macro load32 ndx reg
|
||||||
movl grub_gdb_regs+(\ndx * 4), \reg
|
movl EXT_C(grub_gdb_regs)+(\ndx * 4), \reg
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro load16 ndx reg
|
.macro load16 ndx reg
|
||||||
movw grub_gdb_regs+(\ndx * 4), \reg
|
movw EXT_C(grub_gdb_regs)+(\ndx * 4), \reg
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro save_context
|
.macro save_context
|
||||||
|
@ -131,9 +128,9 @@ grub_gdb_stack:
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
save_context
|
save_context
|
||||||
mov $grub_gdb_stack, %esp
|
mov $EXT_C(grub_gdb_stack), %esp
|
||||||
mov $\beg, %eax /* trap number */
|
mov $\beg, %eax /* trap number */
|
||||||
call grub_gdb_trap
|
call EXT_C(grub_gdb_trap)
|
||||||
load_context
|
load_context
|
||||||
iret
|
iret
|
||||||
|
|
||||||
|
@ -159,8 +156,8 @@ grub_gdb_stack:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.data VECTOR
|
.data VECTOR
|
||||||
.globl grub_gdb_trapvec
|
|
||||||
grub_gdb_trapvec:
|
VARIABLE(grub_gdb_trapvec)
|
||||||
ent EC_ABSENT 0 7
|
ent EC_ABSENT 0 7
|
||||||
ent EC_PRESENT 8
|
ent EC_PRESENT 8
|
||||||
ent EC_ABSENT 9
|
ent EC_ABSENT 9
|
||||||
|
|
Loading…
Reference in a new issue