diff --git a/bochs/.conf.AIX.4.3.1 b/bochs/.conf.AIX.4.3.1 deleted file mode 100755 index 777ebb4f3..000000000 --- a/bochs/.conf.AIX.4.3.1 +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -export CC="xlc" -export CXX="xlC" -export CFLAGS="-qcpluscmt" -export CXXFLAGS="" - -./configure - diff --git a/bochs/CHANGES b/bochs/CHANGES index 4cd67ba25..c6839923a 100644 --- a/bochs/CHANGES +++ b/bochs/CHANGES @@ -8,23 +8,23 @@ Changes after 2.3.5 release: - Implemented MTRR emulation, to enable use --enable-mtrr configure option. MTRRs is enabled by default when cpu-level >= 6. - Removed hostasm optimizations, after Bochs rebenchmarking it was found - out that the feature bringing no speedup or even sometimes slowes - emulation down ! + that the feature bringing no speedup or even sometimes slowes down + the emulation ! - Many minor bugfixes in CPU emulation (both ia32 and x86-64) - Bochs Internal Debugger and Disassember - Many fixes in Bochs internal debugger and disassembler, some debugger interfaces significantly changed due transition to the param tree architecture - - Added support of restoring of the CPU state from external file + - Added support for restoring of the CPU state from external file directly from Bochs debugger - Configure and compile - rename configure option --enable-4meg-pages to --enable-large-pages. The option enables page size extensions (PSE) which refers to 2M pages as well. - - removed -enable-save-restore configure option, save/restore feature - changed to be one the basic Bochs features and compiled by default + - removed --enable-save-restore configure option, save/restore feature + changed to be one of the basic Bochs features and compiled by default for all configurations. - added new Bochs benchmark mode. To run Bochs in benchmark mode execute it with new command line option 'bochs -benchmark time'. The emulation diff --git a/bochs/bochs.h b/bochs/bochs.h index 77aa975b1..5ed780962 100644 --- a/bochs/bochs.h +++ b/bochs/bochs.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: bochs.h,v 1.211 2007-10-16 16:17:48 sshwarts Exp $ +// $Id: bochs.h,v 1.212 2007-10-24 23:27:24 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -278,7 +278,7 @@ public: #else void ask (int level, const char *prefix, const char *fmt, va_list ap); #endif - void put(char *); + void put(const char *); void settype(int); void setio(class iofunctions *); void setonoff(int loglev, int value) { @@ -354,16 +354,16 @@ public: else return "?"; } char *getaction(int i) { - static char *name[] = { "ignore", "report", "ask", "fatal" }; + static const char *name[] = { "ignore", "report", "ask", "fatal" }; assert (i>=ACT_IGNORE && iset_format("Name of ROM BIOS image: %s"); - sprintf(name, "%s/BIOS-bochs-latest", get_builtin_variable("BXSHARE")); + sprintf(name, "%s/BIOS-bochs-latest", (char *)get_builtin_variable("BXSHARE")); path->set_initial_val(name); bx_param_num_c *romaddr = new bx_param_num_c(rom, "addr", @@ -666,7 +666,7 @@ void bx_init_options() // compile time. The one that is listed first will be the default, // which is used unless the user overrides it on the command line or // in a configuration file. - static char *display_library_list[] = { + static const char *display_library_list[] = { #if BX_WITH_X11 "x", #endif @@ -803,7 +803,7 @@ void bx_init_options() "none", 20); user_shortcut->set_runtime_param(1); - static char *mouse_type_list[] = { + static const char *mouse_type_list[] = { "none", "ps2", "imps2", @@ -987,17 +987,17 @@ void bx_init_options() bx_list_c *ata = new bx_list_c(root_param, "ata", "ATA/ATAPI Options"); // disk options - char *s_atachannel[] = { + const char *s_atachannel[] = { "ATA channel 0", "ATA channel 1", "ATA channel 2", "ATA channel 3", }; - char *s_atadevname[2] = { + const char *s_atadevname[2] = { "master", "slave", }; - char *s_atadevice[4][2] = { + const char *s_atadevice[4][2] = { { "First HD/CD on channel 0", "Second HD/CD on channel 0" }, { "First HD/CD on channel 1", @@ -1250,7 +1250,7 @@ void bx_init_options() enabled->set_dependent_list(deplist); } - static char *serial_mode_list[] = { + static const char *serial_mode_list[] = { "null", "file", "term", @@ -1322,7 +1322,7 @@ void bx_init_options() network->get_options()->set(bx_list_c::USE_TAB_WINDOW | bx_list_c::SHOW_PARENT); // ne2k & pnic options - static char *eth_module_list[] = { + static const char *eth_module_list[] = { "null", #if defined(ETH_LINUX) "linux", @@ -1753,7 +1753,7 @@ static int parse_bochsrc(const char *rcfile) return retval; } -static char *get_builtin_variable(char *varname) +static const char *get_builtin_variable(const char *varname) { #ifdef WIN32 int code; @@ -1837,7 +1837,7 @@ static Bit32s parse_line_unformatted(const char *context, char *line) if (ptr[i] == '$') { char varname[512]; char *pv = varname; - char *value; + const char *value; *pv = 0; i++; while (isalpha(ptr[i]) || ptr[i]=='_') { @@ -1847,14 +1847,14 @@ static Bit32s parse_line_unformatted(const char *context, char *line) if (strlen(varname)<1 || !(value = getenv(varname))) { if ((value = get_builtin_variable(varname))) { // append value to the string - for (pv=value; *pv; pv++) + for (pv=(char *)value; *pv; pv++) string[string_i++] = *pv; } else { BX_PANIC (("could not look up environment variable '%s'", varname)); } } else { // append value to the string - for (pv=value; *pv; pv++) + for (pv=(char *)value; *pv; pv++) string[string_i++] = *pv; } } @@ -3047,7 +3047,7 @@ static Bit32s parse_line_formatted(const char *context, int num_params, char *pa } -static char *fdtypes[] = { +static const char *fdtypes[] = { "none", "1_2", "1_44", "2_88", "720k", "360k", "160k", "180k", "320k" }; diff --git a/bochs/fpu/fprem.cc b/bochs/fpu/fprem.cc index 8febca66e..6704db94b 100755 --- a/bochs/fpu/fprem.cc +++ b/bochs/fpu/fprem.cc @@ -25,6 +25,7 @@ these four paragraphs for those parts of this code that are retained. #include "softfloatx80.h" #include "softfloat-round-pack.h" +#define USE_estimateDiv128To64 #include "softfloat-macros.h" /* executes single exponent reduction cycle */ diff --git a/bochs/fpu/fpu.cc b/bochs/fpu/fpu.cc index 506afc257..3ca59a7fd 100644 --- a/bochs/fpu/fpu.cc +++ b/bochs/fpu/fpu.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: fpu.cc,v 1.24 2007-09-11 13:11:03 sshwarts Exp $ +// $Id: fpu.cc,v 1.25 2007-10-24 23:29:17 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman @@ -532,7 +532,7 @@ void BX_CPU_C::print_state_FPU() #else f *= fp.fraction*scale_factor; #endif - fprintf(stderr, "%sFPR%d(%c): %.10f (raw 0x%04x:%08x%08x)\n", + fprintf(stderr, "%sFPR%d(%c): %.10f (raw 0x%04x:%08lx%08lx)\n", i==tos?"=>":" ", i, "v0s?"[BX_CPU_THIS_PTR the_i387.FPU_gettagi((i-tos)&7)], diff --git a/bochs/fpu/fsincos.cc b/bochs/fpu/fsincos.cc index d0a48e19c..f85956881 100755 --- a/bochs/fpu/fsincos.cc +++ b/bochs/fpu/fsincos.cc @@ -25,6 +25,7 @@ these four paragraphs for those parts of this code that are retained. #define FLOAT128 +#define USE_estimateDiv128To64 #include "softfloatx80.h" #include "softfloat-round-pack.h" #include "fpu_constant.h" diff --git a/bochs/fpu/softfloat-macros.h b/bochs/fpu/softfloat-macros.h index 3816c0717..9f53993bd 100755 --- a/bochs/fpu/softfloat-macros.h +++ b/bochs/fpu/softfloat-macros.h @@ -194,6 +194,7 @@ BX_CPP_INLINE void mul64To128(Bit64u a, Bit64u b, Bit64u *z0Ptr, Bit64u *z1Ptr) | unsigned integer is returned. *----------------------------------------------------------------------------*/ +#ifdef USE_estimateDiv128To64 static Bit64u estimateDiv128To64(Bit64u a0, Bit64u a1, Bit64u b) { Bit64u b0, b1; @@ -214,6 +215,7 @@ static Bit64u estimateDiv128To64(Bit64u a0, Bit64u a1, Bit64u b) z |= (b0<<32 <= rem0) ? 0xFFFFFFFF : rem0 / b0; return z; } +#endif /*---------------------------------------------------------------------------- | Returns an approximation to the square root of the 32-bit significand given @@ -225,6 +227,7 @@ static Bit64u estimateDiv128To64(Bit64u a0, Bit64u a1, Bit64u b) | value. *----------------------------------------------------------------------------*/ +#ifdef USE_estimateSqrt32 static Bit32u estimateSqrt32(Bit16s aExp, Bit32u a) { static const Bit16u sqrtOddAdjustments[] = { @@ -251,6 +254,7 @@ static Bit32u estimateSqrt32(Bit16s aExp, Bit32u a) } return ((Bit32u) ((((Bit64u) a)<<31) / z)) + (z>>1); } +#endif /*---------------------------------------------------------------------------- | Returns the number of leading 0 bits before the most-significant 1 bit of diff --git a/bochs/fpu/softfloat.cc b/bochs/fpu/softfloat.cc index 23771034b..d1e4bfd8b 100755 --- a/bochs/fpu/softfloat.cc +++ b/bochs/fpu/softfloat.cc @@ -42,6 +42,8 @@ these four paragraphs for those parts of this code that are retained. | division and square root approximations. (Can be specialized to target | if desired). *----------------------------------------------------------------------------*/ +#define USE_estimateDiv128To64 +#define USE_estimateSqrt32 #include "softfloat-macros.h" /*---------------------------------------------------------------------------- diff --git a/bochs/logio.cc b/bochs/logio.cc index d32d38867..870712e13 100644 --- a/bochs/logio.cc +++ b/bochs/logio.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: logio.cc,v 1.61 2007-10-18 22:44:38 sshwarts Exp $ +// $Id: logio.cc,v 1.62 2007-10-24 23:28:00 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -98,7 +98,7 @@ void iofunctions::init_log(const char *fn) // use newfd/newfn so that we can log the message to the OLD log // file descriptor. FILE *newfd = stderr; - char *newfn = "/dev/stderr"; + const char *newfn = "/dev/stderr"; if(strcmp(fn, "-") != 0) { newfd = fopen(fn, "w"); if(newfd != NULL) { @@ -146,7 +146,7 @@ void iofunctions::exit_log() if (logfd != stderr) { fclose(logfd); logfd = stderr; - free(logfn); + free((char *)logfn); logfn = "/dev/stderr"; } } @@ -314,7 +314,7 @@ void logfunctions::setio(iofunc_t *i) i->add_logfn(this); } -void logfunctions::put(char *p) +void logfunctions::put(const char *p) { char * tmpbuf=strdup("[ ]"); // if we ever have more than 32 chars, // we need to rethink this @@ -593,7 +593,7 @@ void logfunctions::fatal(const char *prefix, const char *fmt, va_list ap, int ex } #endif #if !BX_WITH_WX - static char *divider = "========================================================================"; + static const char *divider = "========================================================================"; fprintf(stderr, "%s\n", divider); fprintf(stderr, "Bochs is exiting with the following message:\n"); fprintf(stderr, "%s ", prefix); diff --git a/bochs/main.cc b/bochs/main.cc index 5149786b8..c70bd1c85 100644 --- a/bochs/main.cc +++ b/bochs/main.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: main.cc,v 1.360 2007-10-21 22:07:31 sshwarts Exp $ +// $Id: main.cc,v 1.361 2007-10-24 23:28:11 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -79,7 +79,7 @@ void bx_init_hardware(void); void bx_init_options(void); void bx_init_bx_dbg(void); -static char *divider = "========================================================================"; +static const char *divider = "========================================================================"; static logfunctions thePluginLog; logfunctions *pluginlog = &thePluginLog; @@ -264,7 +264,7 @@ int bxmain () { // read a param to decide which config interface to start. // If one exists, start it. If not, just begin. bx_param_enum_c *ci_param = SIM->get_param_enum(BXPN_SEL_CONFIG_INTERFACE); - char *ci_name = ci_param->get_selected(); + const char *ci_name = ci_param->get_selected(); if (!strcmp(ci_name, "textconfig")) { #if BX_USE_TEXTCONFIG init_text_config_interface(); // in textconfig.h @@ -750,9 +750,9 @@ bx_bool load_and_init_display_lib() } BX_ASSERT(bx_gui == NULL); bx_param_enum_c *ci_param = SIM->get_param_enum(BXPN_SEL_CONFIG_INTERFACE); - char *ci_name = ci_param->get_selected(); + const char *ci_name = ci_param->get_selected(); bx_param_enum_c *gui_param = SIM->get_param_enum(BXPN_SEL_DISPLAY_LIBRARY); - char *gui_name = gui_param->get_selected(); + const char *gui_name = gui_param->get_selected(); if (!strcmp(ci_name, "wx")) { BX_ERROR(("change of the config interface to wx not implemented yet")); } @@ -1166,7 +1166,10 @@ int bx_atexit(void) #if BX_DEBUGGER == 0 if (SIM && SIM->get_init_done()) { for (int cpu=0; cpuatexit(); +#if BX_SUPPORT_SMP + if (BX_CPU(cpu)) +#endif + BX_CPU(cpu)->atexit(); } #endif diff --git a/bochs/plugin.cc b/bochs/plugin.cc index b05c9464c..884777a8e 100644 --- a/bochs/plugin.cc +++ b/bochs/plugin.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: plugin.cc,v 1.22 2007-09-28 19:51:42 sshwarts Exp $ +// $Id: plugin.cc,v 1.23 2007-10-24 23:28:40 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // This file defines the plugin and plugin-device registration functions and @@ -488,7 +488,7 @@ plugin_startup(void) /* Plugin system: Device registration */ /************************************************************************/ -void pluginRegisterDeviceDevmodel(plugin_t *plugin, plugintype_t type, bx_devmodel_c *devmodel, char *name) +void pluginRegisterDeviceDevmodel(plugin_t *plugin, plugintype_t type, bx_devmodel_c *devmodel, const char *name) { device_t *device; diff --git a/bochs/plugin.h b/bochs/plugin.h index 51b565cbf..8385ec1c6 100644 --- a/bochs/plugin.h +++ b/bochs/plugin.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: plugin.h,v 1.59 2007-09-28 19:51:43 sshwarts Exp $ +// $Id: plugin.h,v 1.60 2007-10-24 23:28:50 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // This file provides macros and types needed for plugins. It is based on @@ -266,7 +266,7 @@ typedef void (*deviceInitMem_t)(BX_MEM_C *); typedef void (*deviceInitDev_t)(void); typedef void (*deviceReset_t)(unsigned); -BOCHSAPI void pluginRegisterDeviceDevmodel(plugin_t *plugin, plugintype_t type, bx_devmodel_c *dev, char *name); +BOCHSAPI void pluginRegisterDeviceDevmodel(plugin_t *plugin, plugintype_t type, bx_devmodel_c *dev, const char *name); BOCHSAPI bx_bool pluginDevicePresent(char *name); /* === IO port stuff === */