Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46356
b: refs/heads/master
c: c5a7156
h: refs/heads/master
v: v3
  • Loading branch information
Bob Moore authored and Len Brown committed Feb 3, 2007
1 parent 5d4b925 commit 92bcd6d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 102 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fdffb72d23172c91af56983f303d1986994df522
refs/heads/master: c5a7156959e89b32260ad6072bbf5077bcdfbeee
78 changes: 17 additions & 61 deletions trunk/drivers/acpi/events/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,20 +635,23 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
}
}

/* Save current system state */

if (acpi_gbl_system_awake_and_running) {
ACPI_SET_BIT(gpe_event_info->flags, ACPI_GPE_SYSTEM_RUNNING);
} else {
ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_SYSTEM_RUNNING);
if (!acpi_gbl_system_awake_and_running) {
/*
* We just woke up because of a wake GPE. Disable any further GPEs
* until we are fully up and running (Only wake GPEs should be enabled
* at this time, but we just brute-force disable them all.)
* 1) We must disable this particular wake GPE so it won't fire again
* 2) We want to disable all wake GPEs, since we are now awake
*/
(void)acpi_hw_disable_all_gpes();
}

/*
* Dispatch the GPE to either an installed handler, or the control
* method associated with this GPE (_Lxx or _Exx).
* If a handler exists, we invoke it and do not attempt to run the method.
* If there is neither a handler nor a method, we disable the level to
* prevent further events from coming in here.
* Dispatch the GPE to either an installed handler, or the control method
* associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke
* it and do not attempt to run the method. If there is neither a handler
* nor a method, we disable this GPE to prevent further such pointless
* events from firing.
*/
switch (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) {
case ACPI_GPE_DISPATCH_HANDLER:
Expand Down Expand Up @@ -679,8 +682,8 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
case ACPI_GPE_DISPATCH_METHOD:

/*
* Disable GPE, so it doesn't keep firing before the method has a
* chance to run.
* Disable the GPE, so it doesn't keep firing before the method has a
* chance to run (it runs asynchronously with interrupts enabled).
*/
status = acpi_ev_disable_gpe(gpe_event_info);
if (ACPI_FAILURE(status)) {
Expand Down Expand Up @@ -713,7 +716,7 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)
gpe_number));

/*
* Disable the GPE. The GPE will remain disabled until the ACPI
* Disable the GPE. The GPE will remain disabled until the ACPI
* Core Subsystem is restarted, or a handler is installed.
*/
status = acpi_ev_disable_gpe(gpe_event_info);
Expand All @@ -728,50 +731,3 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number)

return_UINT32(ACPI_INTERRUPT_HANDLED);
}

#ifdef ACPI_GPE_NOTIFY_CHECK
/*******************************************************************************
* TBD: NOT USED, PROTOTYPE ONLY AND WILL PROBABLY BE REMOVED
*
* FUNCTION: acpi_ev_check_for_wake_only_gpe
*
* PARAMETERS: gpe_event_info - info for this GPE
*
* RETURN: Status
*
* DESCRIPTION: Determine if a a GPE is "wake-only".
*
* Called from Notify() code in interpreter when a "DeviceWake"
* Notify comes in.
*
******************************************************************************/

acpi_status
acpi_ev_check_for_wake_only_gpe(struct acpi_gpe_event_info *gpe_event_info)
{
acpi_status status;

ACPI_FUNCTION_TRACE(ev_check_for_wake_only_gpe);

if ((gpe_event_info) && /* Only >0 for _Lxx/_Exx */
((gpe_event_info->flags & ACPI_GPE_SYSTEM_MASK) == ACPI_GPE_SYSTEM_RUNNING)) { /* System state at GPE time */
/* This must be a wake-only GPE, disable it */

status = acpi_ev_disable_gpe(gpe_event_info);

/* Set GPE to wake-only. Do not change wake disabled/enabled status */

acpi_ev_set_gpe_type(gpe_event_info, ACPI_GPE_TYPE_WAKE);

ACPI_INFO((AE_INFO,
"GPE %p was updated from wake/run to wake-only",
gpe_event_info));

/* This was a wake-only GPE */

return_ACPI_STATUS(AE_WAKE_ONLY_GPE);
}

return_ACPI_STATUS(AE_OK);
}
#endif
68 changes: 33 additions & 35 deletions trunk/include/acpi/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,41 +58,6 @@
#define ACPI_INIT_GLOBAL(a,b) a
#endif

/*
* Keep local copies of these FADT-based registers. NOTE: These globals
* are first in this file for alignment reasons on 64-bit systems.
*/
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;

/*****************************************************************************
*
* Debug support
*
****************************************************************************/

/* Runtime configuration of debug print levels */

extern u32 acpi_dbg_level;
extern u32 acpi_dbg_layer;

/* Procedure nesting level for debug output */

extern u32 acpi_gbl_nesting_level;

/* Event counters */

ACPI_EXTERN u32 acpi_gpe_count;

/* Support for dynamic control method tracing mechanism */

ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
ACPI_EXTERN u32 acpi_gbl_trace_flags;

/*****************************************************************************
*
* Runtime configuration (static defaults that can be overriden at runtime)
Expand Down Expand Up @@ -137,6 +102,34 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_create_osi_method, TRUE);
*/
ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);

/*****************************************************************************
*
* Debug support
*
****************************************************************************/

/* Runtime configuration of debug print levels */

extern u32 acpi_dbg_level;
extern u32 acpi_dbg_layer;

/* Procedure nesting level for debug output */

extern u32 acpi_gbl_nesting_level;

/* Event counters */

ACPI_EXTERN u32 acpi_gpe_count;

/* Support for dynamic control method tracing mechanism */

ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
ACPI_EXTERN u32 acpi_gbl_trace_flags;

/*****************************************************************************
*
* ACPI Table globals
Expand All @@ -154,6 +147,11 @@ ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
#define acpi_fadt acpi_gbl_FADT
extern acpi_native_uint acpi_gbl_permanent_mmap;

/* These addresses are calculated from FADT address values */

ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;

/*
* Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
* determined by the revision of the DSDT: If the DSDT revision is less than
Expand Down
6 changes: 1 addition & 5 deletions trunk/include/acpi/actypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ typedef u32 acpi_event_status;
* | | | +--- Type of dispatch -- to method, handler, or none
* | | +--- Enabled for runtime?
* | +--- Enabled for wake?
* +--- System state when GPE ocurred (running/waking)
* +--- Unused
*/
#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01
#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01
Expand All @@ -618,10 +618,6 @@ typedef u32 acpi_event_status;

#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
*/
Expand Down

0 comments on commit 92bcd6d

Please sign in to comment.