- ported ACPI enable/disable support from latest Qemu sources
This commit is contained in:
parent
1332f905ae
commit
5563a18956
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: acpi.cc,v 1.8 2007-04-06 15:22:17 vruppert Exp $
|
||||
// $Id: acpi.cc,v 1.9 2007-08-04 08:57:42 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2006 Volker Ruppert
|
||||
@ -57,6 +57,9 @@ const Bit8u acpi_sm_iomask[16] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 2, 0, 0, 0
|
||||
|
||||
#define SUS_EN (1 << 13)
|
||||
|
||||
#define ACPI_ENABLE 0xf1
|
||||
#define ACPI_DISABLE 0xf0
|
||||
|
||||
int libacpi_LTX_plugin_init(plugin_t *plugin, plugintype_t type, int argc, char *argv[])
|
||||
{
|
||||
theACPIController = new bx_acpi_ctrl_c();
|
||||
@ -265,8 +268,15 @@ void bx_acpi_ctrl_c::pm_update_sci(void)
|
||||
}
|
||||
}
|
||||
|
||||
void bx_acpi_ctrl_c::generate_smi(void)
|
||||
void bx_acpi_ctrl_c::generate_smi(Bit8u value)
|
||||
{
|
||||
/* ACPI specs 3.0, 4.7.2.5 */
|
||||
if (value == ACPI_ENABLE) {
|
||||
BX_ACPI_THIS s.pmcntrl |= SCI_EN;
|
||||
} else if (value == ACPI_DISABLE) {
|
||||
BX_ACPI_THIS s.pmcntrl &= ~SCI_EN;
|
||||
}
|
||||
|
||||
if (BX_ACPI_THIS s.pci_conf[0x5b] & 0x02) {
|
||||
BX_CPU(0)->deliver_SMI();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: acpi.h,v 1.5 2007-02-20 09:36:55 vruppert Exp $
|
||||
// $Id: acpi.h,v 1.6 2007-08-04 08:57:42 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2006 Volker Ruppert
|
||||
@ -37,7 +37,7 @@ public:
|
||||
virtual ~bx_acpi_ctrl_c();
|
||||
virtual void init(void);
|
||||
virtual void reset(unsigned type);
|
||||
virtual void generate_smi(void);
|
||||
virtual void generate_smi(Bit8u value);
|
||||
#if BX_SUPPORT_SAVE_RESTORE
|
||||
virtual void register_state(void);
|
||||
virtual void after_restore_state(void);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: iodev.h,v 1.87 2007-04-08 21:57:06 sshwarts Exp $
|
||||
// $Id: iodev.h,v 1.88 2007-08-04 08:57:42 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -370,7 +370,7 @@ public:
|
||||
#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() {}
|
||||
virtual void generate_smi(Bit8u value) {}
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: pci2isa.cc,v 1.40 2007-02-03 17:56:35 sshwarts Exp $
|
||||
// $Id: pci2isa.cc,v 1.41 2007-08-04 08:57:42 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -295,7 +295,7 @@ void bx_piix3_c::write(Bit32u address, Bit32u value, unsigned io_len)
|
||||
switch (address) {
|
||||
case 0x00b2:
|
||||
#if BX_SUPPORT_ACPI
|
||||
DEV_acpi_generate_smi();
|
||||
DEV_acpi_generate_smi((Bit8u)value);
|
||||
#else
|
||||
BX_ERROR(("write %08x: APM command register not supported yet", value));
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: plugin.h,v 1.57 2006-10-01 19:51:49 vruppert Exp $
|
||||
// $Id: plugin.h,v 1.58 2007-08-04 08:57:42 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// This file provides macros and types needed for plugins. It is based on
|
||||
@ -194,7 +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()
|
||||
#define DEV_acpi_generate_smi(a) bx_devices.pluginACPIController->generate_smi(a)
|
||||
|
||||
///////// NE2000 macro
|
||||
#define DEV_ne2k_print_info(file,page,reg,brief) \
|
||||
|
Loading…
Reference in New Issue
Block a user