fixed variable name

This commit is contained in:
Stanislav Shwartsman 2008-06-14 16:55:45 +00:00
parent 4cbe1c6568
commit a0e66d0e4c
7 changed files with 80 additions and 80 deletions

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////
// $Id: call_far.cc,v 1.38 2008-06-12 19:14:39 sshwarts Exp $
// $Id: call_far.cc,v 1.39 2008-06-14 16:55:44 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2005 Stanislav Shwartsman
@ -333,13 +333,13 @@ BX_CPU_C::call_protected(bxInstruction_c *i, Bit16u cs_raw, bx_address disp)
return_EIP = IP;
if (gate_descriptor.type==BX_286_CALL_GATE) {
for (unsigned i=0; i<param_count; i++) {
parameter_word[i] = read_virtual_word_32(BX_SEG_REG_SS, return_ESP + i*2);
for (unsigned n=0; n<param_count; n++) {
parameter_word[n] = read_virtual_word_32(BX_SEG_REG_SS, return_ESP + n*2);
}
}
else {
for (unsigned i=0; i<param_count; i++) {
parameter_dword[i] = read_virtual_dword_32(BX_SEG_REG_SS, return_ESP + i*4);
for (unsigned n=0; n<param_count; n++) {
parameter_dword[n] = read_virtual_dword_32(BX_SEG_REG_SS, return_ESP + n*4);
}
}
@ -362,9 +362,9 @@ BX_CPU_C::call_protected(bxInstruction_c *i, Bit16u cs_raw, bx_address disp)
write_new_stack_dword_32(&new_stack, temp_ESP-8, cs_descriptor.dpl, return_ESP);
temp_ESP -= 8;
for (unsigned i=param_count; i>0; i--) {
for (unsigned n=param_count; n>0; n--) {
temp_ESP -= 4;
write_new_stack_dword_32(&new_stack, temp_ESP, cs_descriptor.dpl, parameter_dword[i-1]);
write_new_stack_dword_32(&new_stack, temp_ESP, cs_descriptor.dpl, parameter_dword[n-1]);
}
// push return address onto new stack
write_new_stack_dword_32(&new_stack, temp_ESP-4, cs_descriptor.dpl, return_CS);
@ -376,9 +376,9 @@ BX_CPU_C::call_protected(bxInstruction_c *i, Bit16u cs_raw, bx_address disp)
write_new_stack_word_32(&new_stack, temp_ESP-4, cs_descriptor.dpl, (Bit16u) return_ESP);
temp_ESP -= 4;
for (unsigned i=param_count; i>0; i--) {
for (unsigned n=param_count; n>0; n--) {
temp_ESP -= 2;
write_new_stack_word_32(&new_stack, temp_ESP, cs_descriptor.dpl, parameter_word[i-1]);
write_new_stack_word_32(&new_stack, temp_ESP, cs_descriptor.dpl, parameter_word[n-1]);
}
// push return address onto new stack
write_new_stack_word_32(&new_stack, temp_ESP-2, cs_descriptor.dpl, return_CS);
@ -397,9 +397,9 @@ BX_CPU_C::call_protected(bxInstruction_c *i, Bit16u cs_raw, bx_address disp)
write_new_stack_dword_32(&new_stack, (Bit16u)(temp_SP-8), cs_descriptor.dpl, return_ESP);
temp_SP -= 8;
for (unsigned i=param_count; i>0; i--) {
for (unsigned n=param_count; n>0; n--) {
temp_SP -= 4;
write_new_stack_dword_32(&new_stack, temp_SP, cs_descriptor.dpl, parameter_dword[i-1]);
write_new_stack_dword_32(&new_stack, temp_SP, cs_descriptor.dpl, parameter_dword[n-1]);
}
// push return address onto new stack
write_new_stack_dword_32(&new_stack, (Bit16u)(temp_SP-4), cs_descriptor.dpl, return_CS);
@ -411,9 +411,9 @@ BX_CPU_C::call_protected(bxInstruction_c *i, Bit16u cs_raw, bx_address disp)
write_new_stack_word_32(&new_stack, (Bit16u)(temp_SP-4), cs_descriptor.dpl, (Bit16u) return_ESP);
temp_SP -= 4;
for (unsigned i=param_count; i>0; i--) {
for (unsigned n=param_count; n>0; n--) {
temp_SP -= 2;
write_new_stack_word_32(&new_stack, temp_SP, cs_descriptor.dpl, parameter_word[i-1]);
write_new_stack_word_32(&new_stack, temp_SP, cs_descriptor.dpl, parameter_word[n-1]);
}
// push return address onto new stack
write_new_stack_word_32(&new_stack, (Bit16u)(temp_SP-2), cs_descriptor.dpl, return_CS);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.231 2008-06-12 16:40:52 sshwarts Exp $
// $Id: cpu.cc,v 1.232 2008-06-14 16:55:44 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -834,13 +834,13 @@ bx_bool BX_CPU_C::dbg_check_begin_instr_bpoint(void)
if ((BX_CPU_THIS_PTR guard_found.icount!=0) ||
(tt != BX_CPU_THIS_PTR guard_found.time_tick))
{
for (unsigned i=0; i<bx_guard.iaddr.num_virtual; i++) {
if (bx_guard.iaddr.vir[i].enabled &&
(bx_guard.iaddr.vir[i].cs == cs) &&
(bx_guard.iaddr.vir[i].eip == debug_eip))
for (unsigned n=0; n<bx_guard.iaddr.num_virtual; n++) {
if (bx_guard.iaddr.vir[n].enabled &&
(bx_guard.iaddr.vir[n].cs == cs) &&
(bx_guard.iaddr.vir[n].eip == debug_eip))
{
BX_CPU_THIS_PTR guard_found.guard_found = BX_DBG_GUARD_IADDR_VIR;
BX_CPU_THIS_PTR guard_found.iaddr_index = i;
BX_CPU_THIS_PTR guard_found.iaddr_index = n;
BX_CPU_THIS_PTR guard_found.time_tick = tt;
return(1); // on a breakpoint
}
@ -853,12 +853,12 @@ bx_bool BX_CPU_C::dbg_check_begin_instr_bpoint(void)
if ((BX_CPU_THIS_PTR guard_found.icount!=0) ||
(tt != BX_CPU_THIS_PTR guard_found.time_tick))
{
for (unsigned i=0; i<bx_guard.iaddr.num_linear; i++) {
if (bx_guard.iaddr.lin[i].enabled &&
(bx_guard.iaddr.lin[i].addr == BX_CPU_THIS_PTR guard_found.laddr))
for (unsigned n=0; n<bx_guard.iaddr.num_linear; n++) {
if (bx_guard.iaddr.lin[n].enabled &&
(bx_guard.iaddr.lin[n].addr == BX_CPU_THIS_PTR guard_found.laddr))
{
BX_CPU_THIS_PTR guard_found.guard_found = BX_DBG_GUARD_IADDR_LIN;
BX_CPU_THIS_PTR guard_found.iaddr_index = i;
BX_CPU_THIS_PTR guard_found.iaddr_index = n;
BX_CPU_THIS_PTR guard_found.time_tick = tt;
return(1); // on a breakpoint
}
@ -877,11 +877,11 @@ bx_bool BX_CPU_C::dbg_check_begin_instr_bpoint(void)
if (valid && ((BX_CPU_THIS_PTR guard_found.icount!=0) ||
(tt != BX_CPU_THIS_PTR guard_found.time_tick)))
{
for (unsigned i=0; i<bx_guard.iaddr.num_physical; i++) {
if (bx_guard.iaddr.phy[i].enabled && (bx_guard.iaddr.phy[i].addr == phy))
for (unsigned n=0; n<bx_guard.iaddr.num_physical; n++) {
if (bx_guard.iaddr.phy[n].enabled && (bx_guard.iaddr.phy[n].addr == phy))
{
BX_CPU_THIS_PTR guard_found.guard_found = BX_DBG_GUARD_IADDR_PHY;
BX_CPU_THIS_PTR guard_found.iaddr_index = i;
BX_CPU_THIS_PTR guard_found.iaddr_index = n;
BX_CPU_THIS_PTR guard_found.time_tick = tt;
return(1); // on a breakpoint
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: init.cc,v 1.173 2008-05-30 21:10:37 sshwarts Exp $
// $Id: init.cc,v 1.174 2008-06-14 16:55:45 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -298,7 +298,7 @@ void BX_CPU_C::register_wx_state(void)
// save/restore functionality
void BX_CPU_C::register_state(void)
{
unsigned i;
unsigned n;
char name[10];
sprintf(name, "cpu%d", BX_CPU_ID);
@ -360,8 +360,8 @@ void BX_CPU_C::register_state(void)
BXRS_HEX_PARAM_FIELD(cpu, XCR0, xcr0.val32);
#endif
for(i=0; i<6; i++) {
bx_segment_reg_t *segment = &BX_CPU_THIS_PTR sregs[i];
for(n=0; n<6; n++) {
bx_segment_reg_t *segment = &BX_CPU_THIS_PTR sregs[n];
bx_list_c *sreg = new bx_list_c(cpu, strseg(segment), 9);
BXRS_PARAM_SPECIAL16(sreg, selector,
param_save_handler, param_restore_handler);
@ -475,11 +475,11 @@ void BX_CPU_C::register_state(void)
BXRS_HEX_PARAM_FIELD(fpu, fip, the_i387.fip);
BXRS_HEX_PARAM_FIELD(fpu, fds, the_i387.fds);
BXRS_HEX_PARAM_FIELD(fpu, fdp, the_i387.fdp);
for (i=0; i<8; i++) {
sprintf(name, "st%d", i);
for (n=0; n<8; n++) {
sprintf(name, "st%d", n);
bx_list_c *STx = new bx_list_c(fpu, name, 8);
BXRS_HEX_PARAM_FIELD(STx, exp, the_i387.st_space[i].exp);
BXRS_HEX_PARAM_FIELD(STx, fraction, the_i387.st_space[i].fraction);
BXRS_HEX_PARAM_FIELD(STx, exp, the_i387.st_space[n].exp);
BXRS_HEX_PARAM_FIELD(STx, fraction, the_i387.st_space[n].fraction);
}
BXRS_DEC_PARAM_FIELD(fpu, tos, the_i387.tos);
#endif
@ -487,11 +487,11 @@ void BX_CPU_C::register_state(void)
#if BX_SUPPORT_SSE
bx_list_c *sse = new bx_list_c(cpu, "SSE", 2*BX_XMM_REGISTERS+1);
BXRS_HEX_PARAM_FIELD(sse, mxcsr, mxcsr.mxcsr);
for (i=0; i<BX_XMM_REGISTERS; i++) {
sprintf(name, "xmm%02d_hi", i);
new bx_shadow_num_c(sse, name, &xmm[i].xmm64u(1), BASE_HEX);
sprintf(name, "xmm%02d_lo", i);
new bx_shadow_num_c(sse, name, &xmm[i].xmm64u(0), BASE_HEX);
for (n=0; n<BX_XMM_REGISTERS; n++) {
sprintf(name, "xmm%02d_hi", n);
new bx_shadow_num_c(sse, name, &xmm[n].xmm64u(1), BASE_HEX);
sprintf(name, "xmm%02d_lo", n);
new bx_shadow_num_c(sse, name, &xmm[n].xmm64u(0), BASE_HEX);
}
#endif
@ -664,7 +664,7 @@ BX_CPU_C::~BX_CPU_C()
void BX_CPU_C::reset(unsigned source)
{
unsigned i;
unsigned n;
if (source == BX_RESET_HARDWARE)
BX_INFO(("cpu hardware reset"));
@ -920,15 +920,15 @@ void BX_CPU_C::reset(unsigned source)
#endif
#if BX_SUPPORT_MTRR
for (i=0; i<16; i++)
BX_CPU_THIS_PTR msr.mtrrphys[i] = 0;
for (n=0; n<16; n++)
BX_CPU_THIS_PTR msr.mtrrphys[n] = 0;
BX_CPU_THIS_PTR msr.mtrrfix64k_00000 = 0; // all fix range MTRRs undefined according to manual
BX_CPU_THIS_PTR msr.mtrrfix16k_80000 = 0;
BX_CPU_THIS_PTR msr.mtrrfix16k_a0000 = 0;
for (i=0; i<8; i++)
BX_CPU_THIS_PTR msr.mtrrfix4k[i] = 0;
for (n=0; n<8; n++)
BX_CPU_THIS_PTR msr.mtrrfix4k[n] = 0;
BX_CPU_THIS_PTR msr.pat = BX_CONST64(0x0007040600070406);
BX_CPU_THIS_PTR msr.mtrr_deftype = 0;
@ -961,10 +961,10 @@ void BX_CPU_C::reset(unsigned source)
// Reset XMM state
#if BX_SUPPORT_SSE >= 1 // unchanged on #INIT
for(i=0; i<BX_XMM_REGISTERS; i++)
for(n=0; n<BX_XMM_REGISTERS; n++)
{
BX_CPU_THIS_PTR xmm[i].xmm64u(0) = 0;
BX_CPU_THIS_PTR xmm[i].xmm64u(1) = 0;
BX_CPU_THIS_PTR xmm[n].xmm64u(0) = 0;
BX_CPU_THIS_PTR xmm[n].xmm64u(1) = 0;
}
BX_CPU_THIS_PTR mxcsr.mxcsr = MXCSR_RESET;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: io_pro.cc,v 1.34 2008-06-12 19:14:39 sshwarts Exp $
// $Id: io_pro.cc,v 1.35 2008-06-14 16:55:45 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -139,7 +139,7 @@ bx_bool BX_CPU_C::allow_io(Bit16u addr, unsigned len)
unsigned bit_index = addr & 0x07;
permission16 >>= bit_index;
for (unsigned i=0; i<len; i++) {
for (unsigned n=0; n<len; n++) {
if (permission16 & 0x01)
return(0);
permission16 >>= 1;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: paging.cc,v 1.140 2008-06-02 18:41:08 sshwarts Exp $
// $Id: paging.cc,v 1.141 2008-06-14 16:55:45 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -477,39 +477,39 @@ BX_CPU_C::SetCR3(bx_address val)
// Unconditional initialization of all TLB entries.
void BX_CPU_C::TLB_init(void)
{
unsigned i, wp, us_combined, rw_combined, us_current, rw_current;
unsigned n, wp, us_combined, rw_combined, us_current, rw_current;
for (i=0; i<BX_TLB_SIZE; i++)
BX_CPU_THIS_PTR TLB.entry[i].lpf = BX_INVALID_TLB_ENTRY;
for (n=0; n<BX_TLB_SIZE; n++)
BX_CPU_THIS_PTR TLB.entry[n].lpf = BX_INVALID_TLB_ENTRY;
//
// Setup privilege check matrix.
//
for (i=0; i<BX_PRIV_CHECK_SIZE; i++) {
wp = (i & 0x10) >> 4;
us_current = (i & 0x08) >> 3;
us_combined = (i & 0x04) >> 2;
rw_combined = (i & 0x02) >> 1;
rw_current = (i & 0x01) >> 0;
for (n=0; n<BX_PRIV_CHECK_SIZE; n++) {
wp = (n & 0x10) >> 4;
us_current = (n & 0x08) >> 3;
us_combined = (n & 0x04) >> 2;
rw_combined = (n & 0x02) >> 1;
rw_current = (n & 0x01) >> 0;
if (wp) { // when write protect on
if (us_current > us_combined) // user access, supervisor page
priv_check[i] = 0;
priv_check[n] = 0;
else if (rw_current > rw_combined) // RW access, RO page
priv_check[i] = 0;
priv_check[n] = 0;
else
priv_check[i] = 1;
priv_check[n] = 1;
}
else { // when write protect off
if (us_current == 0) // Supervisor mode access, anything goes
priv_check[i] = 1;
priv_check[n] = 1;
else {
// user mode access
if (us_combined == 0) // user access, supervisor Page
priv_check[i] = 0;
priv_check[n] = 0;
else if (rw_current > rw_combined) // RW access, RO page
priv_check[i] = 0;
priv_check[n] = 0;
else
priv_check[i] = 1;
priv_check[n] = 1;
}
}
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: proc_ctrl.cc,v 1.239 2008-06-12 19:14:39 sshwarts Exp $
// $Id: proc_ctrl.cc,v 1.240 2008-06-14 16:55:45 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -2568,17 +2568,17 @@ Bit32u BX_CPU_C::hwdebug_compare(bx_address laddr_0, unsigned size,
dr_op[2] = (dr7>>24) & 3;
dr_op[3] = (dr7>>28) & 3;
for (unsigned i=0;i<4;i++) {
dr[i] = BX_CPU_THIS_PTR dr[i] & ~alignment_mask[len[i]];
dr_n[i] = dr[i] + alignment_mask[len[i]];
ibpoint_found_n[i] = 0;
for (unsigned n=0;n<4;n++) {
dr[n] = BX_CPU_THIS_PTR dr[n] & ~alignment_mask[len[n]];
dr_n[n] = dr[n] + alignment_mask[len[n]];
ibpoint_found_n[n] = 0;
// See if this instruction address matches any breakpoints
if (dr7 & (3 << i*2)) {
if ((dr_op[i]==opa || dr_op[i]==opb) &&
(laddr_0 <= dr_n[i]) &&
(laddr_n >= dr[i])) {
ibpoint_found_n[i] = 1;
if (dr7 & (3 << n*2)) {
if ((dr_op[n]==opa || dr_op[n]==opb) &&
(laddr_0 <= dr_n[n]) &&
(laddr_n >= dr[n])) {
ibpoint_found_n[n] = 1;
ibpoint_found = 1;
}
}

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: sse_move.cc,v 1.91 2008-06-12 19:14:39 sshwarts Exp $
// $Id: sse_move.cc,v 1.92 2008-06-14 16:55:45 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -31,9 +31,9 @@
void BX_CPU_C::print_state_SSE(void)
{
BX_DEBUG(("MXCSR: 0x%08x\n", BX_MXCSR_REGISTER));
for(unsigned i=0;i<BX_XMM_REGISTERS;i++) {
BxPackedXmmRegister xmm = BX_READ_XMM_REG(i);
BX_DEBUG(("XMM%02u: %08x%08x:%08x%08x\n", i,
for(unsigned n=0;n<BX_XMM_REGISTERS;n++) {
BxPackedXmmRegister xmm = BX_READ_XMM_REG(n);
BX_DEBUG(("XMM%02u: %08x%08x:%08x%08x\n", n,
xmm.xmm32u(3), xmm.xmm32u(2), xmm.xmm32u(1), xmm.xmm32u(0)));
}
}