Revision 355bf2e5 hw/acpi.h

b/hw/acpi.h
78 78
typedef struct ACPIPM1EVT ACPIPM1EVT;
79 79
typedef struct ACPIPM1CNT ACPIPM1CNT;
80 80
typedef struct ACPIGPE ACPIGPE;
81
typedef struct ACPIREGS ACPIREGS;
81 82

  
82
typedef void (*acpi_update_sci_fn)(ACPIPMTimer *tmr);
83
typedef void (*acpi_update_sci_fn)(ACPIREGS *ar);
83 84

  
84 85
struct ACPIPMTimer {
85 86
    QEMUTimer *timer;
......
106 107
    uint8_t *en;
107 108
};
108 109

  
110
struct ACPIREGS {
111
    ACPIPMTimer     tmr;
112
    ACPIGPE         gpe;
113
    struct {
114
        ACPIPM1EVT  evt;
115
        ACPIPM1CNT  cnt;
116
    } pm1;
117
};
118

  
109 119
/* PM_TMR */
110
void acpi_pm_tmr_update(ACPIPMTimer *tmr, bool enable);
111
void acpi_pm_tmr_calc_overflow_time(ACPIPMTimer *tmr);
112
uint32_t acpi_pm_tmr_get(ACPIPMTimer *tmr);
113
void acpi_pm_tmr_init(ACPIPMTimer *tmr, acpi_update_sci_fn update_sci);
114
void acpi_pm_tmr_reset(ACPIPMTimer *tmr);
120
void acpi_pm_tmr_update(ACPIREGS *ar, bool enable);
121
void acpi_pm_tmr_calc_overflow_time(ACPIREGS *ar);
122
uint32_t acpi_pm_tmr_get(ACPIREGS *ar);
123
void acpi_pm_tmr_init(ACPIREGS *ar, acpi_update_sci_fn update_sci);
124
void acpi_pm_tmr_reset(ACPIREGS *ar);
115 125

  
116 126
#include "qemu-timer.h"
117 127
static inline int64_t acpi_pm_tmr_get_clock(void)
......
121 131
}
122 132

  
123 133
/* PM1a_EVT: piix and ich9 don't implement PM1b. */
124
uint16_t acpi_pm1_evt_get_sts(ACPIPM1EVT *pm1, int64_t overflow_time);
125
void acpi_pm1_evt_write_sts(ACPIPM1EVT *pm1, ACPIPMTimer *tmr, uint16_t val);
126
void acpi_pm1_evt_power_down(ACPIPM1EVT *pm1, ACPIPMTimer *tmr);
127
void acpi_pm1_evt_reset(ACPIPM1EVT *pm1);
134
uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar, int64_t overflow_time);
135
void acpi_pm1_evt_write_sts(ACPIREGS *ar, uint16_t val);
136
void acpi_pm1_evt_power_down(ACPIREGS *ar);
137
void acpi_pm1_evt_reset(ACPIREGS *ar);
128 138

  
129 139
/* PM1a_CNT: piix and ich9 don't implement PM1b CNT. */
130
void acpi_pm1_cnt_init(ACPIPM1CNT *pm1_cnt, qemu_irq cmos_s3);
131
void acpi_pm1_cnt_write(ACPIPM1EVT *pm1a, ACPIPM1CNT *pm1_cnt, uint16_t val);
132
void acpi_pm1_cnt_update(ACPIPM1CNT *pm1_cnt,
140
void acpi_pm1_cnt_init(ACPIREGS *ar, qemu_irq cmos_s3);
141
void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val);
142
void acpi_pm1_cnt_update(ACPIREGS *ar,
133 143
                         bool sci_enable, bool sci_disable);
134
void acpi_pm1_cnt_reset(ACPIPM1CNT *pm1_cnt);
144
void acpi_pm1_cnt_reset(ACPIREGS *ar);
135 145

  
136 146
/* GPE0 */
137
void acpi_gpe_init(ACPIGPE *gpe, uint8_t len);
138
void acpi_gpe_blk(ACPIGPE *gpe, uint32_t blk);
139
void acpi_gpe_reset(ACPIGPE *gpe);
147
void acpi_gpe_init(ACPIREGS *ar, uint8_t len);
148
void acpi_gpe_blk(ACPIREGS *ar, uint32_t blk);
149
void acpi_gpe_reset(ACPIREGS *ar);
140 150

  
141
void acpi_gpe_ioport_writeb(ACPIGPE *gpe, uint32_t addr, uint32_t val);
142
uint32_t acpi_gpe_ioport_readb(ACPIGPE *gpe, uint32_t addr);
151
void acpi_gpe_ioport_writeb(ACPIREGS *ar, uint32_t addr, uint32_t val);
152
uint32_t acpi_gpe_ioport_readb(ACPIREGS *ar, uint32_t addr);
143 153

  
144 154
#endif /* !QEMU_HW_ACPI_H */

Also available in: Unified diff