Now devices could be compiled separatelly from CPU

Averything that required cpu.h include now has it explicitly and there are a lot of files not dependant by CPU at all which will compile a lot faster now ...
This commit is contained in:
Stanislav Shwartsman 2006-03-06 22:03:16 +00:00
parent c0aeb1b073
commit 7b6c2587a9
99 changed files with 482 additions and 426 deletions

View File

@ -26,7 +26,7 @@
--enable-x86-debugger \
--enable-cdrom \
--enable-sb16 \
--enable-instrumentation \
--enable-instrumentation=instrument/example1 \
--enable-iodebug \
--enable-show-ips \
--enable-clgd54xx \

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: bochs.h,v 1.188 2006-03-06 19:23:13 sshwarts Exp $
// $Id: bochs.h,v 1.189 2006-03-06 22:02:48 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -359,14 +359,6 @@ BOCHSAPI extern logfunc_t *genlog;
# include "disasm/disasm.h"
#endif
#if BX_PROVIDE_CPU_MEMORY==1
# include "cpu/cpu.h"
#endif
#if BX_EXTERNAL_DEBUGGER
# include "cpu/extdb.h"
#endif
#if BX_GDBSTUB
// defines for GDB stub
void bx_gdbstub_init(int argc, char* argv[]);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: dbg_main.cc,v 1.61 2006-03-06 18:50:54 vruppert Exp $
// $Id: dbg_main.cc,v 1.62 2006-03-06 22:02:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -30,6 +30,7 @@ extern "C" {
}
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev/iodev.h"
#if BX_DEBUGGER
@ -3494,17 +3495,17 @@ Bit32u bx_dbg_get_laddr(Bit16u sel, Bit32u ofs)
void bx_dbg_step_over_command ()
{
bx_address Laddr = BX_CPU(which_cpu)->guard_found.laddr;
bx_address Laddr = BX_CPU(dbg_cpu)->guard_found.laddr;
if (! bx_dbg_read_linear(dbg_cpu, Laddr, 16, bx_disasm_ibuf))
{
return;
}
x86_insn insn = bx_disassemble.decode(BX_CPU(which_cpu)->guard_found.is_32bit_code,
BX_CPU(which_cpu)->guard_found.is_64bit_code,
BX_CPU(which_cpu)->get_segment_base(BX_SEG_REG_CS),
BX_CPU(which_cpu)->guard_found.eip, bx_disasm_ibuf, bx_disasm_tbuf);
x86_insn insn = bx_disassemble.decode(BX_CPU(dbg_cpu)->guard_found.is_32bit_code,
BX_CPU(dbg_cpu)->guard_found.is_64bit_code,
BX_CPU(dbg_cpu)->get_segment_base(BX_SEG_REG_CS),
BX_CPU(dbg_cpu)->guard_found.eip, bx_disasm_ibuf, bx_disasm_tbuf);
unsigned b1 = insn.b1;

View File

@ -1,9 +1,11 @@
/////////////////////////////////////////////////////////////////////////
// $Id: linux.cc,v 1.4 2006-02-14 19:00:07 sshwarts Exp $
// $Id: linux.cc,v 1.5 2006-03-06 22:02:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
#include <stdio.h>
#include "bochs.h"
#include "cpu/cpu.h"
#if BX_DEBUGGER

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: symbols.cc,v 1.3 2006-02-01 18:12:08 sshwarts Exp $
// $Id: symbols.cc,v 1.4 2006-03-06 22:02:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -26,6 +26,7 @@
/////////////////////////////////////////////////////////////////////////
#include "bochs.h"
#include "cpu/cpu.h"
#if !((BX_HAVE_HASH_MAP || BX_HAVE_HASH_MAP_H) && (BX_HAVE_SET || BX_HAVE_SET_H))

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: config.cc,v 1.94 2006-03-05 10:24:27 vruppert Exp $
// $Id: config.cc,v 1.95 2006-03-06 22:02:48 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -2475,10 +2475,10 @@ static Bit32s parse_line_formatted(char *context, int num_params, char *params[]
int num = atoi(&params[0][11]);
char tmppath[80], tmpaddr[80];
if ((num < 1) || (num > BX_N_OPTRAM_IMAGES)) {
PARSE_ERR(("%s: ramimage%d: not supported", context, num));
PARSE_ERR(("%s: optramimage%d: not supported", context, num));
}
if (num_params != 3) {
PARSE_ERR(("%s: ramimage%d directive: wrong # args.", context, num));
PARSE_ERR(("%s: optramimage%d directive: wrong # args.", context, num));
}
sprintf(tmppath, "memory.optram.%d.path", num);
sprintf(tmpaddr, "memory.optram.%d.addr", num);
@ -2491,7 +2491,7 @@ static Bit32s parse_line_formatted(char *context, int num_params, char *params[]
else
SIM->get_param_num(tmpaddr)->set(strtoul (&params[i][8], NULL, 10));
} else {
PARSE_ERR(("%s: optram%d directive malformed.", context, num));
PARSE_ERR(("%s: optramimage%d directive malformed.", context, num));
}
}
} else if (!strcmp(params[0], "vga_update_interval")) {
@ -2989,7 +2989,6 @@ static Bit32s parse_line_formatted(char *context, int num_params, char *params[]
PARSE_ERR(("%s: keyboard_type directive: wrong arg '%s'.", context,params[1]));
}
}
else if (!strcmp(params[0], "keyboard_mapping")
||!strcmp(params[0], "keyboardmapping")) {
for (i=1; i<num_params; i++) {

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: 3dnow.cc,v 1.16 2005-05-12 18:07:41 sshwarts Exp $
// $Id: 3dnow.cc,v 1.17 2006-03-06 22:02:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002 Stanislav Shwartsman
@ -23,6 +23,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_3DNOW

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: access.cc,v 1.64 2006-02-26 21:44:01 sshwarts Exp $
// $Id: access.cc,v 1.65 2006-03-06 22:02:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -26,6 +26,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: apic.cc,v 1.79 2006-03-02 23:16:12 sshwarts Exp $
// $Id: apic.cc,v 1.80 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#include "iodev/iodev.h"
#if BX_SUPPORT_APIC
@ -149,18 +150,20 @@ static void apic_bus_broadcast_eoi(Bit8u vector)
////////////////////////////////////
bx_generic_apic_c::bx_generic_apic_c()
bx_generic_apic_c::bx_generic_apic_c(bx_phy_address base)
{
id = APIC_UNKNOWN_ID;
put("APIC?");
settype(APICLOG);
id = APIC_UNKNOWN_ID;
set_base(base);
}
void bx_generic_apic_c::set_base(bx_phy_address newbase)
{
newbase &= (~0xfff);
BX_INFO(("relocate APIC id=%d to %08x", id, newbase));
base_addr = newbase;
if (id != APIC_UNKNOWN_ID)
BX_INFO(("relocate APIC id=%d to 0x%08x", id, newbase));
}
void bx_generic_apic_c::set_id(Bit8u newid)
@ -204,7 +207,7 @@ void bx_generic_apic_c::read(bx_phy_address addr, void *data, unsigned len)
}
bx_local_apic_c::bx_local_apic_c(BX_CPU_C *mycpu)
: bx_generic_apic_c(), cpu(mycpu), cpu_id(cpu->which_cpu())
: bx_generic_apic_c(BX_LAPIC_BASE_ADDR), cpu(mycpu), cpu_id(cpu->which_cpu())
{
reset();
@ -232,7 +235,7 @@ void bx_local_apic_c::init()
(cpu && cpu->name) ? cpu->name : "?"));
// default address for a local APIC, can be moved
base_addr = APIC_BASE_ADDR;
base_addr = BX_LAPIC_BASE_ADDR;
bypass_irr_isr = 0;
error_status = shadow_error_status = 0;
log_dest = 0;
@ -499,7 +502,7 @@ void bx_local_apic_c::read_aligned(bx_phy_address addr, Bit32u *data, unsigned l
case 0x20: // local APIC id
*data = (id) << 24; break;
case 0x30: // local APIC version
*data = APIC_VERSION_ID; break;
*data = BX_LAPIC_VERSION_ID; break;
case 0x80: // task priority
*data = task_priority & 0xff; break;
case 0x90: // arbitration priority

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: apic.h,v 1.28 2006-03-02 20:09:21 sshwarts Exp $
// $Id: apic.h,v 1.29 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -29,28 +29,19 @@
#ifndef BX_CPU_APIC_H
# define BX_CPU_APIC_H 1
#define APIC_BASE_ADDR 0xfee00000 // default APIC address
#if BX_CPU_LEVEL == 6 && BX_SUPPORT_SSE >= 2
#define BX_IMPLEMENT_XAPIC 1
#endif
#ifdef BX_IMPLEMENT_XAPIC
# define APIC_VERSION_ID 0x00050014 // P4 has 6 LVT entries
#else
# define APIC_VERSION_ID 0x00040010 // P6 has 4 LVT entries
#endif
#if BX_SUPPORT_APIC
#define BX_CPU_APIC(i) (&(BX_CPU(i)->local_apic))
typedef enum {
APIC_TYPE_IOAPIC,
APIC_TYPE_LOCAL_APIC
} bx_apic_type_t;
#define BX_NUM_LOCAL_APICS BX_SMP_PROCESSORS
#define APIC_LEVEL_TRIGGERED 1
#define APIC_EDGE_TRIGGERED 0
class BOCHSAPI bx_generic_apic_c : public logfunctions {
protected:
@ -58,7 +49,7 @@ protected:
Bit8u id;
#define APIC_UNKNOWN_ID 0xff
public:
bx_generic_apic_c();
bx_generic_apic_c(bx_phy_address base);
virtual ~bx_generic_apic_c() { }
// init is called during RESET and when an INIT message is delivered
virtual void init() { }
@ -74,13 +65,24 @@ public:
virtual bx_apic_type_t get_type () = 0;
};
#ifdef BX_INCLUDE_LOCAL_APIC
#define BX_CPU_APIC(i) (&(BX_CPU(i)->local_apic))
#ifdef BX_IMPLEMENT_XAPIC
# define BX_LAPIC_VERSION_ID 0x00050014 // P4 has 6 LVT entries
#else
# define BX_LAPIC_VERSION_ID 0x00040010 // P6 has 4 LVT entries
#endif
#define BX_LAPIC_BASE_ADDR 0xfee00000 // default Local APIC address
#define BX_NUM_LOCAL_APICS BX_SMP_PROCESSORS
#define BX_APIC_FIRST_VECTOR 0x10
#define BX_APIC_LAST_VECTOR 0xfe
#define BX_LOCAL_APIC_MAX_INTS 256
#define APIC_LEVEL_TRIGGERED 1
#define APIC_EDGE_TRIGGERED 0
class BOCHSAPI bx_local_apic_c : public bx_generic_apic_c
{
Bit32u spurious_vector;
@ -190,6 +192,8 @@ public:
void set_initial_timer_count(Bit32u value);
};
#endif /* BX_INCLUDE_LOCAL_APIC */
// For P6 and Pentium family processors the local APIC ID feild is 4 bits.
#ifdef BX_IMPLEMENT_XAPIC
#define APIC_MAX_ID 0xff

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: arith16.cc,v 1.41 2005-07-21 01:59:03 sshwarts Exp $
// $Id: arith16.cc,v 1.42 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: arith32.cc,v 1.46 2005-07-21 01:59:03 sshwarts Exp $
// $Id: arith32.cc,v 1.47 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: arith64.cc,v 1.27 2005-07-21 01:59:03 sshwarts Exp $
// $Id: arith64.cc,v 1.28 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: arith8.cc,v 1.37 2005-07-21 01:59:03 sshwarts Exp $
// $Id: arith8.cc,v 1.38 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: bcd.cc,v 1.16 2005-10-01 07:47:00 sshwarts Exp $
// $Id: bcd.cc,v 1.17 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: bit.cc,v 1.25 2005-09-29 17:32:32 sshwarts Exp $
// $Id: bit.cc,v 1.26 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////
// $Id: call_far.cc,v 1.8 2006-02-28 20:29:03 sshwarts Exp $
// $Id: call_far.cc,v 1.9 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64==0

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.136 2006-03-04 09:24:31 sshwarts Exp $
// $Id: cpu.cc,v 1.137 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,12 +25,17 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "iodev/iodev.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#include "iodev/iodev.h"
#if BX_EXTERNAL_DEBUGGER
#include "extdb.h"
#endif
#if BX_PROVIDE_CPU_MEMORY==1
#if BX_ADDRESS_SPACES==1

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.266 2006-03-01 22:32:23 sshwarts Exp $
// $Id: cpu.h,v 1.267 2006-03-06 22:02:51 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -349,6 +349,7 @@ const char* cpu_mode_string(unsigned cpu_mode);
#endif
class BX_CPU_C;
class BX_MEM_C;
#if BX_USE_CPU_SMF == 0
// normal member functions. This can ONLY be used within BX_CPU_C classes.
@ -993,7 +994,10 @@ typedef struct {
#endif // #if BX_SUPPORT_X86_64
#include "cpu/apic.h"
#if BX_SUPPORT_APIC
#define BX_INCLUDE_LOCAL_APIC 1
#include "apic.h"
#endif
class BX_MEM_C;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpuid.cc,v 1.33 2006-02-20 19:28:57 sshwarts Exp $
// $Id: cpuid.cc,v 1.34 2006-03-06 22:02:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -29,6 +29,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer16.cc,v 1.32 2006-02-12 20:21:36 sshwarts Exp $
// $Id: ctrl_xfer16.cc,v 1.33 2006-03-06 22:02:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer32.cc,v 1.45 2006-02-12 20:21:36 sshwarts Exp $
// $Id: ctrl_xfer32.cc,v 1.46 2006-03-06 22:02:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer64.cc,v 1.41 2006-02-12 20:21:36 sshwarts Exp $
// $Id: ctrl_xfer64.cc,v 1.42 2006-03-06 22:02:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,9 +25,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer8.cc,v 1.19 2005-05-20 20:06:50 sshwarts Exp $
// $Id: ctrl_xfer8.cc,v 1.20 2006-03-06 22:02:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer_pro.cc,v 1.51 2006-02-28 17:47:33 sshwarts Exp $
// $Id: ctrl_xfer_pro.cc,v 1.52 2006-03-06 22:02:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,9 +25,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64==0

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: data_xfer16.cc,v 1.36 2006-03-04 16:58:10 sshwarts Exp $
// $Id: data_xfer16.cc,v 1.37 2006-03-06 22:02:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: data_xfer32.cc,v 1.35 2005-06-21 17:01:18 sshwarts Exp $
// $Id: data_xfer32.cc,v 1.36 2006-03-06 22:02:52 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: data_xfer64.cc,v 1.22 2005-06-21 17:01:18 sshwarts Exp $
// $Id: data_xfer64.cc,v 1.23 2006-03-06 22:02:53 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: data_xfer8.cc,v 1.22 2005-07-21 01:59:05 sshwarts Exp $
// $Id: data_xfer8.cc,v 1.23 2006-03-06 22:02:53 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: debugstuff.cc,v 1.59 2006-02-28 17:47:33 sshwarts Exp $
// $Id: debugstuff.cc,v 1.60 2006-03-06 22:02:53 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,8 +27,10 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_DISASM
void BX_CPU_C::debug_disasm_instruction(bx_address offset)
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: exception.cc,v 1.75 2006-02-28 20:29:03 sshwarts Exp $
// $Id: exception.cc,v 1.76 2006-03-06 22:02:53 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,12 +25,13 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "iodev/iodev.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#include "iodev/iodev.h"
#if BX_SUPPORT_X86_64==0
// Make life easier merging cpu64 & cpu code.
#define RIP EIP

View File

@ -6,6 +6,7 @@
#endif
#include "iodev/iodev.h"
#include "cpu.h"
#include "extdb.h"
TRegs regs;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode.cc,v 1.87 2005-11-11 21:09:02 sshwarts Exp $
// $Id: fetchdecode.cc,v 1.88 2006-03-06 22:02:53 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fetchdecode64.cc,v 1.87 2006-01-17 19:50:42 sshwarts Exp $
// $Id: fetchdecode64.cc,v 1.88 2006-03-06 22:02:56 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,8 +27,10 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64
///////////////////////////

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: flag_ctrl.cc,v 1.24 2005-10-17 13:06:09 sshwarts Exp $
// $Id: flag_ctrl.cc,v 1.25 2006-03-06 22:02:59 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: flag_ctrl_pro.cc,v 1.22 2005-11-21 21:10:59 sshwarts Exp $
// $Id: flag_ctrl_pro.cc,v 1.23 2006-03-06 22:02:59 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_emu.cc,v 1.2 2005-03-19 20:44:00 sshwarts Exp $
// $Id: fpu_emu.cc,v 1.3 2006-03-06 22:02:59 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
// Copyright (C) 2004 MandrakeSoft S.A.
//
@ -27,6 +27,7 @@
#define LOG_THIS BX_CPU_THIS_PTR
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
/* 9B */

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: init.cc,v 1.87 2006-03-04 16:58:10 sshwarts Exp $
// $Id: init.cc,v 1.88 2006-03-06 22:02:59 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,8 +27,10 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
BX_CPU_C::BX_CPU_C(unsigned id): bx_cpuid(id)
#if BX_SUPPORT_APIC
,local_apic (this)
@ -680,7 +682,7 @@ void BX_CPU_C::reset(unsigned source)
/* initialise MSR registers to defaults */
#if BX_CPU_LEVEL >= 5
/* APIC Address, APIC enabled and BSP is default, we'll fill in the rest later */
BX_CPU_THIS_PTR msr.apicbase = APIC_BASE_ADDR;
BX_CPU_THIS_PTR msr.apicbase = BX_LAPIC_BASE_ADDR;
#if BX_SUPPORT_APIC
BX_CPU_THIS_PTR local_apic.init ();
BX_CPU_THIS_PTR msr.apicbase |= 0x900;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: io.cc,v 1.28 2005-08-01 21:40:17 sshwarts Exp $
// $Id: io.cc,v 1.29 2006-03-06 22:02:59 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,9 +27,11 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "iodev/iodev.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#include "iodev/iodev.h"
#if BX_SUPPORT_X86_64==0
// Make life easier for merging cpu64 and cpu32 code.

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: io_pro.cc,v 1.17 2005-06-22 18:13:45 sshwarts Exp $
// $Id: io_pro.cc,v 1.18 2006-03-06 22:02:59 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,9 +27,10 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "iodev/iodev.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#include "iodev/iodev.h"
Bit16u BX_CPP_AttrRegparmN(1)
BX_CPU_C::inp16(Bit16u addr)

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////
// $Id: iret.cc,v 1.10 2005-12-12 22:01:22 sshwarts Exp $
// $Id: iret.cc,v 1.11 2006-03-06 22:03:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64==0

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////
// $Id: jmp_far.cc,v 1.3 2005-08-02 18:44:20 sshwarts Exp $
// $Id: jmp_far.cc,v 1.4 2006-03-06 22:03:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64==0
@ -35,6 +36,7 @@
#define RIP EIP
#endif
void BX_CPP_AttrRegparmN(3)
BX_CPU_C::jump_protected(bxInstruction_c *i, Bit16u cs_raw, bx_address disp)
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: lazy_flags.cc,v 1.30 2006-01-25 22:20:00 sshwarts Exp $
// $Id: lazy_flags.cc,v 1.31 2006-03-06 22:03:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,8 +28,10 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
// This array defines a look-up table for the even parity-ness
// of an 8bit quantity, for optimal assignment of the parity bit
// in the EFLAGS register

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logical16.cc,v 1.23 2005-05-20 20:06:50 sshwarts Exp $
// $Id: logical16.cc,v 1.24 2006-03-06 22:03:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logical32.cc,v 1.24 2005-05-20 20:06:50 sshwarts Exp $
// $Id: logical32.cc,v 1.25 2006-03-06 22:03:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logical64.cc,v 1.14 2005-06-21 17:01:21 sshwarts Exp $
// $Id: logical64.cc,v 1.15 2006-03-06 22:03:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: logical8.cc,v 1.26 2005-05-20 20:06:50 sshwarts Exp $
// $Id: logical8.cc,v 1.27 2006-03-06 22:03:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: mmx.cc,v 1.51 2006-02-22 20:58:16 sshwarts Exp $
// $Id: mmx.cc,v 1.52 2006-03-06 22:03:00 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002 Stanislav Shwartsman
@ -24,6 +24,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: mult16.cc,v 1.20 2005-09-29 17:32:32 sshwarts Exp $
// $Id: mult16.cc,v 1.21 2006-03-06 22:03:01 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: mult32.cc,v 1.19 2005-05-20 20:06:50 sshwarts Exp $
// $Id: mult32.cc,v 1.20 2006-03-06 22:03:01 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: mult64.cc,v 1.16 2005-05-13 14:15:35 sshwarts Exp $
// $Id: mult64.cc,v 1.17 2006-03-06 22:03:01 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: mult8.cc,v 1.20 2005-09-29 17:32:32 sshwarts Exp $
// $Id: mult8.cc,v 1.21 2006-03-06 22:03:01 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: paging.cc,v 1.66 2006-03-02 23:16:12 sshwarts Exp $
// $Id: paging.cc,v 1.67 2006-03-06 22:03:01 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -33,9 +33,9 @@
// P6 for non-PAE anyways...
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if 0

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: proc_ctrl.cc,v 1.138 2006-03-04 09:22:55 sshwarts Exp $
// $Id: proc_ctrl.cc,v 1.139 2006-03-06 22:03:01 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: protect_ctrl.cc,v 1.44 2005-10-15 21:01:36 sshwarts Exp $
// $Id: protect_ctrl.cc,v 1.45 2006-03-06 22:03:01 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,9 +25,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_CPU_LEVEL >= 2

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: resolve16.cc,v 1.9 2003-03-17 00:41:00 cbothamy Exp $
// $Id: resolve16.cc,v 1.10 2006-03-06 22:03:01 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,16 +25,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
void BX_CPP_AttrRegparmN(1)
BX_CPU_C::Resolve16Mod0Rm0(bxInstruction_c *i)
{

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: resolve32.cc,v 1.10 2004-11-02 16:10:02 sshwarts Exp $
// $Id: resolve32.cc,v 1.11 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: resolve64.cc,v 1.7 2003-12-29 21:47:36 sshwarts Exp $
// $Id: resolve64.cc,v 1.8 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,17 +25,14 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64
void BX_CPP_AttrRegparmN(1)
BX_CPU_C::Resolve64Mod0Rm0(bxInstruction_c *i)
{

View File

@ -1,5 +1,5 @@
////////////////////////////////////////////////////////////////////////
// $Id: ret_far.cc,v 1.4 2005-08-03 21:01:02 sshwarts Exp $
// $Id: ret_far.cc,v 1.5 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64==0

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: segment_ctrl.cc,v 1.13 2006-02-11 09:08:02 sshwarts Exp $
// $Id: segment_ctrl.cc,v 1.14 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,9 +27,9 @@
/////////////////////////////////////////////////////////////////////////
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: segment_ctrl_pro.cc,v 1.53 2006-02-28 17:47:33 sshwarts Exp $
// $Id: segment_ctrl_pro.cc,v 1.54 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: shift16.cc,v 1.30 2006-01-22 18:18:19 sshwarts Exp $
// $Id: shift16.cc,v 1.31 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: shift32.cc,v 1.29 2005-10-13 20:21:35 sshwarts Exp $
// $Id: shift32.cc,v 1.30 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: shift64.cc,v 1.18 2005-10-13 20:21:35 sshwarts Exp $
// $Id: shift64.cc,v 1.19 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: shift8.cc,v 1.22 2005-10-13 19:28:10 sshwarts Exp $
// $Id: shift8.cc,v 1.23 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: smm.cc,v 1.2 2006-02-28 19:50:08 sshwarts Exp $
// $Id: smm.cc,v 1.3 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006 Stanislav Shwartsman
@ -23,6 +23,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_CPU_LEVEL >= 3

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: soft_int.cc,v 1.27 2006-02-12 20:21:36 sshwarts Exp $
// $Id: soft_int.cc,v 1.28 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
void BX_CPU_C::BOUND_GwMa(bxInstruction_c *i)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: sse.cc,v 1.37 2006-02-22 20:58:16 sshwarts Exp $
// $Id: sse.cc,v 1.38 2006-03-06 22:03:02 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -22,6 +22,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
/* ********************************************** */

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: sse_move.cc,v 1.48 2006-02-20 19:28:57 sshwarts Exp $
// $Id: sse_move.cc,v 1.49 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -21,9 +21,9 @@
//
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: sse_pfp.cc,v 1.25 2006-02-22 20:20:21 sshwarts Exp $
// $Id: sse_pfp.cc,v 1.26 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -22,6 +22,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_SSE

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: sse_rcp.cc,v 1.9 2005-05-12 18:07:45 sshwarts Exp $
// $Id: sse_rcp.cc,v 1.10 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -22,6 +22,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_SSE

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: stack16.cc,v 1.19 2005-07-31 17:57:27 sshwarts Exp $
// $Id: stack16.cc,v 1.20 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,12 +27,13 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
void BX_CPU_C::PUSH_RX(bxInstruction_c *i)
{
push_16( BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].word.rx );
push_16(BX_CPU_THIS_PTR gen_reg[i->opcodeReg()].word.rx);
}
void BX_CPU_C::PUSH16_CS(bxInstruction_c *i)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: stack32.cc,v 1.30 2005-08-10 18:40:38 sshwarts Exp $
// $Id: stack32.cc,v 1.31 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64==0
@ -34,7 +35,6 @@
#define RBP EBP
#endif
void BX_CPU_C::POP_Ed(bxInstruction_c *i)
{
Bit32u val32;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: stack64.cc,v 1.21 2005-05-20 20:06:50 sshwarts Exp $
// $Id: stack64.cc,v 1.22 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: stack_pro.cc,v 1.26 2005-10-17 13:06:09 sshwarts Exp $
// $Id: stack_pro.cc,v 1.27 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: string.cc,v 1.31 2005-08-01 21:40:17 sshwarts Exp $
// $Id: string.cc,v 1.32 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: tasking.cc,v 1.30 2006-02-28 17:47:33 sshwarts Exp $
// $Id: tasking.cc,v 1.31 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: vm8086.cc,v 1.24 2006-02-28 17:47:33 sshwarts Exp $
// $Id: vm8086.cc,v 1.25 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,9 +25,9 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_X86_64==0

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ferr.cc,v 1.6 2005-05-12 18:07:45 sshwarts Exp $
// $Id: ferr.cc,v 1.7 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -23,9 +23,9 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu/cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#if BX_SUPPORT_FPU
#include "softfloat-specialize.h"

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu.cc,v 1.19 2006-01-29 17:37:23 sshwarts Exp $
// $Id: fpu.cc,v 1.20 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -24,9 +24,10 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "iodev/iodev.h"
#include "cpu/cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#include "iodev/iodev.h"
#define UPDATE_LAST_OPCODE 1
#define CHECK_PENDING_EXCEPTIONS 1

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_arith.cc,v 1.7 2005-05-12 18:07:45 sshwarts Exp $
// $Id: fpu_arith.cc,v 1.8 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -24,6 +24,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu/cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_compare.cc,v 1.7 2005-05-12 18:07:46 sshwarts Exp $
// $Id: fpu_compare.cc,v 1.8 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -21,9 +21,9 @@
//
/////////////////////////////////////////////////////////////////////////
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu/cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
extern float_status_t FPU_pre_exception_handling(Bit16u control_word);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_const.cc,v 1.6 2005-05-12 18:07:46 sshwarts Exp $
// $Id: fpu_const.cc,v 1.7 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -24,6 +24,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu/cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_load_store.cc,v 1.9 2006-02-20 19:28:57 sshwarts Exp $
// $Id: fpu_load_store.cc,v 1.10 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -23,6 +23,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu/cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
extern float_status_t FPU_pre_exception_handling(Bit16u control_word);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_misc.cc,v 1.8 2005-05-12 18:07:46 sshwarts Exp $
// $Id: fpu_misc.cc,v 1.9 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -24,6 +24,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu/cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#include "softfloatx80.h"

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu_trans.cc,v 1.9 2005-05-12 18:07:46 sshwarts Exp $
// $Id: fpu_trans.cc,v 1.10 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2003 Stanislav Shwartsman
@ -24,6 +24,7 @@
#define NEED_CPU_REG_SHORTCUTS 1
#include "bochs.h"
#include "cpu/cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
#include "softfloatx80.h"

View File

@ -30,6 +30,8 @@ these four paragraphs for those parts of this code that are retained.
#ifndef _SOFTFLOAT_SPECIALIZE_H_
#define _SOFTFLOAT_SPECIALIZE_H_
#include "softfloat.h"
/*============================================================================
* Adapted for Bochs (x86 achitecture simulator) by
* Stanislav Shwartsman (stl at fidonet.org.il)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: siminterface.cc,v 1.126 2006-03-06 18:50:55 vruppert Exp $
// $Id: siminterface.cc,v 1.127 2006-03-06 22:03:04 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// See siminterface.h for description of the siminterface concept.
@ -7,6 +7,7 @@
// the configuration user interface, and allows them to talk to each other.
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev.h"
bx_simulator_interface_c *SIM = NULL;
@ -140,8 +141,7 @@ public:
virtual bool test_for_text_console ();
};
bx_param_c *
bx_real_sim_c::get_param(bx_id id)
bx_param_c *bx_real_sim_c::get_param(bx_id id)
{
BX_ASSERT(id >= BXP_NULL && id < BXP_THIS_IS_THE_LAST);
int index = (int)id - BXP_NULL;
@ -152,8 +152,7 @@ bx_real_sim_c::get_param(bx_id id)
}
// recursive function to find parameters from the path
static
bx_param_c *find_param(const char *full_pname, const char *rest_of_pname, bx_param_c *base)
static bx_param_c *find_param(const char *full_pname, const char *rest_of_pname, bx_param_c *base)
{
const char *from = rest_of_pname;
char component[BX_PATHNAME_LEN];
@ -167,7 +166,7 @@ bx_param_c *find_param(const char *full_pname, const char *rest_of_pname, bx_par
}
*to = 0;
if (!component[0]) {
BX_PANIC (("find_param: found empty component in parameter name %s", full_pname));
BX_PANIC (("find_param: found empty component in parameter name '%s'", full_pname));
// or does that mean that we're done?
}
if (base->get_type() != BXT_LIST) {
@ -304,15 +303,14 @@ bx_real_sim_c::bx_real_sim_c()
// which can be used to look them up by number (get_param).
bx_real_sim_c::~bx_real_sim_c ()
{
if ( param_registry != NULL )
if (param_registry != NULL)
{
delete [] param_registry;
param_registry = NULL;
}
}
int
bx_real_sim_c::register_param (bx_id id, bx_param_c *it)
int bx_real_sim_c::register_param (bx_id id, bx_param_c *it)
{
if ((id == BXP_NULL) || (id >= BXP_NEW_PARAM_ID)) return 0;
BX_ASSERT (id >= BXP_NULL && id < BXP_THIS_IS_THE_LAST);
@ -324,34 +322,29 @@ bx_real_sim_c::register_param (bx_id id, bx_param_c *it)
return 0;
}
void
bx_real_sim_c::reset_all_param ()
void bx_real_sim_c::reset_all_param ()
{
bx_reset_options ();
}
int
bx_real_sim_c::get_n_log_modules ()
int bx_real_sim_c::get_n_log_modules ()
{
return io->get_n_logfns ();
}
char *
bx_real_sim_c::get_prefix (int mod)
char *bx_real_sim_c::get_prefix (int mod)
{
logfunc_t *logfn = io->get_logfn (mod);
return logfn->getprefix ();
}
int
bx_real_sim_c::get_log_action (int mod, int level)
int bx_real_sim_c::get_log_action (int mod, int level)
{
logfunc_t *logfn = io->get_logfn (mod);
return logfn->getonoff (level);
}
void
bx_real_sim_c::set_log_action (int mod, int level, int action)
void bx_real_sim_c::set_log_action (int mod, int level, int action)
{
// normal
if (mod >= 0) {
@ -365,26 +358,22 @@ bx_real_sim_c::set_log_action (int mod, int level, int action)
set_log_action (mod, level, action);
}
char *
bx_real_sim_c::get_action_name (int action)
char *bx_real_sim_c::get_action_name(int action)
{
return io->getaction (action);
return io->getaction(action);
}
const char *
bx_real_sim_c::get_log_level_name (int level)
const char *bx_real_sim_c::get_log_level_name(int level)
{
return io->getlevel (level);
}
int
bx_real_sim_c::get_max_log_level ()
int bx_real_sim_c::get_max_log_level()
{
return N_LOGLEV;
}
void
bx_real_sim_c::quit_sim (int code) {
void bx_real_sim_c::quit_sim (int code) {
BX_INFO (("quit_sim called with exit code %d", code));
exit_code = code;
// use longjmp to quit cleanly, no matter where in the stack we are.
@ -407,8 +396,7 @@ bx_real_sim_c::quit_sim (int code) {
}
}
int
bx_real_sim_c::get_default_rc (char *path, int len)
int bx_real_sim_c::get_default_rc (char *path, int len)
{
char *rc = bx_find_bochsrc ();
if (rc == NULL) return -1;
@ -417,8 +405,7 @@ bx_real_sim_c::get_default_rc (char *path, int len)
return 0;
}
int
bx_real_sim_c::read_rc(char *rc)
int bx_real_sim_c::read_rc(char *rc)
{
return bx_read_configuration (rc);
}
@ -427,56 +414,48 @@ bx_real_sim_c::read_rc(char *rc)
// 0: written ok
// -1: failed
// -2: already exists, and overwrite was off
int
bx_real_sim_c::write_rc(char *rc, int overwrite)
int bx_real_sim_c::write_rc(char *rc, int overwrite)
{
return bx_write_configuration (rc, overwrite);
}
int
bx_real_sim_c::get_log_file(char *path, int len)
int bx_real_sim_c::get_log_file(char *path, int len)
{
strncpy(path, SIM->get_param_string(BXPN_LOG_FILENAME)->getptr(), len);
return 0;
}
int
bx_real_sim_c::set_log_file(char *path)
int bx_real_sim_c::set_log_file(char *path)
{
SIM->get_param_string(BXPN_LOG_FILENAME)->set(path);
return 0;
}
int
bx_real_sim_c::get_log_prefix(char *prefix, int len)
int bx_real_sim_c::get_log_prefix(char *prefix, int len)
{
strncpy(prefix, SIM->get_param_string(BXPN_LOG_PREFIX)->getptr(), len);
return 0;
}
int
bx_real_sim_c::set_log_prefix(char *prefix)
int bx_real_sim_c::set_log_prefix(char *prefix)
{
SIM->get_param_string(BXPN_LOG_PREFIX)->set(prefix);
return 0;
}
int
bx_real_sim_c::get_debugger_log_file(char *path, int len)
int bx_real_sim_c::get_debugger_log_file(char *path, int len)
{
strncpy(path, SIM->get_param_string(BXPN_DEBUGGER_LOG_FILENAME)->getptr(), len);
return 0;
}
int
bx_real_sim_c::set_debugger_log_file(char *path)
int bx_real_sim_c::set_debugger_log_file(char *path)
{
SIM->get_param_string(BXPN_DEBUGGER_LOG_FILENAME)->set(path);
return 0;
}
int
bx_real_sim_c::get_cdrom_options(int level, bx_list_c **out, int *where)
int bx_real_sim_c::get_cdrom_options(int level, bx_list_c **out, int *where)
{
char pname[80];
bx_list_c *devlist;
@ -530,8 +509,7 @@ char *clock_sync_names[] = { "none", "realtime", "slowdown", "both", NULL };
int clock_sync_n_names=4;
void
bx_real_sim_c::set_notify_callback (bxevent_handler func, void *arg)
void bx_real_sim_c::set_notify_callback (bxevent_handler func, void *arg)
{
bxevent_callback = func;
bxevent_callback_data = arg;
@ -545,8 +523,7 @@ void bx_real_sim_c::get_notify_callback (
*arg = bxevent_callback_data;
}
BxEvent *
bx_real_sim_c::sim_to_ci_event (BxEvent *event)
BxEvent *bx_real_sim_c::sim_to_ci_event (BxEvent *event)
{
if (bxevent_callback == NULL) {
BX_ERROR (("notify called, but no bxevent_callback function is registered"));
@ -557,8 +534,7 @@ bx_real_sim_c::sim_to_ci_event (BxEvent *event)
}
// returns 0 for continue, 1 for alwayscontinue, 2 for die.
int
bx_real_sim_c::log_msg (const char *prefix, int level, const char *msg)
int bx_real_sim_c::log_msg (const char *prefix, int level, const char *msg)
{
BxEvent be;
be.type = BX_SYNC_EVT_LOG_ASK;
@ -576,8 +552,7 @@ bx_real_sim_c::log_msg (const char *prefix, int level, const char *msg)
// for a registered parameter. Create a synchronous ASK_PARAM event,
// send it to the CI, and wait for the response. The CI will call the
// set() method on the parameter if the user changes the value.
int
bx_real_sim_c::ask_param(bx_param_c *param)
int bx_real_sim_c::ask_param(bx_param_c *param)
{
BX_ASSERT(param != NULL);
// create appropriate event
@ -588,8 +563,7 @@ bx_real_sim_c::ask_param(bx_param_c *param)
return event.retcode;
}
int
bx_real_sim_c::ask_param(const char *pname)
int bx_real_sim_c::ask_param(const char *pname)
{
bx_param_c *paramptr = SIM->get_param(pname);
BX_ASSERT(paramptr != NULL);
@ -601,8 +575,7 @@ bx_real_sim_c::ask_param(const char *pname)
return event.retcode;
}
int
bx_real_sim_c::ask_filename(char *filename, int maxlen, char *prompt, char *the_default, int flags)
int bx_real_sim_c::ask_filename(char *filename, int maxlen, char *prompt, char *the_default, int flags)
{
// implement using ASK_PARAM on a newly created param. I can't use
// ask_param because I don't intend to register this param.
@ -618,8 +591,7 @@ bx_real_sim_c::ask_filename(char *filename, int maxlen, char *prompt, char *the_
return event.retcode;
}
void
bx_real_sim_c::periodic ()
void bx_real_sim_c::periodic ()
{
// give the GUI a chance to do periodic things on the bochs thread. in
// particular, notice if the thread has been asked to die.
@ -655,8 +627,7 @@ bx_real_sim_c::periodic ()
// write, e.g. disk full.
//
// wxWidgets: This may be called from the gui thread.
int
bx_real_sim_c::create_disk_image (
int bx_real_sim_c::create_disk_image (
const char *filename,
int sectors,
bx_bool overwrite)
@ -707,7 +678,8 @@ bx_real_sim_c::create_disk_image (
return 0;
}
void bx_real_sim_c::refresh_ci () {
void bx_real_sim_c::refresh_ci ()
{
if (SIM->is_wx_selected ()) {
// presently, only wxWidgets interface uses these events
// It's an async event, so allocate a pointer and send it.
@ -742,12 +714,14 @@ bx_real_sim_c::get_first_atadevice(Bit32u search_type) {
#if BX_DEBUGGER
// this can be safely called from either thread.
void bx_real_sim_c::debug_break () {
void bx_real_sim_c::debug_break ()
{
bx_debug_break ();
}
// this should only be called from the sim_thread.
void bx_real_sim_c::debug_interpret_cmd (char *cmd) {
void bx_real_sim_c::debug_interpret_cmd (char *cmd)
{
if (!is_sim_thread ()) {
fprintf (stderr, "ERROR: debug_interpret_cmd called but not from sim_thread\n");
return;
@ -755,7 +729,7 @@ void bx_real_sim_c::debug_interpret_cmd (char *cmd) {
bx_dbg_interpret_line (cmd);
}
char *bx_real_sim_c::debug_get_next_command ()
char *bx_real_sim_c::debug_get_next_command()
{
fprintf (stderr, "begin debug_get_next_command\n");
BxEvent event;
@ -768,7 +742,7 @@ char *bx_real_sim_c::debug_get_next_command ()
return NULL;
}
void bx_real_sim_c::debug_puts (const char *text)
void bx_real_sim_c::debug_puts(const char *text)
{
if (SIM->is_wx_selected ()) {
// send message to the wxWidgets debugger
@ -785,8 +759,7 @@ void bx_real_sim_c::debug_puts (const char *text)
}
#endif
void
bx_real_sim_c::register_configuration_interface (
void bx_real_sim_c::register_configuration_interface (
const char* name,
config_interface_callback_t callback,
void *userdata)
@ -796,8 +769,7 @@ bx_real_sim_c::register_configuration_interface (
registered_ci_name = name;
}
int
bx_real_sim_c::configuration_interface(const char *ignore, ci_command_t command)
int bx_real_sim_c::configuration_interface(const char *ignore, ci_command_t command)
{
bx_param_enum_c *ci_param = SIM->get_param_enum(BXPN_SEL_CONFIG_INTERFACE);
char *name = ci_param->get_selected();
@ -820,8 +792,7 @@ bx_real_sim_c::configuration_interface(const char *ignore, ci_command_t command)
return retval;
}
int
bx_real_sim_c::begin_simulation (int argc, char *argv[])
int bx_real_sim_c::begin_simulation (int argc, char *argv[])
{
return bx_begin_simulation (argc, argv);
}
@ -836,8 +807,7 @@ bool bx_real_sim_c::is_sim_thread ()
// started from the "Start Menu" or by double clicking on it on a Mac,
// there may be nothing attached to stdin/stdout/stderr. This function
// tests if stdin/stdout/stderr are usable and returns false if not.
bool
bx_real_sim_c::test_for_text_console ()
bool bx_real_sim_c::test_for_text_console ()
{
#if BX_WITH_CARBON
// In a Carbon application, you have a text console if you run the app from
@ -859,8 +829,7 @@ bx_object_c::bx_object_c (bx_id id)
this->type = BXT_OBJECT;
}
void
bx_object_c::set_type (bx_objtype type)
void bx_object_c::set_type (bx_objtype type)
{
this->type = type;
}
@ -977,22 +946,19 @@ Bit32u bx_param_num_c::set_default_base (Bit32u val) {
return old;
}
void
bx_param_num_c::reset ()
void bx_param_num_c::reset ()
{
this->val.number = initial_val;
}
void
bx_param_num_c::set_handler (param_event_handler handler)
void bx_param_num_c::set_handler (param_event_handler handler)
{
this->handler = handler;
// now that there's a handler, call set once to run the handler immediately
//set (get ());
}
void
bx_param_num_c::set_enable_handler (param_enable_handler handler)
void bx_param_num_c::set_enable_handler (param_enable_handler handler)
{
this->enable_handler = handler;
}
@ -1002,8 +968,7 @@ void bx_param_num_c::set_dependent_list(bx_list_c *l) {
update_dependents();
}
Bit64s
bx_param_num_c::get64 ()
Bit64s bx_param_num_c::get64()
{
if (handler) {
// the handler can decide what value to return and/or do some side effect
@ -1014,8 +979,7 @@ bx_param_num_c::get64 ()
}
}
void
bx_param_num_c::set (Bit64s newval)
void bx_param_num_c::set(Bit64s newval)
{
if (handler) {
// the handler can override the new value and/or perform some side effect
@ -1052,8 +1016,7 @@ void bx_param_num_c::update_dependents()
}
}
void
bx_param_num_c::set_enabled (int en)
void bx_param_num_c::set_enabled (int en)
{
// The enable handler may wish to allow/disallow the action
if (enable_handler) {
@ -1183,8 +1146,8 @@ bx_shadow_num_c::bx_shadow_num_c (bx_id id,
val.p8bit = (Bit8s*) ptr_to_real_val;
}
Bit64s
bx_shadow_num_c::get64 () {
Bit64s bx_shadow_num_c::get64()
{
Bit64u current = 0;
switch (varsize) {
case 8: current = *(val.p8bit); break;
@ -1203,8 +1166,7 @@ bx_shadow_num_c::get64 () {
}
}
void
bx_shadow_num_c::set (Bit64s newval)
void bx_shadow_num_c::set(Bit64s newval)
{
Bit64u tmp = 0;
if ((newval < min || newval > max) && (Bit64u)max != BX_MAX_BIT64U)
@ -1239,8 +1201,7 @@ bx_shadow_num_c::set (Bit64s newval)
}
}
void
bx_shadow_num_c::reset ()
void bx_shadow_num_c::reset()
{
BX_PANIC (("reset not supported on bx_shadow_num_c yet"));
}
@ -1277,8 +1238,7 @@ bx_shadow_bool_c::bx_shadow_bool_c (bx_id id,
this->bitnum = bitnum;
}
Bit64s
bx_shadow_bool_c::get64 () {
Bit64s bx_shadow_bool_c::get64 () {
if (handler) {
// the handler can decide what value to return and/or do some side effect
Bit64s ret = (*handler)(this, 0, (Bit64s) *(val.pbool));
@ -1289,8 +1249,7 @@ bx_shadow_bool_c::get64 () {
}
}
void
bx_shadow_bool_c::set (Bit64s newval)
void bx_shadow_bool_c::set (Bit64s newval)
{
// only change the bitnum bit
Bit64s tmp = (newval&1) << bitnum;
@ -1323,8 +1282,7 @@ bx_param_enum_c::bx_param_enum_c(bx_param_c *parent,
set(initial_val);
}
int
bx_param_enum_c::find_by_name(const char *string)
int bx_param_enum_c::find_by_name(const char *string)
{
char **p;
for (p=&choices[0]; *p; p++) {
@ -1334,8 +1292,7 @@ bx_param_enum_c::find_by_name(const char *string)
return -1;
}
bool
bx_param_enum_c::set_by_name(const char *string)
bool bx_param_enum_c::set_by_name(const char *string)
{
int n = find_by_name(string);
if (n<0) return false;
@ -1403,37 +1360,32 @@ bx_param_string_c::~bx_param_string_c()
}
}
void
bx_param_string_c::reset() {
void bx_param_string_c::reset() {
strncpy(this->val, this->initial_val, maxsize);
}
void
bx_param_string_c::set_handler(param_string_event_handler handler)
void bx_param_string_c::set_handler(param_string_event_handler handler)
{
this->handler = handler;
// now that there's a handler, call set once to run the handler immediately
//set (getptr ());
}
void
bx_param_string_c::set_enable_handler(param_enable_handler handler)
void bx_param_string_c::set_enable_handler(param_enable_handler handler)
{
this->enable_handler = handler;
}
void
bx_param_string_c::set_enabled(int en)
void bx_param_string_c::set_enabled(int en)
{
// The enable handler may wish to allow/disallow the action
if (enable_handler) {
en = (*enable_handler)(this, en);
}
}
bx_param_c::set_enabled(en);
}
Bit32s
bx_param_string_c::get(char *buf, int len)
Bit32s bx_param_string_c::get(char *buf, int len)
{
if (options->get() & RAW_BYTES)
memcpy(buf, val, len);
@ -1447,8 +1399,7 @@ bx_param_string_c::get(char *buf, int len)
return 0;
}
void
bx_param_string_c::set(char *buf)
void bx_param_string_c::set(char *buf)
{
if (options->get() & RAW_BYTES)
memcpy(val, buf, maxsize);
@ -1460,8 +1411,7 @@ bx_param_string_c::set(char *buf)
}
}
bx_bool
bx_param_string_c::equals(const char *buf)
bx_bool bx_param_string_c::equals(const char *buf)
{
if (options->get() & RAW_BYTES)
return (memcmp(val, buf, maxsize) == 0);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: instrument.cc,v 1.16 2006-01-17 18:17:01 sshwarts Exp $
// $Id: instrument.cc,v 1.17 2006-03-06 22:03:15 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -28,6 +28,7 @@
#include <assert.h>
#include "bochs.h"
#include "cpu/cpu.h"
// maximum size of an instruction
#define MAX_OPCODE_SIZE 16

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: instrument.cc,v 1.12 2006-01-17 18:17:01 sshwarts Exp $
// $Id: instrument.cc,v 1.13 2006-03-06 22:03:16 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -27,6 +27,7 @@
#include <assert.h>
#include "bochs.h"
#include "cpu/cpu.h"
bxInstrumentation *icpu = NULL;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: devices.cc,v 1.93 2006-03-03 20:29:50 vruppert Exp $
// $Id: devices.cc,v 1.94 2006-03-06 22:03:16 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -27,11 +27,12 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev.h"
#define LOG_THIS bx_devices.
/* main memory size (in Kbytes)
* subtract 1k for extended BIOS area
* report only base memory, not extended mem
@ -42,10 +43,8 @@
bx_devices_c bx_devices;
// constructor for bx_devices_c
bx_devices_c::bx_devices_c(void)
bx_devices_c::bx_devices_c()
{
put("DEV");
settype(DEVLOG);
@ -98,20 +97,19 @@ bx_devices_c::bx_devices_c(void)
}
bx_devices_c::~bx_devices_c(void)
bx_devices_c::~bx_devices_c()
{
// nothing needed for now
BX_DEBUG(("Exit."));
timer_handle = BX_NULL_TIMER_HANDLE;
}
void
bx_devices_c::init(BX_MEM_C *newmem)
{
unsigned i;
BX_DEBUG(("Init $Id: devices.cc,v 1.93 2006-03-03 20:29:50 vruppert Exp $"));
BX_DEBUG(("Init $Id: devices.cc,v 1.94 2006-03-06 22:03:16 sshwarts Exp $"));
mem = newmem;
/* set no-default handlers, will be overwritten by the real default handler */
@ -349,18 +347,14 @@ bx_devices_c::reset(unsigned type)
}
Bit32u
bx_devices_c::read_handler(void *this_ptr, Bit32u address, unsigned io_len)
Bit32u bx_devices_c::read_handler(void *this_ptr, Bit32u address, unsigned io_len)
{
#if !BX_USE_DEV_SMF
bx_devices_c *class_ptr = (bx_devices_c *) this_ptr;
return( class_ptr->port92_read(address, io_len) );
return class_ptr->port92_read(address, io_len);
}
Bit32u
bx_devices_c::port92_read(Bit32u address, unsigned io_len)
Bit32u bx_devices_c::port92_read(Bit32u address, unsigned io_len)
{
#else
UNUSED(this_ptr);
@ -371,18 +365,14 @@ bx_devices_c::port92_read(Bit32u address, unsigned io_len)
return(BX_GET_ENABLE_A20() << 1);
}
void
bx_devices_c::write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len)
void bx_devices_c::write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len)
{
#if !BX_USE_DEV_SMF
bx_devices_c *class_ptr = (bx_devices_c *) this_ptr;
class_ptr->port92_write(address, value, io_len);
}
void
bx_devices_c::port92_write(Bit32u address, Bit32u value, unsigned io_len)
void bx_devices_c::port92_write(Bit32u address, Bit32u value, unsigned io_len)
{
#else
UNUSED(this_ptr);
@ -401,8 +391,7 @@ bx_devices_c::port92_write(Bit32u address, Bit32u value, unsigned io_len)
// This defines a no-default read handler,
// so Bochs does not segfault if unmapped is not loaded
Bit32u
bx_devices_c::default_read_handler(void *this_ptr, Bit32u address, unsigned io_len)
Bit32u bx_devices_c::default_read_handler(void *this_ptr, Bit32u address, unsigned io_len)
{
UNUSED(this_ptr);
BX_PANIC(("No default io-read handler found for 0x%04x/%d. Unmapped io-device not loaded ?", address, io_len));
@ -411,30 +400,26 @@ bx_devices_c::default_read_handler(void *this_ptr, Bit32u address, unsigned io_l
// This defines a no-default write handler,
// so Bochs does not segfault if unmapped is not loaded
void
bx_devices_c::default_write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len)
void bx_devices_c::default_write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len)
{
UNUSED(this_ptr);
BX_PANIC(("No default io-write handler found for 0x%04x/%d. Unmapped io-device not loaded ?", address, io_len));
}
void
bx_devices_c::timer_handler(void *this_ptr)
void bx_devices_c::timer_handler(void *this_ptr)
{
bx_devices_c *class_ptr = (bx_devices_c *) this_ptr;
class_ptr->timer();
}
void
bx_devices_c::timer()
void bx_devices_c::timer()
{
#if (BX_USE_NEW_PIT==0)
if ( pit->periodic( BX_IODEV_HANDLER_PERIOD ) ) {
// This is a hack to make the IRQ0 work
DEV_pic_lower_irq(0);
DEV_pic_raise_irq(0);
}
}
#endif
@ -454,31 +439,29 @@ bx_devices_c::timer()
}
bx_bool
bx_devices_c::register_irq(unsigned irq, const char *name)
bx_bool bx_devices_c::register_irq(unsigned irq, const char *name)
{
if (irq >= BX_MAX_IRQS) {
BX_PANIC(("IO device %s registered with IRQ=%d above %u",
name, irq, (unsigned) BX_MAX_IRQS-1));
return false;
}
}
if (irq_handler_name[irq]) {
BX_PANIC(("IRQ %u conflict, %s with %s", irq,
irq_handler_name[irq], name));
return false;
}
}
irq_handler_name[irq] = name;
return true;
}
bx_bool
bx_devices_c::unregister_irq(unsigned irq, const char *name)
bx_bool bx_devices_c::unregister_irq(unsigned irq, const char *name)
{
if (irq >= BX_MAX_IRQS) {
BX_PANIC(("IO device %s tried to unregister IRQ %d above %u",
name, irq, (unsigned) BX_MAX_IRQS-1));
return false;
}
}
if (!irq_handler_name[irq]) {
BX_INFO(("IO device %s tried to unregister IRQ %d, not registered",
@ -490,13 +473,12 @@ bx_devices_c::unregister_irq(unsigned irq, const char *name)
BX_INFO(("IRQ %u not registered to %s but to %s", irq,
name, irq_handler_name[irq]));
return false;
}
}
irq_handler_name[irq] = NULL;
return true;
}
bx_bool
bx_devices_c::register_io_read_handler(void *this_ptr, bx_read_handler_t f,
bx_bool bx_devices_c::register_io_read_handler(void *this_ptr, bx_read_handler_t f,
Bit32u addr, const char *name, Bit8u mask)
{
addr &= 0x0000ffff;
@ -547,10 +529,7 @@ bx_devices_c::register_io_read_handler(void *this_ptr, bx_read_handler_t f,
return true; // address mapped successfully
}
bx_bool
bx_devices_c::register_io_write_handler(void *this_ptr, bx_write_handler_t f,
bx_bool bx_devices_c::register_io_write_handler(void *this_ptr, bx_write_handler_t f,
Bit32u addr, const char *name, Bit8u mask)
{
addr &= 0x0000ffff;
@ -601,9 +580,7 @@ bx_devices_c::register_io_write_handler(void *this_ptr, bx_write_handler_t f,
return true; // address mapped successfully
}
bx_bool
bx_devices_c::register_io_read_handler_range(void *this_ptr, bx_read_handler_t f,
bx_bool bx_devices_c::register_io_read_handler_range(void *this_ptr, bx_read_handler_t f,
Bit32u begin_addr, Bit32u end_addr,
const char *name, Bit8u mask)
{
@ -666,9 +643,7 @@ bx_devices_c::register_io_read_handler_range(void *this_ptr, bx_read_handler_t f
return true; // address mapped successfully
}
bx_bool
bx_devices_c::register_io_write_handler_range(void *this_ptr, bx_write_handler_t f,
bx_bool bx_devices_c::register_io_write_handler_range(void *this_ptr, bx_write_handler_t f,
Bit32u begin_addr, Bit32u end_addr,
const char *name, Bit8u mask)
{
@ -733,8 +708,7 @@ bx_devices_c::register_io_write_handler_range(void *this_ptr, bx_write_handler_t
// Registration of default handlers (mainly be the unmapped device)
bx_bool
bx_devices_c::register_default_io_read_handler(void *this_ptr, bx_read_handler_t f,
bx_bool bx_devices_c::register_default_io_read_handler(void *this_ptr, bx_read_handler_t f,
const char *name, Bit8u mask)
{
io_read_handlers.funct = (void *)f;
@ -744,10 +718,7 @@ bx_devices_c::register_default_io_read_handler(void *this_ptr, bx_read_handler_t
return true;
}
bx_bool
bx_devices_c::register_default_io_write_handler(void *this_ptr, bx_write_handler_t f,
bx_bool bx_devices_c::register_default_io_write_handler(void *this_ptr, bx_write_handler_t f,
const char *name, Bit8u mask)
{
io_write_handlers.funct = (void *)f;
@ -757,9 +728,7 @@ bx_devices_c::register_default_io_write_handler(void *this_ptr, bx_write_handler
return true;
}
bx_bool
bx_devices_c::unregister_io_read_handler(void *this_ptr, bx_read_handler_t f,
bx_bool bx_devices_c::unregister_io_read_handler(void *this_ptr, bx_read_handler_t f,
Bit32u addr, Bit8u mask)
{
addr &= 0x0000ffff;
@ -804,9 +773,7 @@ bx_devices_c::unregister_io_read_handler(void *this_ptr, bx_read_handler_t f,
return true;
}
bx_bool
bx_devices_c::unregister_io_write_handler(void *this_ptr, bx_write_handler_t f,
bx_bool bx_devices_c::unregister_io_write_handler(void *this_ptr, bx_write_handler_t f,
Bit32u addr, Bit8u mask)
{
addr &= 0x0000ffff;
@ -839,9 +806,7 @@ bx_devices_c::unregister_io_write_handler(void *this_ptr, bx_write_handler_t f,
return true;
}
bx_bool
bx_devices_c::unregister_io_read_handler_range(void *this_ptr, bx_read_handler_t f,
bx_bool bx_devices_c::unregister_io_read_handler_range(void *this_ptr, bx_read_handler_t f,
Bit32u begin, Bit32u end, Bit8u mask)
{
begin &= 0x0000ffff;
@ -859,9 +824,7 @@ bx_devices_c::unregister_io_read_handler_range(void *this_ptr, bx_read_handler_t
return ret;
}
bx_bool
bx_devices_c::unregister_io_write_handler_range(void *this_ptr, bx_write_handler_t f,
bx_bool bx_devices_c::unregister_io_write_handler_range(void *this_ptr, bx_write_handler_t f,
Bit32u begin, Bit32u end, Bit8u mask)
{
begin &= 0x0000ffff;

View File

@ -1,10 +1,33 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ioapic.cc,v 1.27 2006-02-27 19:04:00 sshwarts Exp $
// $Id: ioapic.cc,v 1.28 2006-03-06 22:03:16 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
#include <stdio.h>
// Copyright (C) 2002 MandrakeSoft S.A.
//
// MandrakeSoft S.A.
// 43, rue d'Aboukir
// 75002 Paris - France
// http://www.linux-mandrake.com/
// http://www.mandrakesoft.com/
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "bochs.h"
#include "cpu/apic.h"
#include "iodev.h"
#if BX_SUPPORT_APIC
class bx_ioapic_c bx_ioapic;
@ -39,8 +62,10 @@ void bx_io_redirect_entry_t::sprintf_self(char *buf)
(unsigned) vector());
}
#define BX_IOAPIC_BASE_ADDR (0xfec00000)
bx_ioapic_c::bx_ioapic_c()
: bx_generic_apic_c()
: bx_generic_apic_c(BX_IOAPIC_BASE_ADDR)
{
put("IOAP");
settype(IOAPICLOG);
@ -54,7 +79,7 @@ void bx_ioapic_c::init(void)
{
bx_generic_apic_c::init();
BX_INFO(("initializing I/O APIC"));
base_addr = 0xfec00000;
base_addr = BX_IOAPIC_BASE_ADDR;
set_id(BX_IOAPIC_DEFAULT_ID);
ioregsel = 0;
DEV_register_memory_handlers(&bx_ioapic,

View File

@ -1,6 +1,33 @@
/////////////////////////////////////////////////////////////////////////
// $Id: ioapic.h,v 1.18 2006-03-01 22:32:24 sshwarts Exp $
// $Id: ioapic.h,v 1.19 2006-03-06 22:03:16 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
//
// MandrakeSoft S.A.
// 43, rue d'Aboukir
// 75002 Paris - France
// http://www.linux-mandrake.com/
// http://www.mandrakesoft.com/
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#ifndef BX_DEVICES_IOAPIC_H
#define BX_DEVICES_IOAPIC_H
#include "cpu/apic.h"
extern class bx_ioapic_c bx_ioapic;
@ -67,3 +94,5 @@ public:
void service_ioapic(void);
virtual bx_apic_type_t get_type() { return APIC_TYPE_IOAPIC; }
};
#endif

View File

@ -1,7 +1,9 @@
/////////////////////////////////////////////////////////////////////////
// $Id: iodebug.cc,v 1.20 2006-03-03 12:55:37 sshwarts Exp $
// $Id: iodebug.cc,v 1.21 2006-03-06 22:03:16 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev.h"
#if BX_SUPPORT_IODEBUG
@ -17,7 +19,6 @@ bx_iodebug_c bx_iodebug;
Bit32u monitored_mem_areas_end[BX_IODEBUG_MAX_AREAS];
} bx_iodebug_s;
// Constructor
bx_iodebug_c::bx_iodebug_c()
{
put("IODEBUG");
@ -41,7 +42,7 @@ void bx_iodebug_c::init(void)
Bit32u bx_iodebug_c::read_handler(void *this_ptr, Bit32u addr, unsigned io_len)
{
bx_iodebug_c bx_iodebug_ptr = (bx_iodebug_c *) this_ptr;
bx_iodebug_c *bx_iodebug_ptr = (bx_iodebug_c *) this_ptr;
return bx_iodebug_ptr->read(addr, io_len);
}
@ -53,7 +54,7 @@ Bit32u bx_iodebug_c::read(Bit32u addr, unsigned io_len)
void bx_iodebug_c::write_handler(void *this_ptr, Bit32u addr, Bit32u dvalue, unsigned io_len)
{
bx_iodebug_c bx_iodebug_ptr = (bx_iodebug_c *) this_ptr;
bx_iodebug_c *bx_iodebug_ptr = (bx_iodebug_c *) this_ptr;
bx_iodebug_ptr->write(addr, dvalue, io_len);
}
@ -75,7 +76,7 @@ void bx_iodebug_c::write(Bit32u addr, Bit32u dvalue, unsigned io_len)
if(dvalue == 0x8A00)
{
bx_iodebug_s.enabled = 1;
// fprintf(stderr, "IODEBUG enabled\n");
// fprintf(stderr, "IODEBUG enabled\n");
bx_iodebug_s.registers[0] = 0;
bx_iodebug_s.registers[1] = 0;
}
@ -86,12 +87,12 @@ void bx_iodebug_c::write(Bit32u addr, Bit32u dvalue, unsigned io_len)
{
case 0x8A01:
bx_iodebug_s.register_select = 0;
// fprintf(stderr, "IODEBUG register 0 selected\n");
// fprintf(stderr, "IODEBUG register 0 selected\n");
break;
case 0x8A02:
bx_iodebug_s.register_select = 1;
// fprintf(stderr, "IODEBUG register 1 selected\n");
// fprintf(stderr, "IODEBUG register 1 selected\n");
break;
case 0x8A80:
@ -149,14 +150,22 @@ void bx_iodebug_c::mem_write(BX_CPU_C *cpu, Bit32u addr, unsigned len, void *dat
if(area)
{
area--;
#if BX_DEBUGGER
fprintf(stdout, "%s @ eip: " FMT_ADDRX " wrote at monitored memory location %8X\n", cpu->name, cpu->get_ip(), addr);
if (cpu != NULL)
fprintf(stdout, "IODEBUG %s @ eip: " FMT_ADDRX " write at monitored memory location %8X\n", cpu->name, cpu->get_ip(), addr);
else
fprintf(stdout, "IODEBUG write at monitored memory location %8X\n", addr);
bx_guard.interrupt_requested=1;
#else
fprintf(stderr,
"IODEBUG write to monitored memory area: %2i\tby EIP:\t\t" FMT_ADDRX "\n\trange start: \t\t%08X\trange end:\t%08X\n\taddress accessed:\t%08X\tdata written:\t",
area,
cpu->get_ip(),
fprintf(stderr, "IODEBUG write to monitored memory area: %2i\t", area);
if (cpu != NULL)
fprintf(stderr, "by EIP:\t\t" FMT_ADDRX "\n\t", cpu->get_ip());
else
fprintf(stderr, "(device origin)\t", cpu->get_ip());
fprintf(stderr, "range start: \t\t%08X\trange end:\t%08X\n\taddress accessed:\t%08X\tdata written:\t",
bx_iodebug_s.monitored_mem_areas_start[area],
bx_iodebug_s.monitored_mem_areas_end[area],
(unsigned) addr);
@ -201,14 +210,22 @@ void bx_iodebug_c::mem_read(BX_CPU_C *cpu, Bit32u addr, unsigned len, void *data
if(area)
{
area--;
#if BX_DEBUGGER
fprintf(stdout, "%s @ eip: " FMT_ADDRX " wrote at monitored memory location %8X\n", cpu->name, cpu->get_ip(), addr);
if (cpu != NULL)
fprintf(stdout, "IODEBUG %s @ eip: " FMT_ADDRX " read at monitored memory location %8X\n", cpu->name, cpu->get_ip(), addr);
else
fprintf(stdout, "IODEBUG read at monitored memory location %8X\n", addr);
bx_guard.interrupt_requested=1;
#else
fprintf(stderr,
"IODEBUG read to monitored memory area: %2i\tby EIP:\t\t" FMT_ADDRX "\n\trange start: \t\t%08X\trange end:\t%08X\n\taddress accessed:\t%08X\tdata written:\t",
area,
cpu->get_ip(),
fprintf(stderr, "IODEBUG read at monitored memory area: %2i\t", area);
if (cpu != NULL)
fprintf(stderr, "by EIP:\t\t" FMT_ADDRX "\n\t", cpu->get_ip());
else
fprintf(stderr, "(device origin)\t", cpu->get_ip());
fprintf(stderr, "range start: \t\t%08X\trange end:\t%08X\n\taddress accessed:\t%08X\tdata written:\t",
bx_iodebug_s.monitored_mem_areas_start[area],
bx_iodebug_s.monitored_mem_areas_end[area],
(unsigned) addr);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: load32bitOShack.cc,v 1.19 2006-02-23 22:48:56 vruppert Exp $
// $Id: load32bitOShack.cc,v 1.20 2006-03-06 22:02:48 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,61 +25,54 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev/iodev.h"
#define LOG_THIS genlog->
static void bx_load_linux_hack(void);
static void bx_load_null_kernel_hack(void);
static Bit32u bx_load_kernel_image(char *path, Bit32u paddr);
void
bx_load32bitOSimagehack(void)
void bx_load32bitOSimagehack(void)
{
if (SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG) &&
(SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG)->getptr()[0] != '\0')
) {
(SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG)->getptr()[0] != '\0'))
{
// Replay IO from log to initialize IO devices to
// a reasonable state needed for the OS. This is done
// in lieu of running the 16-bit BIOS to init things,
// since we want to test straight 32bit stuff for
// freemware.
// Replay IO from log to initialize IO devices to
// a reasonable state needed for the OS. This is done
// in lieu of running the 16-bit BIOS to init things,
// since we want to test straight 32bit stuff for
// freemware.
FILE *fp;
fp = fopen(SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG)->getptr(), "r");
if (fp == NULL) {
BX_PANIC(("could not open IO init file."));
}
while (1) {
unsigned len, op, port, val;
int ret;
ret = fscanf(fp, "%u %u %x %x\n",
&len, &op, &port, &val);
if (ret != 4) {
FILE *fp = fopen(SIM->get_param_string(BXPN_LOAD32BITOS_IOLOG)->getptr(), "r");
if (fp == NULL) {
BX_PANIC(("could not open IO init file."));
}
if (op == 0) {
// read
(void) bx_devices.inp(port, len);
}
else if (op == 1) {
// write
bx_devices.outp(port, val, len);
}
else {
BX_PANIC(("bad IO op in init filen"));
}
if (feof(fp)) break;
}
}//if iolog file to load
while (1) {
unsigned len, op, port, val;
int ret;
ret = fscanf(fp, "%u %u %x %x\n", &len, &op, &port, &val);
if (ret != 4) {
BX_PANIC(("could not open IO init file."));
}
if (op == 0) {
// read
bx_devices.inp(port, len);
}
else if (op == 1) {
// write
bx_devices.outp(port, val, len);
}
else {
BX_PANIC(("bad IO op in init filen"));
}
if (feof(fp)) break;
}
} //if iolog file to load
// Invoke proper hack depending on which OS image we're loading
switch (SIM->get_param_enum(BXPN_LOAD32BITOS_WHICH)->get()) {
@ -99,6 +92,7 @@ struct gdt_entry
Bit32u low;
Bit32u high;
};
struct linux_setup_params
{
/* 0x000 */ Bit8u orig_x;
@ -138,8 +132,7 @@ struct linux_setup_params
/* 0x800 */ Bit8u commandline[2048];
};
static void
bx_load_linux_setup_params( Bit32u initrd_start, Bit32u initrd_size )
static void bx_load_linux_setup_params(Bit32u initrd_start, Bit32u initrd_size)
{
BX_MEM_C *mem = BX_MEM(0);
struct linux_setup_params *params =
@ -176,8 +169,7 @@ bx_load_linux_setup_params( Bit32u initrd_start, Bit32u initrd_size )
params->gdt[3].low = 0x0000ffff;
}
void
bx_load_linux_hack(void)
void bx_load_linux_hack(void)
{
Bit32u initrd_start = 0, initrd_size = 0;
@ -235,8 +227,7 @@ bx_load_linux_hack(void)
BX_CPU(0)->jump_protected( NULL, 0x10, 0x00100000 );
}
void
bx_load_null_kernel_hack(void)
void bx_load_null_kernel_hack(void)
{
// The RESET function will have been called first.
// Set CPU and memory features which are assumed at this point.
@ -282,12 +273,12 @@ bx_load_kernel_image(char *path, Bit32u paddr)
if (fd < 0) {
BX_INFO(( "load_kernel_image: couldn't open image file '%s'.", path ));
BX_EXIT(1);
}
}
ret = fstat(fd, &stat_buf);
if (ret) {
BX_INFO(( "load_kernel_image: couldn't stat image file '%s'.", path ));
BX_EXIT(1);
}
}
size = (unsigned long)stat_buf.st_size;
page_size = ((Bit32u)size + 0xfff) & ~0xfff;
@ -296,7 +287,7 @@ bx_load_kernel_image(char *path, Bit32u paddr)
if ( (paddr + size) > mem->len ) {
BX_INFO(( "load_kernel_image: address range > physical memsize!" ));
BX_EXIT(1);
}
}
offset = 0;
while (size > 0) {
@ -304,10 +295,10 @@ bx_load_kernel_image(char *path, Bit32u paddr)
if (ret <= 0) {
BX_INFO(( "load_kernel_image: read failed on image" ));
BX_EXIT(1);
}
}
size -= ret;
offset += ret;
}
}
close(fd);
BX_INFO(("load_kernel_image: '%s', size=%u read into memory at %08x",
path, (unsigned) stat_buf.st_size, (unsigned) paddr));

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: main.cc,v 1.320 2006-03-05 10:24:27 vruppert Exp $
// $Id: main.cc,v 1.321 2006-03-06 22:02:48 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -25,6 +25,7 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev/iodev.h"
#ifdef HAVE_LOCALE_H

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: memory.cc,v 1.49 2006-03-06 19:23:13 sshwarts Exp $
// $Id: memory.cc,v 1.50 2006-03-06 22:03:16 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -25,6 +25,8 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev/iodev.h"
#define LOG_THIS BX_MEM_THIS

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: misc_mem.cc,v 1.80 2006-03-01 22:32:24 sshwarts Exp $
// $Id: misc_mem.cc,v 1.81 2006-03-06 22:03:16 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -26,7 +26,8 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev/iodev.h"
#define LOG_THIS BX_MEM(0)->
@ -93,7 +94,7 @@ void BX_MEM_C::init_memory(int memsize)
{
int idx;
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.80 2006-03-01 22:32:24 sshwarts Exp $"));
BX_DEBUG(("Init $Id: misc_mem.cc,v 1.81 2006-03-06 22:03:16 sshwarts Exp $"));
// you can pass 0 if memory has been allocated already through
// the constructor, or the desired size of memory if it hasn't
// BX_INFO(("%.2fMB", (float)(BX_MEM_THIS megabytes) ));
@ -323,7 +324,7 @@ void BX_MEM_C::load_ROM(const char *path, Bit32u romaddress, Bit8u type)
for (i = 0; i < BX_SMP_PROCESSORS; i++) {
put_8bit(&p, 0); // entry type = processor
put_8bit(&p, (Bit8u)i); // APIC id
put_8bit(&p, APIC_VERSION_ID & 0xff); // local APIC version number
put_8bit(&p, BX_LAPIC_VERSION_ID & 0xff); // local APIC version number
put_8bit(&p, (i==0)?3:1); // cpu flags: enabled, cpu0 = bootstrap cpu
put_8bit(&p, 0); // cpu signature
put_8bit(&p, 0);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: pc_system.cc,v 1.50 2006-03-04 16:58:10 sshwarts Exp $
// $Id: pc_system.cc,v 1.51 2006-03-06 22:02:50 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -25,8 +25,8 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev/iodev.h"
#define LOG_THIS bx_pc_system.