summaryrefslogtreecommitdiff
path: root/include/acpi
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2004-05-07 09:24:44 -0400
committerLen Brown <lenb@dhcppc3.>2004-05-07 09:24:44 -0400
commit5eb3a43d520e162cac9dc664309aed380d981bbd (patch)
tree87f447d974bbef51487ee41f50888aabfb9a80a3 /include/acpi
parenta308df0297a84870687e90990a8cf0641474e18f (diff)
[ACPI] ACPICA 20040427 from Bob Moore
Completed a major overhaul of the GPE handling within ACPI CA. There are now three types of GPEs: wake-only; runtime-only; combination wake/run. The only GPEs allowed to be combination wake/run are for button-style devices such as a control-method power button, control-method sleep button, or a notebook lid switch. GPEs that have an _Lxx or _Exx method and are not referenced by any _PRW methods are marked for "runtime" and hardware enabled. Any GPE that is referenced by a _PRW method is marked for "wake" (and disabled at runtime). However, at sleep time, only those GPEs that have been specifically enabled for wake via the acpi_enable_gpe() interface will actually be hardware enabled. A new external interface has been added, acpi_set_gpe_type() that is meant to be used by device drivers to force a GPE to a particular type. It will be especially useful for the drivers for the button devices mentioned above. Completed restructuring of the ACPI CA initialization sequence so that default operation region handlers are installed before GPEs are initialized and the _PRW methods are executed. This will prevent errors when the _PRW methods attempt to access system memory or I/O space. GPE enable/disable no longer reads the GPE enable register. We now keep the enable info for runtime and wake separate and in the GPE_EVENT_INFO. We thus no longer depend on the hardware to maintain these bits. Always clear the wake status and fixed/GPE status bits before sleep, even for state S5. Improved the AML debugger output for displaying the GPE blocks and their current status. Added new strings for the _OSI method, of the form "Windows 2001 SPx" where x = 0,1,2,3,4. Fixed a problem where the physical address was incorrectly calculated when the Load() operator was used to directly load from an Operation Region (vs. loading from a Field object.) Also added check for minimum table length for this case. Fix for multiple mutex acquisition. Restore original thread SyncLevel on mutex release. Added ACPI_VALID_SXDS flag to the acpi_get_object_info interface for consistency with the other fields returned. Shrunk the ACPI_GPE_EVENT_INFO structure by 40%. There is one such structure for each GPE in the system, so the size of this structure is important. CPU stack requirement reduction: Cleaned up the method execution and object evaluation paths so that now a parameter structure is passed, instead of copying the various method parameters over and over again. In evregion.c: Correctly exit and reenter the interpreter region if and only if dispatching an operation region request to a user-installed handler. Do not exit/reenter when dispatching to a default handler (e.g., default system memory or I/O handlers)
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acconfig.h4
-rw-r--r--include/acpi/acdispat.h3
-rw-r--r--include/acpi/acevents.h51
-rw-r--r--include/acpi/acexcep.h6
-rw-r--r--include/acpi/acglobal.h1
-rw-r--r--include/acpi/achware.h21
-rw-r--r--include/acpi/aclocal.h39
-rw-r--r--include/acpi/acnamesp.h18
-rw-r--r--include/acpi/acobject.h13
-rw-r--r--include/acpi/acparser.h4
-rw-r--r--include/acpi/acpixf.h10
-rw-r--r--include/acpi/acstruct.h23
-rw-r--r--include/acpi/actbl.h29
-rw-r--r--include/acpi/actypes.h67
14 files changed, 193 insertions, 96 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 908af3e75c44..50e17c4e869d 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -64,7 +64,7 @@
/* Version string */
-#define ACPI_CA_VERSION 0x20040402
+#define ACPI_CA_VERSION 0x20040427
/* Maximum objects in the various object caches */
@@ -187,7 +187,7 @@
/* Number of strings associated with the _OSI reserved method */
-#define ACPI_NUM_OSI_STRINGS 4
+#define ACPI_NUM_OSI_STRINGS 9
/******************************************************************************
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 2a09e926cccc..e003a4f3ff4e 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -437,8 +437,7 @@ acpi_ds_init_aml_walk (
struct acpi_namespace_node *method_node,
u8 *aml_start,
u32 aml_length,
- union acpi_operand_object **params,
- union acpi_operand_object **return_obj_desc,
+ struct acpi_parameter_info *info,
u32 pass_number);
acpi_status
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index 4ab99b2fd670..16455d56ef83 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -46,11 +46,11 @@
acpi_status
-acpi_ev_initialize (
+acpi_ev_initialize_events (
void);
acpi_status
-acpi_ev_handler_initialize (
+acpi_ev_install_xrupt_handlers (
void);
@@ -117,6 +117,20 @@ u8
acpi_ev_valid_gpe_event (
struct acpi_gpe_event_info *gpe_event_info);
+acpi_status
+acpi_ev_update_gpe_enable_masks (
+ struct acpi_gpe_event_info *gpe_event_info,
+ u8 type);
+
+acpi_status
+acpi_ev_enable_gpe (
+ struct acpi_gpe_event_info *gpe_event_info,
+ u8 write_to_hardware);
+
+acpi_status
+acpi_ev_disable_gpe (
+ struct acpi_gpe_event_info *gpe_event_info);
+
struct acpi_gpe_event_info *
acpi_ev_get_gpe_event_info (
acpi_handle gpe_device,
@@ -139,6 +153,11 @@ acpi_status
acpi_ev_delete_gpe_block (
struct acpi_gpe_block_info *gpe_block);
+acpi_status
+acpi_ev_delete_gpe_handlers (
+ struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+ struct acpi_gpe_block_info *gpe_block);
+
u32
acpi_ev_gpe_dispatch (
struct acpi_gpe_event_info *gpe_event_info,
@@ -148,12 +167,25 @@ u32
acpi_ev_gpe_detect (
struct acpi_gpe_xrupt_info *gpe_xrupt_list);
+acpi_status
+acpi_ev_set_gpe_type (
+ struct acpi_gpe_event_info *gpe_event_info,
+ u8 type);
+
+acpi_status
+acpi_ev_check_for_wake_only_gpe (
+ struct acpi_gpe_event_info *gpe_event_info);
+
/*
* Evregion - Address Space handling
*/
acpi_status
-acpi_ev_init_address_spaces (
+acpi_ev_install_region_handlers (
+ void);
+
+acpi_status
+acpi_ev_initialize_op_regions (
void);
acpi_status
@@ -183,6 +215,19 @@ acpi_ev_detach_region (
u8 acpi_ns_is_locked);
acpi_status
+acpi_ev_install_space_handler (
+ struct acpi_namespace_node *node,
+ acpi_adr_space_type space_id,
+ acpi_adr_space_handler handler,
+ acpi_adr_space_setup setup,
+ void *context);
+
+acpi_status
+acpi_ev_execute_reg_methods (
+ struct acpi_namespace_node *node,
+ acpi_adr_space_type space_id);
+
+acpi_status
acpi_ev_execute_reg_method (
union acpi_operand_object *region_obj,
u32 function);
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 9441f5c1a7e8..abda2357e543 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -95,8 +95,9 @@
#define AE_LOGICAL_ADDRESS (acpi_status) (0x001B | AE_CODE_ENVIRONMENTAL)
#define AE_ABORT_METHOD (acpi_status) (0x001C | AE_CODE_ENVIRONMENTAL)
#define AE_SAME_HANDLER (acpi_status) (0x001D | AE_CODE_ENVIRONMENTAL)
+#define AE_WAKE_ONLY_GPE (acpi_status) (0x001E | AE_CODE_ENVIRONMENTAL)
-#define AE_CODE_ENV_MAX 0x001D
+#define AE_CODE_ENV_MAX 0x001E
/*
* Programmer exceptions
@@ -222,7 +223,8 @@ char const *acpi_gbl_exception_names_env[] =
"AE_NO_GLOBAL_LOCK",
"AE_LOGICAL_ADDRESS",
"AE_ABORT_METHOD",
- "AE_SAME_HANDLER"
+ "AE_SAME_HANDLER",
+ "AE_WAKE_ONLY_GPE"
};
char const *acpi_gbl_exception_names_pgm[] =
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 397ca31fdf99..fb32a710d6a1 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -192,6 +192,7 @@ ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
ACPI_EXTERN u8 acpi_gbl_global_lock_present;
ACPI_EXTERN u8 acpi_gbl_events_initialized;
+ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
extern u8 acpi_gbl_shutdown;
extern u32 acpi_gbl_startup_flags;
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 2281f27ea226..a3e067c010e3 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -117,10 +117,6 @@ acpi_status
acpi_hw_enable_gpe (
struct acpi_gpe_event_info *gpe_event_info);
-void
-acpi_hw_enable_gpe_for_wakeup (
- struct acpi_gpe_event_info *gpe_event_info);
-
acpi_status
acpi_hw_disable_gpe (
struct acpi_gpe_event_info *gpe_event_info);
@@ -130,10 +126,6 @@ acpi_hw_disable_gpe_block (
struct acpi_gpe_xrupt_info *gpe_xrupt_info,
struct acpi_gpe_block_info *gpe_block);
-void
-acpi_hw_disable_gpe_for_wakeup (
- struct acpi_gpe_event_info *gpe_event_info);
-
acpi_status
acpi_hw_clear_gpe (
struct acpi_gpe_event_info *gpe_event_info);
@@ -149,13 +141,22 @@ acpi_hw_get_gpe_status (
acpi_event_status *event_status);
acpi_status
-acpi_hw_prepare_gpes_for_sleep (
+acpi_hw_disable_all_gpes (
void);
acpi_status
-acpi_hw_restore_gpes_on_wake (
+acpi_hw_enable_all_runtime_gpes (
void);
+acpi_status
+acpi_hw_enable_all_wakeup_gpes (
+ void);
+
+acpi_status
+acpi_hw_enable_runtime_gpe_block (
+ struct acpi_gpe_xrupt_info *gpe_xrupt_info,
+ struct acpi_gpe_block_info *gpe_block);
+
/* ACPI Timer prototypes */
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index eb1b957ed74e..2afff1148f0c 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -189,8 +189,6 @@ struct acpi_namespace_node
u8 type; /* Type associated with this name */
u16 owner_id;
union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
-
-
union acpi_operand_object *object; /* Pointer to attached ACPI object (optional) */
struct acpi_namespace_node *child; /* First child */
struct acpi_namespace_node *peer; /* Next peer*/
@@ -211,10 +209,8 @@ struct acpi_namespace_node
#define ANOBJ_METHOD_LOCAL 0x10
#define ANOBJ_METHOD_NO_RETVAL 0x20
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
-
#define ANOBJ_IS_BIT_OFFSET 0x80
-
/*
* ACPI Table Descriptor. One per ACPI table
*/
@@ -309,16 +305,31 @@ struct acpi_create_field_info
*
****************************************************************************/
-/* Information about a GPE, one per each GPE in an array */
+/* Dispatch info for each GPE -- either a method or handler, cannot be both */
-struct acpi_gpe_event_info
+struct acpi_handler_info
{
- struct acpi_namespace_node *method_node; /* Method node for this GPE level */
- acpi_gpe_handler handler; /* Address of handler, if any */
+ acpi_event_handler address; /* Address of handler, if any */
void *context; /* Context to be passed to handler */
+ struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */
+};
+
+union acpi_gpe_dispatch_info
+{
+ struct acpi_namespace_node *method_node; /* Method node for this GPE level */
+ struct acpi_handler_info *handler;
+};
+
+/*
+ * Information about a GPE, one per each GPE in an array.
+ * NOTE: Important to keep this struct as small as possible.
+ */
+struct acpi_gpe_event_info
+{
+ union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */
struct acpi_gpe_register_info *register_info; /* Backpointer to register info */
- u8 flags; /* Level or Edge */
- u8 bit_mask; /* This GPE within the register */
+ u8 flags; /* Misc info about this GPE */
+ u8 register_bit; /* This GPE bit within the register */
};
/* Information about a GPE register pair, one per each status/enable pair in an array */
@@ -327,9 +338,8 @@ struct acpi_gpe_register_info
{
struct acpi_generic_address status_address; /* Address of status reg */
struct acpi_generic_address enable_address; /* Address of enable reg */
- u8 status; /* Current value of status reg */
- u8 enable; /* Current value of enable reg */
- u8 wake_enable; /* Mask of bits to keep enabled when sleeping */
+ u8 enable_for_wake; /* GPEs to keep enabled when sleeping */
+ u8 enable_for_run; /* GPEs to keep enabled when running */
u8 base_gpe_number; /* Base GPE number for this register */
};
@@ -339,6 +349,7 @@ struct acpi_gpe_register_info
*/
struct acpi_gpe_block_info
{
+ struct acpi_namespace_node *node;
struct acpi_gpe_block_info *previous;
struct acpi_gpe_block_info *next;
struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */
@@ -502,7 +513,7 @@ struct acpi_thread_state
struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */
union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */
u32 thread_id; /* Running thread ID */
- u16 current_sync_level; /* Mutex Sync (nested acquire) level */
+ u8 current_sync_level; /* Mutex Sync (nested acquire) level */
};
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index de54ba7ba640..8cfd1afbac28 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -278,33 +278,25 @@ acpi_ns_dump_objects (
acpi_status
acpi_ns_evaluate_by_handle (
- struct acpi_namespace_node *prefix_node,
- union acpi_operand_object **params,
- union acpi_operand_object **return_object);
+ struct acpi_parameter_info *info);
acpi_status
acpi_ns_evaluate_by_name (
char *pathname,
- union acpi_operand_object **params,
- union acpi_operand_object **return_object);
+ struct acpi_parameter_info *info);
acpi_status
acpi_ns_evaluate_relative (
- struct acpi_namespace_node *prefix_node,
char *pathname,
- union acpi_operand_object **params,
- union acpi_operand_object **return_object);
+ struct acpi_parameter_info *info);
acpi_status
acpi_ns_execute_control_method (
- struct acpi_namespace_node *method_node,
- union acpi_operand_object **params,
- union acpi_operand_object **return_obj_desc);
+ struct acpi_parameter_info *info);
acpi_status
acpi_ns_get_object_value (
- struct acpi_namespace_node *object_node,
- union acpi_operand_object **return_obj_desc);
+ struct acpi_parameter_info *info);
/*
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 51abddaf15a2..0d479722f4aa 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -204,13 +204,14 @@ struct acpi_object_method
struct acpi_object_mutex
{
ACPI_OBJECT_COMMON_HEADER
- u16 sync_level;
- u16 acquisition_depth;
- struct acpi_thread_state *owner_thread;
- void *semaphore;
+ u8 sync_level; /* 0-15, specified in Mutex() call */
+ u16 acquisition_depth; /* Allow multiple Acquires, same thread */
+ struct acpi_thread_state *owner_thread; /* Current owner of the mutex */
+ void *semaphore; /* Actual OS synchronization object */
union acpi_operand_object *prev; /* Link for list of acquired mutexes */
union acpi_operand_object *next; /* Link for list of acquired mutexes */
- struct acpi_namespace_node *node; /* containing object */
+ struct acpi_namespace_node *node; /* Containing namespace node */
+ u8 original_sync_level; /* Owner's original sync level (0-15) */
};
@@ -220,7 +221,7 @@ struct acpi_object_region
u8 space_id;
union acpi_operand_object *handler; /* Handler for region access */
- struct acpi_namespace_node *node; /* containing object */
+ struct acpi_namespace_node *node; /* Containing namespace node */
union acpi_operand_object *next;
u32 length;
acpi_physical_address address;
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 562e66002ffa..42cc5b4d32a8 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -73,9 +73,7 @@ acpi_psx_load_table (
acpi_status
acpi_psx_execute (
- struct acpi_namespace_node *method_node,
- union acpi_operand_object **params,
- union acpi_operand_object **return_obj_desc);
+ struct acpi_parameter_info *info);
/******************************************************************************
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index e53a918679cb..54ae84dcfbcd 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -296,7 +296,7 @@ acpi_install_gpe_handler (
acpi_handle gpe_device,
u32 gpe_number,
u32 type,
- acpi_gpe_handler handler,
+ acpi_event_handler address,
void *context);
acpi_status
@@ -312,7 +312,7 @@ acpi_status
acpi_remove_gpe_handler (
acpi_handle gpe_device,
u32 gpe_number,
- acpi_gpe_handler handler);
+ acpi_event_handler address);
acpi_status
acpi_enable_event (
@@ -334,6 +334,12 @@ acpi_get_event_status (
acpi_event_status *event_status);
acpi_status
+acpi_set_gpe_type (
+ acpi_handle gpe_device,
+ u32 gpe_number,
+ u8 type);
+
+acpi_status
acpi_enable_gpe (
acpi_handle gpe_device,
u32 gpe_number,
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 56a3782cdbef..e9a2b32e6cc3 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -69,13 +69,14 @@
struct acpi_walk_state
{
u8 data_type; /* To differentiate various internal objs MUST BE FIRST!*/\
+ u8 walk_type;
acpi_owner_id owner_id; /* Owner of objects created during the walk */
u8 last_predicate; /* Result of last predicate */
+ u8 reserved; /* For alignment */
u8 current_result; /* */
u8 next_op_info; /* Info about next_op */
u8 num_operands; /* Stack pointer for Operands[] array */
u8 return_used;
- u8 walk_type;
u16 opcode; /* Current AML opcode */
u8 scope_depth;
u8 reserved1;
@@ -91,7 +92,8 @@ struct acpi_walk_state
struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
union acpi_operand_object **caller_return_desc;
union acpi_generic_state *control_state; /* List of control states (nested IFs) */
- struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */
+ struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */
+ struct acpi_gpe_event_info *gpe_event_info; /* Info for GPE (_Lxx/_Exx methods only */
struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
struct acpi_namespace_node *method_call_node; /* Called method Node*/
union acpi_parse_object *method_call_op; /* method_call Op if running a method */
@@ -200,4 +202,21 @@ union acpi_aml_operands
};
+/* Internal method parameter list */
+
+struct acpi_parameter_info
+{
+ struct acpi_namespace_node *node;
+ union acpi_operand_object **parameters;
+ union acpi_operand_object *return_object;
+ u8 parameter_type;
+ u8 return_object_type;
+};
+
+/* Types for parameter_type above */
+
+#define ACPI_PARAM_ARGS 0
+#define ACPI_PARAM_GPE 1
+
+
#endif
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 55680ad34b55..b380c23584fe 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -288,19 +288,6 @@ struct smart_battery_table
};
-/*
- * High performance timer
- */
-struct hpet_table
-{
- ACPI_TABLE_HEADER_DEF
- u32 hardware_id;
- u32 base_address [3];
- u8 hpet_number;
- u16 clock_tick;
- u8 attributes;
-};
-
#pragma pack()
@@ -344,4 +331,20 @@ struct acpi_table_support
#include "actbl2.h" /* Acpi 2.0 table definitions */
+#pragma pack(1)
+/*
+ * High performance timer
+ */
+struct hpet_table
+{
+ ACPI_TABLE_HEADER_DEF
+ u32 hardware_id;
+ struct acpi_generic_address base_address;
+ u8 hpet_number;
+ u16 clock_tick;
+ u8 attributes;
+};
+
+#pragma pack()
+
#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index e6120c879ae0..cde7e1454d98 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -557,34 +557,56 @@ typedef u32 acpi_event_status;
#define ACPI_GPE_MAX 0xFF
#define ACPI_NUM_GPE 256
+#define ACPI_GPE_ENABLE 0
+#define ACPI_GPE_DISABLE 1
+
+
/*
* GPE info flags - Per GPE
- * +---------+-+-+-+
- * |Bits 8:3 |2|1|0|
- * +---------+-+-+-+
- * | | | |
- * | | | +- Edge or Level Triggered
- * | | +--- Type: Wake or Runtime
- * | +----- Enabled for wake?
- * +--------<Reserved>
+ * +-+-+-+---+---+-+
+ * |7|6|5|4:3|2:1|0|
+ * +-+-+-+---+---+-+
+ * | | | | | |
+ * | | | | | +--- Interrupt type: Edge or Level Triggered
+ * | | | | +--- Type: Wake-only, Runtime-only, or wake/runtime
+ * | | | +--- Type of dispatch -- to method, handler, or none
+ * | | +--- Enabled for runtime?
+ * | +--- Enabled for wake?
+ * +--- System state when GPE ocurred (running/waking)
*/
-#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 1
-#define ACPI_GPE_LEVEL_TRIGGERED (u8) 1
-#define ACPI_GPE_EDGE_TRIGGERED (u8) 0
+#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01
+#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01
+#define ACPI_GPE_EDGE_TRIGGERED (u8) 0x00
+
+#define ACPI_GPE_TYPE_MASK (u8) 0x06
+#define ACPI_GPE_TYPE_WAKE_RUN (u8) 0x06
+#define ACPI_GPE_TYPE_WAKE (u8) 0x02
+#define ACPI_GPE_TYPE_RUNTIME (u8) 0x04 /* Default */
+
+#define ACPI_GPE_DISPATCH_MASK (u8) 0x18
+#define ACPI_GPE_DISPATCH_HANDLER (u8) 0x08
+#define ACPI_GPE_DISPATCH_METHOD (u8) 0x10
+#define ACPI_GPE_DISPATCH_NOT_USED (u8) 0x00 /* Default */
+
+#define ACPI_GPE_RUN_ENABLE_MASK (u8) 0x20
+#define ACPI_GPE_RUN_ENABLED (u8) 0x20
+#define ACPI_GPE_RUN_DISABLED (u8) 0x00 /* Default */
-#define ACPI_GPE_TYPE_MASK (u8) 2
-#define ACPI_GPE_TYPE_WAKE (u8) 2
-#define ACPI_GPE_TYPE_RUNTIME (u8) 0 /* Default */
+#define ACPI_GPE_WAKE_ENABLE_MASK (u8) 0x40
+#define ACPI_GPE_WAKE_ENABLED (u8) 0x40
+#define ACPI_GPE_WAKE_DISABLED (u8) 0x00 /* Default */
-#define ACPI_GPE_ENABLE_MASK (u8) 4
-#define ACPI_GPE_ENABLED (u8) 4
-#define ACPI_GPE_DISABLED (u8) 0 /* Default */
+#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */
+
+#define ACPI_GPE_SYSTEM_MASK (u8) 0x80
+#define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80
+#define ACPI_GPE_SYSTEM_WAKING (u8) 0x00
/*
* Flags for GPE and Lock interfaces
*/
-#define ACPI_EVENT_WAKE_ENABLE 0x2
-#define ACPI_EVENT_WAKE_DISABLE 0x2
+#define ACPI_EVENT_WAKE_ENABLE 0x2 /* acpi_gpe_enable */
+#define ACPI_EVENT_WAKE_DISABLE 0x2 /* acpi_gpe_disable */
#define ACPI_NOT_ISR 0x1
#define ACPI_ISR 0x0
@@ -790,10 +812,6 @@ u32 (*acpi_event_handler) (
void *context);
typedef
-void (*acpi_gpe_handler) (
- void *context);
-
-typedef
void (*acpi_notify_handler) (
acpi_handle device,
u32 value,
@@ -880,6 +898,7 @@ struct acpi_compatible_id_list
#define ACPI_VALID_HID 0x0004
#define ACPI_VALID_UID 0x0008
#define ACPI_VALID_CID 0x0010
+#define ACPI_VALID_SXDS 0x0020
#define ACPI_COMMON_OBJ_INFO \
@@ -899,12 +918,12 @@ struct acpi_device_info
{
ACPI_COMMON_OBJ_INFO;
- u8 highest_dstates[4]; /* _sx_d values 0xFF indicates not valid */
u32 valid; /* Indicates which fields below are valid */
u32 current_status; /* _STA value */
acpi_integer address; /* _ADR value if any */
struct acpi_device_id hardware_id; /* _HID value if any */
struct acpi_device_id unique_id; /* _UID value if any */
+ u8 highest_dstates[4]; /* _sx_d values: 0xFF indicates not valid */
struct acpi_compatible_id_list compatibility_id; /* List of _CIDs if any */
};