~ubuntu-branches/ubuntu/saucy/bochs/saucy-proposed

« back to all changes in this revision

Viewing changes to bochs.h

  • Committer: Bazaar Package Importer
  • Author(s): David Futcher
  • Date: 2009-04-30 07:46:11 UTC
  • mfrom: (1.1.11 upstream) (4.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090430074611-6dih80a5mk2uvxhk
Tags: 2.3.7+20090416-1ubuntu1
* Merge from debian unstable (LP: #370427), remaining changes:
  - debian/patches/12_no-ssp.patch: Build bios with -fno-stack-protector
  - Add Replaces/Conflicts for bochsbios-qemu (<< 2.3.6-2)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
/////////////////////////////////////////////////////////////////////////
4
4
//
5
5
//  Copyright (C) 2002  MandrakeSoft S.A.
22
22
//
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
26
26
 
27
27
//
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()
199
199
 
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)
202
202
#else
203
 
#  define A20ADDR(x)                (bx_phy_address(x))
 
203
#  define A20ADDR(x)                ((bx_phy_address)(x))
204
204
#endif
205
205
 
206
206
#if BX_SUPPORT_SMP
262
262
typedef class BOCHSAPI logfunctions
263
263
{
264
264
  char *prefix;
265
 
  int type;
266
265
// values of onoff: 0=ignore, 1=report, 2=ask, 3=fatal
267
266
#define ACT_IGNORE 0
268
267
#define ACT_REPORT 1
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);
290
 
#else
291
287
  void ask (int level, const char *prefix, const char *fmt, va_list ap);
292
 
#endif
293
288
  void put(const char *);
294
 
  void settype(int);
295
289
  void setio(class iofunctions *);
296
290
  void setonoff(int loglev, int value) {
297
291
    assert (loglev >= 0 && loglev < N_LOGLEV);
315
309
 
316
310
#define BX_LOGPREFIX_SIZE 51
317
311
 
318
 
enum {
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
327
 
};
328
 
 
329
312
class BOCHSAPI iofunctions {
330
313
  int magic;
331
314
  char logprefix[BX_LOGPREFIX_SIZE];
342
325
  iofunctions(const char *);
343
326
 ~iofunctions(void);
344
327
 
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);
346
329
 
347
330
  void init_log(const char *fn);
348
331
  void init_log(int fd);
373
356
 
374
357
protected:
375
358
  int n_logfn;
376
 
#define MAX_LOGFNS 128
 
359
#define MAX_LOGFNS 512
377
360
  logfunc_t *logfn_list[MAX_LOGFNS];
378
361
  const char *logfn;
379
362
};
403
386
#define BX_PANIC(x) (LOG_THIS panic) x
404
387
#define BX_PASS(x) (LOG_THIS pass) x
405
388
 
406
 
#define BX_ASSERT(x) do {if (!(x)) BX_PANIC(("failed assertion \"%s\" at %s:%d\n", #x, __FILE__, __LINE__));} while (0)
 
389
#if BX_ASSERT_ENABLE
 
390
  #define BX_ASSERT(x) do {if (!(x)) BX_PANIC(("failed assertion \"%s\" at %s:%d\n", #x, __FILE__, __LINE__));} while (0)
 
391
#else
 
392
  #define BX_ASSERT(x)
 
393
#endif
407
394
 
408
395
#endif
409
396
 
483
470
int bx_atexit(void);
484
471
BOCHSAPI extern bx_debug_t bx_dbg;
485
472
 
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
489
 
#define BX_RW           2
490
 
 
491
 
#define DATA_ACCESS     0
492
 
#define CODE_ACCESS     1
 
476
#define BX_EXECUTE      2
 
477
#define BX_RW           3
493
478
 
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"
500
483
 
501
484
/* --- EXTERNS --- */
502
485
 
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
524
 
 
525
 
#if BX_SUPPORT_SMP
526
 
  #define BX_SMP_PROCESSORS (bx_cpu_count)
527
 
#else
528
 
  #define BX_SMP_PROCESSORS 1
529
 
#endif
 
509
#define BX_N_USER_PLUGINS 8
530
510
 
531
511
void bx_center_print(FILE *file, const char *line, unsigned maxwidth);
532
512