Added BX_INSTR_HLT instrumentation callback
This commit is contained in:
parent
61271768ae
commit
4638f09b24
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: exception.cc,v 1.56 2005-04-13 17:13:04 sshwarts Exp $
|
||||
// $Id: exception.cc,v 1.57 2005-07-07 18:40:26 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -64,10 +64,10 @@ void BX_CPU_C::long_mode_int(Bit8u vector, bx_bool is_INT, bx_bool is_error_code
|
||||
// else #GP(vector number*16 + 2 + EXT)
|
||||
idtindex = vector*16;
|
||||
if ( (idtindex + 15) > BX_CPU_THIS_PTR idtr.limit) {
|
||||
BX_ERROR(("interrupt(long mode): vector > idtr.limit"));
|
||||
BX_ERROR(("IDT.limit = %04x", (unsigned) BX_CPU_THIS_PTR idtr.limit));
|
||||
BX_ERROR(("IDT.base = %06x", (unsigned) BX_CPU_THIS_PTR idtr.base));
|
||||
BX_ERROR(("interrupt vector must be within IDT table limits"));
|
||||
BX_ERROR(("interrupt(long mode): vector > idtr.limit"));
|
||||
exception(BX_GP_EXCEPTION, vector*16 + 2, 0);
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ void BX_CPU_C::long_mode_int(Bit8u vector, bx_bool is_INT, bx_bool is_error_code
|
||||
// examine CS selector and descriptor given in gate descriptor
|
||||
// selector must be non-null else #GP(EXT)
|
||||
if ( (gate_dest_selector & 0xfffc) == 0 ) {
|
||||
BX_PANIC(("int_trap_gate(): selector null"));
|
||||
BX_PANIC(("int_trap_gate(long mode): selector null"));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
|
||||
@ -435,7 +435,7 @@ void BX_CPU_C::protected_mode_int(Bit8u vector, bx_bool is_INT, bx_bool is_error
|
||||
// examine CS selector and descriptor given in gate descriptor
|
||||
// selector must be non-null else #GP(EXT)
|
||||
if ( (gate_dest_selector & 0xfffc) == 0 ) {
|
||||
BX_PANIC(("int_trap_gate(): selector null"));
|
||||
BX_ERROR(("int_trap_gate(): selector null"));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: proc_ctrl.cc,v 1.108 2005-07-01 14:05:59 sshwarts Exp $
|
||||
// $Id: proc_ctrl.cc,v 1.109 2005-07-07 18:40:33 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -86,13 +86,14 @@ void BX_CPU_C::HLT(bxInstruction_c *i)
|
||||
// will remain in a halt state until one of the above conditions
|
||||
// is met.
|
||||
|
||||
BX_INSTR_HLT(BX_CPU_ID);
|
||||
|
||||
#if BX_USE_IDLE_HACK
|
||||
bx_gui->sim_is_idle ();
|
||||
#endif /* BX_USE_IDLE_HACK */
|
||||
}
|
||||
|
||||
void
|
||||
BX_CPU_C::CLTS(bxInstruction_c *i)
|
||||
void BX_CPU_C::CLTS(bxInstruction_c *i)
|
||||
{
|
||||
#if BX_CPU_LEVEL < 2
|
||||
BX_PANIC(("CLTS: not implemented for < 286"));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: instrument.h,v 1.13 2005-04-29 21:28:43 sshwarts Exp $
|
||||
// $Id: instrument.h,v 1.14 2005-07-07 18:40:34 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -76,6 +76,7 @@ void bx_instr_mem_data(unsigned cpu, bx_address lin, unsigned size, unsigned rw)
|
||||
# define BX_INSTR_INIT(cpu_id)
|
||||
# define BX_INSTR_SHUTDOWN(cpu_id)
|
||||
# define BX_INSTR_RESET(cpu_id) bx_instr_reset(cpu_id)
|
||||
# define BX_INSTR_HLT(cpu_id)
|
||||
# define BX_INSTR_NEW_INSTRUCTION(cpu_id) bx_instr_new_instruction(cpu_id)
|
||||
|
||||
/* called from command line debugger */
|
||||
@ -140,6 +141,7 @@ void bx_instr_mem_data(unsigned cpu, bx_address lin, unsigned size, unsigned rw)
|
||||
# define BX_INSTR_INIT(cpu_id)
|
||||
# define BX_INSTR_SHUTDOWN(cpu_id)
|
||||
# define BX_INSTR_RESET(cpu_id)
|
||||
# define BX_INSTR_HLT(cpu_id)
|
||||
# define BX_INSTR_NEW_INSTRUCTION(cpu_id)
|
||||
|
||||
/* called from command line debugger */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: instrument.h,v 1.11 2005-04-29 21:28:59 sshwarts Exp $
|
||||
// $Id: instrument.h,v 1.12 2005-07-07 18:40:35 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -123,6 +123,7 @@ extern bxInstrumentation icpu[BX_SMP_PROCESSORS];
|
||||
# define BX_INSTR_INIT(cpu_id) icpu[cpu_id].set_cpu_id(cpu_id)
|
||||
# define BX_INSTR_SHUTDOWN(cpu_id)
|
||||
# define BX_INSTR_RESET(cpu_id) icpu[cpu_id].bx_instr_reset()
|
||||
# define BX_INSTR_HLT(cpu_id)
|
||||
# define BX_INSTR_NEW_INSTRUCTION(cpu_id) icpu[cpu_id].bx_instr_new_instruction()
|
||||
|
||||
/* called from command line debugger */
|
||||
@ -187,6 +188,7 @@ extern bxInstrumentation icpu[BX_SMP_PROCESSORS];
|
||||
# define BX_INSTR_INIT(cpu_id)
|
||||
# define BX_INSTR_SHUTDOWN(cpu_id)
|
||||
# define BX_INSTR_RESET(cpu_id)
|
||||
# define BX_INSTR_HLT(cpu_id)
|
||||
# define BX_INSTR_NEW_INSTRUCTION(cpu_id)
|
||||
|
||||
/* called from command line debugger */
|
||||
|
@ -24,7 +24,6 @@ The callback is called each time, when Bochs initializes the CPU object. It
|
||||
can be used for initialization of user's data, dynamic memory allocation and
|
||||
etc.
|
||||
|
||||
|
||||
void bx_instr_shutdown(unsigned cpu);
|
||||
|
||||
The callback is called each time, when Bochs destructs the CPU object. It can
|
||||
@ -38,6 +37,11 @@ be executed once at the start of simulation and each time that user presses
|
||||
RESET BUTTON on the simulator's control panel.
|
||||
|
||||
|
||||
void bx_instr_hlt(unsigned cpu);
|
||||
|
||||
The callback is called each time, when Bochs' emulated CPU enters to the HALT
|
||||
state.
|
||||
|
||||
void bx_instr_new_instruction(unsigned cpu);
|
||||
|
||||
The callback is called each time, when Bochs completes (commits) already
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: instrument.cc,v 1.13 2005-04-29 21:28:59 sshwarts Exp $
|
||||
// $Id: instrument.cc,v 1.14 2005-07-07 18:40:35 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -31,6 +31,7 @@
|
||||
void bx_instr_init(unsigned cpu) {}
|
||||
void bx_instr_shutdown(unsigned cpu) {}
|
||||
void bx_instr_reset(unsigned cpu) {}
|
||||
void bx_instr_hlt(unsigned cpu) {}
|
||||
void bx_instr_new_instruction(unsigned cpu) {}
|
||||
|
||||
void bx_instr_debug_promt() {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: instrument.h,v 1.18 2005-05-31 04:47:50 sshwarts Exp $
|
||||
// $Id: instrument.h,v 1.19 2005-07-07 18:40:35 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -55,6 +55,7 @@ class bxInstruction_c;
|
||||
void bx_instr_init(unsigned cpu);
|
||||
void bx_instr_shutdown(unsigned cpu);
|
||||
void bx_instr_reset(unsigned cpu);
|
||||
void bx_instr_hlt(unsigned cpu);
|
||||
void bx_instr_new_instruction(unsigned cpu);
|
||||
|
||||
void bx_instr_debug_promt();
|
||||
@ -104,6 +105,7 @@ void bx_instr_wrmsr(unsigned cpu, unsigned addr, Bit64u value);
|
||||
# define BX_INSTR_INIT(cpu_id) bx_instr_init(cpu_id)
|
||||
# define BX_INSTR_SHUTDOWN(cpu_id) bx_instr_shutdown(cpu_id)
|
||||
# define BX_INSTR_RESET(cpu_id) bx_instr_reset(cpu_id)
|
||||
# define BX_INSTR_HLT(cpu_id) bx_instr_hlt(cpu_id)
|
||||
# define BX_INSTR_NEW_INSTRUCTION(cpu_id) bx_instr_new_instruction(cpu_id)
|
||||
|
||||
/* called from command line debugger */
|
||||
@ -169,6 +171,7 @@ void bx_instr_wrmsr(unsigned cpu, unsigned addr, Bit64u value);
|
||||
# define BX_INSTR_INIT(cpu_id)
|
||||
# define BX_INSTR_SHUTDOWN(cpu_id)
|
||||
# define BX_INSTR_RESET(cpu_id)
|
||||
# define BX_INSTR_HLT(cpu_id)
|
||||
# define BX_INSTR_NEW_INSTRUCTION(cpu_id)
|
||||
|
||||
/* called from command line debugger */
|
||||
|
Loading…
Reference in New Issue
Block a user