- removed support for old-style syntax userbutton shortcuts
[bochs-mirror.git] / config.h.in
blob8312d18af0ee7aad1fbdfd3108fdc24e5ddce055
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.
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 // 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
114 // it to 0.
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 #define BX_HAVE_SLEEP 0
137 #define BX_HAVE_MSLEEP 0
138 #define BX_HAVE_USLEEP 0
139 #define BX_HAVE_NANOSLEEP 0
140 #define BX_HAVE_ABORT 0
141 #define BX_HAVE_SOCKLEN_T 0
142 #define BX_HAVE_SOCKADDR_IN_SIN_LEN 0
143 #define BX_HAVE_GETTIMEOFDAY 0
144 #if defined(WIN32)
145 #define BX_HAVE_REALTIME_USEC 1
146 #else
147 #define BX_HAVE_REALTIME_USEC (BX_HAVE_GETTIMEOFDAY)
148 #endif
149 #define BX_HAVE_MKSTEMP 0
150 #define BX_HAVE_SYS_MMAN_H 0
151 #define BX_HAVE_XPM_H 0
152 #define BX_HAVE_TIMELOCAL 0
153 #define BX_HAVE_GMTIME 0
154 #define BX_HAVE_MKTIME 0
155 #define BX_HAVE_NET_IF_H 0
157 // This turns on Roland Mainz's idle hack. Presently it is specific to the X11
158 // and term gui. If people try to enable it elsewhere, give a compile error
159 // after the gui definition so that they don't waste their time trying.
160 #define BX_USE_IDLE_HACK 0
162 // Minimum Emulated IPS.
163 // This is used in the realtime PIT as well as for checking the
164 // IPS value set in the config file.
165 #define BX_MIN_IPS 200000
167 // Minimum and maximum values for SMP quantum variable. Defines
168 // how many instructions each CPU could execute execute in one
169 // shot (one cpu_loop call)
170 #define BX_SMP_QUANTUM_MIN 1
171 #define BX_SMP_QUANTUM_MAX 16
173 // Use Static Member Funtions to eliminate 'this' pointer passing
174 // If you want the efficiency of 'C', you can make all the
175 // members of the C++ CPU class to be static.
176 // This defaults to 1 since it should improve performance, but when
177 // SMP mode is enabled, it will be turned off by configure.
178 #define BX_USE_CPU_SMF 1
180 #define BX_USE_MEM_SMF 1
182 // Use static member functions in IO DEVice emulation modules.
183 // For efficiency, use C like functions for IO handling,
184 // and declare a device instance at compile time,
185 // instead of using 'new' and storing the pointer. This
186 // eliminates some overhead, especially for high-use IO
187 // devices like the disk drive.
188 // 1 = Use static member efficiency (normal)
189 // 0 = Use nonstatic member functions (use only if you need
190 // multiple instances of a device class
192 #define BX_USE_HD_SMF 1 // Hard drive
193 #define BX_USE_BIOS_SMF 1 // BIOS
194 #define BX_USE_CMOS_SMF 1 // CMOS
195 #define BX_USE_DMA_SMF 1 // DMA
196 #define BX_USE_FD_SMF 1 // Floppy
197 #define BX_USE_KEY_SMF 1 // Keyboard
198 #define BX_USE_PAR_SMF 1 // Parallel
199 #define BX_USE_PIC_SMF 1 // PIC
200 #define BX_USE_PIT_SMF 1 // PIT
201 #define BX_USE_SER_SMF 1 // Serial
202 #define BX_USE_UM_SMF 1 // Unmapped
203 #define BX_USE_VGA_SMF 1 // VGA
204 #define BX_USE_SB16_SMF 1 // Sound (SB 16)
205 #define BX_USE_DEV_SMF 1 // System Devices (port92)
206 #define BX_USE_PCI_SMF 1 // PCI
207 #define BX_USE_P2I_SMF 1 // PCI-to-ISA bridge
208 #define BX_USE_PIDE_SMF 1 // PCI-IDE
209 #define BX_USE_PCIVGA_SMF 1 // PCI-VGA
210 #define BX_USE_PCIDEV_SMF 1 // PCI-DEV
211 #define BX_USE_PCIUSB_SMF 1 // USB hub
212 #define BX_USE_PCIPNIC_SMF 1 // PCI pseudo NIC
213 #define BX_USE_NE2K_SMF 1 // NE2K
214 #define BX_USE_EFI_SMF 1 // External FPU IRQ
215 #define BX_USE_GAMEPORT_SMF 1 // Gameport
216 #define BX_USE_CIRRUS_SMF 1 // SVGA Cirrus
217 #define BX_USE_BUSM_SMF 1 // Bus Mouse
218 #define BX_USE_ACPI_SMF 1 // ACPI
220 #define BX_PLUGINS 0
221 #define BX_HAVE_DLFCN_H 0
223 #if BX_PLUGINS && \
224 ( !BX_USE_HD_SMF || !BX_USE_BIOS_SMF || !BX_USE_CMOS_SMF \
225 || !BX_USE_DMA_SMF || !BX_USE_FD_SMF || !BX_USE_KEY_SMF \
226 || !BX_USE_PAR_SMF || !BX_USE_PIC_SMF || !BX_USE_PIT_SMF \
227 || !BX_USE_SER_SMF || !BX_USE_UM_SMF || !BX_USE_VGA_SMF \
228 || !BX_USE_SB16_SMF || !BX_USE_DEV_SMF || !BX_USE_PCI_SMF \
229 || !BX_USE_P2I_SMF || !BX_USE_PCIVGA_SMF || !BX_USE_PCIUSB_SMF \
230 || !BX_USE_PCIPNIC_SMF || !BX_USE_PIDE_SMF || !BX_USE_ACPI_SMF \
231 || !BX_USE_NE2K_SMF || !BX_USE_EFI_SMF || !BX_USE_GAMEPORT_SMF \
232 || !BX_USE_PCIDEV_SMF || !BX_USE_CIRRUS_SMF)
233 #error You must use SMF to have plugins
234 #endif
236 #define BX_SUPPORT_SB16 0
237 #define BX_SUPPORT_GAMEPORT 0
239 #if BX_SUPPORT_SB16
240 // Use virtual methods for the sound output functions
241 #define BX_USE_SOUND_VIRTUAL 1
242 // Determines which sound output class is to be used.
243 // Currently the following are available:
244 // bx_sound_linux_c Output for Linux, to /dev/dsp and /dev/midi00
245 // bx_sound_windows_c Output for Windows midi and wave mappers
246 // bx_sound_output_c Dummy functions, no output
247 #define BX_SOUND_OUTPUT_C bx_sound_output_c
248 #endif
250 #define USE_RAW_SERIAL 0
252 // This enables writing to port 0xe9 and the output
253 // is sent to the console. Reading from port 0xe9
254 // will return 0xe9 to let you know this is available.
255 // Leave this 0 unless you have a reason to use it.
256 #define BX_PORT_E9_HACK 0
258 #define BX_GDBSTUB 0
260 // This option enables compressed (zlib) hd support
261 #define BX_COMPRESSED_HD_SUPPORT 0
262 #define BX_HAVE_ZLIB 0
264 #if BX_COMPRESSED_HD_SUPPORT && !BX_HAVE_ZLIB
265 #error You must have zlib to enable compressed hd support
266 #endif
268 // This option defines the number of supported ATA channels.
269 // There are up to two drives per ATA channel.
270 #define BX_MAX_ATA_CHANNEL 4
272 #if (BX_MAX_ATA_CHANNEL>4 || BX_MAX_ATA_CHANNEL<1)
273 # error "BX_MAX_ATA_CHANNEL should be between 1 and 4"
274 #endif
276 // =================================================================
277 // BEGIN: OPTIONAL DEBUGGER SECTION
279 // These options are only used if you compile in support for the
280 // native command line debugging environment. Typically, the debugger
281 // is not used, and this section can be ignored.
282 // =================================================================
284 // Compile in support for virtual/linear/physical breakpoints.
285 // Enable only those you need. Recommend using only linear
286 // breakpoints, unless you need others. Less supported means
287 // slightly faster execution time.
288 #define BX_DBG_MAX_VIR_BPOINTS 10
289 #define BX_DBG_MAX_LIN_BPOINTS 10
290 #define BX_DBG_MAX_PHY_BPOINTS 10
292 // max file pathname size for debugger commands
293 #define BX_MAX_PATH 256
294 // max nesting level for debug scripts including other scripts
295 #define BX_INFILE_DEPTH 10
296 // use this command to include (nest) debug scripts
297 #define BX_INCLUDE_CMD "source"
299 // Make a call to command line debugger extensions. If set to 1,
300 // a call is made. An external routine has a chance to process
301 // the command. If it does, than the debugger ignores the command.
302 #define BX_DBG_EXTENSIONS 0
304 // =================================================================
305 // END: OPTIONAL DEBUGGER SECTION
306 // =================================================================
308 //////////////////////////////////////////////////////////////////////
309 // END OF USER CONFIGURABLE OPTIONS : DON'T EDIT ANYTHING BELOW !!! //
310 // THIS IS GENERATED BY THE ./configure SCRIPT //
311 //////////////////////////////////////////////////////////////////////
314 #define BX_WITH_X11 0
315 #define BX_WITH_BEOS 0
316 #define BX_WITH_WIN32 0
317 #define BX_WITH_MACOS 0
318 #define BX_WITH_CARBON 0
319 #define BX_WITH_NOGUI 0
320 #define BX_WITH_TERM 0
321 #define BX_WITH_RFB 0
322 #define BX_WITH_AMIGAOS 0
323 #define BX_WITH_SDL 0
324 #define BX_WITH_SVGA 0
325 #define BX_WITH_WX 0
327 // BX_USE_TEXTCONFIG should be set to 1 unless Bochs is compiled
328 // for wxWidgets only.
329 #define BX_USE_TEXTCONFIG 1
331 // A certain functions must NOT be fastcall even if compiled with fastcall
332 // option, and those are callbacks from Windows which are defined either
333 // as cdecl or stdcall. The entry point main() also has to remain cdecl.
334 #ifndef CDECL
335 #if defined(_MSC_VER)
336 #define CDECL __cdecl
337 #else
338 #define CDECL
339 #endif
340 #endif
342 // add special export symbols for win32 DLL building. The main code must
343 // have __declspec(dllexport) on variables, functions, or classes that the
344 // plugins can access. The plugins should #define PLUGGABLE which will
345 // activate the __declspec(dllimport) instead.
346 #if defined(WIN32) || defined(__CYGWIN__)
347 # if BX_PLUGINS && defined(BX_PLUGGABLE)
348 // #warning I will import DLL symbols from Bochs main program.
349 # define BOCHSAPI __declspec(dllimport)
350 # elif BX_PLUGINS
351 // #warning I will export DLL symbols.
352 # define BOCHSAPI __declspec(dllexport)
353 # endif
354 #endif
355 #ifndef BOCHSAPI
356 # define BOCHSAPI
357 #endif
359 #if defined(__CYGWIN__)
360 // Make BOCHSAPI_CYGONLY exactly the same as BOCHSAPI. This symbol
361 // will be used for any cases where Cygwin requires a special tag
362 // but VC++ does not.
363 #define BOCHSAPI_CYGONLY BOCHSAPI
364 #else
365 // define the symbol to be empty
366 #define BOCHSAPI_CYGONLY /*empty*/
367 #endif
369 #if defined(_MSC_VER)
370 // Make BOCHSAPI_MSVCONLY exactly the same as BOCHSAPI. This symbol
371 // will be used for any cases where VC++ requires a special tag
372 // but Cygwin does not.
373 #define BOCHSAPI_MSVCONLY BOCHSAPI
374 #else
375 // define the symbol to be empty
376 #define BOCHSAPI_MSVCONLY /*empty*/
377 #endif
379 #define BX_DEFAULT_CONFIG_INTERFACE "defined_by_configure"
380 #define BX_DEFAULT_DISPLAY_LIBRARY "defined_by_configure"
382 // Roland Mainz's idle hack is presently specific to X11. If people try to
383 // enable it elsewhere, give a compile error so that they don't waste their
384 // time trying.
385 #if (BX_USE_IDLE_HACK && !BX_WITH_X11 && !BX_WITH_TERM)
386 # error IDLE_HACK will only work with the X11 or term gui. Correct configure args and retry.
387 #endif
389 #define WORDS_BIGENDIAN 0
391 #define SIZEOF_UNSIGNED_CHAR 0
392 #define SIZEOF_UNSIGNED_SHORT 0
393 #define SIZEOF_UNSIGNED_INT 0
394 #define SIZEOF_UNSIGNED_LONG 0
395 #define SIZEOF_UNSIGNED_LONG_LONG 0
396 #define SIZEOF_INT_P 0
398 #define BX_64BIT_CONSTANTS_USE_LL 1
399 #if BX_64BIT_CONSTANTS_USE_LL
400 // doesn't work on Microsoft Visual C++, maybe others
401 #define BX_CONST64(x) (x##LL)
402 #elif defined(_MSC_VER)
403 #define BX_CONST64(x) (x##I64)
404 #else
405 #define BX_CONST64(x) (x)
406 #endif
408 #if defined(WIN32)
409 typedef unsigned char Bit8u;
410 typedef signed char Bit8s;
411 typedef unsigned short Bit16u;
412 typedef signed short Bit16s;
413 typedef unsigned int Bit32u;
414 typedef signed int Bit32s;
415 #ifdef __MINGW32__
416 typedef unsigned long long Bit64u;
417 typedef signed long long Bit64s;
418 #include <sys/types.h>
419 #else
420 typedef unsigned __int64 Bit64u;
421 typedef signed __int64 Bit64s;
422 #endif
423 #elif BX_WITH_MACOS
424 typedef unsigned char Bit8u;
425 typedef signed char Bit8s;
426 typedef unsigned short Bit16u;
427 typedef signed short Bit16s;
428 typedef unsigned int Bit32u;
429 typedef signed int Bit32s;
430 typedef unsigned long long Bit64u;
431 typedef signed long long Bit64s;
432 #else
434 // Unix like platforms
436 #if SIZEOF_UNSIGNED_CHAR != 1
437 # error "sizeof (unsigned char) != 1"
438 #else
439 typedef unsigned char Bit8u;
440 typedef signed char Bit8s;
441 #endif
443 #if SIZEOF_UNSIGNED_SHORT != 2
444 # error "sizeof (unsigned short) != 2"
445 #else
446 typedef unsigned short Bit16u;
447 typedef signed short Bit16s;
448 #endif
450 #if SIZEOF_UNSIGNED_INT == 4
451 typedef unsigned int Bit32u;
452 typedef signed int Bit32s;
453 #elif SIZEOF_UNSIGNED_LONG == 4
454 typedef unsigned long Bit32u;
455 typedef signed long Bit32s;
456 #else
457 # error "can't find sizeof(type) of 4 bytes!"
458 #endif
460 #if SIZEOF_UNSIGNED_LONG == 8
461 typedef unsigned long Bit64u;
462 typedef signed long Bit64s;
463 #elif SIZEOF_UNSIGNED_LONG_LONG == 8
464 typedef unsigned long long Bit64u;
465 typedef signed long long Bit64s;
466 #else
467 # error "can't find data type of 8 bytes"
468 #endif
470 #endif
472 #define GET32L(val64) ((Bit32u)(((Bit64u)(val64)) & 0xFFFFFFFF))
473 #define GET32H(val64) ((Bit32u)(((Bit64u)(val64)) >> 32))
475 // now that Bit32u and Bit64u exist, defined bx_address
476 #if BX_SUPPORT_X86_64
477 typedef Bit64u bx_address;
478 #else
479 typedef Bit32u bx_address;
480 #endif
482 // define physical and linear address types
483 typedef Bit32u bx_phy_address;
484 typedef bx_address bx_lin_address;
486 #define BX_PHY_ADDRESS_WIDTH 32
487 #if BX_SUPPORT_X86_64
488 #define BX_LIN_ADDRESS_WIDTH 48
489 #else
490 #define BX_LIN_ADDRESS_WIDTH 32
491 #endif
493 // technically, in an 8 bit signed the real minimum is -128, not -127.
494 // But if you decide to negate -128 you tend to get -128 again, so it's
495 // better not to use the absolute maximum in the signed range.
496 #define BX_MAX_BIT64U ( (Bit64u) -1 )
497 #define BX_MIN_BIT64U ( 0 )
498 #define BX_MAX_BIT64S ( ((Bit64u) -1) >> 1 )
499 #define BX_MIN_BIT64S ( (Bit64s)-(((Bit64u) -1) >> 1) )
500 #define BX_MAX_BIT32U ( (Bit32u) -1 )
501 #define BX_MIN_BIT32U ( 0 )
502 #define BX_MAX_BIT32S ( ((Bit32u) -1) >> 1 )
503 #define BX_MIN_BIT32S ( (Bit32s)-(((Bit32u) -1) >> 1) )
504 #define BX_MAX_BIT16U ( (Bit16u) -1 )
505 #define BX_MIN_BIT16U ( 0 )
506 #define BX_MAX_BIT16S ( ((Bit16u) -1) >> 1 )
507 #define BX_MIN_BIT16S ( (Bit16s)-(((Bit16u) -1) >> 1) )
508 #define BX_MAX_BIT8U ( (Bit8u) -1 )
509 #define BX_MIN_BIT8U ( 0 )
510 #define BX_MAX_BIT8S ( ((Bit8u) -1) >> 1 )
511 #define BX_MIN_BIT8S ( (Bit8s)-(((Bit8u) -1) >> 1) )
514 // create an unsigned integer type that is the same size as a pointer.
515 // You can typecast a pointer to a bx_pr_equiv_t without losing any
516 // bits (and without getting the compiler excited). This is used in
517 // the FPU emulation code, where pointers and integers are often
518 // used interchangeably.
519 #if SIZEOF_INT_P == 4
520 typedef Bit32u bx_ptr_equiv_t;
521 #elif SIZEOF_INT_P == 8
522 typedef Bit64u bx_ptr_equiv_t;
523 #else
524 # error "could not define bx_ptr_equiv_t to size of int*"
525 #endif
527 // Use a boolean type that will not conflict with the builtin type
528 // on any system.
529 typedef Bit32u bx_bool;
531 #if BX_WITH_MACOS
532 # define bx_ptr_t char *
533 #else
534 # define bx_ptr_t void *
535 #endif
537 #if defined(WIN32)
538 # define BX_LITTLE_ENDIAN
539 #elif BX_WITH_MACOS
540 # define BX_BIG_ENDIAN
541 #else
542 #if WORDS_BIGENDIAN
543 # define BX_BIG_ENDIAN
544 #else
545 # define BX_LITTLE_ENDIAN
546 #endif
547 #endif // defined(WIN32)
550 #if BX_SUPPORT_X86_64
551 #ifdef BX_LITTLE_ENDIAN
552 typedef
553 struct {
554 Bit64u lo;
555 Bit64u hi;
556 } Bit128u;
557 typedef
558 struct {
559 Bit64u lo;
560 Bit64s hi;
561 } Bit128s;
562 #else // must be Big Endian
563 typedef
564 struct {
565 Bit64u hi;
566 Bit64u lo;
567 } Bit128u;
568 typedef
569 struct {
570 Bit64s hi;
571 Bit64u lo;
572 } Bit128s;
573 #endif
574 #endif // #if BX_SUPPORT_X86_64
577 // for now only term.cc requires a GUI sighandler.
578 #define BX_GUI_SIGHANDLER (BX_WITH_TERM)
580 #define HAVE_SIGACTION 1
582 // configure will change the definition of "inline" to the value
583 // that the C compiler allows. It tests the following keywords to
584 // see if any is permitted: inline, __inline__, __inline. If none
585 // is permitted, it defines inline to be empty.
586 #define inline inline
588 // inline functions in headers that are compiled with C compiler
589 // (e.g. fpu code) are declared with BX_C_INLINE macro. Note that
590 // the word "inline" itself may now be redefined by the above #define.
591 // Many compilers are known to work with "static inline". If the
592 // compiler can put the function inline, it does so and never creates
593 // a symbol for the function. If optimization is off, or inline is
594 // defined to be empty, the static keyword causes the function to create
595 // a symbol that's visible only to that .c file. Each .c file that
596 // includes the header will produde another local version of the
597 // BX_C_INLINE function (not ideal). However without "static" you can
598 // duplicate symbol problems which are even worse.
599 #define BX_C_INLINE static inline
601 // Use BX_CPP_INLINE for all C++ inline functions. Note that the
602 // word "inline" itself may now be redefined by the above #define.
603 #define BX_CPP_INLINE inline
605 #ifdef __GNUC__
607 // Some helpful compiler hints for compilers that allow them; GCC for now.
609 // BX_CPP_AlignN(n):
610 // Align a construct on an n-byte boundary.
612 // BX_CPP_AttrPrintf(formatArg, firstArg):
613 // This function takes printf-like arguments, so the compiler can check
614 // the consistency of the format string and the matching arguments.
615 // 'formatArg' is the parameter number (starting from 1) of the format
616 // string argument. 'firstArg' is the parameter number of the 1st argument
617 // to check against the string argument. NOTE: For non-static member
618 // functions, the this-ptr is argument number 1 but is invisible on
619 // the function prototype declaration - but you still have to count it.
621 // BX_CPP_AttrNoReturn():
622 // This function never returns. The compiler can optimize-out following
623 // code accordingly.
625 #define BX_CPP_AlignN(n) __attribute__ ((aligned (n)))
626 #define BX_CPP_AttrPrintf(formatArg, firstArg) \
627 __attribute__ ((format (printf, formatArg, firstArg)))
628 #define BX_CPP_AttrNoReturn() __attribute__ ((noreturn))
630 #else
632 #define BX_CPP_AlignN(n) /* Not supported. */
633 #define BX_CPP_AttrPrintf(formatArg, firstArg) /* Not supported. */
634 #define BX_CPP_AttrNoReturn() /* Not supported. */
636 #endif
638 #define BX_DEBUGGER 0
639 #define BX_DISASM 0
641 #if (BX_DEBUGGER == 1) && (BX_DISASM == 0)
642 #error Dissembler is required for BX_DEBUGGER !
643 #endif
645 #define BX_PROVIDE_CPU_MEMORY 1
646 #define BX_PROVIDE_DEVICE_MODELS 1
648 #define BX_PROVIDE_MAIN 1
650 #define BX_INSTRUMENTATION 0
652 // enable BX_DEBUG/BX_ERROR/BX_INFO messages
653 #define BX_NO_LOGGING 0
655 // limited i440FX PCI support
656 #define BX_SUPPORT_PCI 0
658 // Bochs VBE display interface
659 #define BX_SUPPORT_VBE 0
661 // CLGD54XX emulation
662 #define BX_SUPPORT_CLGD54XX 0
664 // ACPI controller
665 #define BX_SUPPORT_ACPI 0
667 #if (BX_SUPPORT_ACPI && !BX_SUPPORT_PCI)
668 #error To enable ACPI support, you must also enable PCI
669 #endif
671 // Experimental VGA on PCI
672 #define BX_SUPPORT_PCIVGA 0
674 // Experimental host PCI device mapping
675 #define BX_SUPPORT_PCIDEV 0
677 #if (BX_SUPPORT_PCIDEV && !BX_SUPPORT_PCI)
678 #error To enable PCI host device mapping, you must also enable PCI
679 #endif
681 // limited USB on PCI
682 #define BX_SUPPORT_PCIUSB 0
684 #if (BX_SUPPORT_PCIUSB && !BX_SUPPORT_PCI)
685 #error To enable USB, you must also enable PCI
686 #endif
688 #define BX_SUPPORT_BUSMOUSE 0
690 #define BX_SUPPORT_ALIGNMENT_CHECK 0
691 #define BX_SUPPORT_FPU 0
692 #define BX_SUPPORT_MMX 0
693 #define BX_SUPPORT_3DNOW 0
694 #define BX_SUPPORT_SSE 0
695 #define BX_SUPPORT_SSE_EXTENSION 0
696 #define BX_SUPPORT_SSE4A 0
697 #define BX_SUPPORT_SSE5A 0
698 #define BX_SUPPORT_DAZ 0
699 #define BX_SUPPORT_MISALIGNED_SSE 0
700 #define BX_SUPPORT_SEP 0
701 #define BX_SUPPORT_VME 0
702 #define BX_SUPPORT_POPCNT 0
703 #define BX_SUPPORT_MONITOR_MWAIT 0
704 #define BX_SUPPORT_XSAVE 0
706 #define BX_SUPPORT_MTRR 0
707 #define BX_SUPPORT_LARGE_PAGES 0
708 #define BX_SUPPORT_GLOBAL_PAGES 0
709 #define BX_SUPPORT_PAE 0
711 #define BX_SupportGuest2HostTLB 0
712 #define BX_SupportRepeatSpeedups 0
713 #define BX_SupportHostAsms 0
715 #define BX_SUPPORT_ICACHE 0
716 #define BX_SUPPORT_TRACE_CACHE 0
718 #if (BX_SUPPORT_TRACE_CACHE && BX_SUPPORT_ICACHE==0)
719 #error Trace cache optimization cannot be compiled without iCache!
720 #endif
722 // if 1, don't do gpf on MSRs that we don't implement
723 #define BX_IGNORE_BAD_MSR 0
725 // CLFLUSH was introduced together with SSE2 instruction set
726 #if BX_SUPPORT_SSE >= 2
727 #define BX_SUPPORT_CLFLUSH 1
728 #else
729 #define BX_SUPPORT_CLFLUSH 0
730 #endif
732 #if (BX_SUPPORT_ALIGNMENT_CHECK && BX_CPU_LEVEL < 4)
733 #error Alignment exception check is not supported in i386 !
734 #endif
736 #if (BX_SUPPORT_VME && BX_CPU_LEVEL < 5)
737 #error With CPU level < 5, you must disable v8086 mode extensions !
738 #endif
740 #if (BX_SUPPORT_MMX && BX_CPU_LEVEL < 5)
741 #error With CPU level < 5, you must disable MMX support !
742 #endif
744 #if (!BX_SUPPORT_FPU && BX_CPU_LEVEL > 4)
745 #error With CPU level > 4, you must enable FPU support !
746 #endif
748 #if (BX_SUPPORT_MMX && !BX_SUPPORT_FPU)
749 #error "MMX cannot be compiled without FPU support !"
750 #endif
752 #if (BX_SUPPORT_FPU && BX_CPU_LEVEL < 3)
753 #error "FPU cannot be compiled without cpu level >= 3 !"
754 #endif
756 #if (BX_SUPPORT_3DNOW && !BX_SUPPORT_MMX)
757 #error "3DNow! cannot be compiled without MMX support !"
758 #endif
760 #if (BX_SUPPORT_SSE && !BX_SUPPORT_MMX)
761 #error "SSE cannot be compiled without FPU+MMX support !"
762 #endif
764 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SSE)
765 #error "SSE is only supported with CPU_LEVEL >= 6 !"
766 #endif
768 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_SEP)
769 #error "SYSENTER/SYSEXIT only supported with CPU_LEVEL >= 6 !"
770 #endif
772 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_PAE)
773 #error "Physical Address Extensions (PAE) only supported with CPU_LEVEL >= 6 !"
774 #endif
775 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_GLOBAL_PAGES)
776 #error "Page Global Extension (PGE) only supported with CPU_LEVEL >= 6 !"
777 #endif
778 #if (BX_CPU_LEVEL<5 && BX_SUPPORT_LARGE_PAGES)
779 #error "Page Size Extension (PSE) only supported with CPU_LEVEL >= 5 !"
780 #endif
781 #if (BX_CPU_LEVEL<6 && BX_SUPPORT_MTRR)
782 #error "MTRRs only supported with CPU_LEVEL >= 6 !"
783 #endif
785 #if (BX_SUPPORT_PAE && !BX_SUPPORT_LARGE_PAGES)
786 #error "Physical Address Extensions (PAE) requires large pages support !"
787 #endif
789 #if BX_SUPPORT_X86_64
790 // Sanity checks to ensure that you cannot accidently use conflicting options.
792 #if BX_CPU_LEVEL < 6
793 #error "X86-64 requires cpu level 6 or greater !"
794 #endif
795 #if (BX_SUPPORT_SSE<2)
796 #error "X86-64 requires SSE2 !"
797 #endif
798 #if !BX_SUPPORT_PAE
799 #error "X86-64 requires Physical Address Extensions (PAE) !"
800 #endif
801 #if !BX_SUPPORT_GLOBAL_PAGES
802 #error "X86-64 requires Page Global Extension (PGE) !"
803 #endif
804 #if !BX_SUPPORT_LARGE_PAGES
805 #error "X86-64 requires Page Size Extension (PSE) !"
806 #endif
807 #endif
809 #define BX_HAVE_GETENV 0
810 #define BX_HAVE_SETENV 0
811 #define BX_HAVE_SELECT 0
812 #define BX_HAVE_SNPRINTF 0
813 #define BX_HAVE_VSNPRINTF 0
814 #define BX_HAVE_STRTOULL 0
815 #define BX_HAVE_STRTOUQ 0
816 #define BX_HAVE_STRDUP 0
817 #define BX_HAVE_STRREV 0
818 #define BX_HAVE_STRUCT_TIMEVAL 0
820 // used in term gui
821 #define BX_HAVE_COLOR_SET 0
822 #define BX_HAVE_MVHLINE 0
823 #define BX_HAVE_MVVLINE 0
826 // set if your compiler does not permit an empty struct
827 #define BX_NO_EMPTY_STRUCTS 0
829 // set if your compiler does not understand __attribute__ after a struct
830 #define BX_NO_ATTRIBUTES 0
831 #if BX_NO_ATTRIBUTES
832 #define GCC_ATTRIBUTE(x) /* attribute not supported */
833 #else
834 #define GCC_ATTRIBUTE __attribute__
835 #endif
837 // set to use fast function calls
838 #define BX_FAST_FUNC_CALL 0
840 // On gcc2.95+ x86 only
841 #if BX_FAST_FUNC_CALL && defined(__i386__) && defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
842 #if BX_USE_CPU_SMF == 1
843 # define BX_CPP_AttrRegparmN(X) __attribute__((regparm(X)))
844 #else
845 // FIXME: BX_FAST_FUNC_CALL doesn't work with BX_USE_CPU_SMF = 0
846 # define BX_CPP_AttrRegparmN(X) /* Not defined */
847 #endif
848 #else
849 # define BX_CPP_AttrRegparmN(X) /* Not defined */
850 #endif
852 // set if your compiler does not allow label at the end of a {} block
853 #define BX_NO_BLANK_LABELS 0
855 // set if you do have <hash_map>, used in bx_debug/dbg_main.c
856 #define BX_HAVE_HASH_MAP 0
858 // set if you do have <hash_map.h>, used in bx_debug/dbg_main.c
859 #define BX_HAVE_HASH_MAP_H 0
861 // set if you do have <set>, used in bx_debug/dbg_main.c
862 #define BX_HAVE_SET 0
864 // set if you do have <set.h>, used in bx_debug/dbg_main.c
865 #define BX_HAVE_SET_H 0
867 // Support x86 hardware debugger registers and facilites.
868 // These are the debug facilites offered by the x86 architecture,
869 // not the optional built-in debugger.
870 #define BX_X86_DEBUGGER 0
872 #define BX_SUPPORT_CDROM 0
874 #if BX_SUPPORT_CDROM
875 // This is the C++ class name to use if we are supporting
876 // low-level CDROM.
877 # define LOWLEVEL_CDROM cdrom_interface
878 #endif
880 // NE2K network emulation
881 #define BX_SUPPORT_NE2K 0
883 // Pseudo PCI NIC
884 #define BX_SUPPORT_PCIPNIC 0
886 #if (BX_SUPPORT_PCIPNIC && !BX_SUPPORT_PCI)
887 #error To enable the PCI pseudo NIC, you must also enable PCI
888 #endif
890 // this enables the lowlevel stuff below if one of the NICs is present
891 #define BX_NETWORKING 0
893 #define BX_ETH_NULL_LOGGING 1
894 #define BX_ETH_FBSD_LOGGING 1
896 // determine which NE2K packet mover modules will be enabled
897 // (this was moved from iodev/eth.h)
898 #define ETH_NULL 1
899 #ifdef BX_USE_ETH_ARPBACK
900 # define ETH_ARPBACK 1
901 #endif
902 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__NetBSD_kernel__) || defined(__APPLE__)
903 #define ETH_FBSD 1
904 #endif
905 #if defined(linux)
906 #define ETH_LINUX 1
907 #endif
908 #if defined(WIN32)
909 #define ETH_WIN32 1
910 #endif
912 // this enables Ethertap packet mover; determined by configure script
913 #define HAVE_ETHERTAP 0
915 // this enables TUN/TAP packet mover; determined by configure script
916 #define HAVE_TUNTAP 0
918 // this enables VDE packet mover; determined by configure script
919 #define HAVE_VDE 0
922 // I/O Interface to debug
923 #define BX_SUPPORT_IODEBUG 0
925 // External Debugger
926 #define BX_EXTERNAL_DEBUGGER 0
928 #ifdef WIN32
929 #define BX_FLOPPY0_NAME "Floppy Disk A:"
930 #define BX_FLOPPY1_NAME "Floppy Disk B:"
931 #else
932 #define BX_FLOPPY0_NAME "Floppy Disk 0"
933 #define BX_FLOPPY1_NAME "Floppy Disk 1"
934 #endif
936 #endif // _BX_CONFIG_H