From 70115b995d8029e56dbbe84603c758632cc3c6a8 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 29 Feb 2012 14:44:52 +0100 Subject: [PATCH] * grub-core/gdb/i386/machdep.S: Use VARIABLE and EXT_C instead of hardcoding the relevant info. --- ChangeLog | 5 +++++ grub-core/gdb/i386/machdep.S | 27 ++++++++++++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 266047a0b..149463d9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-02-29 Vladimir Serbinenko + + * grub-core/gdb/i386/machdep.S: Use VARIABLE and EXT_C instead of + hardcoding the relevant info. + 2012-02-29 Vladimir Serbinenko * grub-core/gnulib/argp-fmtstream.c (__argp_get_display_len): Add diff --git a/grub-core/gdb/i386/machdep.S b/grub-core/gdb/i386/machdep.S index 62e8b2629..24edd0f2c 100644 --- a/grub-core/gdb/i386/machdep.S +++ b/grub-core/gdb/i386/machdep.S @@ -18,6 +18,7 @@ */ #include +#include #define EC_PRESENT 1 #define EC_ABSENT 0 @@ -30,13 +31,9 @@ #define VECTOR 1 - .globl grub_gdb_trap - .globl grub_gdb_regs - .bss - .globl grub_gdb_stack .space GRUB_GDB_STACKSIZE -grub_gdb_stack: +VARIABLE(grub_gdb_stack) /* * Supplemental macros for register saving/restoration @@ -44,22 +41,22 @@ grub_gdb_stack: */ .macro save32 reg ndx - movl \reg, grub_gdb_regs+(\ndx * 4) + movl \reg, EXT_C(grub_gdb_regs)+(\ndx * 4) .endm .macro save16 reg ndx mov $0, %eax - movw \reg, grub_gdb_regs+(\ndx * 4) - movw %ax, grub_gdb_regs+(\ndx * 4 + 2) - movl grub_gdb_regs+(EAX * 4), %eax + movw \reg, EXT_C(grub_gdb_regs)+(\ndx * 4) + movw %ax, EXT_C(grub_gdb_regs)+(\ndx * 4 + 2) + movl EXT_C(grub_gdb_regs)+(EAX * 4), %eax .endm .macro load32 ndx reg - movl grub_gdb_regs+(\ndx * 4), \reg + movl EXT_C(grub_gdb_regs)+(\ndx * 4), \reg .endm .macro load16 ndx reg - movw grub_gdb_regs+(\ndx * 4), \reg + movw EXT_C(grub_gdb_regs)+(\ndx * 4), \reg .endm .macro save_context @@ -131,9 +128,9 @@ grub_gdb_stack: .endif save_context - mov $grub_gdb_stack, %esp + mov $EXT_C(grub_gdb_stack), %esp mov $\beg, %eax /* trap number */ - call grub_gdb_trap + call EXT_C(grub_gdb_trap) load_context iret @@ -159,8 +156,8 @@ grub_gdb_stack: */ .data VECTOR - .globl grub_gdb_trapvec -grub_gdb_trapvec: + +VARIABLE(grub_gdb_trapvec) ent EC_ABSENT 0 7 ent EC_PRESENT 8 ent EC_ABSENT 9