move startup_SIPI code to CPU

This commit is contained in:
Stanislav Shwartsman 2009-01-27 21:13:38 +00:00
parent 4dcea7e888
commit aa982c27d8
3 changed files with 28 additions and 23 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: apic.cc,v 1.113 2009-01-10 11:30:20 vruppert Exp $
// $Id: apic.cc,v 1.114 2009-01-27 21:13:38 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002 Zwane Mwaikambo, Stanislav Shwartsman
@ -506,32 +506,23 @@ void bx_local_apic_c::receive_EOI(Bit32u value)
if(vec < 0) {
BX_DEBUG(("EOI written without any bit in ISR"));
} else {
if((Bit32u) vec != spurious_vector) {
BX_DEBUG(("%s: local apic received EOI, hopefully for vector 0x%02x", cpu->name, vec));
isr[vec] = 0;
if(tmr[vec]) {
apic_bus_broadcast_eoi(vec);
tmr[vec] = 0;
}
service_local_apic();
}
if ((Bit32u) vec != spurious_vector) {
BX_DEBUG(("%s: local apic received EOI, hopefully for vector 0x%02x", cpu->name, vec));
isr[vec] = 0;
if(tmr[vec]) {
apic_bus_broadcast_eoi(vec);
tmr[vec] = 0;
}
service_local_apic();
}
}
if(bx_dbg.apic)
print_status();
if(bx_dbg.apic) print_status();
}
void bx_local_apic_c::startup_msg(Bit32u vector)
{
if(cpu->debug_trap & BX_DEBUG_TRAP_SPECIAL) {
cpu->debug_trap &= ~BX_DEBUG_TRAP_SPECIAL;
cpu->gen_reg[BX_32BIT_REG_EIP].dword.erx = 0;
cpu->load_seg_reg(&cpu->sregs[BX_SEG_REG_CS], vector*0x100);
BX_INFO(("%s started up at %04X:%08X by APIC",
cpu->name, vector*0x100, cpu->get_eip()));
} else {
BX_INFO(("%s started up by APIC, but was not halted at the time", cpu->name));
}
cpu->deliver_SIPI(vector);
}
// APIC read: 4 byte read from 16-byte aligned APIC address

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.cc,v 1.260 2009-01-20 21:34:59 sshwarts Exp $
// $Id: cpu.cc,v 1.261 2009-01-27 21:13:38 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -819,6 +819,19 @@ void BX_CPU_C::boundaryFetch(const Bit8u *fetchPtr, unsigned remainingInPage, bx
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.d_b, Is64BitMode());
}
void BX_CPU_C::deliver_SIPI(unsigned vector)
{
if (BX_CPU_THIS_PTR debug_trap & BX_DEBUG_TRAP_SPECIAL) {
BX_CPU_THIS_PTR debug_trap &= ~BX_DEBUG_TRAP_SPECIAL;
RIP = 0;
load_seg_reg(&BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS], vector*0x100);
BX_INFO(("%s started up at %04X:%08X by APIC",
BX_CPU_THIS_PTR name, vector*0x100, EIP));
} else {
BX_INFO(("%s started up by APIC, but was not halted at the time", BX_CPU_THIS_PTR name));
}
}
void BX_CPU_C::deliver_INIT(void)
{
if (! BX_CPU_THIS_PTR disable_INIT)

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.562 2009-01-27 20:29:04 sshwarts Exp $
// $Id: cpu.h,v 1.563 2009-01-27 21:13:38 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -3192,6 +3192,7 @@ public: // for now...
BX_SMF void deliver_INIT(void);
BX_SMF void deliver_NMI(void);
BX_SMF void deliver_SMI(void);
BX_SMF void deliver_SIPI(unsigned vector);
BX_SMF void debug(bx_address offset);
#if BX_DISASM
BX_SMF void debug_disasm_instruction(bx_address offset);