1. Fix BX_INFO message in config.cc
2. In init.cc save and restore BX_CPU_THIS__PTR trace value, allows to enable/disable tracing using save/restore. 3. in iret.cc - cleanup3. in iret.cc - cleanup3. in iret.cc - cleanup
This commit is contained in:
parent
b66d5385f7
commit
c8c5772f44
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: config.cc,v 1.106 2006-05-30 17:01:27 sshwarts Exp $
|
||||
// $Id: config.cc,v 1.107 2006-06-05 17:33:24 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -3317,8 +3317,7 @@ int bx_write_configuration(const char *rc, int overwrite)
|
||||
int i;
|
||||
char *strptr, tmppath[80], tmpaddr[80], tmpdev[80];
|
||||
bx_list_c *base;
|
||||
|
||||
BX_INFO(("write configuration to %s\n", rc));
|
||||
BX_INFO(("write current configuration to %s", rc));
|
||||
// check if it exists. If so, only proceed if overwrite is set.
|
||||
FILE *fp = fopen(rc, "r");
|
||||
if (fp != NULL) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: init.cc,v 1.114 2006-06-05 16:36:56 sshwarts Exp $
|
||||
// $Id: init.cc,v 1.115 2006-06-05 17:33:25 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -547,6 +547,7 @@ void BX_CPU_C::register_state(void)
|
||||
BXRS_PARAM_BOOL(list, nmi_pending, nmi_pending);
|
||||
BXRS_PARAM_BOOL(list, in_smm, in_smm);
|
||||
BXRS_PARAM_BOOL(list, nmi_disable, nmi_disable);
|
||||
BXRS_PARAM_BOOL(list, trace, trace);
|
||||
}
|
||||
|
||||
Bit64s BX_CPU_C::param_save_handler(void *devptr, bx_param_c *param, Bit64s val)
|
||||
|
@ -1,5 +1,5 @@
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// $Id: iret.cc,v 1.12 2006-05-21 20:41:48 sshwarts Exp $
|
||||
// $Id: iret.cc,v 1.13 2006-06-05 17:33:25 sshwarts Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -62,7 +62,7 @@ BX_CPU_C::iret_protected(bxInstruction_c *i)
|
||||
bx_selector_t link_selector;
|
||||
bx_descriptor_t tss_descriptor;
|
||||
|
||||
if (BX_CPU_THIS_PTR get_VM ())
|
||||
if (BX_CPU_THIS_PTR get_VM())
|
||||
BX_PANIC(("iret_protected: VM sholdn't be set here !"));
|
||||
|
||||
//BX_INFO(("IRET: nested task return"));
|
||||
@ -135,13 +135,13 @@ BX_CPU_C::iret_protected(bxInstruction_c *i)
|
||||
*/
|
||||
|
||||
if (i->os32L()) {
|
||||
top_nbytes_same = 12;
|
||||
top_nbytes_outer = 20;
|
||||
top_nbytes_same = 12;
|
||||
top_nbytes_outer = 20;
|
||||
ss_offset = 16;
|
||||
}
|
||||
else {
|
||||
top_nbytes_same = 6;
|
||||
top_nbytes_outer = 10;
|
||||
top_nbytes_same = 6;
|
||||
top_nbytes_outer = 10;
|
||||
ss_offset = 8;
|
||||
}
|
||||
|
||||
@ -285,10 +285,10 @@ BX_CPU_C::iret_protected(bxInstruction_c *i)
|
||||
|
||||
/* AR byte must indicate a writable data segment,
|
||||
* else #GP(SS selector) */
|
||||
if ( ss_descriptor.valid==0 ||
|
||||
ss_descriptor.segment==0 ||
|
||||
ss_descriptor.u.segment.executable ||
|
||||
ss_descriptor.u.segment.r_w==0 )
|
||||
if (ss_descriptor.valid==0 ||
|
||||
ss_descriptor.segment==0 ||
|
||||
ss_descriptor.u.segment.executable ||
|
||||
ss_descriptor.u.segment.r_w==0)
|
||||
{
|
||||
BX_ERROR(("iret: SS AR byte not writable code segment"));
|
||||
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
|
||||
@ -380,9 +380,9 @@ BX_CPU_C::long_iret(bxInstruction_c *i)
|
||||
|
||||
BX_DEBUG (("LONG MODE IRET"));
|
||||
|
||||
if ( BX_CPU_THIS_PTR get_NT () ) {
|
||||
BX_ERROR(("iret64: return from nested task not supported in x86-64 mode !"));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
if (BX_CPU_THIS_PTR get_NT()) {
|
||||
BX_ERROR(("iret64: return from nested task in x86-64 mode !"));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
|
||||
/* 64bit opsize
|
||||
@ -464,7 +464,7 @@ BX_CPU_C::long_iret(bxInstruction_c *i)
|
||||
parse_selector(raw_cs_selector, &cs_selector);
|
||||
|
||||
// return CS selector must be non-null, else #GP(0)
|
||||
if ( (raw_cs_selector & 0xfffc) == 0 ) {
|
||||
if ((raw_cs_selector & 0xfffc) == 0) {
|
||||
BX_ERROR(("iret64: return CS selector null"));
|
||||
exception(BX_GP_EXCEPTION, 0, 0);
|
||||
}
|
||||
@ -523,7 +523,7 @@ BX_CPU_C::long_iret(bxInstruction_c *i)
|
||||
*/
|
||||
|
||||
/* top 10/20 bytes on stack must be within limits else #SS(0) */
|
||||
if ( !can_pop(top_nbytes_outer) ) {
|
||||
if (! can_pop(top_nbytes_outer)) {
|
||||
BX_PANIC(("iret64: top bytes not within stack limits"));
|
||||
exception(BX_SS_EXCEPTION, 0, 0);
|
||||
}
|
||||
@ -555,10 +555,10 @@ BX_CPU_C::long_iret(bxInstruction_c *i)
|
||||
|
||||
/* AR byte must indicate a writable data segment,
|
||||
* else #GP(SS selector) */
|
||||
if ( ss_descriptor.valid==0 ||
|
||||
ss_descriptor.segment==0 ||
|
||||
ss_descriptor.u.segment.executable ||
|
||||
ss_descriptor.u.segment.r_w==0 )
|
||||
if (ss_descriptor.valid==0 ||
|
||||
ss_descriptor.segment==0 ||
|
||||
ss_descriptor.u.segment.executable ||
|
||||
ss_descriptor.u.segment.r_w==0)
|
||||
{
|
||||
BX_ERROR(("iret64: SS AR byte not writable code segment"));
|
||||
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
|
||||
@ -566,7 +566,7 @@ BX_CPU_C::long_iret(bxInstruction_c *i)
|
||||
|
||||
/* stack segment DPL must equal the RPL of the return CS selector,
|
||||
* else #GP(SS selector) */
|
||||
if ( ss_descriptor.dpl != cs_selector.rpl ) {
|
||||
if (ss_descriptor.dpl != cs_selector.rpl) {
|
||||
BX_ERROR(("iret64: SS.dpl != CS selector RPL"));
|
||||
exception(BX_GP_EXCEPTION, raw_ss_selector & 0xfffc, 0);
|
||||
}
|
||||
@ -616,7 +616,7 @@ BX_CPU_C::long_iret(bxInstruction_c *i)
|
||||
// VM unaffected
|
||||
writeEFlags(new_eflags, changeMask);
|
||||
|
||||
if ( (raw_ss_selector & 0xfffc) != 0 ) {
|
||||
if ((raw_ss_selector & 0xfffc) != 0) {
|
||||
// load SS:RSP from stack
|
||||
// load the SS-cache with SS descriptor
|
||||
load_ss(&ss_selector, &ss_descriptor, cs_selector.rpl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user