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 // Controls how many instances of BX_MEM_C are created. For
60 // SMP, use several processors with one shared memory space.
61 #define BX_ADDRESS_SPACES 1
63 #if BX_ADDRESS_SPACES != 1
64 #error "Support for several address spaces still not implemented"
67 // include in APIC models, required for a multiprocessor system.
68 #define BX_SUPPORT_APIC 0
70 #if (BX_SUPPORT_SMP && !BX_SUPPORT_APIC)
71 #error For multiprocessor simulation, BX_SUPPORT_APIC is required.
74 // if simulating Linux, this provides a few more debugging options
75 // such as tracing all system calls.
76 #define BX_DEBUG_LINUX 0
78 // adds support for the GNU readline library in the debugger command
80 #define HAVE_LIBREADLINE 0
81 #define HAVE_READLINE_HISTORY_H 0
83 // Define to 1 if you have <locale.h>
84 #define HAVE_LOCALE_H 0
86 // I rebuilt the code which provides timers to IO devices.
87 // Setting this to 1 will introduce a little code which
88 // will panic out if cases which shouldn't happen occur.
89 // Set this to 0 for optimal performance.
90 #define BX_TIMER_DEBUG 1
92 // Settable A20 line. For efficiency, you can disable
93 // having a settable A20 line, eliminating conditional
94 // code for every physical memory access. You'll have
95 // to tell your software not to mess with the A20 line,
96 // and accept it as always being on if you change this.
97 // 1 = use settable A20 line. (normal)
98 // 0 = A20 is like the rest of the address lines
100 #define BX_SUPPORT_A20 1
102 // Processor Instructions Per Second
103 // To find out what value to use for the 'ips' directive
104 // in your '.bochsrc' file, set BX_SHOW_IPS to 1, and
105 // run the software in bochs you plan to use most. Bochs
106 // will print out periodic IPS ratings. This will change
107 // based on the processor mode at the time, and various
108 // other factors. You'll get a reasonable estimate though.
109 // When you're done, reset BX_SHOW_IPS to 0, do a
110 // 'make all-clean', then 'make' again.
112 #define BX_SHOW_IPS 0
115 #if (BX_SHOW_IPS) && (defined(__MINGW32__) || defined(_MSC_VER))
121 // Support Paging mechanism.
122 // 0 = don't support paging at all (DOS & Minix don't require it)
123 // 1 = support paging. (Most other OS's require paging)
124 // Use Translation Lookaside Buffer (TLB) for caching
125 // paging translations. This will make paging mode
126 // more efficient. If you're OS doesn't use paging,
127 // then you won't need either.
128 // 1 = Use a TLB for effiency
129 // 0 = don't use a TLB, walk the page tables for every access
130 // BX_TLB_SIZE: Number of entries in TLB
131 // BX_TLB_INDEX_OF(lpf): This macro is passed the linear page frame
132 // (top 20 bits of the linear address. It must map these bits to
133 // one of the TLB cache slots, given the size of BX_TLB_SIZE.
134 // There will be a many-to-one mapping to each TLB cache slot.
135 // When there are collisions, the old entry is overwritten with
136 // one for the newest access.
140 #define BX_TLB_SIZE 1024
141 #define BX_TLB_MASK ((BX_TLB_SIZE-1) << 12)
142 #define BX_TLB_INDEX_OF(lpf) (((lpf) & BX_TLB_MASK) >> 12)
144 #define BX_USE_QUICK_TLB_INVALIDATE 0
146 // Compile in support for DMA & FLOPPY IO. You'll need this
147 // if you plan to use the floppy drive emulation. But if
148 // you're environment doesn't require it, you can change
151 #define BX_DMA_FLOPPY_IO 1
154 // Default number of Megs of memory to emulate. The
155 // 'megs:' directive in the '.bochsrc' file overrides this,
156 // allowing per-run settings.
158 #define BX_DEFAULT_MEM_MEGS 32
161 // CPU level emulation. Default level is set in
162 // the configure script. BX_CPU_LEVEL defines the CPU level
163 // to emulate. BX_CPU_LEVEL_HACKED is a hack to define the
164 // level of some integer instructions, so they can be tested
165 // before the rest of the emulation is up to that level.
167 #define BX_CPU_LEVEL 0
168 #define BX_CPU_LEVEL_HACKED 0
170 // emulate x86-64 instruction set?
171 #define BX_SUPPORT_X86_64 0
173 // make it configurable through configuration interface
174 #ifdef BX_SUPPORT_X86_64
175 #define BX_CPU_VECTOR_INTEL 0
177 #define BX_CPU_VECTOR_INTEL 1
180 #define BX_SUPPORT_V8086_MODE 1
182 #define BX_HAVE_SLEEP 0
183 #define BX_HAVE_MSLEEP 0
184 #define BX_HAVE_USLEEP 0
185 #define BX_HAVE_NANOSLEEP 0
186 #define BX_HAVE_ABORT 0
187 #define BX_HAVE_SOCKLEN_T 0
188 #define BX_HAVE_SOCKADDR_IN_SIN_LEN 0
189 #define BX_HAVE_GETTIMEOFDAY 0
191 #define BX_HAVE_REALTIME_USEC 1
193 #define BX_HAVE_REALTIME_USEC (BX_HAVE_GETTIMEOFDAY)
195 #define BX_HAVE_MKSTEMP 0
196 #define BX_HAVE_SYS_MMAN_H 0
197 #define BX_HAVE_XPM_H 0
198 #define BX_HAVE_TIMELOCAL 0
199 #define BX_HAVE_GMTIME 0
200 #define BX_HAVE_MKTIME 0
201 #define BX_HAVE_NET_IF_H 0
203 // This turns on Roland Mainz's idle hack. Presently it is specific to the X11
204 // and term gui. If people try to enable it elsewhere, give a compile error
205 // after the gui definition so that they don't waste their time trying.
206 #define BX_USE_IDLE_HACK 0
208 // Minimum Emulated IPS.
209 // This is used in the realtime PIT as well as for checking the
210 // IPS value set in the config file.
211 #define BX_MIN_IPS 200000
213 // Minimum and maximum values for SMP quantum variable. Defines
214 // how many instructions each CPU could execute execute in one
215 // shot (one cpu_loop call)
216 #define BX_SMP_QUANTUM_MIN 1
217 #define BX_SMP_QUANTUM_MAX 16
219 // Use Static Member Funtions to eliminate 'this' pointer passing
220 // If you want the efficiency of 'C', you can make all the
221 // members of the C++ CPU class to be static.
222 // This defaults to 1 since it should improve performance, but when
223 // SMP mode is enabled, it will be turned off by configure.
224 #define BX_USE_CPU_SMF 1
226 #define BX_USE_MEM_SMF 0
228 // Use static member functions in IO DEVice emulation modules.
229 // For efficiency, use C like functions for IO handling,
230 // and declare a device instance at compile time,
231 // instead of using 'new' and storing the pointer. This
232 // eliminates some overhead, especially for high-use IO
233 // devices like the disk drive.
234 // 1 = Use static member efficiency (normal)
235 // 0 = Use nonstatic member functions (use only if you need
236 // multiple instances of a device class
238 #define BX_USE_HD_SMF 1 // Hard drive
239 #define BX_USE_BIOS_SMF 1 // BIOS
240 #define BX_USE_CMOS_SMF 1 // CMOS
241 #define BX_USE_DMA_SMF 1 // DMA
242 #define BX_USE_FD_SMF 1 // Floppy
243 #define BX_USE_KEY_SMF 1 // Keyboard
244 #define BX_USE_PAR_SMF 1 // Parallel
245 #define BX_USE_PIC_SMF 1 // PIC
246 #define BX_USE_PIT_SMF 1 // PIT
247 #define BX_USE_SER_SMF 1 // Serial
248 #define BX_USE_UM_SMF 1 // Unmapped
249 #define BX_USE_VGA_SMF 1 // VGA
250 #define BX_USE_SB16_SMF 1 // Sound (SB 16)
251 #define BX_USE_DEV_SMF 1 // System Devices (port92)
252 #define BX_USE_PCI_SMF 1 // PCI
253 #define BX_USE_P2I_SMF 1 // PCI-to-ISA bridge
254 #define BX_USE_PIDE_SMF 1 // PCI-IDE
255 #define BX_USE_PCIVGA_SMF 1 // PCI-VGA
256 #define BX_USE_PCIDEV_SMF 1 // PCI-DEV
257 #define BX_USE_PCIUSB_SMF 1 // USB hub
258 #define BX_USE_PCIPNIC_SMF 1 // PCI pseudo NIC
259 #define BX_USE_NE2K_SMF 1 // NE2K
260 #define BX_USE_EFI_SMF 1 // External FPU IRQ
261 #define BX_USE_GAMEPORT_SMF 1 // Gameport
262 #define BX_USE_CIRRUS_SMF 1 // SVGA Cirrus
263 #define BX_USE_BUSM_SMF 1 // Bus Mouse
264 #define BX_USE_ACPI_SMF 1 // ACPI
267 #define BX_HAVE_DLFCN_H 0
270 ( !BX_USE_HD_SMF || !BX_USE_BIOS_SMF || !BX_USE_CMOS_SMF \
271 || !BX_USE_DMA_SMF || !BX_USE_FD_SMF || !BX_USE_KEY_SMF \
272 || !BX_USE_PAR_SMF || !BX_USE_PIC_SMF || !BX_USE_PIT_SMF \
273 || !BX_USE_SER_SMF || !BX_USE_UM_SMF || !BX_USE_VGA_SMF \
274 || !BX_USE_SB16_SMF || !BX_USE_DEV_SMF || !BX_USE_PCI_SMF \
275 || !BX_USE_P2I_SMF || !BX_USE_PCIVGA_SMF || !BX_USE_PCIUSB_SMF \
276 || !BX_USE_PCIPNIC_SMF || !BX_USE_PIDE_SMF || !BX_USE_ACPI_SMF \
277 || !BX_USE_NE2K_SMF || !BX_USE_EFI_SMF || !BX_USE_GAMEPORT_SMF \
278 || !BX_USE_PCIDEV_SMF || !BX_USE_CIRRUS_SMF)
279 #error You must use SMF to have plugins
282 #define BX_SUPPORT_SB16 0
283 #define BX_SUPPORT_GAMEPORT 0
286 // Use virtual methods for the sound output functions
287 #define BX_USE_SOUND_VIRTUAL 1
288 // Determines which sound output class is to be used.
289 // Currently the following are available:
290 // bx_sound_linux_c Output for Linux, to /dev/dsp and /dev/midi00
291 // bx_sound_windows_c Output for Windows midi and wave mappers
292 // bx_sound_output_c Dummy functions, no output
293 #define BX_SOUND_OUTPUT_C bx_sound_output_c
296 #define USE_RAW_SERIAL 0
298 // This enables writing to port 0xe9 and the output
299 // is sent to the console. Reading from port 0xe9
300 // will return 0xe9 to let you know this is available.
301 // Leave this 0 unless you have a reason to use it.
302 #define BX_PORT_E9_HACK 0
306 // This option enables compressed (zlib) hd support
307 #define BX_COMPRESSED_HD_SUPPORT 0
308 #define BX_HAVE_ZLIB 0
310 #if BX_COMPRESSED_HD_SUPPORT && !BX_HAVE_ZLIB
311 #error You must have zlib to enable compressed hd support
314 // This option defines the number of supported ATA channels.
315 // There are up to two drives per ATA channel.
316 #define BX_MAX_ATA_CHANNEL 4
318 #if (BX_MAX_ATA_CHANNEL>4 || BX_MAX_ATA_CHANNEL<1)
319 # error "BX_MAX_ATA_CHANNEL should be between 1 and 4"
322 // =================================================================
323 // BEGIN: OPTIONAL DEBUGGER SECTION
325 // These options are only used if you compile in support for the
326 // native command line debugging environment. Typically, the debugger
327 // is not used, and this section can be ignored.
328 // =================================================================
330 // Compile in support for virtual/linear/physical breakpoints.
331 // Set to 1, only those you need. Recommend using only linear
332 // breakpoints, unless you need others. Less supported means
333 // slightly faster execution time.
334 #define BX_DBG_SUPPORT_VIR_BPOINT 1
335 #define BX_DBG_SUPPORT_LIN_BPOINT 1
336 #define BX_DBG_SUPPORT_PHY_BPOINT 1
338 // max number of virtual/linear/physical breakpoints handled
339 #define BX_DBG_MAX_VIR_BPOINTS 10
340 #define BX_DBG_MAX_LIN_BPOINTS 10
341 #define BX_DBG_MAX_PHY_BPOINTS 10
343 // max file pathname size for debugger commands
344 #define BX_MAX_PATH 256
345 // max nesting level for debug scripts including other scripts
346 #define BX_INFILE_DEPTH 10
347 // use this command to include (nest) debug scripts
348 #define BX_INCLUDE_CMD "source"
350 // Make a call to command line debugger extensions. If set to 1,
351 // a call is made. An external routine has a chance to process
352 // the command. If it does, than the debugger ignores the command.
353 #define BX_DBG_EXTENSIONS 0
355 // =================================================================
356 // END: OPTIONAL DEBUGGER SECTION
357 // =================================================================
360 //////////////////////////////////////////////////////////////////////
361 // END OF USER CONFIGURABLE OPTIONS : DON'T EDIT ANYTHING BELOW !!! //
362 // THIS IS GENERATED BY THE ./configure SCRIPT //
363 //////////////////////////////////////////////////////////////////////
366 #define BX_WITH_X11 0
367 #define BX_WITH_BEOS 0
368 #define BX_WITH_WIN32 0
369 #define BX_WITH_MACOS 0
370 #define BX_WITH_CARBON 0
371 #define BX_WITH_NOGUI 0
372 #define BX_WITH_TERM 0
373 #define BX_WITH_RFB 0
374 #define BX_WITH_AMIGAOS 0
375 #define BX_WITH_SDL 0
376 #define BX_WITH_SVGA 0
379 // BX_USE_TEXTCONFIG should be set to 1 unless Bochs is compiled
380 // for wxWidgets only.
381 #define BX_USE_TEXTCONFIG 1
383 // add special export symbols for win32 DLL building. The main code must
384 // have __declspec(dllexport) on variables, functions, or classes that the
385 // plugins can access. The plugins should #define PLUGGABLE which will
386 // activate the __declspec(dllimport) instead.
387 #if defined(WIN32) || defined(__CYGWIN__)
388 # if BX_PLUGINS && defined(BX_PLUGGABLE)
389 // #warning I will import DLL symbols from Bochs main program.
390 # define BOCHSAPI __declspec(dllimport)
392 // #warning I will export DLL symbols.
393 # define BOCHSAPI __declspec(dllexport)
400 #if defined(__CYGWIN__)
401 // Make BOCHSAPI_CYGONLY exactly the same as BOCHSAPI. This symbol
402 // will be used for any cases where Cygwin requires a special tag
403 // but VC++ does not.
404 #define BOCHSAPI_CYGONLY BOCHSAPI
406 // define the symbol to be empty
407 #define BOCHSAPI_CYGONLY /*empty*/
410 #if defined(_MSC_VER)
411 // Make BOCHSAPI_MSVCONLY exactly the same as BOCHSAPI. This symbol
412 // will be used for any cases where VC++ requires a special tag
413 // but Cygwin does not.
414 #define BOCHSAPI_MSVCONLY BOCHSAPI
416 // define the symbol to be empty
417 #define BOCHSAPI_MSVCONLY /*empty*/
420 #define BX_DEFAULT_CONFIG_INTERFACE "defined_by_configure"
421 #define BX_DEFAULT_DISPLAY_LIBRARY "defined_by_configure"
423 // Roland Mainz's idle hack is presently specific to X11. If people try to
424 // enable it elsewhere, give a compile error so that they don't waste their
426 #if (BX_USE_IDLE_HACK && !BX_WITH_X11 && !BX_WITH_TERM)
427 # error IDLE_HACK will only work with the X11 or term gui. Correct configure args and retry.
430 #define WORDS_BIGENDIAN 0
432 #define SIZEOF_UNSIGNED_CHAR 0
433 #define SIZEOF_UNSIGNED_SHORT 0
434 #define SIZEOF_UNSIGNED_INT 0
435 #define SIZEOF_UNSIGNED_LONG 0
436 #define SIZEOF_UNSIGNED_LONG_LONG 0
437 #define SIZEOF_INT_P 0
439 #define BX_64BIT_CONSTANTS_USE_LL 1
440 #if BX_64BIT_CONSTANTS_USE_LL
441 // doesn't work on Microsoft Visual C++, maybe others
442 #define BX_CONST64(x) (x##LL)
444 #define BX_CONST64(x) (x)
448 typedef unsigned char Bit8u
;
449 typedef signed char Bit8s
;
450 typedef unsigned short Bit16u
;
451 typedef signed short Bit16s
;
452 typedef unsigned int Bit32u
;
453 typedef signed int Bit32s
;
455 typedef unsigned long long Bit64u
;
456 typedef signed long long Bit64s
;
457 #include <sys/types.h>
459 typedef unsigned __int64 Bit64u
;
460 typedef signed __int64 Bit64s
;
463 typedef unsigned char Bit8u
;
464 typedef signed char Bit8s
;
465 typedef unsigned short Bit16u
;
466 typedef signed short Bit16s
;
467 typedef unsigned int Bit32u
;
468 typedef signed int Bit32s
;
469 typedef unsigned long long Bit64u
;
470 typedef signed long long Bit64s
;
473 // Unix like platforms
475 #if SIZEOF_UNSIGNED_CHAR != 1
476 # error "sizeof (unsigned char) != 1"
478 typedef unsigned char Bit8u
;
479 typedef signed char Bit8s
;
482 #if SIZEOF_UNSIGNED_SHORT != 2
483 # error "sizeof (unsigned short) != 2"
485 typedef unsigned short Bit16u
;
486 typedef signed short Bit16s
;
489 #if SIZEOF_UNSIGNED_INT == 4
490 typedef unsigned int Bit32u
;
491 typedef signed int Bit32s
;
492 #elif SIZEOF_UNSIGNED_LONG == 4
493 typedef unsigned long Bit32u
;
494 typedef signed long Bit32s
;
496 # error "can't find sizeof(type) of 4 bytes!"
499 #if SIZEOF_UNSIGNED_LONG == 8
500 typedef unsigned long Bit64u
;
501 typedef signed long Bit64s
;
502 #elif SIZEOF_UNSIGNED_LONG_LONG == 8
503 typedef unsigned long long Bit64u
;
504 typedef signed long long Bit64s
;
506 # error "can't find data type of 8 bytes"
511 #define GET32L(val64) ((Bit32u)(((Bit64u)(val64)) & 0xFFFFFFFF))
512 #define GET32H(val64) ((Bit32u)(((Bit64u)(val64)) >> 32))
514 // now that Bit32u and Bit64u exist, defined bx_address
515 #if BX_SUPPORT_X86_64
516 typedef Bit64u bx_address
;
518 typedef Bit32u bx_address
;
521 // define physical and linear address types
522 typedef Bit32u bx_phy_address
;
523 typedef bx_address bx_lin_address
;
525 #define BX_PHY_ADDRESS_WIDTH 32
526 #if BX_SUPPORT_X86_64
527 #define BX_LIN_ADDRESS_WIDTH 48
529 #define BX_LIN_ADDRESS_WIDTH 32
532 // technically, in an 8 bit signed the real minimum is -128, not -127.
533 // But if you decide to negate -128 you tend to get -128 again, so it's
534 // better not to use the absolute maximum in the signed range.
535 #define BX_MAX_BIT64U ( (Bit64u) -1 )
536 #define BX_MIN_BIT64U ( 0 )
537 #define BX_MAX_BIT64S ( ((Bit64u) -1) >> 1 )
538 #define BX_MIN_BIT64S ( (Bit64s)-(((Bit64u) -1) >> 1) )
539 #define BX_MAX_BIT32U ( (Bit32u) -1 )
540 #define BX_MIN_BIT32U ( 0 )
541 #define BX_MAX_BIT32S ( ((Bit32u) -1) >> 1 )
542 #define BX_MIN_BIT32S ( (Bit32s)-(((Bit32u) -1) >> 1) )
543 #define BX_MAX_BIT16U ( (Bit16u) -1 )
544 #define BX_MIN_BIT16U ( 0 )
545 #define BX_MAX_BIT16S ( ((Bit16u) -1) >> 1 )
546 #define BX_MIN_BIT16S ( (Bit16s)-(((Bit16u) -1) >> 1) )
547 #define BX_MAX_BIT8U ( (Bit8u) -1 )
548 #define BX_MIN_BIT8U ( 0 )
549 #define BX_MAX_BIT8S ( ((Bit8u) -1) >> 1 )
550 #define BX_MIN_BIT8S ( (Bit8s)-(((Bit8u) -1) >> 1) )
553 // create an unsigned integer type that is the same size as a pointer.
554 // You can typecast a pointer to a bx_pr_equiv_t without losing any
555 // bits (and without getting the compiler excited). This is used in
556 // the FPU emulation code, where pointers and integers are often
557 // used interchangeably.
558 #if SIZEOF_INT_P == 4
559 typedef Bit32u bx_ptr_equiv_t
;
560 #elif SIZEOF_INT_P == 8
561 typedef Bit64u bx_ptr_equiv_t
;
563 # error "could not define bx_ptr_equiv_t to size of int*"
566 // Use a boolean type that will not conflict with the builtin type
568 typedef Bit32u bx_bool
;
571 # define bx_ptr_t char *
573 # define bx_ptr_t void *
577 # define BX_LITTLE_ENDIAN
579 # define BX_BIG_ENDIAN
582 # define BX_BIG_ENDIAN
584 # define BX_LITTLE_ENDIAN
586 #endif // defined(WIN32)
589 #if BX_SUPPORT_X86_64
590 #ifdef BX_LITTLE_ENDIAN
601 #else // must be Big Endian
613 #endif // #if BX_SUPPORT_X86_64
616 // for now only term.cc requires a GUI sighandler.
617 #define BX_GUI_SIGHANDLER (BX_WITH_TERM)
619 #define HAVE_SIGACTION 1
621 // configure will change the definition of "inline" to the value
622 // that the C compiler allows. It tests the following keywords to
623 // see if any is permitted: inline, __inline__, __inline. If none
624 // is permitted, it defines inline to be empty.
625 #define inline inline
627 // inline functions in headers that are compiled with C compiler
628 // (e.g. fpu code) are declared with BX_C_INLINE macro. Note that
629 // the word "inline" itself may now be redefined by the above #define.
630 // Many compilers are known to work with "static inline". If the
631 // compiler can put the function inline, it does so and never creates
632 // a symbol for the function. If optimization is off, or inline is
633 // defined to be empty, the static keyword causes the function to create
634 // a symbol that's visible only to that .c file. Each .c file that
635 // includes the header will produde another local version of the
636 // BX_C_INLINE function (not ideal). However without "static" you can
637 // duplicate symbol problems which are even worse.
638 #define BX_C_INLINE static inline
640 // Use BX_CPP_INLINE for all C++ inline functions. Note that the
641 // word "inline" itself may now be redefined by the above #define.
642 #define BX_CPP_INLINE inline
646 // Some helpful compiler hints for compilers that allow them; GCC for now.
649 // Align a construct on an n-byte boundary.
651 // BX_CPP_AttrPrintf(formatArg, firstArg):
652 // This function takes printf-like arguments, so the compiler can check
653 // the consistency of the format string and the matching arguments.
654 // 'formatArg' is the parameter number (starting from 1) of the format
655 // string argument. 'firstArg' is the parameter number of the 1st argument
656 // to check against the string argument. NOTE: For non-static member
657 // functions, the this-ptr is argument number 1 but is invisible on
658 // the function prototype declaration - but you still have to count it.
660 // BX_CPP_AttrNoReturn():
661 // This function never returns. The compiler can optimize-out following
664 #define BX_CPP_AlignN(n) __attribute__ ((aligned (n)))
665 #define BX_CPP_AttrPrintf(formatArg, firstArg) \
666 __attribute__ ((format (printf, formatArg, firstArg)))
667 #define BX_CPP_AttrNoReturn() __attribute__ ((noreturn))
671 #define BX_CPP_AlignN(n) /* Not supported. */
672 #define BX_CPP_AttrPrintf(formatArg, firstArg) /* Not supported. */
673 #define BX_CPP_AttrNoReturn() /* Not supported. */
677 #define BX_DEBUGGER 0
680 #if (BX_DEBUGGER == 1) && (BX_DISASM == 0)
681 #error "Dissembler is required for BX_DEBUGGER !"
684 #define BX_PROVIDE_CPU_MEMORY 1
685 #define BX_PROVIDE_DEVICE_MODELS 1
687 #define BX_PROVIDE_MAIN 1
689 #define BX_INSTRUMENTATION 0
691 // limited i440FX PCI support
692 #define BX_SUPPORT_PCI 0
694 // Bochs VBE display interface
695 #define BX_SUPPORT_VBE 0
697 // CLGD54XX emulation
698 #define BX_SUPPORT_CLGD54XX 0
700 // CLGD54XX PCI emulation
701 #define BX_SUPPORT_CLGD54XX_PCI 0
703 #if (BX_SUPPORT_CLGD54XX_PCI && !BX_SUPPORT_PCI)
704 #error To enable CL-GD54xx PCI support, you must also enable PCI
708 #define BX_SUPPORT_ACPI 0
710 #if (BX_SUPPORT_ACPI && !BX_SUPPORT_PCI)
711 #error To enable ACPI support, you must also enable PCI
714 // Experimental VGA on PCI
715 #define BX_SUPPORT_PCIVGA 0
717 // Experimental host PCI device mapping
718 #define BX_SUPPORT_PCIDEV 0
720 #if (BX_SUPPORT_PCIDEV && !BX_SUPPORT_PCI)
721 #error To enable PCI host device mapping, you must also enable PCI
724 // limited USB on PCI
725 #define BX_SUPPORT_PCIUSB 0
727 #if (BX_SUPPORT_PCIUSB && !BX_SUPPORT_PCI)
728 #error To enable USB, you must also enable PCI
731 #define BX_SUPPORT_BUSMOUSE 0
733 #define BX_SUPPORT_ALIGNMENT_CHECK 0
734 #define BX_SUPPORT_FPU 0
735 #define BX_SUPPORT_MMX 0
736 #define BX_SUPPORT_3DNOW 0
737 #define BX_SUPPORT_SSE 0
738 #define BX_SUPPORT_SSE_EXTENSION 0
739 #define BX_SUPPORT_DAZ 0
740 #define BX_SUPPORT_MISALIGNED_SSE 0
741 #define BX_SUPPORT_SEP 0
742 #define BX_SUPPORT_VME 0
744 #define BX_SUPPORT_4MEG_PAGES 0
745 #define BX_SUPPORT_GLOBAL_PAGES 0
746 #define BX_SUPPORT_PAE 0
748 #define BX_SupportGuest2HostTLB 0
749 #define BX_SupportRepeatSpeedups 0
750 #define BX_SupportHostAsms 0
751 #define BX_SupportHostAsmsFpu 0
753 #define BX_SUPPORT_ICACHE 0
755 // save/restore support
756 #define BX_SUPPORT_SAVE_RESTORE 0
758 // if 1, don't do gpf on MSRs that we don't implement
759 #define BX_IGNORE_BAD_MSR 0
761 // CLFLUSH was introduced together with SSE2 instruction set
762 #if BX_SUPPORT_SSE >= 2
763 #define BX_SUPPORT_CLFLUSH 1
765 #define BX_SUPPORT_CLFLUSH 0
768 #if (BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL < 4)
769 #error Alignment exception check is not supported in i386 !
772 #if (BX_SUPPORT_VME && BX_CPU_LEVEL < 5)
773 #error With CPU level < 5, you must disable v8086 mode extensions !
776 #if (BX_SUPPORT_VME && !BX_SUPPORT_V8086_MODE)
777 #error You must enable v8086 mode support to use v8086 mode extensions !
780 #if (BX_SUPPORT_MMX && BX_CPU_LEVEL < 5)
781 #error With CPU level < 5, you must disable MMX support !
784 #if (!BX_SUPPORT_FPU && BX_CPU_LEVEL >= 5)
785 #error With CPU level >= 5, you must enable FPU support !
788 #if (BX_SUPPORT_MMX && !BX_SUPPORT_FPU)
789 #error "MMX cannot be compiled without FPU support !"
792 #if (BX_SUPPORT_FPU && BX_CPU_LEVEL < 3)
793 #error "FPU cannot be compiled without cpu level >= 3 !"
796 #if (BX_SUPPORT_3DNOW && !BX_SUPPORT_MMX)
797 #error "3DNow! cannot be compiled without MMX support !"
800 #if (BX_SUPPORT_SSE && !BX_SUPPORT_MMX)
801 #error "SSE cannot be compiled without FPU+MMX support !"
804 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SSE)
805 #error "SSE is only supported with CPU_LEVEL >= 6 !"
808 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SEP)
809 #error "SYSENTER/SYSEXIT only supported with CPU_LEVEL >= 6 !"
812 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_PAE)
813 #error "Physical Address Extensions (PAE) only supported with CPU_LEVEL >= 6 !"
815 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_GLOBAL_PAGES)
816 #error "Page Global Extension (PGE) only supported with CPU_LEVEL >= 6 !"
818 #if (BX_CPU_LEVEL<5 && BX_SUPPORT_4MEG_PAGES)
819 #error "Page Size Extension (PSE) only supported with CPU_LEVEL >= 5 !"
822 #if BX_SUPPORT_X86_64
823 // Sanity checks to ensure that you cannot accidently use conflicting options.
826 #error "X86-64 requires cpu level 6 or greater !"
828 #if (BX_SUPPORT_SSE<2)
829 #error "X86-64 requires SSE2 !"
832 #error "X86-64 requires Physical Address Extensions (PAE) !"
834 #if !BX_SUPPORT_GLOBAL_PAGES
835 #error "X86-64 requires Page Global Extension (PGE) !"
837 #if !BX_SUPPORT_4MEG_PAGES
838 #error "X86-64 requires Page Size Extension (PSE) !"
842 #define BX_HAVE_GETENV 0
843 #define BX_HAVE_SETENV 0
844 #define BX_HAVE_SELECT 0
845 #define BX_HAVE_SNPRINTF 0
846 #define BX_HAVE_VSNPRINTF 0
847 #define BX_HAVE_STRTOULL 0
848 #define BX_HAVE_STRTOUQ 0
849 #define BX_HAVE_STRDUP 0
850 #define BX_HAVE_STRREV 0
851 #define BX_HAVE_STRUCT_TIMEVAL 0
854 #define BX_HAVE_COLOR_SET 0
855 #define BX_HAVE_MVHLINE 0
856 #define BX_HAVE_MVVLINE 0
859 // set if your compiler does not permit an empty struct
860 #define BX_NO_EMPTY_STRUCTS 0
862 // set if your compiler does not understand __attribute__ after a struct
863 #define BX_NO_ATTRIBUTES 0
865 #define GCC_ATTRIBUTE(x) /* attribute not supported */
867 #define GCC_ATTRIBUTE __attribute__
870 // set to use fast function calls
871 #define BX_FAST_FUNC_CALL 0
873 // On gcc2.95+ x86 only
874 #if BX_FAST_FUNC_CALL && defined(__i386__) && defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
875 #if BX_USE_CPU_SMF == 1
876 # define BX_CPP_AttrRegparmN(X) __attribute__((regparm(X)))
878 // FIXME: BX_FAST_FUNC_CALL doesn't work with BX_USE_CPU_SMF = 0
879 # define BX_CPP_AttrRegparmN(X) /* Not defined */
882 # define BX_CPP_AttrRegparmN(X) /* Not defined */
885 // set if your compiler does not allow label at the end of a {} block
886 #define BX_NO_BLANK_LABELS 0
888 // set if you do have <hash_map>, used in bx_debug/dbg_main.c
889 #define BX_HAVE_HASH_MAP 0
891 // set if you do have <hash_map.h>, used in bx_debug/dbg_main.c
892 #define BX_HAVE_HASH_MAP_H 0
894 // set if you do have <set>, used in bx_debug/dbg_main.c
895 #define BX_HAVE_SET 0
897 // set if you do have <set.h>, used in bx_debug/dbg_main.c
898 #define BX_HAVE_SET_H 0
900 // Support x86 hardware debugger registers and facilites.
901 // These are the debug facilites offered by the x86 architecture,
902 // not the optional built-in debugger.
903 #define BX_X86_DEBUGGER 0
905 #define BX_SUPPORT_CDROM 0
908 // This is the C++ class name to use if we are supporting
910 # define LOWLEVEL_CDROM cdrom_interface
913 // NE2K network emulation
914 #define BX_SUPPORT_NE2K 0
917 #define BX_SUPPORT_PCIPNIC 0
919 #if (BX_SUPPORT_PCIPNIC && !BX_SUPPORT_PCI)
920 #error To enable the PCI pseudo NIC, you must also enable PCI
923 // this enables the lowlevel stuff below if one of the NICs is present
924 #define BX_NETWORKING 0
926 #define BX_ETH_NULL_LOGGING 1
927 #define BX_ETH_FBSD_LOGGING 1
929 // determine which NE2K packet mover modules will be enabled
930 // (this was moved from iodev/eth.h)
932 #ifdef BX_USE_ETH_ARPBACK
933 # define ETH_ARPBACK 1
935 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__NetBSD_kernel__) || defined(__APPLE__)
945 // this enables Ethertap packet mover; determined by configure script
946 #define HAVE_ETHERTAP 0
948 // this enables TUN/TAP packet mover; determined by configure script
949 #define HAVE_TUNTAP 0
951 // this enables VDE packet mover; determined by configure script
955 // I/O Interface to debug
956 #define BX_SUPPORT_IODEBUG 0
959 #define BX_EXTERNAL_DEBUGGER 0
962 #define BX_MAGIC_BREAKPOINT 1
965 #define BX_FLOPPY0_NAME "Floppy Disk A:"
966 #define BX_FLOPPY1_NAME "Floppy Disk B:"
968 #define BX_FLOPPY0_NAME "Floppy Disk 0"
969 #define BX_FLOPPY1_NAME "Floppy Disk 1"
972 // This is handy for certain performance testing purposes, but otherwise
973 // totally useless. If you define BX_SCHEDULED_DIE_TIME then it enables code
974 // in bx_pit_c::periodic that will cause Bochs to exit() after a certain number
976 //#define BX_SCHEDULED_DIE_TIME 1162230000 // end of redhat6.0 boot
978 #endif // _BX_CONFIG_H