1 // Copyright (C) 2001 MandrakeSoft S.A.
5 // 75002 Paris - France
6 // http://www.linux-mandrake.com/
7 // http://www.mandrakesoft.com/
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2 of the License, or (at your option) any later version.
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 // config.h.in is distributed in the source TAR file. When you run
25 // the configure script, it generates config.h with some changes
26 // according to your build environment. For example, in config.h.in,
27 // SIZEOF_UNSIGNED_CHAR is set to 0. When configure produces config.h
28 // it will change "0" to the detected value for your system.
30 // config.h contains ONLY preprocessor #defines and a few typedefs.
31 // It must be included by both C and C++ files, so it must not
32 // contain anything language dependent such as a class declaration.
36 #define _BX_CONFIG_H_ 1
38 ///////////////////////////////////////////////////////////////////
39 // USER CONFIGURABLE OPTIONS : EDIT ONLY OPTIONS IN THIS SECTION //
40 ///////////////////////////////////////////////////////////////////
44 // quit_sim is defined in gui/siminterface.h
45 #define BX_EXIT(x) SIM->quit_sim (x)
47 // provide the real main and the usual exit.
48 #define BX_EXIT(x) ::exit(x)
51 // We have tested the following combinations:
52 // * processors=1, bootstrap=0, ioapic_id=1 (uniprocessor system)
53 // * processors=2, bootstrap=0, ioapic_id=2
54 // * processors=4, bootstrap=0, ioapic_id=4
55 #define BX_SUPPORT_SMP 0
56 #define BX_BOOTSTRAP_PROCESSOR 0
57 #define BX_MAX_SMP_THREADS_SUPPORTED 8
59 // include in APIC models, required for a multiprocessor system.
60 #define BX_SUPPORT_APIC 0
62 #if (BX_SUPPORT_SMP && !BX_SUPPORT_APIC)
63 #error For multiprocessor simulation, BX_SUPPORT_APIC is required.
66 // if simulating Linux, this provides a few more debugging options
67 // such as tracing all system calls.
68 #define BX_DEBUG_LINUX 0
70 // adds support for the GNU readline library in the debugger command
72 #define HAVE_LIBREADLINE 0
73 #define HAVE_READLINE_HISTORY_H 0
75 // Define to 1 if you have <locale.h>
76 #define HAVE_LOCALE_H 0
78 // I rebuilt the code which provides timers to IO devices.
79 // Setting this to 1 will introduce a little code which
80 // will panic out if cases which shouldn't happen occur.
81 // Set this to 0 for optimal performance.
82 #define BX_TIMER_DEBUG 0
84 // Settable A20 line. For efficiency, you can disable
85 // having a settable A20 line, eliminating conditional
86 // code for every physical memory access. You'll have
87 // to tell your software not to mess with the A20 line,
88 // and accept it as always being on if you change this.
89 // 1 = use settable A20 line. (normal)
90 // 0 = A20 is like the rest of the address lines
92 #define BX_SUPPORT_A20 1
94 // Processor Instructions Per Second
95 // To find out what value to use for the 'ips' directive
96 // in your '.bochsrc' file, set BX_SHOW_IPS to 1, and
97 // run the software in bochs you plan to use most. Bochs
98 // will print out periodic IPS ratings. This will change
99 // based on the processor mode at the time, and various
100 // other factors. You'll get a reasonable estimate though.
101 // When you're done, reset BX_SHOW_IPS to 0, do a
102 // 'make all-clean', then 'make' again.
104 #define BX_SHOW_IPS 0
107 #if (BX_SHOW_IPS) && (defined(__MINGW32__) || defined(_MSC_VER))
111 // Compile in support for DMA & FLOPPY IO. You'll need this
112 // if you plan to use the floppy drive emulation. But if
113 // you're environment doesn't require it, you can change
116 #define BX_DMA_FLOPPY_IO 1
118 // Default number of Megs of memory to emulate. The
119 // 'megs:' directive in the '.bochsrc' file overrides this,
120 // allowing per-run settings.
122 #define BX_DEFAULT_MEM_MEGS 32
124 // CPU level emulation. Default level is set in
125 // the configure script. BX_CPU_LEVEL defines the CPU level
126 // to emulate. BX_CPU_LEVEL_HACKED is a hack to define the
127 // level of some instructions, so they can be tested before
128 // the rest of the emulation is up to that level.
130 #define BX_CPU_LEVEL 0
131 #define BX_CPU_LEVEL_HACKED 0
133 // emulate x86-64 instruction set?
134 #define BX_SUPPORT_X86_64 0
136 // emulate long physical address (>32 bit)
137 #define BX_PHY_ADDRESS_LONG 0
139 #define BX_HAVE_SLEEP 0
140 #define BX_HAVE_MSLEEP 0
141 #define BX_HAVE_USLEEP 0
142 #define BX_HAVE_NANOSLEEP 0
143 #define BX_HAVE_ABORT 0
144 #define BX_HAVE_SOCKLEN_T 0
145 #define BX_HAVE_SOCKADDR_IN_SIN_LEN 0
146 #define BX_HAVE_GETTIMEOFDAY 0
148 #define BX_HAVE_REALTIME_USEC 1
150 #define BX_HAVE_REALTIME_USEC (BX_HAVE_GETTIMEOFDAY)
152 #define BX_HAVE_MKSTEMP 0
153 #define BX_HAVE_SYS_MMAN_H 0
154 #define BX_HAVE_XPM_H 0
155 #define BX_HAVE_TIMELOCAL 0
156 #define BX_HAVE_GMTIME 0
157 #define BX_HAVE_MKTIME 0
158 #define BX_HAVE_NET_IF_H 0
160 // This turns on Roland Mainz's idle hack. Presently it is specific to the X11
161 // and term gui. If people try to enable it elsewhere, give a compile error
162 // after the gui definition so that they don't waste their time trying.
163 #define BX_USE_IDLE_HACK 0
165 // Minimum Emulated IPS.
166 // This is used in the realtime PIT as well as for checking the
167 // IPS value set in the config file.
168 #define BX_MIN_IPS 200000
170 // Minimum and maximum values for SMP quantum variable. Defines
171 // how many instructions each CPU could execute execute in one
172 // shot (one cpu_loop call)
173 #define BX_SMP_QUANTUM_MIN 1
174 #define BX_SMP_QUANTUM_MAX 16
176 // Use Static Member Funtions to eliminate 'this' pointer passing
177 // If you want the efficiency of 'C', you can make all the
178 // members of the C++ CPU class to be static.
179 // This defaults to 1 since it should improve performance, but when
180 // SMP mode is enabled, it will be turned off by configure.
181 #define BX_USE_CPU_SMF 1
183 #define BX_USE_MEM_SMF 1
185 // Use static member functions in IO DEVice emulation modules.
186 // For efficiency, use C like functions for IO handling,
187 // and declare a device instance at compile time,
188 // instead of using 'new' and storing the pointer. This
189 // eliminates some overhead, especially for high-use IO
190 // devices like the disk drive.
191 // 1 = Use static member efficiency (normal)
192 // 0 = Use nonstatic member functions (use only if you need
193 // multiple instances of a device class
195 #define BX_USE_HD_SMF 1 // Hard drive
196 #define BX_USE_BIOS_SMF 1 // BIOS
197 #define BX_USE_CMOS_SMF 1 // CMOS
198 #define BX_USE_DMA_SMF 1 // DMA
199 #define BX_USE_FD_SMF 1 // Floppy
200 #define BX_USE_KEY_SMF 1 // Keyboard
201 #define BX_USE_PAR_SMF 1 // Parallel
202 #define BX_USE_PIC_SMF 1 // PIC
203 #define BX_USE_PIT_SMF 1 // PIT
204 #define BX_USE_SER_SMF 1 // Serial
205 #define BX_USE_UM_SMF 1 // Unmapped
206 #define BX_USE_VGA_SMF 1 // VGA
207 #define BX_USE_SB16_SMF 1 // Sound (SB 16)
208 #define BX_USE_DEV_SMF 1 // System Devices (port92)
209 #define BX_USE_PCI_SMF 1 // PCI
210 #define BX_USE_P2I_SMF 1 // PCI-to-ISA bridge
211 #define BX_USE_PIDE_SMF 1 // PCI-IDE
212 #define BX_USE_PCIVGA_SMF 1 // PCI-VGA
213 #define BX_USE_PCIDEV_SMF 1 // PCI-DEV
214 #define BX_USE_PCIUSB_SMF 1 // USB hub
215 #define BX_USE_PCIPNIC_SMF 1 // PCI pseudo NIC
216 #define BX_USE_NE2K_SMF 1 // NE2K
217 #define BX_USE_EFI_SMF 1 // External FPU IRQ
218 #define BX_USE_GAMEPORT_SMF 1 // Gameport
219 #define BX_USE_CIRRUS_SMF 1 // SVGA Cirrus
220 #define BX_USE_BUSM_SMF 1 // Bus Mouse
221 #define BX_USE_ACPI_SMF 1 // ACPI
224 #define BX_HAVE_DLFCN_H 0
227 ( !BX_USE_HD_SMF || !BX_USE_BIOS_SMF || !BX_USE_CMOS_SMF \
228 || !BX_USE_DMA_SMF || !BX_USE_FD_SMF || !BX_USE_KEY_SMF \
229 || !BX_USE_PAR_SMF || !BX_USE_PIC_SMF || !BX_USE_PIT_SMF \
230 || !BX_USE_SER_SMF || !BX_USE_UM_SMF || !BX_USE_VGA_SMF \
231 || !BX_USE_SB16_SMF || !BX_USE_DEV_SMF || !BX_USE_PCI_SMF \
232 || !BX_USE_P2I_SMF || !BX_USE_PCIVGA_SMF || !BX_USE_PCIUSB_SMF \
233 || !BX_USE_PCIPNIC_SMF || !BX_USE_PIDE_SMF || !BX_USE_ACPI_SMF \
234 || !BX_USE_NE2K_SMF || !BX_USE_EFI_SMF || !BX_USE_GAMEPORT_SMF \
235 || !BX_USE_PCIDEV_SMF || !BX_USE_CIRRUS_SMF)
236 #error You must use SMF to have plugins
239 #define BX_SUPPORT_SB16 0
240 #define BX_SUPPORT_GAMEPORT 0
243 // Use virtual methods for the sound output functions
244 #define BX_USE_SOUND_VIRTUAL 1
245 // Determines which sound output class is to be used.
246 // Currently the following are available:
247 // bx_sound_linux_c Output for Linux, to /dev/dsp and /dev/midi00
248 // bx_sound_windows_c Output for Windows midi and wave mappers
249 // bx_sound_output_c Dummy functions, no output
250 #define BX_SOUND_OUTPUT_C bx_sound_output_c
251 // Use ALSA sound interface on Linux
252 #define BX_HAVE_ALSASOUND 0
255 #define USE_RAW_SERIAL 0
257 // This enables writing to port 0xe9 and the output
258 // is sent to the console. Reading from port 0xe9
259 // will return 0xe9 to let you know this is available.
260 // Leave this 0 unless you have a reason to use it.
261 #define BX_PORT_E9_HACK 0
265 // This option enables compressed (zlib) hd support
266 #define BX_COMPRESSED_HD_SUPPORT 0
267 #define BX_HAVE_ZLIB 0
269 #if BX_COMPRESSED_HD_SUPPORT && !BX_HAVE_ZLIB
270 #error You must have zlib to enable compressed hd support
273 // This option defines the number of supported ATA channels.
274 // There are up to two drives per ATA channel.
275 #define BX_MAX_ATA_CHANNEL 4
277 #if (BX_MAX_ATA_CHANNEL>4 || BX_MAX_ATA_CHANNEL<1)
278 # error "BX_MAX_ATA_CHANNEL should be between 1 and 4"
281 // =================================================================
282 // BEGIN: OPTIONAL DEBUGGER SECTION
284 // These options are only used if you compile in support for the
285 // native command line debugging environment. Typically, the debugger
286 // is not used, and this section can be ignored.
287 // =================================================================
289 // Compile in support for virtual/linear/physical breakpoints.
290 // Enable only those you need. Recommend using only linear
291 // breakpoints, unless you need others. Less supported means
292 // slightly faster execution time.
293 #define BX_DBG_MAX_VIR_BPOINTS 10
294 #define BX_DBG_MAX_LIN_BPOINTS 10
295 #define BX_DBG_MAX_PHY_BPOINTS 10
297 // max file pathname size for debugger commands
298 #define BX_MAX_PATH 256
299 // max nesting level for debug scripts including other scripts
300 #define BX_INFILE_DEPTH 10
301 // use this command to include (nest) debug scripts
302 #define BX_INCLUDE_CMD "source"
304 // Make a call to command line debugger extensions. If set to 1,
305 // a call is made. An external routine has a chance to process
306 // the command. If it does, than the debugger ignores the command.
307 #define BX_DBG_EXTENSIONS 0
309 // =================================================================
310 // END: OPTIONAL DEBUGGER SECTION
311 // =================================================================
313 //////////////////////////////////////////////////////////////////////
314 // END OF USER CONFIGURABLE OPTIONS : DON'T EDIT ANYTHING BELOW !!! //
315 // THIS IS GENERATED BY THE ./configure SCRIPT //
316 //////////////////////////////////////////////////////////////////////
319 #define BX_WITH_X11 0
320 #define BX_WITH_BEOS 0
321 #define BX_WITH_WIN32 0
322 #define BX_WITH_MACOS 0
323 #define BX_WITH_CARBON 0
324 #define BX_WITH_NOGUI 0
325 #define BX_WITH_TERM 0
326 #define BX_WITH_RFB 0
327 #define BX_WITH_AMIGAOS 0
328 #define BX_WITH_SDL 0
329 #define BX_WITH_SVGA 0
332 // BX_USE_TEXTCONFIG should be set to 1 unless Bochs is compiled
333 // for wxWidgets only.
334 #define BX_USE_TEXTCONFIG 1
336 // A certain functions must NOT be fastcall even if compiled with fastcall
337 // option, and those are callbacks from Windows which are defined either
338 // as cdecl or stdcall. The entry point main() also has to remain cdecl.
340 #if defined(_MSC_VER)
341 #define CDECL __cdecl
347 // add special export symbols for win32 DLL building. The main code must
348 // have __declspec(dllexport) on variables, functions, or classes that the
349 // plugins can access. The plugins should #define PLUGGABLE which will
350 // activate the __declspec(dllimport) instead.
351 #if defined(WIN32) || defined(__CYGWIN__)
352 # if BX_PLUGINS && defined(BX_PLUGGABLE)
353 // #warning I will import DLL symbols from Bochs main program.
354 # define BOCHSAPI __declspec(dllimport)
356 // #warning I will export DLL symbols.
357 # define BOCHSAPI __declspec(dllexport)
364 #if defined(__CYGWIN__)
365 // Make BOCHSAPI_CYGONLY exactly the same as BOCHSAPI. This symbol
366 // will be used for any cases where Cygwin requires a special tag
367 // but VC++ does not.
368 #define BOCHSAPI_CYGONLY BOCHSAPI
370 // define the symbol to be empty
371 #define BOCHSAPI_CYGONLY /*empty*/
374 #if defined(_MSC_VER)
375 // Make BOCHSAPI_MSVCONLY exactly the same as BOCHSAPI. This symbol
376 // will be used for any cases where VC++ requires a special tag
377 // but Cygwin does not.
378 #define BOCHSAPI_MSVCONLY BOCHSAPI
380 // define the symbol to be empty
381 #define BOCHSAPI_MSVCONLY /*empty*/
384 #define BX_DEFAULT_CONFIG_INTERFACE "defined_by_configure"
385 #define BX_DEFAULT_DISPLAY_LIBRARY "defined_by_configure"
387 // Roland Mainz's idle hack is presently specific to X11. If people try to
388 // enable it elsewhere, give a compile error so that they don't waste their
390 #if (BX_USE_IDLE_HACK && !BX_WITH_X11 && !BX_WITH_TERM)
391 # error IDLE_HACK will only work with the X11 or term gui. Correct configure args and retry.
394 #define WORDS_BIGENDIAN 0
396 #define SIZEOF_UNSIGNED_CHAR 0
397 #define SIZEOF_UNSIGNED_SHORT 0
398 #define SIZEOF_UNSIGNED_INT 0
399 #define SIZEOF_UNSIGNED_LONG 0
400 #define SIZEOF_UNSIGNED_LONG_LONG 0
401 #define SIZEOF_INT_P 0
403 #define BX_64BIT_CONSTANTS_USE_LL 1
404 #if BX_64BIT_CONSTANTS_USE_LL
405 // doesn't work on Microsoft Visual C++, maybe others
406 #define BX_CONST64(x) (x##LL)
407 #elif defined(_MSC_VER)
408 #define BX_CONST64(x) (x##I64)
410 #define BX_CONST64(x) (x)
414 typedef unsigned char Bit8u
;
415 typedef signed char Bit8s
;
416 typedef unsigned short Bit16u
;
417 typedef signed short Bit16s
;
418 typedef unsigned int Bit32u
;
419 typedef signed int Bit32s
;
421 typedef unsigned long long Bit64u
;
422 typedef signed long long Bit64s
;
423 #include <sys/types.h>
425 typedef unsigned __int64 Bit64u
;
426 typedef signed __int64 Bit64s
;
429 typedef unsigned char Bit8u
;
430 typedef signed char Bit8s
;
431 typedef unsigned short Bit16u
;
432 typedef signed short Bit16s
;
433 typedef unsigned int Bit32u
;
434 typedef signed int Bit32s
;
435 typedef unsigned long long Bit64u
;
436 typedef signed long long Bit64s
;
439 // Unix like platforms
441 #if SIZEOF_UNSIGNED_CHAR != 1
442 # error "sizeof (unsigned char) != 1"
444 typedef unsigned char Bit8u
;
445 typedef signed char Bit8s
;
448 #if SIZEOF_UNSIGNED_SHORT != 2
449 # error "sizeof (unsigned short) != 2"
451 typedef unsigned short Bit16u
;
452 typedef signed short Bit16s
;
455 #if SIZEOF_UNSIGNED_INT == 4
456 typedef unsigned int Bit32u
;
457 typedef signed int Bit32s
;
458 #elif SIZEOF_UNSIGNED_LONG == 4
459 typedef unsigned long Bit32u
;
460 typedef signed long Bit32s
;
462 # error "can't find sizeof(type) of 4 bytes!"
465 #if SIZEOF_UNSIGNED_LONG == 8
466 typedef unsigned long Bit64u
;
467 typedef signed long Bit64s
;
468 #elif SIZEOF_UNSIGNED_LONG_LONG == 8
469 typedef unsigned long long Bit64u
;
470 typedef signed long long Bit64s
;
472 # error "can't find data type of 8 bytes"
477 #define GET32L(val64) ((Bit32u)(((Bit64u)(val64)) & 0xFFFFFFFF))
478 #define GET32H(val64) ((Bit32u)(((Bit64u)(val64)) >> 32))
480 // now that Bit32u and Bit64u exist, defined bx_address
481 #if BX_SUPPORT_X86_64
482 typedef Bit64u bx_address
;
484 typedef Bit32u bx_address
;
487 // define physical and linear address types
488 typedef bx_address bx_lin_address
;
490 #if BX_SUPPORT_X86_64
491 #define BX_LIN_ADDRESS_WIDTH 48
493 #define BX_LIN_ADDRESS_WIDTH 32
496 #if BX_PHY_ADDRESS_LONG
497 typedef Bit64u bx_phy_address
;
498 #define BX_PHY_ADDRESS_WIDTH 40
500 typedef Bit32u bx_phy_address
;
501 #define BX_PHY_ADDRESS_WIDTH 32
504 // technically, in an 8 bit signed the real minimum is -128, not -127.
505 // But if you decide to negate -128 you tend to get -128 again, so it's
506 // better not to use the absolute maximum in the signed range.
507 #define BX_MAX_BIT64U ( (Bit64u) -1 )
508 #define BX_MIN_BIT64U ( 0 )
509 #define BX_MAX_BIT64S ( ((Bit64u) -1) >> 1 )
510 #define BX_MIN_BIT64S ( (Bit64s)-(((Bit64u) -1) >> 1) )
511 #define BX_MAX_BIT32U ( (Bit32u) -1 )
512 #define BX_MIN_BIT32U ( 0 )
513 #define BX_MAX_BIT32S ( ((Bit32u) -1) >> 1 )
514 #define BX_MIN_BIT32S ( (Bit32s)-(((Bit32u) -1) >> 1) )
515 #define BX_MAX_BIT16U ( (Bit16u) -1 )
516 #define BX_MIN_BIT16U ( 0 )
517 #define BX_MAX_BIT16S ( ((Bit16u) -1) >> 1 )
518 #define BX_MIN_BIT16S ( (Bit16s)-(((Bit16u) -1) >> 1) )
519 #define BX_MAX_BIT8U ( (Bit8u) -1 )
520 #define BX_MIN_BIT8U ( 0 )
521 #define BX_MAX_BIT8S ( ((Bit8u) -1) >> 1 )
522 #define BX_MIN_BIT8S ( (Bit8s)-(((Bit8u) -1) >> 1) )
525 // create an unsigned integer type that is the same size as a pointer.
526 // You can typecast a pointer to a bx_pr_equiv_t without losing any
527 // bits (and without getting the compiler excited). This is used in
528 // the FPU emulation code, where pointers and integers are often
529 // used interchangeably.
530 #if SIZEOF_INT_P == 4
531 typedef Bit32u bx_ptr_equiv_t
;
532 #elif SIZEOF_INT_P == 8
533 typedef Bit64u bx_ptr_equiv_t
;
535 # error "could not define bx_ptr_equiv_t to size of int*"
538 // Use a boolean type that will not conflict with the builtin type
540 typedef Bit32u bx_bool
;
543 # define bx_ptr_t char *
545 # define bx_ptr_t void *
549 # define BX_LITTLE_ENDIAN
551 # define BX_BIG_ENDIAN
554 # define BX_BIG_ENDIAN
556 # define BX_LITTLE_ENDIAN
558 #endif // defined(WIN32)
561 #if BX_SUPPORT_X86_64
562 #ifdef BX_LITTLE_ENDIAN
573 #else // must be Big Endian
585 #endif // #if BX_SUPPORT_X86_64
588 // for now only term.cc requires a GUI sighandler.
589 #define BX_GUI_SIGHANDLER (BX_WITH_TERM)
591 #define HAVE_SIGACTION 1
593 // configure will change the definition of "inline" to the value
594 // that the C compiler allows. It tests the following keywords to
595 // see if any is permitted: inline, __inline__, __inline. If none
596 // is permitted, it defines inline to be empty.
597 #define inline inline
599 // inline functions in headers that are compiled with C compiler
600 // (e.g. fpu code) are declared with BX_C_INLINE macro. Note that
601 // the word "inline" itself may now be redefined by the above #define.
602 // Many compilers are known to work with "static inline". If the
603 // compiler can put the function inline, it does so and never creates
604 // a symbol for the function. If optimization is off, or inline is
605 // defined to be empty, the static keyword causes the function to create
606 // a symbol that's visible only to that .c file. Each .c file that
607 // includes the header will produde another local version of the
608 // BX_C_INLINE function (not ideal). However without "static" you can
609 // duplicate symbol problems which are even worse.
610 #define BX_C_INLINE static inline
612 // Use BX_CPP_INLINE for all C++ inline functions. Note that the
613 // word "inline" itself may now be redefined by the above #define.
614 #define BX_CPP_INLINE inline
618 // Some helpful compiler hints for compilers that allow them; GCC for now.
621 // Align a construct on an n-byte boundary.
623 // BX_CPP_AttrPrintf(formatArg, firstArg):
624 // This function takes printf-like arguments, so the compiler can check
625 // the consistency of the format string and the matching arguments.
626 // 'formatArg' is the parameter number (starting from 1) of the format
627 // string argument. 'firstArg' is the parameter number of the 1st argument
628 // to check against the string argument. NOTE: For non-static member
629 // functions, the this-ptr is argument number 1 but is invisible on
630 // the function prototype declaration - but you still have to count it.
632 // BX_CPP_AttrNoReturn():
633 // This function never returns. The compiler can optimize-out following
636 #define BX_CPP_AlignN(n) __attribute__ ((aligned (n)))
637 #define BX_CPP_AttrPrintf(formatArg, firstArg) \
638 __attribute__ ((format (printf, formatArg, firstArg)))
639 #define BX_CPP_AttrNoReturn() __attribute__ ((noreturn))
643 #define BX_CPP_AlignN(n) /* Not supported. */
644 #define BX_CPP_AttrPrintf(formatArg, firstArg) /* Not supported. */
645 #define BX_CPP_AttrNoReturn() /* Not supported. */
649 #define BX_DEBUGGER 0
652 #if (BX_DEBUGGER == 1) && (BX_DISASM == 0)
653 #error Dissembler is required for BX_DEBUGGER !
656 #define BX_PROVIDE_CPU_MEMORY 1
657 #define BX_PROVIDE_DEVICE_MODELS 1
659 #define BX_PROVIDE_MAIN 1
661 #define BX_INSTRUMENTATION 0
663 // enable BX_DEBUG/BX_ERROR/BX_INFO messages
664 #define BX_NO_LOGGING 0
666 // enable BX_ASSERT checks
667 #define BX_ASSERT_ENABLE 0
669 // limited i440FX PCI support
670 #define BX_SUPPORT_PCI 0
672 // Bochs VBE display interface
673 #define BX_SUPPORT_VBE 0
675 // CLGD54XX emulation
676 #define BX_SUPPORT_CLGD54XX 0
679 #define BX_SUPPORT_ACPI 0
681 #if (BX_SUPPORT_ACPI && !BX_SUPPORT_PCI)
682 #error To enable ACPI support, you must also enable PCI
685 // Experimental VGA on PCI
686 #define BX_SUPPORT_PCIVGA 0
688 // Experimental host PCI device mapping
689 #define BX_SUPPORT_PCIDEV 0
691 #if (BX_SUPPORT_PCIDEV && !BX_SUPPORT_PCI)
692 #error To enable PCI host device mapping, you must also enable PCI
695 // limited USB on PCI
696 #define BX_SUPPORT_PCIUSB 0
698 #if (BX_SUPPORT_PCIUSB && !BX_SUPPORT_PCI)
699 #error To enable USB, you must also enable PCI
702 #define BX_SUPPORT_BUSMOUSE 0
704 #define BX_SUPPORT_ALIGNMENT_CHECK 0
705 #define BX_SUPPORT_FPU 0
706 #define BX_SUPPORT_MMX 0
707 #define BX_SUPPORT_3DNOW 0
708 #define BX_SUPPORT_SSE 0
709 #define BX_SUPPORT_SSE_EXTENSION 0
710 #define BX_SUPPORT_SSE4A 0
711 #define BX_SUPPORT_SSE5A 0
712 #define BX_SUPPORT_DAZ 0
713 #define BX_SUPPORT_MISALIGNED_SSE 0
714 #define BX_SUPPORT_SEP 0
715 #define BX_SUPPORT_VME 0
716 #define BX_SUPPORT_POPCNT 0
717 #define BX_SUPPORT_MONITOR_MWAIT 0
718 #define BX_SUPPORT_XSAVE 0
719 #define BX_SUPPORT_AES 0
721 #define BX_SUPPORT_MTRR 0
722 #define BX_SUPPORT_LARGE_PAGES 0
723 #define BX_SUPPORT_GLOBAL_PAGES 0
724 #define BX_SUPPORT_PAE 0
726 #define BX_SupportGuest2HostTLB 0
727 #define BX_SupportRepeatSpeedups 0
728 #define BX_SupportHostAsms 0
730 #define BX_SUPPORT_ICACHE 0
731 #define BX_SUPPORT_TRACE_CACHE 0
733 #if (BX_SUPPORT_TRACE_CACHE && BX_SUPPORT_ICACHE==0)
734 #error Trace cache optimization cannot be compiled without iCache!
737 // if 1, don't do gpf on MSRs that we don't implement
738 #define BX_IGNORE_BAD_MSR 0
740 // CLFLUSH was introduced together with SSE2 instruction set
741 #if BX_SUPPORT_SSE >= 2
742 #define BX_SUPPORT_CLFLUSH 1
744 #define BX_SUPPORT_CLFLUSH 0
747 #if (BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL < 4)
748 #error Alignment exception check is not supported in i386 !
751 #if (BX_SUPPORT_VME && BX_CPU_LEVEL < 5)
752 #error With CPU level < 5, you must disable v8086 mode extensions !
755 #if (BX_SUPPORT_MMX && BX_CPU_LEVEL < 5)
756 #error With CPU level < 5, you must disable MMX support !
759 #if (!BX_SUPPORT_FPU && BX_CPU_LEVEL > 4)
760 #error With CPU level > 4, you must enable FPU support !
763 #if (BX_SUPPORT_MMX && !BX_SUPPORT_FPU)
764 #error "MMX cannot be compiled without FPU support !"
767 #if (BX_SUPPORT_FPU && BX_CPU_LEVEL < 3)
768 #error "FPU cannot be compiled without cpu level >= 3 !"
771 #if (BX_SUPPORT_3DNOW && !BX_SUPPORT_MMX)
772 #error "3DNow! cannot be compiled without MMX support !"
775 #if (BX_SUPPORT_AES && !BX_SUPPORT_SSE)
776 #error "AES cannot be compiled without SSE support !"
779 #if (BX_SUPPORT_XSAVE && !BX_SUPPORT_SSE)
780 #error "XSAVE cannot be compiled without SSE support !"
783 #if (BX_SUPPORT_SSE && !BX_SUPPORT_MMX)
784 #error "SSE cannot be compiled without FPU+MMX support !"
787 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SSE)
788 #error "SSE is only supported with CPU_LEVEL >= 6 !"
791 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SEP)
792 #error "SYSENTER/SYSEXIT only supported with CPU_LEVEL >= 6 !"
795 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_PAE)
796 #error "Physical Address Extensions (PAE) only supported with CPU_LEVEL >= 6 !"
798 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_GLOBAL_PAGES)
799 #error "Page Global Extension (PGE) only supported with CPU_LEVEL >= 6 !"
801 #if (BX_CPU_LEVEL<5 && BX_SUPPORT_LARGE_PAGES)
802 #error "Page Size Extension (PSE) only supported with CPU_LEVEL >= 5 !"
804 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_MTRR)
805 #error "MTRRs only supported with CPU_LEVEL >= 6 !"
808 #if (BX_SUPPORT_PAE && !BX_SUPPORT_LARGE_PAGES)
809 #error "Physical Address Extensions (PAE) requires large pages support !"
812 #if BX_SUPPORT_X86_64
813 // Sanity checks to ensure that you cannot accidently use conflicting options.
816 #error "X86-64 requires cpu level 6 or greater !"
818 #if (BX_SUPPORT_SSE<2)
819 #error "X86-64 requires SSE2 !"
822 #error "X86-64 requires Physical Address Extensions (PAE) !"
824 #if !BX_SUPPORT_GLOBAL_PAGES
825 #error "X86-64 requires Page Global Extension (PGE) !"
827 #if !BX_SUPPORT_LARGE_PAGES
828 #error "X86-64 requires Page Size Extension (PSE) !"
832 #define BX_HAVE_GETENV 0
833 #define BX_HAVE_SETENV 0
834 #define BX_HAVE_SELECT 0
835 #define BX_HAVE_SNPRINTF 0
836 #define BX_HAVE_VSNPRINTF 0
837 #define BX_HAVE_STRTOULL 0
838 #define BX_HAVE_STRTOUQ 0
839 #define BX_HAVE_STRDUP 0
840 #define BX_HAVE_STRREV 0
841 #define BX_HAVE_STRUCT_TIMEVAL 0
844 #define BX_HAVE_COLOR_SET 0
845 #define BX_HAVE_MVHLINE 0
846 #define BX_HAVE_MVVLINE 0
849 // set if your compiler does not permit an empty struct
850 #define BX_NO_EMPTY_STRUCTS 0
852 // set if your compiler does not understand __attribute__ after a struct
853 #define BX_NO_ATTRIBUTES 0
855 #define GCC_ATTRIBUTE(x) /* attribute not supported */
857 #define GCC_ATTRIBUTE __attribute__
860 // set to use fast function calls
861 #define BX_FAST_FUNC_CALL 0
863 // On gcc2.95+ x86 only
864 #if BX_FAST_FUNC_CALL && defined(__i386__) && defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
865 #if BX_USE_CPU_SMF == 1
866 # define BX_CPP_AttrRegparmN(X) __attribute__((regparm(X)))
868 // FIXME: BX_FAST_FUNC_CALL doesn't work with BX_USE_CPU_SMF = 0
869 # define BX_CPP_AttrRegparmN(X) /* Not defined */
872 # define BX_CPP_AttrRegparmN(X) /* Not defined */
875 // set if your compiler does not allow label at the end of a {} block
876 #define BX_NO_BLANK_LABELS 0
878 // set if you do have <hash_map>, used in bx_debug/dbg_main.c
879 #define BX_HAVE_HASH_MAP 0
881 // set if you do have <hash_map.h>, used in bx_debug/dbg_main.c
882 #define BX_HAVE_HASH_MAP_H 0
884 // set if you do have <set>, used in bx_debug/dbg_main.c
885 #define BX_HAVE_SET 0
887 // set if you do have <set.h>, used in bx_debug/dbg_main.c
888 #define BX_HAVE_SET_H 0
890 // Support x86 hardware debugger registers and facilites.
891 // These are the debug facilites offered by the x86 architecture,
892 // not the optional built-in debugger.
893 #define BX_X86_DEBUGGER 0
895 #define BX_SUPPORT_CDROM 0
898 // This is the C++ class name to use if we are supporting
900 # define LOWLEVEL_CDROM cdrom_interface
903 // NE2K network emulation
904 #define BX_SUPPORT_NE2K 0
907 #define BX_SUPPORT_PCIPNIC 0
909 #if (BX_SUPPORT_PCIPNIC && !BX_SUPPORT_PCI)
910 #error To enable the PCI pseudo NIC, you must also enable PCI
913 // this enables the lowlevel stuff below if one of the NICs is present
914 #define BX_NETWORKING 0
916 #define BX_ETH_NULL_LOGGING 1
917 #define BX_ETH_FBSD_LOGGING 1
919 // determine which NE2K packet mover modules will be enabled
920 // (this was moved from iodev/eth.h)
922 #ifdef BX_USE_ETH_ARPBACK
923 # define ETH_ARPBACK 1
925 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__NetBSD_kernel__) || defined(__APPLE__)
935 // this enables Ethertap packet mover; determined by configure script
936 #define HAVE_ETHERTAP 0
938 // this enables TUN/TAP packet mover; determined by configure script
939 #define HAVE_TUNTAP 0
941 // this enables VDE packet mover; determined by configure script
945 // I/O Interface to debug
946 #define BX_SUPPORT_IODEBUG 0
949 #define BX_EXTERNAL_DEBUGGER 0
952 #define BX_FLOPPY0_NAME "Floppy Disk A:"
953 #define BX_FLOPPY1_NAME "Floppy Disk B:"
955 #define BX_FLOPPY0_NAME "Floppy Disk 0"
956 #define BX_FLOPPY1_NAME "Floppy Disk 1"
959 #endif // _BX_CONFIG_H