1
1
/////////////////////////////////////////////////////////////////////////
2
// $Id: bochs.h,v 1.231 2008/05/23 14:04:42 sshwarts Exp $
2
// $Id: bochs.h,v 1.243 2009/03/15 12:54:59 vruppert Exp $
3
3
/////////////////////////////////////////////////////////////////////////
5
5
// Copyright (C) 2002 MandrakeSoft S.A.
23
23
// You should have received a copy of the GNU Lesser General Public
24
24
// License along with this library; if not, write to the Free Software
25
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
28
// bochs.h is the master header file for all C++ code. It includes all
198
198
#define BX_GET_ENABLE_A20() bx_pc_system.get_enable_a20()
200
200
#if BX_SUPPORT_A20
201
# define A20ADDR(x) (bx_phy_address(x) & bx_pc_system.a20_mask)
201
# define A20ADDR(x) ((bx_phy_address)(x) & bx_pc_system.a20_mask)
203
# define A20ADDR(x) (bx_phy_address(x))
203
# define A20ADDR(x) ((bx_phy_address)(x))
206
206
#if BX_SUPPORT_SMP
285
284
void pass(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3);
286
285
void ldebug(const char *fmt, ...) BX_CPP_AttrPrintf(2, 3);
287
286
void fatal (const char *prefix, const char *fmt, va_list ap, int exit_status);
288
#if BX_EXTERNAL_DEBUGGER
289
virtual void ask (int level, const char *prefix, const char *fmt, va_list ap);
291
287
void ask (int level, const char *prefix, const char *fmt, va_list ap);
293
288
void put(const char *);
295
289
void setio(class iofunctions *);
296
290
void setonoff(int loglev, int value) {
297
291
assert (loglev >= 0 && loglev < N_LOGLEV);
316
310
#define BX_LOGPREFIX_SIZE 51
319
IOLOG=0, FDLOG, GENLOG, CMOSLOG, CDLOG, DMALOG, ETHLOG, G2HLOG, HDLOG, KBDLOG,
320
NE2KLOG, PARLOG, PCILOG, PICLOG, PITLOG, SB16LOG, SERLOG, VGALOG,
321
DEVLOG, MEMLOG, DISLOG, GUILOG, IOAPICLOG, APICLOG, CPU0LOG, CPU1LOG,
322
CPU2LOG, CPU3LOG, CPU4LOG, CPU5LOG, CPU6LOG, CPU7LOG, CPU8LOG, CPU9LOG,
323
CPU10LOG, CPU11LOG, CPU12LOG, CPU13LOG, CPU14LOG, CPU15LOG, CTRLLOG,
324
UNMAPLOG, SERRLOG, BIOSLOG, PIT81LOG, PIT82LOG, IODEBUGLOG, PCI2ISALOG,
325
PLUGINLOG, EXTFPUIRQLOG , PCIVGALOG, PCIUSBLOG, VTIMERLOG, STIMERLOG,
326
PCIIDELOG, PCIDEVLOG, PCIPNICLOG, SPEAKERLOG, BUSMLOG, GAMELOG, ACPILOG
329
312
class BOCHSAPI iofunctions {
331
314
char logprefix[BX_LOGPREFIX_SIZE];
342
325
iofunctions(const char *);
343
326
~iofunctions(void);
345
void out(int facility, int level, const char *pre, const char *fmt, va_list ap);
328
void out(int level, const char *pre, const char *fmt, va_list ap);
347
330
void init_log(const char *fn);
348
331
void init_log(int fd);
403
386
#define BX_PANIC(x) (LOG_THIS panic) x
404
387
#define BX_PASS(x) (LOG_THIS pass) x
406
#define BX_ASSERT(x) do {if (!(x)) BX_PANIC(("failed assertion \"%s\" at %s:%d\n", #x, __FILE__, __LINE__));} while (0)
390
#define BX_ASSERT(x) do {if (!(x)) BX_PANIC(("failed assertion \"%s\" at %s:%d\n", #x, __FILE__, __LINE__));} while (0)
483
470
int bx_atexit(void);
484
471
BOCHSAPI extern bx_debug_t bx_dbg;
486
// memory access type (read/write/rw)
473
// memory access type (read/write/execute/rw)
487
474
#define BX_READ 0
488
475
#define BX_WRITE 1
491
#define DATA_ACCESS 0
492
#define CODE_ACCESS 1
494
479
#include "memory/memory.h"
495
480
#include "pc_system.h"
496
481
#include "plugin.h"
497
482
#include "gui/gui.h"
498
#include "gui/textconfig.h"
499
#include "gui/keymap.h"
501
484
/* --- EXTERNS --- */
519
502
#define BX_N_OPTRAM_IMAGES 4
520
503
#define BX_N_SERIAL_PORTS 4
521
504
#define BX_N_PARALLEL_PORTS 2
522
#define BX_N_USB_HUBS 1
505
#define BX_N_USB_UHCI_PORTS 2
506
#define BX_N_USB_OHCI_PORTS 2
507
#define BX_N_USB_HUB_PORTS 8
523
508
#define BX_N_PCI_SLOTS 5
526
#define BX_SMP_PROCESSORS (bx_cpu_count)
528
#define BX_SMP_PROCESSORS 1
509
#define BX_N_USER_PLUGINS 8
531
511
void bx_center_print(FILE *file, const char *line, unsigned maxwidth);