- removed obsolete configure option --enable-time0. The 'clock' runtime option

is already doing the same.
- DCC oscillator disable support added
- fixed indent mode in modified sections
This commit is contained in:
Volker Ruppert 2005-09-10 16:40:59 +00:00
parent fd427df0d7
commit e450b1af53
5 changed files with 57 additions and 103 deletions

View File

@ -294,8 +294,6 @@
#define USE_RAW_SERIAL 0
#define BX_USE_SPECIFIED_TIME0 0
// This enables writing to port 0xe9 and the output
// is sent to the console. Reading from port 0xe9
// will return 0xe9 to let you know this is available.

33
bochs/configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Id: configure.in,v 1.294 2005/07/30 15:02:40 vruppert Exp .
# From configure.in Id: configure.in,v 1.295 2005/09/10 16:40:14 vruppert Exp .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
#
@ -1069,7 +1069,7 @@ Optional Features:
--enable-instrumentation compile in support for instrumentation
--enable-simid=0 or 1 CPU simulator ID if using more than one
--enable-num-sim=1 or 2 number of CPU simulators
--enable-time0=n start at n instead of using time()
--enable-time0=n start at n (obsolete)
--enable-raw-serial use raw serial port access
--enable-vbe use VESA BIOS extensions
--enable-clgd54xx enable CLGD54XX emulation
@ -35713,32 +35713,21 @@ _ACEOF
fi;
echo "$as_me:$LINENO: checking for specified CMOS start time" >&5
echo $ECHO_N "checking for specified CMOS start time... $ECHO_C" >&6
# Check whether --enable-time0 or --disable-time0 was given.
if test "${enable_time0+set}" = set; then
enableval="$enable_time0"
if test "$enableval" = yes; then
cat >>confdefs.h <<\_ACEOF
#define BX_USE_SPECIFIED_TIME0 917385580
_ACEOF
echo "$as_me:$LINENO: result: $enableval" >&5
echo "${ECHO_T}$enableval" >&6
{ { echo "$as_me:$LINENO: error: obsolete option - use runtime option 'clock' instead" >&5
echo "$as_me: error: obsolete option - use runtime option 'clock' instead" >&2;}
{ (exit 1); exit 1; }; }
elif test "$enableval" = no; then
cat >>confdefs.h <<\_ACEOF
#define BX_USE_SPECIFIED_TIME0 0
_ACEOF
else
cat >>confdefs.h <<_ACEOF
#define BX_USE_SPECIFIED_TIME0 $enableval
_ACEOF
fi
else
cat >>confdefs.h <<\_ACEOF
#define BX_USE_SPECIFIED_TIME0 0
_ACEOF
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi;

View File

@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(bochs.h)
AC_REVISION([[$Id: configure.in,v 1.294 2005-07-30 15:02:40 vruppert Exp $]])
AC_REVISION([[$Id: configure.in,v 1.295 2005-09-10 16:40:14 vruppert Exp $]])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(ltdlconf.h)
@ -1458,19 +1458,15 @@ AC_ARG_ENABLE(num-sim,
]
)
AC_MSG_CHECKING(for specified CMOS start time)
AC_ARG_ENABLE(time0,
[ --enable-time0=n start at n instead of using time()],
[if test "$enableval" = yes; then
AC_DEFINE(BX_USE_SPECIFIED_TIME0, 917385580)
elif test "$enableval" = no; then
AC_DEFINE(BX_USE_SPECIFIED_TIME0, 0)
else
AC_DEFINE_UNQUOTED(BX_USE_SPECIFIED_TIME0, $enableval)
fi],
[ --enable-time0=n start at n (obsolete)],
[AC_MSG_RESULT($enableval)
AC_MSG_ERROR([obsolete option - use runtime option 'clock' instead])
],
[
AC_DEFINE(BX_USE_SPECIFIED_TIME0, 0)
]
)
AC_MSG_RESULT(no)
])
dnl // serial mode 'socket' needs wsock32.dll in non-plugin mode
if test "$bx_plugins" = 0; then

View File

