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 16
294 #define BX_DBG_MAX_LIN_BPOINTS 16
295 #define BX_DBG_MAX_PHY_BPOINTS 16
297 #define BX_DBG_MAX_WATCHPONTS 16
299 // max file pathname size for debugger commands
300 #define BX_MAX_PATH 256
301 // max nesting level for debug scripts including other scripts
302 #define BX_INFILE_DEPTH 10
303 // use this command to include (nest) debug scripts
304 #define BX_INCLUDE_CMD "source"
306 // Make a call to command line debugger extensions. If set to 1,
307 // a call is made. An external routine has a chance to process
308 // the command. If it does, than the debugger ignores the command.
309 #define BX_DBG_EXTENSIONS 0
311 // =================================================================
312 // END: OPTIONAL DEBUGGER SECTION
313 // =================================================================
315 //////////////////////////////////////////////////////////////////////
316 // END OF USER CONFIGURABLE OPTIONS : DON'T EDIT ANYTHING BELOW !!! //
317 // THIS IS GENERATED BY THE ./configure SCRIPT //
318 //////////////////////////////////////////////////////////////////////
321 #define BX_WITH_X11 0
322 #define BX_WITH_BEOS 0
323 #define BX_WITH_WIN32 0
324 #define BX_WITH_MACOS 0
325 #define BX_WITH_CARBON 0
326 #define BX_WITH_NOGUI 0
327 #define BX_WITH_TERM 0
328 #define BX_WITH_RFB 0
329 #define BX_WITH_AMIGAOS 0
330 #define BX_WITH_SDL 0
331 #define BX_WITH_SVGA 0
334 // BX_USE_TEXTCONFIG should be set to 1 unless Bochs is compiled
335 // for wxWidgets only.
336 #define BX_USE_TEXTCONFIG 1
338 // A certain functions must NOT be fastcall even if compiled with fastcall
339 // option, and those are callbacks from Windows which are defined either
340 // as cdecl or stdcall. The entry point main() also has to remain cdecl.
342 #if defined(_MSC_VER)
343 #define CDECL __cdecl
349 // add special export symbols for win32 DLL building. The main code must
350 // have __declspec(dllexport) on variables, functions, or classes that the
351 // plugins can access. The plugins should #define PLUGGABLE which will
352 // activate the __declspec(dllimport) instead.
353 #if defined(WIN32) || defined(__CYGWIN__)
354 # if BX_PLUGINS && defined(BX_PLUGGABLE)
355 // #warning I will import DLL symbols from Bochs main program.
356 # define BOCHSAPI __declspec(dllimport)
358 // #warning I will export DLL symbols.
359 # define BOCHSAPI __declspec(dllexport)
366 #if defined(__CYGWIN__)
367 // Make BOCHSAPI_CYGONLY exactly the same as BOCHSAPI. This symbol
368 // will be used for any cases where Cygwin requires a special tag
369 // but VC++ does not.
370 #define BOCHSAPI_CYGONLY BOCHSAPI
372 // define the symbol to be empty
373 #define BOCHSAPI_CYGONLY /*empty*/
376 #if defined(_MSC_VER)
377 // Make BOCHSAPI_MSVCONLY exactly the same as BOCHSAPI. This symbol
378 // will be used for any cases where VC++ requires a special tag
379 // but Cygwin does not.
380 #define BOCHSAPI_MSVCONLY BOCHSAPI
382 // define the symbol to be empty
383 #define BOCHSAPI_MSVCONLY /*empty*/
386 #define BX_DEFAULT_CONFIG_INTERFACE "defined_by_configure"
387 #define BX_DEFAULT_DISPLAY_LIBRARY "defined_by_configure"
389 // Roland Mainz's idle hack is presently specific to X11. If people try to
390 // enable it elsewhere, give a compile error so that they don't waste their
392 #if (BX_USE_IDLE_HACK && !BX_WITH_X11 && !BX_WITH_TERM)
393 # error IDLE_HACK will only work with the X11 or term gui. Correct configure args and retry.
396 #define WORDS_BIGENDIAN 0
398 #define SIZEOF_UNSIGNED_CHAR 0
399 #define SIZEOF_UNSIGNED_SHORT 0
400 #define SIZEOF_UNSIGNED_INT 0
401 #define SIZEOF_UNSIGNED_LONG 0
402 #define SIZEOF_UNSIGNED_LONG_LONG 0
403 #define SIZEOF_INT_P 0
405 #define BX_64BIT_CONSTANTS_USE_LL 1
406 #if BX_64BIT_CONSTANTS_USE_LL
407 // doesn't work on Microsoft Visual C++, maybe others
408 #define BX_CONST64(x) (x##LL)
409 #elif defined(_MSC_VER)
410 #define BX_CONST64(x) (x##I64)
412 #define BX_CONST64(x) (x)
416 typedef unsigned char Bit8u
;
417 typedef signed char Bit8s
;
418 typedef unsigned short Bit16u
;
419 typedef signed short Bit16s
;
420 typedef unsigned int Bit32u
;
421 typedef signed int Bit32s
;
423 typedef unsigned long long Bit64u
;
424 typedef signed long long Bit64s
;
425 #include <sys/types.h>
427 typedef unsigned __int64 Bit64u
;
428 typedef signed __int64 Bit64s
;
431 typedef unsigned char Bit8u
;
432 typedef signed char Bit8s
;
433 typedef unsigned short Bit16u
;
434 typedef signed short Bit16s
;
435 typedef unsigned int Bit32u
;
436 typedef signed int Bit32s
;
437 typedef unsigned long long Bit64u
;
438 typedef signed long long Bit64s
;
441 // Unix like platforms
443 #if SIZEOF_UNSIGNED_CHAR != 1
444 # error "sizeof (unsigned char) != 1"
446 typedef unsigned char Bit8u
;
447 typedef signed char Bit8s
;
450 #if SIZEOF_UNSIGNED_SHORT != 2
451 # error "sizeof (unsigned short) != 2"
453 typedef unsigned short Bit16u
;
454 typedef signed short Bit16s
;
457 #if SIZEOF_UNSIGNED_INT == 4
458 typedef unsigned int Bit32u
;
459 typedef signed int Bit32s
;
460 #elif SIZEOF_UNSIGNED_LONG == 4
461 typedef unsigned long Bit32u
;
462 typedef signed long Bit32s
;
464 # error "can't find sizeof(type) of 4 bytes!"
467 #if SIZEOF_UNSIGNED_LONG == 8
468 typedef unsigned long Bit64u
;
469 typedef signed long Bit64s
;
470 #elif SIZEOF_UNSIGNED_LONG_LONG == 8
471 typedef unsigned long long Bit64u
;
472 typedef signed long long Bit64s
;
474 # error "can't find data type of 8 bytes"
479 #define GET32L(val64) ((Bit32u)(((Bit64u)(val64)) & 0xFFFFFFFF))
480 #define GET32H(val64) ((Bit32u)(((Bit64u)(val64)) >> 32))
482 // now that Bit32u and Bit64u exist, defined bx_address
483 #if BX_SUPPORT_X86_64
484 typedef Bit64u bx_address
;
486 typedef Bit32u bx_address
;
489 // define physical and linear address types
490 typedef bx_address bx_lin_address
;
492 #if BX_SUPPORT_X86_64
493 #define BX_LIN_ADDRESS_WIDTH 48
495 #define BX_LIN_ADDRESS_WIDTH 32
498 #if BX_PHY_ADDRESS_LONG
499 typedef Bit64u bx_phy_address
;
500 #define BX_PHY_ADDRESS_WIDTH 40
502 typedef Bit32u bx_phy_address
;
503 #define BX_PHY_ADDRESS_WIDTH 32
506 // small sanity check
507 #if BX_PHY_ADDRESS_LONG
508 #if (BX_PHY_ADDRESS_WIDTH <= 32)
509 #error "BX_PHY_ADDRESS_LONG implies emulated physical address width > 32 bit"
513 #define BX_PHY_ADDRESS_MASK ((((Bit64u)(1)) << BX_PHY_ADDRESS_WIDTH) - 1)
515 #define BX_PHY_ADDRESS_RESERVED_BITS \
516 (~BX_PHY_ADDRESS_MASK & BX_CONST64(0xfffffffffffff))
518 // technically, in an 8 bit signed the real minimum is -128, not -127.
519 // But if you decide to negate -128 you tend to get -128 again, so it's
520 // better not to use the absolute maximum in the signed range.
521 #define BX_MAX_BIT64U ( (Bit64u) -1 )
522 #define BX_MIN_BIT64U ( 0 )
523 #define BX_MAX_BIT64S ( ((Bit64u) -1) >> 1 )
524 #define BX_MIN_BIT64S ( (Bit64s)-(((Bit64u) -1) >> 1) )
525 #define BX_MAX_BIT32U ( (Bit32u) -1 )
526 #define BX_MIN_BIT32U ( 0 )
527 #define BX_MAX_BIT32S ( ((Bit32u) -1) >> 1 )
528 #define BX_MIN_BIT32S ( (Bit32s)-(((Bit32u) -1) >> 1) )
529 #define BX_MAX_BIT16U ( (Bit16u) -1 )
530 #define BX_MIN_BIT16U ( 0 )
531 #define BX_MAX_BIT16S ( ((Bit16u) -1) >> 1 )
532 #define BX_MIN_BIT16S ( (Bit16s)-(((Bit16u) -1) >> 1) )
533 #define BX_MAX_BIT8U ( (Bit8u) -1 )
534 #define BX_MIN_BIT8U ( 0 )
535 #define BX_MAX_BIT8S ( ((Bit8u) -1) >> 1 )
536 #define BX_MIN_BIT8S ( (Bit8s)-(((Bit8u) -1) >> 1) )
539 // create an unsigned integer type that is the same size as a pointer.
540 // You can typecast a pointer to a bx_pr_equiv_t without losing any
541 // bits (and without getting the compiler excited).
542 #if SIZEOF_INT_P == 4
543 typedef Bit32u bx_ptr_equiv_t
;
544 #elif SIZEOF_INT_P == 8
545 typedef Bit64u bx_ptr_equiv_t
;
547 # error "could not define bx_ptr_equiv_t to size of int*"
550 // Use a boolean type that will not conflict with the builtin type
552 typedef Bit32u bx_bool
;
555 # define bx_ptr_t char *
557 # define bx_ptr_t void *
561 # define BX_LITTLE_ENDIAN
563 # define BX_BIG_ENDIAN
566 # define BX_BIG_ENDIAN
568 # define BX_LITTLE_ENDIAN
570 #endif // defined(WIN32)
573 #if BX_SUPPORT_X86_64
574 #ifdef BX_LITTLE_ENDIAN
585 #else // must be Big Endian
597 #endif // #if BX_SUPPORT_X86_64
600 // for now only term.cc requires a GUI sighandler.
601 #define BX_GUI_SIGHANDLER (BX_WITH_TERM)
603 #define HAVE_SIGACTION 1
605 // configure will change the definition of "inline" to the value
606 // that the C compiler allows. It tests the following keywords to
607 // see if any is permitted: inline, __inline__, __inline. If none
608 // is permitted, it defines inline to be empty.
609 #define inline inline
611 // inline functions in headers that are compiled with C compiler
612 // (e.g. fpu code) are declared with BX_C_INLINE macro. Note that
613 // the word "inline" itself may now be redefined by the above #define.
614 // Many compilers are known to work with "static inline". If the
615 // compiler can put the function inline, it does so and never creates
616 // a symbol for the function. If optimization is off, or inline is
617 // defined to be empty, the static keyword causes the function to create
618 // a symbol that's visible only to that .c file. Each .c file that
619 // includes the header will produde another local version of the
620 // BX_C_INLINE function (not ideal). However without "static" you can
621 // duplicate symbol problems which are even worse.
622 #define BX_C_INLINE static inline
624 // Use BX_CPP_INLINE for all C++ inline functions. Note that the
625 // word "inline" itself may now be redefined by the above #define.
626 #define BX_CPP_INLINE inline
630 // Some helpful compiler hints for compilers that allow them; GCC for now.
633 // Align a construct on an n-byte boundary.
635 // BX_CPP_AttrPrintf(formatArg, firstArg):
636 // This function takes printf-like arguments, so the compiler can check
637 // the consistency of the format string and the matching arguments.
638 // 'formatArg' is the parameter number (starting from 1) of the format
639 // string argument. 'firstArg' is the parameter number of the 1st argument
640 // to check against the string argument. NOTE: For non-static member
641 // functions, the this-ptr is argument number 1 but is invisible on
642 // the function prototype declaration - but you still have to count it.
644 // BX_CPP_AttrNoReturn():
645 // This function never returns. The compiler can optimize-out following
648 #define BX_CPP_AlignN(n) __attribute__ ((aligned (n)))
649 #define BX_CPP_AttrPrintf(formatArg, firstArg) \
650 __attribute__ ((format (printf, formatArg, firstArg)))
651 #define BX_CPP_AttrNoReturn() __attribute__ ((noreturn))
655 #define BX_CPP_AlignN(n) /* Not supported. */
656 #define BX_CPP_AttrPrintf(formatArg, firstArg) /* Not supported. */
657 #define BX_CPP_AttrNoReturn() /* Not supported. */
661 #define BX_DEBUGGER 0
664 #if (BX_DEBUGGER == 1) && (BX_DISASM == 0)
665 #error Dissembler is required for BX_DEBUGGER !
668 #define BX_PROVIDE_CPU_MEMORY 1
669 #define BX_PROVIDE_DEVICE_MODELS 1
671 #define BX_PROVIDE_MAIN 1
673 #define BX_INSTRUMENTATION 0
675 // enable BX_DEBUG/BX_ERROR/BX_INFO messages
676 #define BX_NO_LOGGING 0
678 // enable BX_ASSERT checks
679 #define BX_ASSERT_ENABLE 0
681 // limited i440FX PCI support
682 #define BX_SUPPORT_PCI 0
684 // Bochs VBE display interface
685 #define BX_SUPPORT_VBE 0
687 // CLGD54XX emulation
688 #define BX_SUPPORT_CLGD54XX 0
691 #define BX_SUPPORT_ACPI 0
693 #if (BX_SUPPORT_ACPI && !BX_SUPPORT_PCI)
694 #error To enable ACPI support, you must also enable PCI
697 // Experimental VGA on PCI
698 #define BX_SUPPORT_PCIVGA 0
700 // Experimental host PCI device mapping
701 #define BX_SUPPORT_PCIDEV 0
703 #if (BX_SUPPORT_PCIDEV && !BX_SUPPORT_PCI)
704 #error To enable PCI host device mapping, you must also enable PCI
707 // limited USB on PCI
708 #define BX_SUPPORT_PCIUSB 0
710 #if (BX_SUPPORT_PCIUSB && !BX_SUPPORT_PCI)
711 #error To enable USB, you must also enable PCI
714 #define BX_SUPPORT_BUSMOUSE 0
716 #define BX_SUPPORT_ALIGNMENT_CHECK 0
717 #define BX_SUPPORT_FPU 0
718 #define BX_SUPPORT_MMX 0
719 #define BX_SUPPORT_3DNOW 0
720 #define BX_SUPPORT_SSE 0
721 #define BX_SUPPORT_SSE_EXTENSION 0
722 #define BX_SUPPORT_SSE4A 0
723 #define BX_SUPPORT_SSE5A 0
724 #define BX_SUPPORT_DAZ 0
725 #define BX_SUPPORT_MISALIGNED_SSE 0
726 #define BX_SUPPORT_SEP 0
727 #define BX_SUPPORT_VME 0
728 #define BX_SUPPORT_POPCNT 0
729 #define BX_SUPPORT_MONITOR_MWAIT 0
730 #define BX_SUPPORT_XSAVE 0
731 #define BX_SUPPORT_AES 0
732 #define BX_SUPPORT_MOVBE 0
734 #define BX_SUPPORT_MTRR 0
735 #define BX_SUPPORT_LARGE_PAGES 0
736 #define BX_SUPPORT_GLOBAL_PAGES 0
737 #define BX_SUPPORT_PAE 0
739 #define BX_SupportGuest2HostTLB 0
740 #define BX_SupportRepeatSpeedups 0
741 #define BX_SupportHostAsms 0
743 #define BX_SUPPORT_ICACHE 0
744 #define BX_SUPPORT_TRACE_CACHE 0
746 #if (BX_SUPPORT_TRACE_CACHE && BX_SUPPORT_ICACHE==0)
747 #error Trace cache optimization cannot be compiled without iCache!
751 #define BX_CPU_VENDOR_INTEL 0
753 #define BX_CPU_VENDOR_INTEL 1
756 // Maximum CPUID vendor and brand string lengths
757 #define BX_CPUID_VENDOR_LEN 12
758 #define BX_CPUID_BRAND_LEN 48
760 // if 1, don't do gpf on MSRs that we don't implement
761 #define BX_IGNORE_BAD_MSR 0
763 // CLFLUSH was introduced together with SSE2 instruction set
764 #if BX_SUPPORT_SSE >= 2
765 #define BX_SUPPORT_CLFLUSH 1
767 #define BX_SUPPORT_CLFLUSH 0
770 #if (BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL < 4)
771 #error Alignment exception check is not supported in i386 !
774 #if (BX_SUPPORT_VME && BX_CPU_LEVEL < 5)
775 #error With CPU level < 5, you must disable v8086 mode extensions !
778 #if (BX_SUPPORT_MMX && BX_CPU_LEVEL < 5)
779 #error With CPU level < 5, you must disable MMX support !
782 #if (!BX_SUPPORT_FPU && BX_CPU_LEVEL > 4)
783 #error With CPU level > 4, you must enable FPU support !
786 #if (BX_SUPPORT_MMX && !BX_SUPPORT_FPU)
787 #error "MMX cannot be compiled without FPU support !"
790 #if (BX_SUPPORT_FPU && BX_CPU_LEVEL < 3)
791 #error "FPU cannot be compiled without cpu level >= 3 !"
794 #if (BX_SUPPORT_3DNOW && !BX_SUPPORT_MMX)
795 #error "3DNow! cannot be compiled without MMX support !"
798 #if (BX_SUPPORT_AES && !BX_SUPPORT_SSE)
799 #error "AES cannot be compiled without SSE support !"
802 #if (BX_SUPPORT_XSAVE && !BX_SUPPORT_SSE)
803 #error "XSAVE cannot be compiled without SSE support !"
806 #if (BX_SUPPORT_SSE && !BX_SUPPORT_MMX)
807 #error "SSE cannot be compiled without FPU+MMX support !"
810 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SSE)
811 #error "SSE is only supported with CPU_LEVEL >= 6 !"
814 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SEP)
815 #error "SYSENTER/SYSEXIT only supported with CPU_LEVEL >= 6 !"
818 #if (BX_SUPPORT_SSE < 3) || (BX_SUPPORT_SSE == 3 && BX_SUPPORT_SSE_EXTENSION == 0)
820 #error "MOVBE only supported with SSE3E !"
824 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_PAE)
825 #error "Physical Address Extensions (PAE) only supported with CPU_LEVEL >= 6 !"
827 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_GLOBAL_PAGES)
828 #error "Page Global Extension (PGE) only supported with CPU_LEVEL >= 6 !"
830 #if (BX_CPU_LEVEL<5 && BX_SUPPORT_LARGE_PAGES)
831 #error "Page Size Extension (PSE) only supported with CPU_LEVEL >= 5 !"
833 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_MTRR)
834 #error "MTRRs only supported with CPU_LEVEL >= 6 !"
837 #if (BX_SUPPORT_PAE && !BX_SUPPORT_LARGE_PAGES)
838 #error "Physical Address Extensions (PAE) requires large pages support !"
841 #if BX_SUPPORT_X86_64
842 // Sanity checks to ensure that you cannot accidently use conflicting options.
845 #error "X86-64 requires cpu level 6 or greater !"
847 #if (BX_SUPPORT_SSE<2)
848 #error "X86-64 requires SSE2 !"
851 #error "X86-64 requires Physical Address Extensions (PAE) !"
853 #if !BX_SUPPORT_GLOBAL_PAGES
854 #error "X86-64 requires Page Global Extension (PGE) !"
856 #if !BX_SUPPORT_LARGE_PAGES
857 #error "X86-64 requires Page Size Extension (PSE) !"
861 #define BX_HAVE_GETENV 0
862 #define BX_HAVE_SETENV 0
863 #define BX_HAVE_SELECT 0
864 #define BX_HAVE_SNPRINTF 0
865 #define BX_HAVE_VSNPRINTF 0
866 #define BX_HAVE_STRTOULL 0
867 #define BX_HAVE_STRTOUQ 0
868 #define BX_HAVE_STRDUP 0
869 #define BX_HAVE_STRREV 0
870 #define BX_HAVE_STRUCT_TIMEVAL 0
873 #define BX_HAVE_COLOR_SET 0
874 #define BX_HAVE_MVHLINE 0
875 #define BX_HAVE_MVVLINE 0
878 // set if your compiler does not permit an empty struct
879 #define BX_NO_EMPTY_STRUCTS 0
881 // set if your compiler does not understand __attribute__ after a struct
882 #define BX_NO_ATTRIBUTES 0
884 #define GCC_ATTRIBUTE(x) /* attribute not supported */
886 #define GCC_ATTRIBUTE __attribute__
889 // set to use fast function calls
890 #define BX_FAST_FUNC_CALL 0
892 // On gcc2.95+ x86 only
893 #if BX_FAST_FUNC_CALL && defined(__i386__) && defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
894 #if BX_USE_CPU_SMF == 1
895 # define BX_CPP_AttrRegparmN(X) __attribute__((regparm(X)))
897 // FIXME: BX_FAST_FUNC_CALL doesn't work with BX_USE_CPU_SMF = 0
898 # define BX_CPP_AttrRegparmN(X) /* Not defined */
901 # define BX_CPP_AttrRegparmN(X) /* Not defined */
904 // set if your compiler does not allow label at the end of a {} block
905 #define BX_NO_BLANK_LABELS 0
907 // set if you do have <hash_map>, used in bx_debug/dbg_main.c
908 #define BX_HAVE_HASH_MAP 0
910 // set if you do have <hash_map.h>, used in bx_debug/dbg_main.c
911 #define BX_HAVE_HASH_MAP_H 0
913 // set if you do have <set>, used in bx_debug/dbg_main.c
914 #define BX_HAVE_SET 0
916 // set if you do have <set.h>, used in bx_debug/dbg_main.c
917 #define BX_HAVE_SET_H 0
919 // Support x86 hardware debugger registers and facilites.
920 // These are the debug facilites offered by the x86 architecture,
921 // not the optional built-in debugger.
922 #define BX_X86_DEBUGGER 0
924 #define BX_SUPPORT_CDROM 0
927 // This is the C++ class name to use if we are supporting
929 # define LOWLEVEL_CDROM cdrom_interface
932 // NE2K network emulation
933 #define BX_SUPPORT_NE2K 0
936 #define BX_SUPPORT_PCIPNIC 0
938 #if (BX_SUPPORT_PCIPNIC && !BX_SUPPORT_PCI)
939 #error To enable the PCI pseudo NIC, you must also enable PCI
942 // this enables the lowlevel stuff below if one of the NICs is present
943 #define BX_NETWORKING 0
945 #define BX_ETH_NULL_LOGGING 1
946 #define BX_ETH_FBSD_LOGGING 1
948 // determine which NE2K packet mover modules will be enabled
949 // (this was moved from iodev/eth.h)
951 #ifdef BX_USE_ETH_ARPBACK
952 # define ETH_ARPBACK 1
954 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__NetBSD_kernel__) || defined(__APPLE__)
964 // this enables Ethertap packet mover; determined by configure script
965 #define HAVE_ETHERTAP 0
967 // this enables TUN/TAP packet mover; determined by configure script
968 #define HAVE_TUNTAP 0
970 // this enables VDE packet mover; determined by configure script
974 // I/O Interface to debug
975 #define BX_SUPPORT_IODEBUG 0
978 #define BX_FLOPPY0_NAME "Floppy Disk A:"
979 #define BX_FLOPPY1_NAME "Floppy Disk B:"
981 #define BX_FLOPPY0_NAME "Floppy Disk 0"
982 #define BX_FLOPPY1_NAME "Floppy Disk 1"
985 #endif // _BX_CONFIG_H