Now we have a nice structure for handling ACPI fixed events. This means we can do things like make acpi_button block, instead of polling it. Direct register access has gone away. The next revision of the bus manager interface should include namespace traversal and AML control method execution.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11529 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+17
-27
@@ -7,45 +7,35 @@
|
||||
#define _ACPI_H
|
||||
|
||||
#include <bus_manager.h>
|
||||
#include <KernelExport.h>
|
||||
|
||||
typedef struct acpi_module_info acpi_module_info;
|
||||
|
||||
struct acpi_module_info {
|
||||
bus_manager_info binfo;
|
||||
|
||||
uint32 (*read_acpi_reg) (uint32 register_id);
|
||||
void (*write_acpi_reg) (uint32 register_id, uint32 value);
|
||||
|
||||
void (*enable_fixed_event) (uint32 event);
|
||||
void (*disable_fixed_event) (uint32 event);
|
||||
|
||||
uint32 (*fixed_event_status) (uint32 event);
|
||||
/* Returns 1 if event set, 0 otherwise */
|
||||
void (*reset_fixed_event) (uint32 event);
|
||||
|
||||
status_t (*install_fixed_event_handler) (uint32 event, interrupt_handler *handler, void *data);
|
||||
status_t (*remove_fixed_event_handler) (uint32 event, interrupt_handler *handler);
|
||||
};
|
||||
|
||||
#define B_ACPI_MODULE_NAME "bus_managers/acpi/v1"
|
||||
|
||||
#ifndef __ACTYPES_H__
|
||||
|
||||
/* ACPI register_id arguments */
|
||||
/* ACPI fixed event types */
|
||||
|
||||
#define ACPI_BITREG_TIMER_STATUS 0x00
|
||||
#define ACPI_BITREG_BUS_MASTER_STATUS 0x01
|
||||
#define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02
|
||||
#define ACPI_BITREG_POWER_BUTTON_STATUS 0x03
|
||||
#define ACPI_BITREG_SLEEP_BUTTON_STATUS 0x04
|
||||
#define ACPI_BITREG_RT_CLOCK_STATUS 0x05
|
||||
#define ACPI_BITREG_WAKE_STATUS 0x06
|
||||
|
||||
#define ACPI_BITREG_TIMER_ENABLE 0x07
|
||||
#define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x08
|
||||
#define ACPI_BITREG_POWER_BUTTON_ENABLE 0x09
|
||||
#define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0A
|
||||
#define ACPI_BITREG_RT_CLOCK_ENABLE 0x0B
|
||||
#define ACPI_BITREG_WAKE_ENABLE 0x0C
|
||||
|
||||
#define ACPI_BITREG_SCI_ENABLE 0x0D
|
||||
#define ACPI_BITREG_BUS_MASTER_RLD 0x0E
|
||||
#define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x0F
|
||||
#define ACPI_BITREG_SLEEP_TYPE_A 0x10
|
||||
#define ACPI_BITREG_SLEEP_TYPE_B 0x11
|
||||
#define ACPI_BITREG_SLEEP_ENABLE 0x12
|
||||
|
||||
#define ACPI_BITREG_ARB_DISABLE 0x13
|
||||
#define ACPI_EVENT_PMTIMER 0
|
||||
#define ACPI_EVENT_GLOBAL 1
|
||||
#define ACPI_EVENT_POWER_BUTTON 2
|
||||
#define ACPI_EVENT_SLEEP_BUTTON 3
|
||||
#define ACPI_EVENT_RTC 4
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user