- skip SMM init if already done at first boot time (fixes reboot failure)
[bochs-mirror.git] / config.h.in
blob31d181d1764f02a2af538bed0ee6c341ee66a1e7
1 // Copyright (C) 2001 MandrakeSoft S.A.
2 //
3 // MandrakeSoft S.A.
4 // 43, rue d'Aboukir
5 // 75002 Paris - France
6 // http://www.linux-mandrake.com/
7 // http://www.mandrakesoft.com/
8 //
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.
29 //
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.
35 #ifndef _BX_CONFIG_H_
36 #define _BX_CONFIG_H_ 1
38 ///////////////////////////////////////////////////////////////////
39 // USER CONFIGURABLE OPTIONS : EDIT ONLY OPTIONS IN THIS SECTION //
40 ///////////////////////////////////////////////////////////////////
43 #if 1
44 // quit_sim is defined in gui/siminterface.h
45 #define BX_EXIT(x) SIM->quit_sim (x)
46 #else
47 // provide the real main and the usual exit.
48 #define BX_EXIT(x) ::exit(x)
49 #endif
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.
64 #endif
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
71 // prompt.
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))
108 #define SIGALRM 14
109 #endif
111 // Paging Options:
112 // ---------------
113 // Support Paging mechanism.
114 // 0 = don't support paging at all (DOS & Minix don't require it)
115 // 1 = support paging. (Most other OS's require paging)
116 // Use Translation Lookaside Buffer (TLB) for caching
117 // paging translations. This will make paging mode
118 // more efficient. If you're OS doesn't use paging,
119 // then you won't need either.
120 // 1 = Use a TLB for effiency
121 // 0 = don't use a TLB, walk the page tables for every access
122 // BX_TLB_SIZE: Number of entries in TLB
123 // BX_TLB_INDEX_OF(lpf): This macro is passed the linear page frame
124 // (top 20 bits of the linear address. It must map these bits to
125 // one of the TLB cache slots, given the size of BX_TLB_SIZE.
126 // There will be a many-to-one mapping to each TLB cache slot.
127 // When there are collisions, the old entry is overwritten with
128 // one for the newest access.
130 #define BX_USE_TLB 1
132 #define BX_TLB_SIZE 1024
133 #define BX_TLB_MASK ((BX_TLB_SIZE-1) << 12)
134 #define BX_TLB_INDEX_OF(lpf) ((((unsigned)(lpf)) & BX_TLB_MASK) >> 12)
136 // Compile in support for DMA & FLOPPY IO. You'll need this
137 // if you plan to use the floppy drive emulation. But if
138 // you're environment doesn't require it, you can change
139 // it to 0.
141 #define BX_DMA_FLOPPY_IO 1
143 // Default number of Megs of memory to emulate. The
144 // 'megs:' directive in the '.bochsrc' file overrides this,
145 // allowing per-run settings.
147 #define BX_DEFAULT_MEM_MEGS 32
149 // CPU level emulation. Default level is set in
150 // the configure script. BX_CPU_LEVEL defines the CPU level
151 // to emulate. BX_CPU_LEVEL_HACKED is a hack to define the
152 // level of some instructions, so they can be tested before
153 // the rest of the emulation is up to that level.
155 #define BX_CPU_LEVEL 0
156 #define BX_CPU_LEVEL_HACKED 0
158 // emulate x86-64 instruction set?
159 #define BX_SUPPORT_X86_64 0
161 #define BX_HAVE_SLEEP 0
162 #define BX_HAVE_MSLEEP 0
163 #define BX_HAVE_USLEEP 0
164 #define BX_HAVE_NANOSLEEP 0
165 #define BX_HAVE_ABORT 0
166 #define BX_HAVE_SOCKLEN_T 0
167 #define BX_HAVE_SOCKADDR_IN_SIN_LEN 0
168 #define BX_HAVE_GETTIMEOFDAY 0
169 #if defined(WIN32)
170 #define BX_HAVE_REALTIME_USEC 1
171 #else
172 #define BX_HAVE_REALTIME_USEC (BX_HAVE_GETTIMEOFDAY)
173 #endif
174 #define BX_HAVE_MKSTEMP 0
175 #define BX_HAVE_SYS_MMAN_H 0
176 #define BX_HAVE_XPM_H 0
177 #define BX_HAVE_TIMELOCAL 0
178 #define BX_HAVE_GMTIME 0
179 #define BX_HAVE_MKTIME 0
180 #define BX_HAVE_NET_IF_H 0
182 // This turns on Roland Mainz's idle hack. Presently it is specific to the X11
183 // and term gui. If people try to enable it elsewhere, give a compile error
184 // after the gui definition so that they don't waste their time trying.
185 #define BX_USE_IDLE_HACK 0
187 // Minimum Emulated IPS.
188 // This is used in the realtime PIT as well as for checking the
189 // IPS value set in the config file.
190 #define BX_MIN_IPS 200000
192 // Minimum and maximum values for SMP quantum variable. Defines
193 // how many instructions each CPU could execute execute in one
194 // shot (one cpu_loop call)
195 #define BX_SMP_QUANTUM_MIN 1
196 #define BX_SMP_QUANTUM_MAX 16
198 // Use Static Member Funtions to eliminate 'this' pointer passing
199 // If you want the efficiency of 'C', you can make all the
200 // members of the C++ CPU class to be static.
201 // This defaults to 1 since it should improve performance, but when
202 // SMP mode is enabled, it will be turned off by configure.
203 #define BX_USE_CPU_SMF 1
205 #define BX_USE_MEM_SMF 1
207 // Use static member functions in IO DEVice emulation modules.
208 // For efficiency, use C like functions for IO handling,
209 // and declare a device instance at compile time,
210 // instead of using 'new' and storing the pointer. This
211 // eliminates some overhead, especially for high-use IO
212 // devices like the disk drive.
213 // 1 = Use static member efficiency (normal)
214 // 0 = Use nonstatic member functions (use only if you need
215 // multiple instances of a device class
217 #define BX_USE_HD_SMF 1 // Hard drive
218 #define BX_USE_BIOS_SMF 1 // BIOS
219 #define BX_USE_CMOS_SMF 1 // CMOS
220 #define BX_USE_DMA_SMF 1 // DMA
221 #define BX_USE_FD_SMF 1 // Floppy
222 #define BX_USE_KEY_SMF 1 // Keyboard
223 #define BX_USE_PAR_SMF 1 // Parallel
224 #define BX_USE_PIC_SMF 1 // PIC
225 #define BX_USE_PIT_SMF 1 // PIT
226 #define BX_USE_SER_SMF 1 // Serial
227 #define BX_USE_UM_SMF 1 // Unmapped
228 #define BX_USE_VGA_SMF 1 // VGA
229 #define BX_USE_SB16_SMF 1 // Sound (SB 16)
230 #define BX_USE_DEV_SMF 1 // System Devices (port92)
231 #define BX_USE_PCI_SMF 1 // PCI
232 #define BX_USE_P2I_SMF 1 // PCI-to-ISA bridge
233 #define BX_USE_PIDE_SMF 1 // PCI-IDE
234 #define BX_USE_PCIVGA_SMF 1 // PCI-VGA
235 #define BX_USE_PCIDEV_SMF 1 // PCI-DEV
236 #define BX_USE_PCIUSB_SMF 1 // USB hub
237 #define BX_USE_PCIPNIC_SMF 1 // PCI pseudo NIC
238 #define BX_USE_NE2K_SMF 1 // NE2K
239 #define BX_USE_EFI_SMF 1 // External FPU IRQ
240 #define BX_USE_GAMEPORT_SMF 1 // Gameport
241 #define BX_USE_CIRRUS_SMF 1 // SVGA Cirrus
242 #define BX_USE_BUSM_SMF 1 // Bus Mouse
243 #define BX_USE_ACPI_SMF 1 // ACPI
245 #define BX_PLUGINS 0
246 #define BX_HAVE_DLFCN_H 0
248 #if BX_PLUGINS && \
249 ( !BX_USE_HD_SMF || !BX_USE_BIOS_SMF || !BX_USE_CMOS_SMF \
250 || !BX_USE_DMA_SMF || !BX_USE_FD_SMF || !BX_USE_KEY_SMF \
251 || !BX_USE_PAR_SMF || !BX_USE_PIC_SMF || !BX_USE_PIT_SMF \
252 || !BX_USE_SER_SMF || !BX_USE_UM_SMF || !BX_USE_VGA_SMF \
253 || !BX_USE_SB16_SMF || !BX_USE_DEV_SMF || !BX_USE_PCI_SMF \
254 || !BX_USE_P2I_SMF || !BX_USE_PCIVGA_SMF || !BX_USE_PCIUSB_SMF \
255 || !BX_USE_PCIPNIC_SMF || !BX_USE_PIDE_SMF || !BX_USE_ACPI_SMF \
256 || !BX_USE_NE2K_SMF || !BX_USE_EFI_SMF || !BX_USE_GAMEPORT_SMF \
257 || !BX_USE_PCIDEV_SMF || !BX_USE_CIRRUS_SMF)
258 #error You must use SMF to have plugins
259 #endif
261 #define BX_SUPPORT_SB16 0
262 #define BX_SUPPORT_GAMEPORT 0
264 #if BX_SUPPORT_SB16
265 // Use virtual methods for the sound output functions
266 #define BX_USE_SOUND_VIRTUAL 1
267 // Determines which sound output class is to be used.
268 // Currently the following are available:
269 // bx_sound_linux_c Output for Linux, to /dev/dsp and /dev/midi00
270 // bx_sound_windows_c Output for Windows midi and wave mappers
271 // bx_sound_output_c Dummy functions, no output
272 #define BX_SOUND_OUTPUT_C bx_sound_output_c
273 #endif
275 #define USE_RAW_SERIAL 0
277 // This enables writing to port 0xe9 and the output
278 // is sent to the console. Reading from port 0xe9
279 // will return 0xe9 to let you know this is available.
280 // Leave this 0 unless you have a reason to use it.
281 #define BX_PORT_E9_HACK 0
283 #define BX_GDBSTUB 0
285 // This option enables compressed (zlib) hd support
286 #define BX_COMPRESSED_HD_SUPPORT 0
287 #define BX_HAVE_ZLIB 0
289 #if BX_COMPRESSED_HD_SUPPORT && !BX_HAVE_ZLIB
290 #error You must have zlib to enable compressed hd support
291 #endif
293 // This option defines the number of supported ATA channels.
294 // There are up to two drives per ATA channel.
295 #define BX_MAX_ATA_CHANNEL 4
297 #if (BX_MAX_ATA_CHANNEL>4 || BX_MAX_ATA_CHANNEL<1)
298 # error "BX_MAX_ATA_CHANNEL should be between 1 and 4"
299 #endif
301 // =================================================================
302 // BEGIN: OPTIONAL DEBUGGER SECTION
304 // These options are only used if you compile in support for the
305 // native command line debugging environment. Typically, the debugger
306 // is not used, and this section can be ignored.
307 // =================================================================
309 // Compile in support for virtual/linear/physical breakpoints.
310 // Enable only those you need. Recommend using only linear
311 // breakpoints, unless you need others. Less supported means
312 // slightly faster execution time.
313 #define BX_DBG_MAX_VIR_BPOINTS 10
314 #define BX_DBG_MAX_LIN_BPOINTS 10
315 #define BX_DBG_MAX_PHY_BPOINTS 10
317 // max file pathname size for debugger commands
318 #define BX_MAX_PATH 256
319 // max nesting level for debug scripts including other scripts
320 #define BX_INFILE_DEPTH 10
321 // use this command to include (nest) debug scripts
322 #define BX_INCLUDE_CMD "source"
324 // Make a call to command line debugger extensions. If set to 1,
325 // a call is made. An external routine has a chance to process
326 // the command. If it does, than the debugger ignores the command.
327 #define BX_DBG_EXTENSIONS 0
329 // =================================================================
330 // END: OPTIONAL DEBUGGER SECTION
331 // =================================================================
333 //////////////////////////////////////////////////////////////////////
334 // END OF USER CONFIGURABLE OPTIONS : DON'T EDIT ANYTHING BELOW !!! //
335 // THIS IS GENERATED BY THE ./configure SCRIPT //
336 //////////////////////////////////////////////////////////////////////
339 #define BX_WITH_X11 0
340 #define BX_WITH_BEOS 0
341 #define BX_WITH_WIN32 0
342 #define BX_WITH_MACOS 0
343 #define BX_WITH_CARBON 0
344 #define BX_WITH_NOGUI 0
345 #define BX_WITH_TERM 0
346 #define BX_WITH_RFB 0
347 #define BX_WITH_AMIGAOS 0
348 #define BX_WITH_SDL 0
349 #define BX_WITH_SVGA 0
350 #define BX_WITH_WX 0
352 // BX_USE_TEXTCONFIG should be set to 1 unless Bochs is compiled
353 // for wxWidgets only.
354 #define BX_USE_TEXTCONFIG 1
356 // add special export symbols for win32 DLL building. The main code must
357 // have __declspec(dllexport) on variables, functions, or classes that the
358 // plugins can access. The plugins should #define PLUGGABLE which will
359 // activate the __declspec(dllimport) instead.
360 #if defined(WIN32) || defined(__CYGWIN__)
361 # if BX_PLUGINS && defined(BX_PLUGGABLE)
362 // #warning I will import DLL symbols from Bochs main program.
363 # define BOCHSAPI __declspec(dllimport)
364 # elif BX_PLUGINS
365 // #warning I will export DLL symbols.
366 # define BOCHSAPI __declspec(dllexport)
367 # endif
368 #endif
369 #ifndef BOCHSAPI
370 # define BOCHSAPI
371 #endif
373 #if defined(__CYGWIN__)
374 // Make BOCHSAPI_CYGONLY exactly the same as BOCHSAPI. This symbol
375 // will be used for any cases where Cygwin requires a special tag
376 // but VC++ does not.
377 #define BOCHSAPI_CYGONLY BOCHSAPI
378 #else
379 // define the symbol to be empty
380 #define BOCHSAPI_CYGONLY /*empty*/
381 #endif
383 #if defined(_MSC_VER)
384 // Make BOCHSAPI_MSVCONLY exactly the same as BOCHSAPI. This symbol
385 // will be used for any cases where VC++ requires a special tag
386 // but Cygwin does not.
387 #define BOCHSAPI_MSVCONLY BOCHSAPI
388 #else
389 // define the symbol to be empty
390 #define BOCHSAPI_MSVCONLY /*empty*/
391 #endif
393 #define BX_DEFAULT_CONFIG_INTERFACE "defined_by_configure"
394 #define BX_DEFAULT_DISPLAY_LIBRARY "defined_by_configure"
396 // Roland Mainz's idle hack is presently specific to X11. If people try to
397 // enable it elsewhere, give a compile error so that they don't waste their
398 // time trying.
399 #if (BX_USE_IDLE_HACK && !BX_WITH_X11 && !BX_WITH_TERM)
400 # error IDLE_HACK will only work with the X11 or term gui. Correct configure args and retry.
401 #endif
403 #define WORDS_BIGENDIAN 0
405 #define SIZEOF_UNSIGNED_CHAR 0
406 #define SIZEOF_UNSIGNED_SHORT 0
407 #define SIZEOF_UNSIGNED_INT 0
408 #define SIZEOF_UNSIGNED_LONG 0
409 #define SIZEOF_UNSIGNED_LONG_LONG 0
410 #define SIZEOF_INT_P 0
412 #define BX_64BIT_CONSTANTS_USE_LL 1
413 #if BX_64BIT_CONSTANTS_USE_LL
414 // doesn't work on Microsoft Visual C++, maybe others
415 #define BX_CONST64(x) (x##LL)
416 #else
417 #define BX_CONST64(x) (x)
418 #endif
420 #if defined(WIN32)
421 typedef unsigned char Bit8u;
422 typedef signed char Bit8s;
423 typedef unsigned short Bit16u;
424 typedef signed short Bit16s;
425 typedef unsigned int Bit32u;
426 typedef signed int Bit32s;
427 #ifdef __MINGW32__
428 typedef unsigned long long Bit64u;
429 typedef signed long long Bit64s;
430 #include <sys/types.h>
431 #else
432 typedef unsigned __int64 Bit64u;
433 typedef signed __int64 Bit64s;
434 #endif
435 #elif BX_WITH_MACOS
436 typedef unsigned char Bit8u;
437 typedef signed char Bit8s;
438 typedef unsigned short Bit16u;
439 typedef signed short Bit16s;
440 typedef unsigned int Bit32u;
441 typedef signed int Bit32s;
442 typedef unsigned long long Bit64u;
443 typedef signed long long Bit64s;
444 #else
446 // Unix like platforms
448 #if SIZEOF_UNSIGNED_CHAR != 1
449 # error "sizeof (unsigned char) != 1"
450 #else
451 typedef unsigned char Bit8u;
452 typedef signed char Bit8s;
453 #endif
455 #if SIZEOF_UNSIGNED_SHORT != 2
456 # error "sizeof (unsigned short) != 2"
457 #else
458 typedef unsigned short Bit16u;
459 typedef signed short Bit16s;
460 #endif
462 #if SIZEOF_UNSIGNED_INT == 4
463 typedef unsigned int Bit32u;
464 typedef signed int Bit32s;
465 #elif SIZEOF_UNSIGNED_LONG == 4
466 typedef unsigned long Bit32u;
467 typedef signed long Bit32s;
468 #else
469 # error "can't find sizeof(type) of 4 bytes!"
470 #endif
472 #if SIZEOF_UNSIGNED_LONG == 8
473 typedef unsigned long Bit64u;
474 typedef signed long Bit64s;
475 #elif SIZEOF_UNSIGNED_LONG_LONG == 8
476 typedef unsigned long long Bit64u;
477 typedef signed long long Bit64s;
478 #else
479 # error "can't find data type of 8 bytes"
480 #endif
482 #endif
484 #define GET32L(val64) ((Bit32u)(((Bit64u)(val64)) & 0xFFFFFFFF))
485 #define GET32H(val64) ((Bit32u)(((Bit64u)(val64)) >> 32))
487 // now that Bit32u and Bit64u exist, defined bx_address
488 #if BX_SUPPORT_X86_64
489 typedef Bit64u bx_address;
490 #else
491 typedef Bit32u bx_address;
492 #endif
494 // define physical and linear address types
495 typedef Bit32u bx_phy_address;
496 typedef bx_address bx_lin_address;
498 #define BX_PHY_ADDRESS_WIDTH 32
499 #if BX_SUPPORT_X86_64
500 #define BX_LIN_ADDRESS_WIDTH 48
501 #else
502 #define BX_LIN_ADDRESS_WIDTH 32
503 #endif
505 // technically, in an 8 bit signed the real minimum is -128, not -127.
506 // But if you decide to negate -128 you tend to get -128 again, so it's
507 // better not to use the absolute maximum in the signed range.
508 #define BX_MAX_BIT64U ( (Bit64u) -1 )
509 #define BX_MIN_BIT64U ( 0 )
510 #define BX_MAX_BIT64S ( ((Bit64u) -1) >> 1 )
511 #define BX_MIN_BIT64S ( (Bit64s)-(((Bit64u) -1) >> 1) )
512 #define BX_MAX_BIT32U ( (Bit32u) -1 )
513 #define BX_MIN_BIT32U ( 0 )
514 #define BX_MAX_BIT32S ( ((Bit32u) -1) >> 1 )
515 #define BX_MIN_BIT32S ( (Bit32s)-(((Bit32u) -1) >> 1) )
516 #define BX_MAX_BIT16U ( (Bit16u) -1 )
517 #define BX_MIN_BIT16U ( 0 )
518 #define BX_MAX_BIT16S ( ((Bit16u) -1) >> 1 )
519 #define BX_MIN_BIT16S ( (Bit16s)-(((Bit16u) -1) >> 1) )
520 #define BX_MAX_BIT8U ( (Bit8u) -1 )
521 #define BX_MIN_BIT8U ( 0 )
522 #define BX_MAX_BIT8S ( ((Bit8u) -1) >> 1 )
523 #define BX_MIN_BIT8S ( (Bit8s)-(((Bit8u) -1) >> 1) )
526 // create an unsigned integer type that is the same size as a pointer.
527 // You can typecast a pointer to a bx_pr_equiv_t without losing any
528 // bits (and without getting the compiler excited). This is used in
529 // the FPU emulation code, where pointers and integers are often
530 // used interchangeably.
531 #if SIZEOF_INT_P == 4
532 typedef Bit32u bx_ptr_equiv_t;
533 #elif SIZEOF_INT_P == 8
534 typedef Bit64u bx_ptr_equiv_t;
535 #else
536 # error "could not define bx_ptr_equiv_t to size of int*"
537 #endif
539 // Use a boolean type that will not conflict with the builtin type
540 // on any system.
541 typedef Bit32u bx_bool;
543 #if BX_WITH_MACOS
544 # define bx_ptr_t char *
545 #else
546 # define bx_ptr_t void *
547 #endif
549 #if defined(WIN32)
550 # define BX_LITTLE_ENDIAN
551 #elif BX_WITH_MACOS
552 # define BX_BIG_ENDIAN
553 #else
554 #if WORDS_BIGENDIAN
555 # define BX_BIG_ENDIAN
556 #else
557 # define BX_LITTLE_ENDIAN
558 #endif
559 #endif // defined(WIN32)
562 #if BX_SUPPORT_X86_64
563 #ifdef BX_LITTLE_ENDIAN
564 typedef
565 struct {
566 Bit64u lo;
567 Bit64u hi;
568 } Bit128u;
569 typedef
570 struct {
571 Bit64u lo;
572 Bit64s hi;
573 } Bit128s;
574 #else // must be Big Endian
575 typedef
576 struct {
577 Bit64u hi;
578 Bit64u lo;
579 } Bit128u;
580 typedef
581 struct {
582 Bit64s hi;
583 Bit64u lo;
584 } Bit128s;
585 #endif
586 #endif // #if BX_SUPPORT_X86_64
589 // for now only term.cc requires a GUI sighandler.
590 #define BX_GUI_SIGHANDLER (BX_WITH_TERM)
592 #define HAVE_SIGACTION 1
594 // configure will change the definition of "inline" to the value
595 // that the C compiler allows. It tests the following keywords to
596 // see if any is permitted: inline, __inline__, __inline. If none
597 // is permitted, it defines inline to be empty.
598 #define inline inline
600 // inline functions in headers that are compiled with C compiler
601 // (e.g. fpu code) are declared with BX_C_INLINE macro. Note that
602 // the word "inline" itself may now be redefined by the above #define.
603 // Many compilers are known to work with "static inline". If the
604 // compiler can put the function inline, it does so and never creates
605 // a symbol for the function. If optimization is off, or inline is
606 // defined to be empty, the static keyword causes the function to create
607 // a symbol that's visible only to that .c file. Each .c file that
608 // includes the header will produde another local version of the
609 // BX_C_INLINE function (not ideal). However without "static" you can
610 // duplicate symbol problems which are even worse.
611 #define BX_C_INLINE static inline
613 // Use BX_CPP_INLINE for all C++ inline functions. Note that the
614 // word "inline" itself may now be redefined by the above #define.
615 #define BX_CPP_INLINE inline
617 #ifdef __GNUC__
619 // Some helpful compiler hints for compilers that allow them; GCC for now.
621 // BX_CPP_AlignN(n):
622 // Align a construct on an n-byte boundary.
624 // BX_CPP_AttrPrintf(formatArg, firstArg):
625 // This function takes printf-like arguments, so the compiler can check
626 // the consistency of the format string and the matching arguments.
627 // 'formatArg' is the parameter number (starting from 1) of the format
628 // string argument. 'firstArg' is the parameter number of the 1st argument
629 // to check against the string argument. NOTE: For non-static member
630 // functions, the this-ptr is argument number 1 but is invisible on
631 // the function prototype declaration - but you still have to count it.
633 // BX_CPP_AttrNoReturn():
634 // This function never returns. The compiler can optimize-out following
635 // code accordingly.
637 #define BX_CPP_AlignN(n) __attribute__ ((aligned (n)))
638 #define BX_CPP_AttrPrintf(formatArg, firstArg) \
639 __attribute__ ((format (printf, formatArg, firstArg)))
640 #define BX_CPP_AttrNoReturn() __attribute__ ((noreturn))
642 #else
644 #define BX_CPP_AlignN(n) /* Not supported. */
645 #define BX_CPP_AttrPrintf(formatArg, firstArg) /* Not supported. */
646 #define BX_CPP_AttrNoReturn() /* Not supported. */
648 #endif
650 #define BX_DEBUGGER 0
651 #define BX_DISASM 0
653 #if (BX_DEBUGGER == 1) && (BX_DISASM == 0)
654 #error Dissembler is required for BX_DEBUGGER !
655 #endif
657 #define BX_PROVIDE_CPU_MEMORY 1
658 #define BX_PROVIDE_DEVICE_MODELS 1
660 #define BX_PROVIDE_MAIN 1
662 #define BX_INSTRUMENTATION 0
664 // enable BX_DEBUG/BX_ERROR/BX_INFO messages
665 #define BX_NO_LOGGING 0
667 // limited i440FX PCI support
668 #define BX_SUPPORT_PCI 0
670 // Bochs VBE display interface
671 #define BX_SUPPORT_VBE 0
673 // CLGD54XX emulation
674 #define BX_SUPPORT_CLGD54XX 0
676 // CLGD54XX PCI emulation
677 #define BX_SUPPORT_CLGD54XX_PCI 0
679 #if (BX_SUPPORT_CLGD54XX_PCI && !BX_SUPPORT_PCI)
680 #error To enable CL-GD54xx PCI support, you must also enable PCI
681 #endif
683 // ACPI controller
684 #define BX_SUPPORT_ACPI 0
686 #if (BX_SUPPORT_ACPI && !BX_SUPPORT_PCI)
687 #error To enable ACPI support, you must also enable PCI
688 #endif
690 // Experimental VGA on PCI
691 #define BX_SUPPORT_PCIVGA 0
693 // Experimental host PCI device mapping
694 #define BX_SUPPORT_PCIDEV 0
696 #if (BX_SUPPORT_PCIDEV && !BX_SUPPORT_PCI)
697 #error To enable PCI host device mapping, you must also enable PCI
698 #endif
700 // limited USB on PCI
701 #define BX_SUPPORT_PCIUSB 0
703 #if (BX_SUPPORT_PCIUSB && !BX_SUPPORT_PCI)
704 #error To enable USB, you must also enable PCI
705 #endif
707 #define BX_SUPPORT_BUSMOUSE 0
709 #define BX_SUPPORT_V8086_MODE 1
710 #define BX_SUPPORT_ALIGNMENT_CHECK 0
711 #define BX_SUPPORT_FPU 0
712 #define BX_SUPPORT_MMX 0
713 #define BX_SUPPORT_3DNOW 0
714 #define BX_SUPPORT_SSE 0
715 #define BX_SUPPORT_SSE_EXTENSION 0
716 #define BX_SUPPORT_DAZ 0
717 #define BX_SUPPORT_MISALIGNED_SSE 0
718 #define BX_SUPPORT_SEP 0
719 #define BX_SUPPORT_VME 0
720 #define BX_SUPPORT_POPCNT 0
721 #define BX_SUPPORT_MONITOR_MWAIT 0
722 #define BX_SUPPORT_MTRR 0
724 #define BX_SUPPORT_LARGE_PAGES 0
725 #define BX_SUPPORT_GLOBAL_PAGES 0
726 #define BX_SUPPORT_PAE 0
728 #define BX_SupportGuest2HostTLB 0
729 #define BX_SupportRepeatSpeedups 0
730 #define BX_SupportHostAsms 0
732 #define BX_SUPPORT_ICACHE 0
734 // if 1, don't do gpf on MSRs that we don't implement
735 #define BX_IGNORE_BAD_MSR 0
737 // CLFLUSH was introduced together with SSE2 instruction set
738 #if BX_SUPPORT_SSE >= 2
739 #define BX_SUPPORT_CLFLUSH 1
740 #else
741 #define BX_SUPPORT_CLFLUSH 0
742 #endif
744 #if (BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL < 4)
745 #error Alignment exception check is not supported in i386 !
746 #endif
748 #if (BX_SUPPORT_VME && BX_CPU_LEVEL < 5)
749 #error With CPU level < 5, you must disable v8086 mode extensions !
750 #endif
752 #if (BX_SUPPORT_VME && !BX_SUPPORT_V8086_MODE)
753 #error You must enable v8086 mode support to use v8086 mode extensions !
754 #endif
756 #if (BX_SUPPORT_MMX && BX_CPU_LEVEL < 5)
757 #error With CPU level < 5, you must disable MMX support !
758 #endif
760 #if (!BX_SUPPORT_FPU && BX_CPU_LEVEL >= 5)
761 #error With CPU level >= 5, you must enable FPU support !
762 #endif
764 #if (BX_SUPPORT_MMX && !BX_SUPPORT_FPU)
765 #error "MMX cannot be compiled without FPU support !"
766 #endif
768 #if (BX_SUPPORT_FPU && BX_CPU_LEVEL < 3)
769 #error "FPU cannot be compiled without cpu level >= 3 !"
770 #endif
772 #if (BX_SUPPORT_3DNOW && !BX_SUPPORT_MMX)
773 #error "3DNow! cannot be compiled without MMX support !"
774 #endif
776 #if (BX_SUPPORT_SSE && !BX_SUPPORT_MMX)
777 #error "SSE cannot be compiled without FPU+MMX support !"
778 #endif
780 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SSE)
781 #error "SSE is only supported with CPU_LEVEL >= 6 !"
782 #endif
784 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SEP)
785 #error "SYSENTER/SYSEXIT only supported with CPU_LEVEL >= 6 !"
786 #endif
788 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_PAE)
789 #error "Physical Address Extensions (PAE) only supported with CPU_LEVEL >= 6 !"
790 #endif
791 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_GLOBAL_PAGES)
792 #error "Page Global Extension (PGE) only supported with CPU_LEVEL >= 6 !"
793 #endif
794 #if (BX_CPU_LEVEL<5 && BX_SUPPORT_LARGE_PAGES)
795 #error "Page Size Extension (PSE) only supported with CPU_LEVEL >= 5 !"
796 #endif
797 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_MTRR)
798 #error "MTRRs only supported with CPU_LEVEL >= 6 !"
799 #endif
801 #if (BX_SUPPORT_PAE && !BX_SUPPORT_LARGE_PAGES)
802 #error "Physical Address Extensions (PAE) requires large pages support !"
803 #endif
805 #if BX_SUPPORT_X86_64
806 // Sanity checks to ensure that you cannot accidently use conflicting options.
808 #if BX_CPU_LEVEL < 6
809 #error "X86-64 requires cpu level 6 or greater !"
810 #endif
811 #if (BX_SUPPORT_SSE<2)
812 #error "X86-64 requires SSE2 !"
813 #endif
814 #if !BX_SUPPORT_PAE
815 #error "X86-64 requires Physical Address Extensions (PAE) !"
816 #endif
817 #if !BX_SUPPORT_GLOBAL_PAGES
818 #error "X86-64 requires Page Global Extension (PGE) !"
819 #endif
820 #if !BX_SUPPORT_LARGE_PAGES
821 #error "X86-64 requires Page Size Extension (PSE) !"
822 #endif
823 #endif
825 #define BX_HAVE_GETENV 0
826 #define BX_HAVE_SETENV 0
827 #define BX_HAVE_SELECT 0
828 #define BX_HAVE_SNPRINTF 0
829 #define BX_HAVE_VSNPRINTF 0
830 #define BX_HAVE_STRTOULL 0
831 #define BX_HAVE_STRTOUQ 0
832 #define BX_HAVE_STRDUP 0
833 #define BX_HAVE_STRREV 0
834 #define BX_HAVE_STRUCT_TIMEVAL 0
836 // used in term gui
837 #define BX_HAVE_COLOR_SET 0
838 #define BX_HAVE_MVHLINE 0
839 #define BX_HAVE_MVVLINE 0
842 // set if your compiler does not permit an empty struct
843 #define BX_NO_EMPTY_STRUCTS 0
845 // set if your compiler does not understand __attribute__ after a struct
846 #define BX_NO_ATTRIBUTES 0
847 #if BX_NO_ATTRIBUTES
848 #define GCC_ATTRIBUTE(x) /* attribute not supported */
849 #else
850 #define GCC_ATTRIBUTE __attribute__
851 #endif
853 // set to use fast function calls
854 #define BX_FAST_FUNC_CALL 0
856 // On gcc2.95+ x86 only
857 #if BX_FAST_FUNC_CALL && defined(__i386__) && defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
858 #if BX_USE_CPU_SMF == 1
859 # define BX_CPP_AttrRegparmN(X) __attribute__((regparm(X)))
860 #else
861 // FIXME: BX_FAST_FUNC_CALL doesn't work with BX_USE_CPU_SMF = 0
862 # define BX_CPP_AttrRegparmN(X) /* Not defined */
863 #endif
864 #else
865 # define BX_CPP_AttrRegparmN(X) /* Not defined */
866 #endif
868 // set if your compiler does not allow label at the end of a {} block
869 #define BX_NO_BLANK_LABELS 0
871 // set if you do have <hash_map>, used in bx_debug/dbg_main.c
872 #define BX_HAVE_HASH_MAP 0
874 // set if you do have <hash_map.h>, used in bx_debug/dbg_main.c
875 #define BX_HAVE_HASH_MAP_H 0
877 // set if you do have <set>, used in bx_debug/dbg_main.c
878 #define BX_HAVE_SET 0
880 // set if you do have <set.h>, used in bx_debug/dbg_main.c
881 #define BX_HAVE_SET_H 0
883 // Support x86 hardware debugger registers and facilites.
884 // These are the debug facilites offered by the x86 architecture,
885 // not the optional built-in debugger.
886 #define BX_X86_DEBUGGER 0
888 #define BX_SUPPORT_CDROM 0
890 #if BX_SUPPORT_CDROM
891 // This is the C++ class name to use if we are supporting
892 // low-level CDROM.
893 # define LOWLEVEL_CDROM cdrom_interface
894 #endif
896 // NE2K network emulation
897 #define BX_SUPPORT_NE2K 0
899 // Pseudo PCI NIC
900 #define BX_SUPPORT_PCIPNIC 0
902 #if (BX_SUPPORT_PCIPNIC && !BX_SUPPORT_PCI)
903 #error To enable the PCI pseudo NIC, you must also enable PCI
904 #endif
906 // this enables the lowlevel stuff below if one of the NICs is present
907 #define BX_NETWORKING 0
909 #define BX_ETH_NULL_LOGGING 1
910 #define BX_ETH_FBSD_LOGGING 1
912 // determine which NE2K packet mover modules will be enabled
913 // (this was moved from iodev/eth.h)
914 #define ETH_NULL 1
915 #ifdef BX_USE_ETH_ARPBACK
916 # define ETH_ARPBACK 1
917 #endif
918 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__NetBSD_kernel__) || defined(__APPLE__)
919 #define ETH_FBSD 1
920 #endif
921 #if defined(linux)
922 #define ETH_LINUX 1
923 #endif
924 #if defined(WIN32)
925 #define ETH_WIN32 1
926 #endif
928 // this enables Ethertap packet mover; determined by configure script
929 #define HAVE_ETHERTAP 0
931 // this enables TUN/TAP packet mover; determined by configure script
932 #define HAVE_TUNTAP 0
934 // this enables VDE packet mover; determined by configure script
935 #define HAVE_VDE 0
938 // I/O Interface to debug
939 #define BX_SUPPORT_IODEBUG 0
941 // External Debugger
942 #define BX_EXTERNAL_DEBUGGER 0
944 // Magic breakpoints
945 #define BX_MAGIC_BREAKPOINT 1
947 #ifdef WIN32
948 #define BX_FLOPPY0_NAME "Floppy Disk A:"
949 #define BX_FLOPPY1_NAME "Floppy Disk B:"
950 #else
951 #define BX_FLOPPY0_NAME "Floppy Disk 0"
952 #define BX_FLOPPY1_NAME "Floppy Disk 1"
953 #endif
955 #endif // _BX_CONFIG_H