@ -1,7 +1,7 @@
<!--
================================================================
doc/docbook/user/user.dbk
$Id: user.dbk,v 1.180 2005-09-02 15:38:46 vruppert Exp $
$Id: user.dbk,v 1.181 2005-09-10 16:40:14 vruppert Exp $
This is the top level file for the Bochs Users Manual.
================================================================
@ -2388,22 +2388,6 @@ turn it off.
cosimulation described above.
</entry>
</row>
<row>
<entry>--enable-time0=n</entry>
<entry>no</entry>
<entry>
Start CMOS clock at at time0 of <replaceable>n</replaceable> instead of using time(). You likely
don't want this option. When debugging, it is very helpful to have
deterministic execution, and the clock is something that can skew
determinism. If you supply this option, pass it a value returned by the
time(NULL) call, relating to the time you want bochs to start the CMOS
clock from. For instance, '--enable-time0=917385580'. If you use this
option but don't provide a value, configure uses a default value. Note
that the <link linkend="bochsopt-time0">time0 option</link> in <filename>bochsrc</filename> will override this value. Without this
option, the CMOS clock uses a time0 based on the value of time(NULL),
which is probably what you want.
</entry>
</row>
<row>
<entry>--enable-xpm</entry>
<entry>yes</entry>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cmos.cc,v 1.46 2005-09-10 13:22:51 vruppert Exp $
// $Id: cmos.cc,v 1.47 2005-09-10 16:40:14 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -118,7 +118,7 @@ bx_cmos_c::~bx_cmos_c(void)
void
bx_cmos_c::init(void)
{
BX_DEBUG(("Init $Id: cmos.cc,v 1.46 2005-09-10 13:22:51 vruppert Exp $"));
BX_DEBUG(("Init $Id: cmos.cc,v 1.47 2005-09-10 16:40:14 vruppert Exp $"));
// CMOS RAM & RTC
DEV_register_ioread_handler(this, read_handler, 0x0070, "CMOS RAM", 1);
@ -142,50 +142,37 @@ bx_cmos_c::init(void)
244, 0, 0, "cmos"); // one-shot, not-active
}
#if BX_USE_SPECIFIED_TIME0 != 0
// ??? this will not be correct for using an image file.
// perhaps take values in CMOS and work backwards to find
// s.timeval from values read in.
BX_CMOS_THIS s.timeval = BX_USE_SPECIFIED_TIME0;
#else // BX_USE_SPECIFIED_TIME0 != 0
// localtime
if (bx_options.clock.Otime0->get () == BX_CLOCK_TIME0_LOCAL) {
BX_INFO(("Using local time for initial clock"));
BX_CMOS_THIS s.timeval = time(NULL);
}
// utc
else if (bx_options.clock.Otime0->get () == BX_CLOCK_TIME0_UTC) {
bx_bool utc_ok = 0;
BX_INFO(("Using local time for initial clock"));
BX_CMOS_THIS s.timeval = time(NULL);
} else if (bx_options.clock.Otime0->get () == BX_CLOCK_TIME0_UTC) {
bx_bool utc_ok = 0;
BX_INFO(("Using utc time for initial clock"));
BX_CMOS_THIS s.timeval = time(NULL);
BX_INFO(("Using utc time for initial clock"));
BX_CMOS_THIS s.timeval = time(NULL);
#if BX_HAVE_GMTIME
#if BX_HAVE_MKTIME
struct tm *utc_holder = gmtime(&BX_CMOS_THIS s.timeval);
utc_holder->tm_isdst = -1;
utc_ok = 1;
BX_CMOS_THIS s.timeval = mktime(utc_holder);
struct tm *utc_holder = gmtime(&BX_CMOS_THIS s.timeval);
utc_holder->tm_isdst = -1;
utc_ok = 1;
BX_CMOS_THIS s.timeval = mktime(utc_holder);
#elif BX_HAVE_TIMELOCAL
struct tm *utc_holder = gmtime(&BX_CMOS_THIS s.timeval);
utc_holder->tm_isdst = 0; // XXX Is this correct???
utc_ok = 1;
BX_CMOS_THIS s.timeval = timelocal(utc_holder);
struct tm *utc_holder = gmtime(&BX_CMOS_THIS s.timeval);
utc_holder->tm_isdst = 0; // XXX Is this correct???
utc_ok = 1;
BX_CMOS_THIS s.timeval = timelocal(utc_holder);
#endif //BX_HAVE_MKTIME
#endif //BX_HAVE_GMTIME
if (!utc_ok) {
BX_ERROR(("UTC time is not supported on your platform. Using current time(NULL)"));
}
if (!utc_ok) {
BX_ERROR(("UTC time is not supported on your platform. Using current time(NULL)"));
}
} else {
BX_INFO(("Using specified time for initial clock"));
BX_CMOS_THIS s.timeval = bx_options.clock.Otime0->get ();
}
else {
BX_INFO(("Using specified time for initial clock"));
BX_CMOS_THIS s.timeval = bx_options.clock.Otime0->get ();
}
#endif // BX_USE_SPECIFIED_TIME0 != 0
char *tmptime;
while( (tmptime = strdup(ctime(&(BX_CMOS_THIS s.timeval)))) == NULL) {
@ -212,20 +199,20 @@ bx_cmos_c::init(void)
);
if (fd < 0) {
BX_PANIC(("trying to open cmos image file '%s'",
bx_options.cmos.Opath->getptr ()));
}
bx_options.cmos.Opath->getptr ()));
}
ret = fstat(fd, &stat_buf);
if (ret) {
BX_PANIC(("CMOS: could not fstat() image file."));
}
}
if (stat_buf.st_size != BX_NUM_CMOS_REGS) {
BX_PANIC(("CMOS: image file not same size as BX_NUM_CMOS_REGS."));
}
}
ret = ::read(fd, (bx_ptr_t) BX_CMOS_THIS s.reg, BX_NUM_CMOS_REGS);
if (ret != BX_NUM_CMOS_REGS) {
BX_PANIC(("CMOS: error reading cmos file."));
}
}
close(fd);
BX_INFO(("successfuly read from image file '%s'.",
bx_options.cmos.Opath->getptr ()));
@ -265,29 +252,29 @@ bx_cmos_c::reset(unsigned type)
void
bx_cmos_c::CRA_change(void)
{
unsigned nibble;
Bit8u nibble, dcc;
// Periodic Interrupt timer
nibble = BX_CMOS_THIS s.reg[REG_STAT_A] & 0x0f;
if (nibble == 0) {
dcc = (BX_CMOS_THIS s.reg[REG_STAT_A] >> 4) & 0x07;
if ((nibble == 0) || ((dcc & 0x06) == 0)) {
// No Periodic Interrupt Rate when 0, deactivate timer
bx_pc_system.deactivate_timer(BX_CMOS_THIS s.periodic_timer_index);
BX_CMOS_THIS s.periodic_interval_usec = (Bit32u) -1; // max value
}
else {
} else {
// values 0001b and 0010b are the same as 1000b and 1001b
if (nibble <= 2)
nibble += 7;
BX_CMOS_THIS s.periodic_interval_usec = (unsigned) (1000000.0L /
(32768.0L / (1 << (nibble - 1))));
(32768.0L / (1 << (nibble - 1))));
// if Periodic Interrupt Enable bit set, activate timer
if ( BX_CMOS_THIS s.reg[REG_STAT_B] & 0x40 )
if (BX_CMOS_THIS s.reg[REG_STAT_B] & 0x40)
bx_pc_system.activate_timer(BX_CMOS_THIS s.periodic_timer_index,
BX_CMOS_THIS s.periodic_interval_usec, 1);
BX_CMOS_THIS s.periodic_interval_usec, 1);
else
bx_pc_system.deactivate_timer(BX_CMOS_THIS s.periodic_timer_index);
}
}
}
@ -448,7 +435,7 @@ bx_cmos_c::write(Bit32u address, Bit32u value, unsigned io_len)
dcc = (value >> 4) & 0x07;
if ((dcc & 0x06) == 0x06) {
BX_INFO(("CRA: divider chain RESET"));
} else if (dcc != 0x02) {
} else if (dcc > 0x02) {
BX_PANIC(("CRA: divider chain control 0x%02x", dcc));
}
BX_CMOS_THIS s.reg[REG_STAT_A] &= 0x80;