diff --git a/bochs/bochs.h b/bochs/bochs.h index 01c1c1437..8862b2288 100644 --- a/bochs/bochs.h +++ b/bochs/bochs.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: bochs.h,v 1.218 2007-12-20 18:32:14 sshwarts Exp $ +// $Id: bochs.h,v 1.219 2007-12-26 18:39:15 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -193,9 +193,9 @@ void print_tree(bx_param_c *node, int level = 0); #define BX_GET_ENABLE_A20() bx_pc_system.get_enable_a20() #if BX_SUPPORT_A20 -# define A20ADDR(x) ((x) & bx_pc_system.a20_mask) +# define A20ADDR(x) ((bx_phy_address)(x) & bx_pc_system.a20_mask) #else -# define A20ADDR(x) (x) +# define A20ADDR(x) ((bx_phy_address)(x)) #endif #if BX_SUPPORT_SMP diff --git a/bochs/fpu/fpu.cc b/bochs/fpu/fpu.cc index a9e6e5b65..5335cf9e5 100644 --- a/bochs/fpu/fpu.cc +++ b/bochs/fpu/fpu.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: fpu.cc,v 1.30 2007-12-23 17:21:27 sshwarts Exp $ +// $Id: fpu.cc,v 1.31 2007-12-26 18:39:15 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman @@ -95,12 +95,12 @@ int BX_CPU_C::fpu_save_environment(bxInstruction_c *i) write_virtual_dword(i->seg(), RMAddr(i) + 0x04, tmp); tmp = 0xffff0000 | BX_CPU_THIS_PTR the_i387.get_tag_word(); write_virtual_dword(i->seg(), RMAddr(i) + 0x08, tmp); - tmp = (BX_CPU_THIS_PTR the_i387.fip) & 0xffffffff; + tmp = (Bit32u)(BX_CPU_THIS_PTR the_i387.fip) & 0xffffffff; write_virtual_dword(i->seg(), RMAddr(i) + 0x0c, tmp); tmp = (BX_CPU_THIS_PTR the_i387.fcs & 0xffff) | ((Bit32u)(BX_CPU_THIS_PTR the_i387.foo)) << 16; write_virtual_dword(i->seg(), RMAddr(i) + 0x10, tmp); - tmp = (BX_CPU_THIS_PTR the_i387.fdp) & 0xffffffff; + tmp = (Bit32u)(BX_CPU_THIS_PTR the_i387.fdp) & 0xffffffff; write_virtual_dword(i->seg(), RMAddr(i) + 0x14, tmp); tmp = 0xffff0000 | (BX_CPU_THIS_PTR the_i387.fds); write_virtual_dword(i->seg(), RMAddr(i) + 0x18, tmp); @@ -117,11 +117,11 @@ int BX_CPU_C::fpu_save_environment(bxInstruction_c *i) write_virtual_word(i->seg(), RMAddr(i) + 0x02, tmp); tmp = BX_CPU_THIS_PTR the_i387.get_tag_word(); write_virtual_word(i->seg(), RMAddr(i) + 0x04, tmp); - tmp = (BX_CPU_THIS_PTR the_i387.fip) & 0xffff; + tmp = (Bit16u)(BX_CPU_THIS_PTR the_i387.fip) & 0xffff; write_virtual_word(i->seg(), RMAddr(i) + 0x06, tmp); tmp = (BX_CPU_THIS_PTR the_i387.fcs); write_virtual_word(i->seg(), RMAddr(i) + 0x08, tmp); - tmp = (BX_CPU_THIS_PTR the_i387.fdp) & 0xffff; + tmp = (Bit16u)(BX_CPU_THIS_PTR the_i387.fdp) & 0xffff; write_virtual_word(i->seg(), RMAddr(i) + 0x0a, tmp); tmp = (BX_CPU_THIS_PTR the_i387.fds); write_virtual_word(i->seg(), RMAddr(i) + 0x0c, tmp); @@ -511,11 +511,11 @@ void BX_CPU_C::print_state_FPU() fprintf(stderr, "tag word: 0x%04x\n", reg); reg = BX_CPU_THIS_PTR the_i387.foo; fprintf(stderr, "operand: 0x%04x\n", reg); - reg = BX_CPU_THIS_PTR the_i387.fip & 0xffffffff; + reg = (Bit32u)(BX_CPU_THIS_PTR the_i387.fip) & 0xffffffff; fprintf(stderr, "fip: 0x%08x\n", reg); reg = BX_CPU_THIS_PTR the_i387.fcs; fprintf(stderr, "fcs: 0x%04x\n", reg); - reg = BX_CPU_THIS_PTR the_i387.fdp & 0xffffffff; + reg = (Bit32u)(BX_CPU_THIS_PTR the_i387.fdp) & 0xffffffff; fprintf(stderr, "fdp: 0x%08x\n", reg); reg = BX_CPU_THIS_PTR the_i387.fds; fprintf(stderr, "fds: 0x%04x\n", reg); diff --git a/bochs/fpu/fpu_load_store.cc b/bochs/fpu/fpu_load_store.cc index c7bb2728f..93615f678 100755 --- a/bochs/fpu/fpu_load_store.cc +++ b/bochs/fpu/fpu_load_store.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: fpu_load_store.cc,v 1.14 2007-12-20 20:58:38 sshwarts Exp $ +// $Id: fpu_load_store.cc,v 1.15 2007-12-26 18:39:15 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman @@ -231,7 +231,7 @@ void BX_CPU_C::FBLD_PACKED_BCD(bxInstruction_c *i) } // read packed bcd from memory - Bit16u lo8 = read_virtual_qword(i->seg(), RMAddr(i)); + Bit64u lo8 = read_virtual_qword(i->seg(), RMAddr(i)); Bit16u hi2 = read_virtual_word (i->seg(), RMAddr(i) + 8); Bit64s scale = 1; diff --git a/bochs/fpu/softfloat-round-pack.cc b/bochs/fpu/softfloat-round-pack.cc index 4d334be9a..4ec4b0523 100755 --- a/bochs/fpu/softfloat-round-pack.cc +++ b/bochs/fpu/softfloat-round-pack.cc @@ -82,7 +82,7 @@ Bit32s roundAndPackInt32(int zSign, Bit64u absZ, float_status_t &status) } } } - int roundBits = absZ & 0x7F; + int roundBits = (int)(absZ & 0x7F); absZ = (absZ + roundIncrement)>>7; absZ &= ~(((roundBits ^ 0x40) == 0) & roundNearestEven); Bit32s z = (Bit32s) absZ; @@ -295,7 +295,7 @@ float64 roundAndPackFloat64(int zSign, Bit16s zExp, Bit64u zSig, float_status_t } } } - roundBits = zSig & 0x3FF; + roundBits = (Bit16s)(zSig & 0x3FF); if (0x7FD <= (Bit16u) zExp) { if ((0x7FD < zExp) || ((zExp == 0x7FD) @@ -308,7 +308,7 @@ float64 roundAndPackFloat64(int zSign, Bit16s zExp, Bit64u zSig, float_status_t int isTiny = (zExp < -1) || (zSig + roundIncrement < BX_CONST64(0x8000000000000000)); shift64RightJamming(zSig, -zExp, &zSig); zExp = 0; - roundBits = zSig & 0x3FF; + roundBits = (Bit16s)(zSig & 0x3FF); if (isTiny && roundBits) { float_raise(status, float_flag_underflow); if(get_flush_underflow_to_zero(status)) { diff --git a/bochs/fpu/softfloat.cc b/bochs/fpu/softfloat.cc index 0c87552fb..25ec30223 100755 --- a/bochs/fpu/softfloat.cc +++ b/bochs/fpu/softfloat.cc @@ -99,7 +99,7 @@ float32 int64_to_float32(Bit64s a, float_status_t &status) Bit64u absA = zSign ? -a : a; int shiftCount = countLeadingZeros64(absA) - 40; if (0 <= shiftCount) { - return packFloat32(zSign, 0x95 - shiftCount, absA<>1) + 0x3FE; aSig |= BX_CONST64(0x0010000000000000); - zSig = estimateSqrt32(aExp, aSig>>21); + zSig = estimateSqrt32(aExp, (Bit32u)(aSig>>21)); aSig <<= 9 - (aExp & 1); zSig = estimateDiv128To64(aSig, 0, zSig<<32) + (zSig<<30); if ((zSig & 0x1FF) <= 5) { diff --git a/bochs/fpu/softfloatx80.cc b/bochs/fpu/softfloatx80.cc index a5ffa01de..9bf093c6a 100755 --- a/bochs/fpu/softfloatx80.cc +++ b/bochs/fpu/softfloatx80.cc @@ -199,7 +199,7 @@ floatx80 floatx80_scale(floatx80 a, floatx80 b, float_status_t &status) int shiftCount = 0x403E - bExp; bSig >>= shiftCount; - Bit32s scale = bSig; + Bit32s scale = (Bit32s) bSig; if (bSign) scale = -scale; /* -32768..32767 */ return roundAndPackFloatx80(80, aSign, aExp+scale, aSig, 0, status); diff --git a/bochs/iodev/vga.cc b/bochs/iodev/vga.cc index ad8701997..9b25127a7 100644 --- a/bochs/iodev/vga.cc +++ b/bochs/iodev/vga.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: vga.cc,v 1.144 2007-10-24 23:16:41 sshwarts Exp $ +// $Id: vga.cc,v 1.145 2007-12-26 18:39:15 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -122,7 +122,7 @@ bx_vga_c::~bx_vga_c() void bx_vga_c::init(void) { - unsigned i,len,string_i; + unsigned i,string_i; unsigned x,y; #if BX_SUPPORT_VBE Bit16u max_xres, max_yres, max_bpp; @@ -132,6 +132,7 @@ void bx_vga_c::init(void) char *ptr; char string[512]; char *extname; + size_t len; #if BX_SUPPORT_VBE unsigned addr; #endif diff --git a/bochs/pc_system.h b/bochs/pc_system.h index f2a29c16a..e2a8c0bd1 100644 --- a/bochs/pc_system.h +++ b/bochs/pc_system.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: pc_system.h,v 1.42 2007-11-01 18:03:48 sshwarts Exp $ +// $Id: pc_system.h,v 1.43 2007-12-26 18:39:15 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2004 MandrakeSoft S.A. @@ -156,7 +156,7 @@ public: // when A20 line is disabled, mask physical memory addresses to: // 286: 20 bits // 386: 20 bits - Bit32u a20_mask; + bx_phy_address a20_mask; volatile bx_bool kill_bochs_request;