From 3074078297abfed59679924bb4a4a686f1bb28b3 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Sat, 19 Mar 2005 20:44:01 +0000 Subject: [PATCH] Added CVS version header to all the files. One more small change in APIC --- bochs/cpu/3dnow.cc | 3 ++ bochs/cpu/apic.cc | 31 ++++++------- bochs/cpu/apic.h | 9 ++-- bochs/cpu/cpuid.cc | 4 ++ bochs/cpu/descriptor.h | 2 +- bochs/cpu/fetchdecode.h | 5 ++ bochs/cpu/fpu_emu.cc | 2 + bochs/cpu/i387.h | 2 + bochs/cpu/icache.h | 2 + bochs/cpu/mmx.cc | 3 ++ bochs/cpu/segment_ctrl.cc | 80 +++++++++++--------------------- bochs/cpu/soft_int.cc | 2 + bochs/cpu/sse.cc | 2 + bochs/cpu/sse_move.cc | 2 + bochs/cpu/sse_pfp.cc | 2 + bochs/cpu/sse_rcp.cc | 2 + bochs/cpu/stack_pro.cc | 2 + bochs/cpu/xmm.h | 2 + bochs/patches/patch.apic-mrieker | 30 ------------ 19 files changed, 85 insertions(+), 102 deletions(-) diff --git a/bochs/cpu/3dnow.cc b/bochs/cpu/3dnow.cc index 12c9a7d83..cbafa894e 100755 --- a/bochs/cpu/3dnow.cc +++ b/bochs/cpu/3dnow.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: 3dnow.cc,v 1.15 2005-03-19 20:44:00 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002 Stanislav Shwartsman // Written by Stanislav Shwartsman @@ -17,6 +19,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +///////////////////////////////////////////////////////////////////////// #define NEED_CPU_REG_SHORTCUTS 1 #include "bochs.h" diff --git a/bochs/cpu/apic.cc b/bochs/cpu/apic.cc index 34c4350f7..58712e0e9 100644 --- a/bochs/cpu/apic.cc +++ b/bochs/cpu/apic.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: apic.cc,v 1.43 2005-03-19 18:42:59 sshwarts Exp $ +// $Id: apic.cc,v 1.44 2005-03-19 20:44:00 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// #define NEED_CPU_REG_SHORTCUTS 1 @@ -18,7 +18,6 @@ bx_generic_apic_c::bx_generic_apic_c () id = APIC_UNKNOWN_ID; put("APIC?"); settype(APICLOG); - hwreset (); } void bx_generic_apic_c::set_arb_id (int new_arb_id) @@ -219,6 +218,10 @@ bx_bool bx_generic_apic_c::deliver (Bit8u dest, Bit8u dest_mode, Bit8u delivery_ /* once = false */ break; case APIC_DM_INIT: + + // NOTE: special behavior of local apics is handled in + // bx_local_apic_c::deliver + // normal INIT IPI sent to processors for (i = 0; i < BX_LOCAL_APIC_NUM; i++) { if (deliver_bitmask & (1<init(); @@ -379,8 +382,7 @@ void bx_local_apic_c::init () icr_high = icr_low = log_dest = task_priority = 0; spurious_vec = 0xff; // software disabled (bit 8) - // KPL - // Register a non-active timer for use when the timer is started. + // KPL: Register a non-active timer for use when the timer is started. timer_handle = bx_pc_system.register_timer_ticks(this, BX_CPU(0)->local_apic.periodic_smf, 0, 0, 0, "lapic"); } @@ -426,7 +428,7 @@ void bx_local_apic_c::write (Bit32u addr, Bit32u *data, unsigned len) if (len != 4) { BX_PANIC (("local apic write with len=%d (should be 4)", len)); } - BX_DEBUG(("%s: write %08x to APIC address %08x", cpu->name, *data, addr)); + BX_DEBUG(("%s: write 0x%08x to APIC address %08x", cpu->name, *data, addr)); addr &= 0xff0; Bit32u value = *data; switch (addr) { @@ -460,7 +462,8 @@ void bx_local_apic_c::write (Bit32u addr, Bit32u *data, unsigned len) BX_DEBUG (("set destination format to %02x", dest_format)); break; case 0xf0: // spurious interrupt vector - spurious_vec = (spurious_vec & 0x0f) | (value & 0x3f0); + // bits 0-3 are hardwired to logical '1 + spurious_vec = (spurious_vec & 0xff) | (value & 0x30f); break; case 0x280: // error status reg // Here's what the IA-devguide-3 says on p.7-45: @@ -826,18 +829,14 @@ Bit32u bx_local_apic_c::get_delivery_bitmask (Bit8u dest, Bit8u dest_mode) Bit8u bx_local_apic_c::get_ppr () { - Bit32u tpr = (task_priority >> 4) & 0xf; /* we want 7:4 */ - Bit32u isrv = (highest_priority_int(isr) >> 4) & 0xf; /* ditto */ + int ppr = highest_priority_int (isr); - if (tpr >= isrv) - proc_priority = task_priority & 0xff; - else - proc_priority = isrv << 4; /* low 4 bits of PPR have to be cleared */ + if ((ppr < 0) || ((task_priority & 0xF0) >= (ppr & 0xF0))) + ppr = task_priority; + else + ppr &= 0xF0; - if (bx_dbg.apic) - BX_DEBUG(("%s: get_ppr returning %#x", cpu->name, proc_priority)); - - return (Bit8u) proc_priority; + return ppr; } Bit8u bx_local_apic_c::get_tpr () diff --git a/bochs/cpu/apic.h b/bochs/cpu/apic.h index 76d53d9e3..62df6df02 100644 --- a/bochs/cpu/apic.h +++ b/bochs/cpu/apic.h @@ -1,4 +1,7 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: apic.h,v 1.14 2005-03-19 20:44:00 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// +// // Copyright (C) 2001 MandrakeSoft S.A. // // MandrakeSoft S.A. @@ -20,6 +23,7 @@ // 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_CPU_APIC_H @@ -91,12 +95,11 @@ class BOCHSAPI bx_local_apic_c : public bx_generic_apic_c // cleared when the interrupt is acknowledged by the processor. Bit8u irr[BX_LOCAL_APIC_MAX_INTS]; // ISR=in-service register. When an IRR bit is cleared, the corresponding - // bit in ISR is set. The ISR bit is cleared when - Bit8u isr[BX_LOCAL_APIC_MAX_INTS]; + // bit in ISR is set. + Bit8u isr[BX_LOCAL_APIC_MAX_INTS]; Bit32u arb_id; Bit32u arb_priority; Bit32u task_priority; - Bit32u proc_priority; Bit32u log_dest; Bit32u dest_format; Bit32u spurious_vec; diff --git a/bochs/cpu/cpuid.cc b/bochs/cpu/cpuid.cc index 4a585e903..19730ce38 100755 --- a/bochs/cpu/cpuid.cc +++ b/bochs/cpu/cpuid.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: +///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. // @@ -21,6 +23,8 @@ // 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 +// +///////////////////////////////////////////////////////////////////////// #define NEED_CPU_REG_SHORTCUTS 1 diff --git a/bochs/cpu/descriptor.h b/bochs/cpu/descriptor.h index 62c43ed11..85bd923f1 100755 --- a/bochs/cpu/descriptor.h +++ b/bochs/cpu/descriptor.h @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: descriptor.h +// $Id: descriptor.h,v 1.5 2005-03-19 20:44:00 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. diff --git a/bochs/cpu/fetchdecode.h b/bochs/cpu/fetchdecode.h index 69768c0a6..5f40c9294 100755 --- a/bochs/cpu/fetchdecode.h +++ b/bochs/cpu/fetchdecode.h @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: fetchdecode.h,v 1.15 2005-03-19 20:44:00 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman // Written by Stanislav Shwartsman @@ -16,6 +18,9 @@ // 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_COMMON_FETCHDECODE_TABLES_H #define BX_COMMON_FETCHDECODE_TABLES_H diff --git a/bochs/cpu/fpu_emu.cc b/bochs/cpu/fpu_emu.cc index 07dd0d47b..b87b1ac7d 100644 --- a/bochs/cpu/fpu_emu.cc +++ b/bochs/cpu/fpu_emu.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: fpu_emu.cc,v 1.2 2005-03-19 20:44:00 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // Copyright (C) 2004 MandrakeSoft S.A. // // MandrakeSoft S.A. diff --git a/bochs/cpu/i387.h b/bochs/cpu/i387.h index 3566bbc8a..77d5eaa2a 100644 --- a/bochs/cpu/i387.h +++ b/bochs/cpu/i387.h @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: i387.h,v 1.28 2005-03-19 20:44:00 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2004 Stanislav Shwartsman // Written by Stanislav Shwartsman diff --git a/bochs/cpu/icache.h b/bochs/cpu/icache.h index 976127661..c7309ecd7 100755 --- a/bochs/cpu/icache.h +++ b/bochs/cpu/icache.h @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: icache.h,v 1.5 2005-03-19 20:44:00 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. // diff --git a/bochs/cpu/mmx.cc b/bochs/cpu/mmx.cc index 961c8687b..350db29e3 100644 --- a/bochs/cpu/mmx.cc +++ b/bochs/cpu/mmx.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: mmx.cc,v 1.44 2005-03-19 20:44:00 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2002 Stanislav Shwartsman // Written by Stanislav Shwartsman @@ -17,6 +19,7 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +///////////////////////////////////////////////////////////////////////// #define NEED_CPU_REG_SHORTCUTS 1 diff --git a/bochs/cpu/segment_ctrl.cc b/bochs/cpu/segment_ctrl.cc index 8542c0d09..ff2a790e7 100644 --- a/bochs/cpu/segment_ctrl.cc +++ b/bochs/cpu/segment_ctrl.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: segment_ctrl.cc,v 1.11 2003-10-06 10:01:12 sshwarts Exp $ +// $Id: segment_ctrl.cc,v 1.12 2005-03-19 20:44:00 sshwarts Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -23,12 +23,8 @@ // 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 - - - - - - +// +///////////////////////////////////////////////////////////////////////// @@ -37,18 +33,13 @@ #define LOG_THIS BX_CPU_THIS_PTR - - - - - void -BX_CPU_C::LES_GvMp(bxInstruction_c *i) +void BX_CPU_C::LES_GvMp(bxInstruction_c *i) { if (i->modC0()) { // (BW) NT seems to use this when booting. BX_INFO(("invalid use of LES, must use memory reference!")); UndefinedOpcode(i); - } + } #if BX_CPU_LEVEL > 2 if (i->os32L()) { @@ -61,10 +52,10 @@ BX_CPU_C::LES_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES], es); BX_WRITE_32BIT_REGZ(i->nnn(), reg_32); - } + } else #endif /* BX_CPU_LEVEL > 2 */ - { /* 16 bit mode */ + { /* 16 bit mode */ Bit16u reg_16, es; read_virtual_word(i->seg(), RMAddr(i), ®_16); @@ -73,16 +64,15 @@ BX_CPU_C::LES_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_ES], es); BX_WRITE_16BIT_REG(i->nnn(), reg_16); - } + } } - void -BX_CPU_C::LDS_GvMp(bxInstruction_c *i) +void BX_CPU_C::LDS_GvMp(bxInstruction_c *i) { if (i->modC0()) { BX_INFO(("invalid use of LDS, must use memory reference!")); UndefinedOpcode(i); - } + } #if BX_CPU_LEVEL > 2 if (i->os32L()) { @@ -95,7 +85,7 @@ BX_CPU_C::LDS_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS], ds); BX_WRITE_32BIT_REGZ(i->nnn(), reg_32); - } + } else #endif /* BX_CPU_LEVEL > 2 */ { /* 16 bit mode */ @@ -107,20 +97,17 @@ BX_CPU_C::LDS_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_DS], ds); BX_WRITE_16BIT_REG(i->nnn(), reg_16); - } + } } - void -BX_CPU_C::LFS_GvMp(bxInstruction_c *i) -{ -#if BX_CPU_LEVEL < 3 - BX_PANIC(("lfs_gvmp: not supported on 8086")); -#else /* 386+ */ +#if BX_CPU_LEVEL >= 3 +void BX_CPU_C::LFS_GvMp(bxInstruction_c *i) +{ if (i->modC0()) { BX_INFO(("invalid use of LFS, must use memory reference!")); UndefinedOpcode(i); - } + } if (i->os32L()) { Bit32u reg_32; @@ -132,7 +119,7 @@ BX_CPU_C::LFS_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_FS], fs); BX_WRITE_32BIT_REGZ(i->nnn(), reg_32); - } + } else { /* 16 bit operand size */ Bit16u reg_16; Bit16u fs; @@ -143,21 +130,15 @@ BX_CPU_C::LFS_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_FS], fs); BX_WRITE_16BIT_REG(i->nnn(), reg_16); - } -#endif + } } - void -BX_CPU_C::LGS_GvMp(bxInstruction_c *i) +void BX_CPU_C::LGS_GvMp(bxInstruction_c *i) { -#if BX_CPU_LEVEL < 3 - BX_PANIC(("lgs_gvmp: not supported on 8086")); -#else /* 386+ */ - if (i->modC0()) { BX_INFO(("invalid use of LGS, must use memory reference!")); UndefinedOpcode(i); - } + } if (i->os32L()) { Bit32u reg_32; @@ -169,7 +150,7 @@ BX_CPU_C::LGS_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_GS], gs); BX_WRITE_32BIT_REGZ(i->nnn(), reg_32); - } + } else { /* 16 bit operand size */ Bit16u reg_16; Bit16u gs; @@ -180,21 +161,15 @@ BX_CPU_C::LGS_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_GS], gs); BX_WRITE_16BIT_REG(i->nnn(), reg_16); - } -#endif + } } - void -BX_CPU_C::LSS_GvMp(bxInstruction_c *i) +void BX_CPU_C::LSS_GvMp(bxInstruction_c *i) { -#if BX_CPU_LEVEL < 3 - BX_PANIC(("lss_gvmp: not supported on 8086")); -#else /* 386+ */ - if (i->modC0()) { BX_INFO(("invalid use of LSS, must use memory reference!")); UndefinedOpcode(i); - } + } if (i->os32L()) { Bit32u reg_32; @@ -206,7 +181,7 @@ BX_CPU_C::LSS_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS], ss_raw); BX_WRITE_32BIT_REGZ(i->nnn(), reg_32); - } + } else { /* 16 bit operand size */ Bit16u reg_16; Bit16u ss_raw; @@ -217,6 +192,7 @@ BX_CPU_C::LSS_GvMp(bxInstruction_c *i) load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_SS], ss_raw); BX_WRITE_16BIT_REG(i->nnn(), reg_16); - } -#endif + } } + +#endif diff --git a/bochs/cpu/soft_int.cc b/bochs/cpu/soft_int.cc index 069424006..b3537d0bb 100644 --- a/bochs/cpu/soft_int.cc +++ b/bochs/cpu/soft_int.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: soft_int.cc,v 1.25 2005-03-19 20:44:00 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. // diff --git a/bochs/cpu/sse.cc b/bochs/cpu/sse.cc index 4954622fe..c99681168 100644 --- a/bochs/cpu/sse.cc +++ b/bochs/cpu/sse.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: sse.cc,v 1.31 2005-03-19 20:44:00 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman // Written by Stanislav Shwartsman diff --git a/bochs/cpu/sse_move.cc b/bochs/cpu/sse_move.cc index 73f836454..dad67042e 100644 --- a/bochs/cpu/sse_move.cc +++ b/bochs/cpu/sse_move.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: sse_move.cc,v 1.35 2005-03-19 20:44:01 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman // Written by Stanislav Shwartsman diff --git a/bochs/cpu/sse_pfp.cc b/bochs/cpu/sse_pfp.cc index ee1759b70..c47d83af7 100644 --- a/bochs/cpu/sse_pfp.cc +++ b/bochs/cpu/sse_pfp.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: sse_pfp.cc,v 1.20 2005-03-19 20:44:01 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman // Written by Stanislav Shwartsman diff --git a/bochs/cpu/sse_rcp.cc b/bochs/cpu/sse_rcp.cc index 786d1fb6a..3a800714e 100755 --- a/bochs/cpu/sse_rcp.cc +++ b/bochs/cpu/sse_rcp.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: sse_rcp.cc,v 1.8 2005-03-19 20:44:01 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman // Written by Stanislav Shwartsman diff --git a/bochs/cpu/stack_pro.cc b/bochs/cpu/stack_pro.cc index fcd6f890a..e2fa98d2e 100644 --- a/bochs/cpu/stack_pro.cc +++ b/bochs/cpu/stack_pro.cc @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: stack_pro.cc,v 1.21 2005-03-19 20:44:01 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. // diff --git a/bochs/cpu/xmm.h b/bochs/cpu/xmm.h index af40368d9..9745d5d6a 100644 --- a/bochs/cpu/xmm.h +++ b/bochs/cpu/xmm.h @@ -1,4 +1,6 @@ ///////////////////////////////////////////////////////////////////////// +// $Id: xmm.h,v 1.17 2005-03-19 20:44:01 sshwarts Exp $ +///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2003 Stanislav Shwartsman // Written by Stanislav Shwartsman diff --git a/bochs/patches/patch.apic-mrieker b/bochs/patches/patch.apic-mrieker index 556bc13b9..9775c0e29 100644 --- a/bochs/patches/patch.apic-mrieker +++ b/bochs/patches/patch.apic-mrieker @@ -55,15 +55,6 @@ diff -u -r1.14 apic.cc #define LOG_THIS this-> bx_generic_apic_c *apic_index[APIC_MAX_ID]; -@@ -15,7 +18,7 @@ - id = APIC_UNKNOWN_ID; - put("APIC?"); - settype(APICLOG); -- hwreset (); -+ // hwreset (); see bx_local_apic_c::bx_local_apic_c - } - - bx_generic_apic_c::~bx_generic_apic_c () @@ -169,32 +178,51 @@ bx_bool bx_generic_apic_c::deliver (Bit8u dest, Bit8u dest_mode, Bit8u delivery_mode, Bit8u vector, Bit8u polarity, Bit8u trig_mode) @@ -292,27 +283,6 @@ diff -u -r1.14 apic.cc } } BX_INFO(("}", cpu->name)); -@@ -691,14 +776,14 @@ - } - - Bit8u bx_local_apic_c::get_ppr () -+ - { -- static int warned = 0; -- if (warned < 10) { -- BX_ERROR(("WARNING: Local APIC Processor Priority not implemented, returning 0")); -- warned++; -- } -- // should look at TPR, vector of highest priority isr, etc. -- return 0; -+ int ppr; -+ -+ ppr = highest_priority_int (isr); // see what's in service now -+ if ((ppr < 0) || ((task_priority & 0xF0) >= (ppr & 0xF0))) ppr = task_priority; // or if tpr is higher, use that -+ else ppr &= 0xF0; -+ return (ppr); - } - Index: cpu/cpu.cc ===================================================================