- SMI generation implemented (needs to be checked for SMP)

This commit is contained in:
Volker Ruppert 2006-10-01 19:51:49 +00:00
parent 6276cae023
commit 5d1e848a6a
6 changed files with 36 additions and 14 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: acpi.cc,v 1.3 2006-10-01 13:47:26 vruppert Exp $
// $Id: acpi.cc,v 1.4 2006-10-01 19:51:49 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2006 Volker Ruppert
@ -28,6 +28,8 @@
// is used to know when we are exporting symbols and when we are importing.
#define BX_PLUGGABLE
#include "bochs.h"
#include "cpu/cpu.h"
#include "iodev.h"
#if BX_SUPPORT_PCI && BX_SUPPORT_ACPI
@ -241,6 +243,13 @@ void bx_acpi_ctrl_c::pm_update_sci(void)
}
}
void bx_acpi_ctrl_c::generate_smi(void)
{
if (BX_ACPI_THIS s.pci_conf[0x5b] & 0x02) {
BX_CPU(0)->deliver_SMI();
}
}
// static IO port read callback handler
// redirects to non-static class handler to avoid virtual functions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: acpi.h,v 1.3 2006-10-01 13:47:26 vruppert Exp $
// $Id: acpi.h,v 1.4 2006-10-01 19:51:49 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2006 Volker Ruppert
@ -31,12 +31,13 @@
# define BX_ACPI_THIS_PTR this
#endif
class bx_acpi_ctrl_c : public bx_devmodel_c, public bx_pci_device_stub_c {
class bx_acpi_ctrl_c : public bx_acpi_ctrl_stub_c {
public:
bx_acpi_ctrl_c();
virtual ~bx_acpi_ctrl_c();
virtual void init(void);
virtual void reset(unsigned type);
virtual void generate_smi(void);
#if BX_SUPPORT_SAVE_RESTORE
virtual void register_state(void);
virtual void after_restore_state(void);

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: devices.cc,v 1.113 2006-09-25 20:13:52 sshwarts Exp $
// $Id: devices.cc,v 1.114 2006-10-01 19:51:49 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -73,7 +73,7 @@ void bx_devices_c::init_stubs()
pluginPciBridge = &stubPci;
pluginPci2IsaBridge = &stubPci2Isa;
pluginPciIdeController = &stubPciIde;
pluginACPIController = NULL;
pluginACPIController = &stubACPIController;
#if BX_SUPPORT_PCIVGA
pluginPciVgaAdapter = NULL;
#endif
@ -120,7 +120,7 @@ void bx_devices_c::init(BX_MEM_C *newmem)
unsigned i;
const char def_name[] = "Default";
BX_DEBUG(("Init $Id: devices.cc,v 1.113 2006-09-25 20:13:52 sshwarts Exp $"));
BX_DEBUG(("Init $Id: devices.cc,v 1.114 2006-10-01 19:51:49 vruppert Exp $"));
mem = newmem;
/* set no-default handlers, will be overwritten by the real default handler */

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: iodev.h,v 1.83 2006-09-24 16:58:13 vruppert Exp $
// $Id: iodev.h,v 1.84 2006-10-01 19:51:49 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -362,6 +362,13 @@ public:
};
#endif
#if BX_SUPPORT_ACPI
class BOCHSAPI bx_acpi_ctrl_stub_c : public bx_devmodel_c, public bx_pci_device_stub_c {
public:
virtual void generate_smi() {}
};
#endif
#if BX_SUPPORT_BUSMOUSE
class BOCHSAPI bx_busm_stub_c : public bx_devmodel_c {
public:
@ -427,7 +434,7 @@ public:
bx_pci_bridge_stub_c *pluginPciBridge;
bx_pci2isa_stub_c *pluginPci2IsaBridge;
bx_pci_ide_stub_c *pluginPciIdeController;
bx_devmodel_c *pluginACPIController;
bx_acpi_ctrl_stub_c *pluginACPIController;
bx_devmodel_c *pluginPciVgaAdapter;
bx_devmodel_c *pluginPciDevAdapter;
bx_devmodel_c *pluginPciPNicAdapter;
@ -438,7 +445,7 @@ public:
bx_cmos_stub_c *pluginCmosDevice;
bx_serial_stub_c *pluginSerialDevice;
#if BX_SUPPORT_PCIUSB
bx_pci_usb_stub_c *pluginPciUSBAdapter;
bx_pci_usb_stub_c *pluginPciUSBAdapter;
#endif
bx_devmodel_c *pluginParallelDevice;
bx_devmodel_c *pluginUnmapped;
@ -479,7 +486,10 @@ public:
bx_speaker_stub_c stubSpeaker;
bx_serial_stub_c stubSerial;
#if BX_SUPPORT_PCIUSB
bx_pci_usb_stub_c stubUsbAdapter;
bx_pci_usb_stub_c stubUsbAdapter;
#endif
#if BX_SUPPORT_ACPI
bx_acpi_ctrl_stub_c stubACPIController;
#endif
// Some info to pass to devices which can handled bulk IO. This allows

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: pci2isa.cc,v 1.38 2006-10-01 13:47:26 vruppert Exp $
// $Id: pci2isa.cc,v 1.39 2006-10-01 19:51:49 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -296,9 +296,10 @@ void bx_piix3_c::write(Bit32u address, Bit32u value, unsigned io_len)
switch (address) {
case 0x00b2:
BX_ERROR(("write %08x: APM command register not supported yet", value));
#if BX_SUPPORT_ACPI
// TODO: generate SMI
DEV_acpi_generate_smi();
#else
BX_ERROR(("write %08x: APM command register not supported yet", value));
#endif
BX_P2I_THIS s.apmc = value & 0xff;
break;

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: plugin.h,v 1.56 2006-09-24 16:58:13 vruppert Exp $
// $Id: plugin.h,v 1.57 2006-10-01 19:51:49 vruppert Exp $
/////////////////////////////////////////////////////////////////////////
//
// This file provides macros and types needed for plugins. It is based on
@ -194,6 +194,7 @@ extern "C" {
#define DEV_pci_print_i440fx_state() bx_devices.pluginPciBridge->print_i440fx_state()
#define DEV_ide_bmdma_present() bx_devices.pluginPciIdeController->bmdma_present()
#define DEV_ide_bmdma_set_irq(a) bx_devices.pluginPciIdeController->bmdma_set_irq(a)
#define DEV_acpi_generate_smi() bx_devices.pluginACPIController->generate_smi()
///////// NE2000 macro
#define DEV_ne2k_print_info(file,page,reg,brief) \