1 /////////////////////////////////////////////////////////////////////////
2 // $Id: acpi.h,v 1.7 2007/09/28 19:51:59 sshwarts Exp $
3 /////////////////////////////////////////////////////////////////////////
5 // Copyright (C) 2006 Volker Ruppert
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef BX_IODEV_ACPI_H
22 #define BX_IODEV_ACPI_H
25 # define BX_ACPI_SMF static
26 # define BX_ACPI_THIS theACPIController->
27 # define BX_ACPI_THIS_PTR theACPIController
30 # define BX_ACPI_THIS this->
31 # define BX_ACPI_THIS_PTR this
34 class bx_acpi_ctrl_c
: public bx_acpi_ctrl_stub_c
{
37 virtual ~bx_acpi_ctrl_c();
38 virtual void init(void);
39 virtual void reset(unsigned type
);
40 virtual void generate_smi(Bit8u value
);
41 virtual void register_state(void);
42 virtual void after_restore_state(void);
44 virtual Bit32u
pci_read_handler(Bit8u address
, unsigned io_len
);
45 virtual void pci_write_handler(Bit8u address
, Bit32u value
, unsigned io_len
);
47 static Bit32u
read_handler(void *this_ptr
, Bit32u address
, unsigned io_len
);
48 static void write_handler(void *this_ptr
, Bit32u address
, Bit32u value
, unsigned io_len
);
50 Bit32u
read(Bit32u address
, unsigned io_len
);
51 void write(Bit32u address
, Bit32u value
, unsigned io_len
);
53 BX_ACPI_SMF
void timer(void);
56 BX_ACPI_SMF
void set_irq_level(bx_bool level
);
57 BX_ACPI_SMF Bit32u
get_pmtmr(void);
58 BX_ACPI_SMF Bit16u
get_pmsts(void);
59 BX_ACPI_SMF
void pm_update_sci(void);
60 static void timer_handler(void *);
70 Bit64u tmr_overflow_time
;