- rename "_long" to "dword" in eip structure in cpu64.

- add get_erx() method to bx_gen_reg_t which returns the erx field of the
  structure (which is has a different name in cpu and cpu64).  Providing
  an accessor is one strategy for avoiding igly "#ifdef BX_SUPPORT_X86_64"
  statements in the rest of the code.
- cpu64/init.cc: the "eflags" before get_flag and set_flag is no longer
  correct. removed.
- modified files: load32bitOShack.cc logio.cc cpu/cpu.h cpu64/apic.cc
  cpu64/cpu.h cpu64/init.cc cpu64/proc_ctrl.cc debug/dbg_main.cc
This commit is contained in:
Bryce Denney 2002-09-12 18:52:14 +00:00
parent 5fc31bcfda
commit 5d9fa0844e
4 changed files with 21 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.42 2002-09-12 18:10:39 bdenney Exp $
// $Id: cpu.h,v 1.43 2002-09-12 18:52:14 bdenney Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -580,6 +580,7 @@ typedef struct {
};
} word;
};
BX_CPP_INLINE get_erx() { return erx; }
} bx_gen_reg_t;
#else
typedef struct {
@ -596,6 +597,7 @@ typedef struct {
Bit16u word_filler;
} word;
};
BX_CPP_INLINE get_erx() { return erx; }
} bx_gen_reg_t;
#endif

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dbg_main.cc,v 1.59 2002-09-12 18:10:46 bdenney Exp $
// $Id: dbg_main.cc,v 1.60 2002-09-12 18:52:14 bdenney Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -42,13 +42,13 @@ extern "C" {
#endif
// define shortcuts to get register from the default CPU
#define EBP (BX_CPU(dbg_cpu)->gen_reg[5].erx)
#if BX_SUPPORT_X86_64==0
#define EIP (BX_CPU(dbg_cpu)->eip)
#define EBP (BX_CPU(dbg_cpu)->gen_reg[5].get_erx())
#if BX_SUPPORT_X86_64
#define EIP (BX_CPU(dbg_cpu)->dword.eip)
#else
#define EIP (BX_CPU(dbg_cpu)->_long.eip)
#define EIP (BX_CPU(dbg_cpu)->eip)
#endif
#define ESP (BX_CPU(dbg_cpu)->gen_reg[4].erx)
#define ESP (BX_CPU(dbg_cpu)->gen_reg[4].get_erx ())
#define SP (BX_CPU(dbg_cpu)->gen_reg[4].word.rx)
@ -2111,14 +2111,14 @@ void bx_dbg_disassemble_current (int which_cpu, int print_time)
if( BX_CPU(dbg_cpu)->trace_reg )
fprintf( stderr,
"eax: %08X\tecx: %08X\tedx: %08X\tebx: %08X\tesp: %08X\tebp: %08X\tesi: %08X\tedi: %08X\ncf=%u af=%u zf=%u sf=%u of=%u pf=%u tf=%u if=%u df=%u iopl=%u nt=%u rf=%u vm=%u\n",
BX_CPU(which_cpu)->gen_reg[0].erx,
BX_CPU(which_cpu)->gen_reg[1].erx,
BX_CPU(which_cpu)->gen_reg[2].erx,
BX_CPU(which_cpu)->gen_reg[3].erx,
BX_CPU(which_cpu)->gen_reg[4].erx,
BX_CPU(which_cpu)->gen_reg[5].erx,
BX_CPU(which_cpu)->gen_reg[6].erx,
BX_CPU(which_cpu)->gen_reg[7].erx,
BX_CPU(which_cpu)->gen_reg[0].get_erx(),
BX_CPU(which_cpu)->gen_reg[1].get_erx(),
BX_CPU(which_cpu)->gen_reg[2].get_erx(),
BX_CPU(which_cpu)->gen_reg[3].get_erx(),
BX_CPU(which_cpu)->gen_reg[4].get_erx(),
BX_CPU(which_cpu)->gen_reg[5].get_erx(),
BX_CPU(which_cpu)->gen_reg[6].get_erx(),
BX_CPU(which_cpu)->gen_reg[7].get_erx(),
!!BX_CPU(which_cpu)->get_CF(),
!!BX_CPU(which_cpu)->get_AF(),
!!BX_CPU(which_cpu)->get_ZF(),

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: load32bitOShack.cc,v 1.11 2002-09-12 18:10:35 bdenney Exp $
// $Id: load32bitOShack.cc,v 1.12 2002-09-12 18:52:13 bdenney Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -235,7 +235,7 @@ bx_load_null_kernel_hack(void)
#if BX_SUPPORT_X86_64==0
BX_CPU(0)->eip = 0x00100000;
#else
BX_CPU(0)->_long.eip = 0x00100000;
BX_CPU(0)->dword.eip = 0x00100000;
#endif
// CS deltas

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logio.cc,v 1.26 2002-09-12 07:16:35 bdenney Exp $
// $Id: logio.cc,v 1.27 2002-09-12 18:52:14 bdenney Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -178,7 +178,7 @@ iofunctions::out(int f, int l, const char *prefix, const char *fmt, va_list ap)
#if BX_SUPPORT_X86_64==0
fprintf(logfd, "%08x", BX_CPU(0)->eip);
#else
fprintf(logfd, "%08x", BX_CPU(0)->_long.eip);
fprintf(logfd, "%08x", BX_CPU(0)->dword.eip);
#endif
break;
case 'e':