Added ability to switch off bochs loging (BX_DEBUG/INFO/ERROR)

This commit is contained in:
Stanislav Shwartsman 2007-10-30 18:57:46 +00:00
parent 754e43baed
commit afdcadad73
4 changed files with 93 additions and 45 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: bochs.h,v 1.212 2007-10-24 23:27:24 sshwarts Exp $
// $Id: bochs.h,v 1.213 2007-10-30 18:57:45 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -373,22 +373,20 @@ typedef class BOCHSAPI iofunctions iofunc_t;
((io==NULL)? (io=new iofunc_t("/dev/stderr")) : io)
#define SAFE_GET_GENLOG() \
((genlog==NULL)? (genlog=new logfunc_t(SAFE_GET_IOFUNC())) : genlog)
/* #define NO_LOGGING */
#ifndef NO_LOGGING
#define BX_INFO(x) (LOG_THIS info) x
#define BX_DEBUG(x) (LOG_THIS ldebug) x
#define BX_ERROR(x) (LOG_THIS error) x
#if BX_NO_LOGGING
#define BX_INFO(x) ;
#define BX_DEBUG(x) ;
#define BX_ERROR(x) ;
#define BX_PANIC(x) (LOG_THIS panic) x
#define BX_PASS(x) (LOG_THIS pass) x
#else
#define EMPTY do { } while(0)
#define BX_INFO(x) EMPTY
#define BX_DEBUG(x) EMPTY
#define BX_ERROR(x) EMPTY
#define BX_INFO(x) (LOG_THIS info) x
#define BX_DEBUG(x) (LOG_THIS ldebug) x
#define BX_ERROR(x) (LOG_THIS error) x
#define BX_PANIC(x) (LOG_THIS panic) x
#define BX_PASS(x) (LOG_THIS pass) x

View File

@ -150,14 +150,12 @@
#define BX_DMA_FLOPPY_IO 1
// Default number of Megs of memory to emulate. The
// 'megs:' directive in the '.bochsrc' file overrides this,
// allowing per-run settings.
#define BX_DEFAULT_MEM_MEGS 32
// CPU level emulation. Default level is set in
// the configure script. BX_CPU_LEVEL defines the CPU level
// to emulate. BX_CPU_LEVEL_HACKED is a hack to define the
@ -214,7 +212,7 @@
// SMP mode is enabled, it will be turned off by configure.
#define BX_USE_CPU_SMF 1
#define BX_USE_MEM_SMF 0
#define BX_USE_MEM_SMF 1
// Use static member functions in IO DEVice emulation modules.
// For efficiency, use C like functions for IO handling,
@ -663,7 +661,7 @@ typedef
#define BX_DISASM 0
#if (BX_DEBUGGER == 1) && (BX_DISASM == 0)
#error "Dissembler is required for BX_DEBUGGER !"
#error Dissembler is required for BX_DEBUGGER !
#endif
#define BX_PROVIDE_CPU_MEMORY 1
@ -673,6 +671,9 @@ typedef
#define BX_INSTRUMENTATION 0
// enable BX_DEBUG/BX_ERROR/BX_INFO messages
#define BX_NO_LOGGING 0
// limited i440FX PCI support
#define BX_SUPPORT_PCI 0

91
bochs/configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Id: configure.in,v 1.347 2007/10/11 21:28:57 sshwarts Exp .
# From configure.in Id: configure.in,v 1.348 2007/10/21 22:07:31 sshwarts Exp .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.60.
#
@ -1569,6 +1569,7 @@ Optional Features:
--enable-all-optimizations compile in all possible optimizations
--enable-readline use readline library, if available
--enable-instrumentation compile in support for instrumentation
--enable-logging enable logging
--enable-raw-serial use raw serial port access
--enable-vbe use VESA BIOS extensions
--enable-clgd54xx enable CLGD54XX emulation
@ -4503,7 +4504,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 4506 "configure"' > conftest.$ac_ext
echo '#line 4507 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -6869,11 +6870,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6872: $lt_compile\"" >&5)
(eval echo "\"\$as_me:6873: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:6876: \$? = $ac_status" >&5
echo "$as_me:6877: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -7102,11 +7103,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7105: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7106: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7109: \$? = $ac_status" >&5
echo "$as_me:7110: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -7169,11 +7170,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7172: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7173: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7176: \$? = $ac_status" >&5
echo "$as_me:7177: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -9442,7 +9443,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9445 "configure"
#line 9446 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -9540,7 +9541,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9543 "configure"
#line 9544 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11747,11 +11748,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11750: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11751: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:11754: \$? = $ac_status" >&5
echo "$as_me:11755: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -11814,11 +11815,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11817: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11818: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:11821: \$? = $ac_status" >&5
echo "$as_me:11822: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -13236,7 +13237,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 13239 "configure"
#line 13240 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -13334,7 +13335,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 13337 "configure"
#line 13338 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -14157,11 +14158,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:14160: $lt_compile\"" >&5)
(eval echo "\"\$as_me:14161: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:14164: \$? = $ac_status" >&5
echo "$as_me:14165: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -14224,11 +14225,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:14227: $lt_compile\"" >&5)
(eval echo "\"\$as_me:14228: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:14231: \$? = $ac_status" >&5
echo "$as_me:14232: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -16267,11 +16268,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16270: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16271: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:16274: \$? = $ac_status" >&5
echo "$as_me:16275: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -16500,11 +16501,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16503: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16504: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:16507: \$? = $ac_status" >&5
echo "$as_me:16508: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -16567,11 +16568,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16570: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16571: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:16574: \$? = $ac_status" >&5
echo "$as_me:16575: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -18840,7 +18841,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 18843 "configure"
#line 18844 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -18938,7 +18939,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 18941 "configure"
#line 18942 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -21319,7 +21320,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 21322 "configure"
#line 21323 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -38798,6 +38799,38 @@ if test "$bx_plugins" = 0; then
esac
fi
{ echo "$as_me:$LINENO: checking enable logging" >&5
echo $ECHO_N "checking enable logging... $ECHO_C" >&6; }
# Check whether --enable-logging was given.
if test "${enable_logging+set}" = set; then
enableval=$enable_logging; if test "$enableval" = yes; then
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
cat >>confdefs.h <<\_ACEOF
#define BX_NO_LOGGING 0
_ACEOF
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
cat >>confdefs.h <<\_ACEOF
#define BX_NO_LOGGING 1
_ACEOF
fi
else
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
cat >>confdefs.h <<\_ACEOF
#define BX_NO_LOGGING 0
_ACEOF
fi
{ echo "$as_me:$LINENO: checking for raw serial support" >&5
echo $ECHO_N "checking for raw serial support... $ECHO_C" >&6; }
# Check whether --enable-raw-serial was given.

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.348 2007-10-21 22:07:31 sshwarts Exp $]])
AC_REVISION([[$Id: configure.in,v 1.349 2007-10-30 18:57:46 sshwarts Exp $]])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(ltdlconf.h)
@ -1409,6 +1409,22 @@ if test "$bx_plugins" = 0; then
esac
fi
AC_MSG_CHECKING(enable logging)
AC_ARG_ENABLE(logging,
[ --enable-logging enable logging],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_NO_LOGGING, 0)
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_NO_LOGGING, 1)
fi],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_NO_LOGGING, 0)
]
)
AC_MSG_CHECKING(for raw serial support)
AC_ARG_ENABLE(raw-serial,
[ --enable-raw-serial use raw serial port access],