[prev in list] [next in list] [prev in thread] [next in thread]
List: bochs-cvs
Subject: [Bochs-cvs] CVS: bochs/cpu cpu.cc, 1.162, 1.163 cpu.h, 1.299,
From: Stanislav Shwartsman <sshwarts () users ! sourceforge ! net>
Date: 2006-06-17 12:09:57
Message-ID: E1FrZcj-0002pe-ME () sc8-pr-cvs3 ! sourceforge ! net
[Download RAW message or body]
Update of /cvsroot/bochs/bochs/cpu
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10453/cpu
Modified Files:
cpu.cc cpu.h debugstuff.cc exception.cc paging.cc
Log Message:
Move paddr_valid param of dbg_xlate_linear2phy method to return value.
This is much easier to use.
Index: cpu.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/cpu.cc,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -d -r1.162 -r1.163
--- cpu.cc 16 Jun 2006 20:08:03 -0000 1.162
+++ cpu.cc 17 Jun 2006 12:09:55 -0000 1.163
@@ -892,9 +892,8 @@
#endif
#if BX_DBG_SUPPORT_PHY_BPOINT
if (bx_guard.guard_for & BX_DBG_GUARD_IADDR_PHY) {
- Bit32u phy;
- bx_bool valid;
- dbg_xlate_linear2phy(BX_CPU_THIS_PTR guard_found.laddr, &phy, &valid);
+ bx_phy_address phy;
+ bx_bool valid = dbg_xlate_linear2phy(BX_CPU_THIS_PTR guard_found.laddr, &phy);
// The "guard_found.icount!=0" condition allows you to step or
// continue beyond a breakpoint. Bryce tried removing it once,
// and once you get to a breakpoint you are stuck there forever.
Index: cpu.h
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/cpu.h,v
retrieving revision 1.299
retrieving revision 1.300
diff -u -d -r1.299 -r1.300
--- cpu.h 11 Jun 2006 16:40:37 -0000 1.299
+++ cpu.h 17 Jun 2006 12:09:55 -0000 1.300
@@ -2644,7 +2644,7 @@
BX_SMF bx_bool dbg_check_end_instr_bpoint(void);
#endif
#if BX_DEBUGGER || BX_DISASM || BX_INSTRUMENTATION || BX_GDBSTUB
- BX_SMF void dbg_xlate_linear2phy(bx_address linear, Bit32u *phy, bx_bool \
*valid); + BX_SMF bx_bool dbg_xlate_linear2phy(bx_address linear, bx_phy_address \
*phy); #endif
BX_SMF void atexit(void);
Index: debugstuff.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/debugstuff.cc,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- debugstuff.cc 12 Jun 2006 16:58:26 -0000 1.71
+++ debugstuff.cc 17 Jun 2006 12:09:55 -0000 1.72
@@ -34,7 +34,6 @@
#if BX_DISASM
void BX_CPU_C::debug_disasm_instruction(bx_address offset)
{
- bx_bool valid;
bx_phy_address phy_addr;
Bit8u instr_buf[16];
char char_buf[512];
@@ -44,8 +43,7 @@
static disassembler bx_disassemble;
unsigned remainsInPage = 0x1000 - (offset & 0xfff);
- dbg_xlate_linear2phy(BX_CPU_THIS_PTR get_segment_base(BX_SEG_REG_CS) + offset,
- &phy_addr, &valid);
+ bx_bool valid = dbg_xlate_linear2phy(BX_CPU_THIS_PTR \
get_segment_base(BX_SEG_REG_CS) + offset, &phy_addr); if (valid && BX_CPU_THIS_PTR \
mem!=NULL) { BX_CPU_THIS_PTR mem->dbg_fetch_mem(phy_addr, 16, instr_buf);
char_buf[i++] = '>';
Index: exception.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/exception.cc,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -d -r1.81 -r1.82
--- exception.cc 12 Jun 2006 19:51:31 -0000 1.81
+++ exception.cc 17 Jun 2006 12:09:55 -0000 1.82
@@ -141,9 +141,9 @@
// descriptor AR byte must indicate code seg
// and code segment descriptor DPL<=CPL, else #GP(selector+EXT)
- if ( cs_descriptor.valid==0 || cs_descriptor.segment==0 ||
- IS_DATA_SEGMENT(cs_descriptor.type) ||
- cs_descriptor.dpl>CPL)
+ if (cs_descriptor.valid==0 || cs_descriptor.segment==0 ||
+ IS_DATA_SEGMENT(cs_descriptor.type) ||
+ cs_descriptor.dpl>CPL)
{
BX_ERROR(("interrupt(long mode): not code segment"));
exception(BX_GP_EXCEPTION, cs_selector.value & 0xfffc, 0);
@@ -165,14 +165,14 @@
// if code segment is non-conforming and DPL < CPL then
// INTERRUPT TO INNER PRIVILEGE:
if ((IS_CODE_SEGMENT_NON_CONFORMING(cs_descriptor.type)
- && cs_descriptor.dpl<CPL) || (ist > 0))
+ && cs_descriptor.dpl<CPL) || (ist != 0))
{
Bit64u RSP_for_cpl_x;
BX_DEBUG(("interrupt(long mode): INTERRUPT TO INNER PRIVILEGE"));
// check selector and descriptor for new stack in current TSS
- if (ist > 0) {
+ if (ist != 0) {
BX_DEBUG(("interrupt(long mode): trap to IST, vector = %d\n",ist));
get_RSP_from_TSS(ist+3, &RSP_for_cpl_x);
}
Index: paging.cc
===================================================================
RCS file: /cvsroot/bochs/bochs/cpu/paging.cc,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- paging.cc 9 Jun 2006 22:39:50 -0000 1.75
+++ paging.cc 17 Jun 2006 12:09:55 -0000 1.76
@@ -1066,14 +1066,13 @@
#if BX_DEBUGGER || BX_DISASM || BX_INSTRUMENTATION || BX_GDBSTUB
-void BX_CPU_C::dbg_xlate_linear2phy(bx_address laddr, Bit32u *phy, bx_bool *valid)
+bx_bool BX_CPU_C::dbg_xlate_linear2phy(bx_address laddr, bx_phy_address *phy)
{
bx_address lpf, poffset, paddress;
if (BX_CPU_THIS_PTR cr0.pg == 0) {
*phy = laddr;
- *valid = 1;
- return;
+ return 1;
}
lpf = laddr & BX_CONST64(0xfffffffffffff000); // linear page frame
@@ -1087,8 +1086,7 @@
if (tlbEntry->lpf == BX_TLB_LPF_VALUE(lpf)) {
paddress = tlbEntry->ppf | poffset;
*phy = paddress;
- *valid = 1;
- return;
+ return 1;
}
#endif
@@ -1137,13 +1135,11 @@
}
*phy = paddress;
- *valid = 1;
- return;
+ return 1;
page_fault:
*phy = 0;
- *valid = 0;
- return;
+ return 0;
}
#endif
_______________________________________________
Bochs-cvs mailing list
Bochs-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic