diff options
author | Robert Moore <Robert.Moore@intel.com> | 2012-02-01 13:18:17 -0800 |
---|---|---|
committer | Robert Moore <Robert.Moore@intel.com> | 2012-02-01 13:18:17 -0800 |
commit | 3009583f881defec824a43196e97d42090b0fc22 (patch) | |
tree | f91546ba01dd25ac9b45df11a4a78fc6b3457024 | |
parent | 4057b5134140b299a47eed7e9ebbee39cfc5885e (diff) | |
download | acpica-3009583f881defec824a43196e97d42090b0fc22.tar.gz |
Support for custom ACPICA build for ACPI 5.0 reduced hardware.
Add ACPI_REDUCED_HARDWARE flag that removes all hardware-related
code (about 10% code, 5% static data).
36 files changed, 734 insertions, 479 deletions
diff --git a/source/compiler/aslstubs.c b/source/compiler/aslstubs.c index 3a260d013..bc8703c9e 100644 --- a/source/compiler/aslstubs.c +++ b/source/compiler/aslstubs.c @@ -200,13 +200,6 @@ AcpiDsStoreObjectToLocal ( } ACPI_STATUS -AcpiEvDeleteGpeBlock ( - ACPI_GPE_BLOCK_INFO *GpeBlock) -{ - return (AE_OK); -} - -ACPI_STATUS AcpiEvQueueNotifyRequest ( ACPI_NAMESPACE_NODE *Node, UINT32 NotifyValue) @@ -221,6 +214,14 @@ AcpiEvIsNotifyObject ( return (FALSE); } +#if (!ACPI_REDUCED_HARDWARE) +ACPI_STATUS +AcpiEvDeleteGpeBlock ( + ACPI_GPE_BLOCK_INFO *GpeBlock) +{ + return (AE_OK); +} + ACPI_STATUS AcpiEvAcquireGlobalLock ( UINT16 Timeout) @@ -234,6 +235,7 @@ AcpiEvReleaseGlobalLock ( { return (AE_OK); } +#endif /* !ACPI_REDUCED_HARDWARE */ ACPI_STATUS AcpiEvInitializeRegion ( diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index 094522d2c..932372ffe 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -213,6 +213,7 @@ AcpiDbConvertToNode ( } +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiDbSleep @@ -254,6 +255,8 @@ AcpiDbSleep ( return (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ + /******************************************************************************* * @@ -1091,6 +1094,7 @@ AcpiDbDisplayResources ( } +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiDbGenerateGpe @@ -1129,5 +1133,6 @@ AcpiDbGenerateGpe ( (void) AcpiEvGpeDispatch (NULL, GpeEventInfo, GpeNumber); } +#endif /* !ACPI_REDUCED_HARDWARE */ #endif /* ACPI_DEBUGGER */ diff --git a/source/components/debugger/dbdisply.c b/source/components/debugger/dbdisply.c index 158a8f54c..d8b3aa901 100644 --- a/source/components/debugger/dbdisply.c +++ b/source/components/debugger/dbdisply.c @@ -842,6 +842,7 @@ AcpiDbDisplayArgumentObject ( } +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiDbDisplayGpes @@ -1004,6 +1005,7 @@ AcpiDbDisplayGpes ( GpeXruptInfo = GpeXruptInfo->Next; } } +#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* @@ -1083,6 +1085,8 @@ AcpiDbDisplayHandlers ( } } +#if (!ACPI_REDUCED_HARDWARE) + /* Fixed event handlers */ AcpiOsPrintf ("\nFixed Event Handlers:\n"); @@ -1101,6 +1105,8 @@ AcpiDbDisplayHandlers ( } } +#endif /* !ACPI_REDUCED_HARDWARE */ + /* Miscellaneous global handlers */ AcpiOsPrintf ("\nMiscellaneous Global Handlers:\n"); diff --git a/source/components/debugger/dbinput.c b/source/components/debugger/dbinput.c index d2ac74749..3e61bdbb8 100644 --- a/source/components/debugger/dbinput.c +++ b/source/components/debugger/dbinput.c @@ -734,12 +734,15 @@ AcpiDbCommandDispatch ( break; case CMD_ENABLEACPI: +#if (!ACPI_REDUCED_HARDWARE) + Status = AcpiEnable(); if (ACPI_FAILURE(Status)) { AcpiOsPrintf("AcpiEnable failed (Status=%X)\n", Status); return (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ break; case CMD_EVENT: diff --git a/source/components/events/evevent.c b/source/components/events/evevent.c index 10b3318c4..1cdf7df18 100644 --- a/source/components/events/evevent.c +++ b/source/components/events/evevent.c @@ -120,6 +120,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evevent") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static ACPI_STATUS @@ -401,4 +403,6 @@ AcpiEvFixedEventDispatch ( AcpiGbl_FixedEventHandlers[Event].Context)); } +#endif /* !ACPI_REDUCED_HARDWARE */ + diff --git a/source/components/events/evglock.c b/source/components/events/evglock.c index 5a960932a..031233a84 100644 --- a/source/components/events/evglock.c +++ b/source/components/events/evglock.c @@ -121,6 +121,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evglock") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /* Local prototypes */ @@ -444,3 +445,5 @@ AcpiEvReleaseGlobalLock ( AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex); return_ACPI_STATUS (Status); } + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/events/evgpe.c b/source/components/events/evgpe.c index 2f3d31276..de32275b5 100644 --- a/source/components/events/evgpe.c +++ b/source/components/events/evgpe.c @@ -121,6 +121,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpe") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static void ACPI_SYSTEM_XFACE @@ -898,3 +900,4 @@ AcpiEvGpeDispatch ( return_UINT32 (ACPI_INTERRUPT_HANDLED); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/events/evgpeblk.c b/source/components/events/evgpeblk.c index 5709bbc72..622b7721c 100644 --- a/source/components/events/evgpeblk.c +++ b/source/components/events/evgpeblk.c @@ -121,6 +121,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpeblk") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static ACPI_STATUS @@ -617,3 +619,4 @@ AcpiEvInitializeGpeBlock ( return_ACPI_STATUS (AE_OK); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/events/evgpeinit.c b/source/components/events/evgpeinit.c index a3965bcb9..4a85449f2 100644 --- a/source/components/events/evgpeinit.c +++ b/source/components/events/evgpeinit.c @@ -122,6 +122,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpeinit") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /* * Note: History of _PRW support in ACPICA @@ -529,3 +530,5 @@ AcpiEvMatchGpeMethod ( Name, GpeNumber)); return_ACPI_STATUS (AE_OK); } + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/events/evgpeutil.c b/source/components/events/evgpeutil.c index d0ce838ad..a5ad32074 100644 --- a/source/components/events/evgpeutil.c +++ b/source/components/events/evgpeutil.c @@ -113,7 +113,6 @@ * *****************************************************************************/ - #include "acpi.h" #include "accommon.h" #include "acevents.h" @@ -122,6 +121,7 @@ ACPI_MODULE_NAME ("evgpeutil") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: AcpiEvWalkGpeList @@ -494,3 +494,4 @@ AcpiEvDeleteGpeHandlers ( return_ACPI_STATUS (AE_OK); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/events/evmisc.c b/source/components/events/evmisc.c index b69373ae8..b0fa3b52f 100644 --- a/source/components/events/evmisc.c +++ b/source/components/events/evmisc.c @@ -363,6 +363,7 @@ AcpiEvNotifyDispatch ( } +#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * FUNCTION: AcpiEvTerminate @@ -442,3 +443,5 @@ AcpiEvTerminate ( } return_VOID; } + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/events/evsci.c b/source/components/events/evsci.c index 1827682a8..696606778 100644 --- a/source/components/events/evsci.c +++ b/source/components/events/evsci.c @@ -123,6 +123,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evsci") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static UINT32 ACPI_SYSTEM_XFACE @@ -277,4 +279,4 @@ AcpiEvRemoveSciHandler ( return_ACPI_STATUS (Status); } - +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/events/evxface.c b/source/components/events/evxface.c index 29a3185c9..a6aea0946 100644 --- a/source/components/events/evxface.c +++ b/source/components/events/evxface.c @@ -128,257 +128,6 @@ /******************************************************************************* * - * FUNCTION: AcpiInstallExceptionHandler - * - * PARAMETERS: Handler - Pointer to the handler function for the - * event - * - * RETURN: Status - * - * DESCRIPTION: Saves the pointer to the handler function - * - ******************************************************************************/ - -ACPI_STATUS -AcpiInstallExceptionHandler ( - ACPI_EXCEPTION_HANDLER Handler) -{ - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiInstallExceptionHandler); - - - Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Don't allow two handlers. */ - - if (AcpiGbl_ExceptionHandler) - { - Status = AE_ALREADY_EXISTS; - goto Cleanup; - } - - /* Install the handler */ - - AcpiGbl_ExceptionHandler = Handler; - -Cleanup: - (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiInstallExceptionHandler) - - -/******************************************************************************* - * - * FUNCTION: AcpiInstallGlobalEventHandler - * - * PARAMETERS: Handler - Pointer to the global event handler function - * Context - Value passed to the handler on each event - * - * RETURN: Status - * - * DESCRIPTION: Saves the pointer to the handler function. The global handler - * is invoked upon each incoming GPE and Fixed Event. It is - * invoked at interrupt level at the time of the event dispatch. - * Can be used to update event counters, etc. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiInstallGlobalEventHandler ( - ACPI_GBL_EVENT_HANDLER Handler, - void *Context) -{ - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiInstallGlobalEventHandler); - - - /* Parameter validation */ - - if (!Handler) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Don't allow two handlers. */ - - if (AcpiGbl_GlobalEventHandler) - { - Status = AE_ALREADY_EXISTS; - goto Cleanup; - } - - AcpiGbl_GlobalEventHandler = Handler; - AcpiGbl_GlobalEventHandlerContext = Context; - - -Cleanup: - (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiInstallGlobalEventHandler) - - -/******************************************************************************* - * - * FUNCTION: AcpiInstallFixedEventHandler - * - * PARAMETERS: Event - Event type to enable. - * Handler - Pointer to the handler function for the - * event - * Context - Value passed to the handler on each GPE - * - * RETURN: Status - * - * DESCRIPTION: Saves the pointer to the handler function and then enables the - * event. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiInstallFixedEventHandler ( - UINT32 Event, - ACPI_EVENT_HANDLER Handler, - void *Context) -{ - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiInstallFixedEventHandler); - - - /* Parameter validation */ - - if (Event > ACPI_EVENT_MAX) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Don't allow two handlers. */ - - if (NULL != AcpiGbl_FixedEventHandlers[Event].Handler) - { - Status = AE_ALREADY_EXISTS; - goto Cleanup; - } - - /* Install the handler before enabling the event */ - - AcpiGbl_FixedEventHandlers[Event].Handler = Handler; - AcpiGbl_FixedEventHandlers[Event].Context = Context; - - Status = AcpiEnableEvent (Event, 0); - if (ACPI_FAILURE (Status)) - { - ACPI_WARNING ((AE_INFO, "Could not enable fixed event 0x%X", Event)); - - /* Remove the handler */ - - AcpiGbl_FixedEventHandlers[Event].Handler = NULL; - AcpiGbl_FixedEventHandlers[Event].Context = NULL; - } - else - { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Enabled fixed event %X, Handler=%p\n", Event, Handler)); - } - - -Cleanup: - (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiInstallFixedEventHandler) - - -/******************************************************************************* - * - * FUNCTION: AcpiRemoveFixedEventHandler - * - * PARAMETERS: Event - Event type to disable. - * Handler - Address of the handler - * - * RETURN: Status - * - * DESCRIPTION: Disables the event and unregisters the event handler. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiRemoveFixedEventHandler ( - UINT32 Event, - ACPI_EVENT_HANDLER Handler) -{ - ACPI_STATUS Status = AE_OK; - - - ACPI_FUNCTION_TRACE (AcpiRemoveFixedEventHandler); - - - /* Parameter validation */ - - if (Event > ACPI_EVENT_MAX) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Disable the event before removing the handler */ - - Status = AcpiDisableEvent (Event, 0); - - /* Always Remove the handler */ - - AcpiGbl_FixedEventHandlers[Event].Handler = NULL; - AcpiGbl_FixedEventHandlers[Event].Context = NULL; - - if (ACPI_FAILURE (Status)) - { - ACPI_WARNING ((AE_INFO, - "Could not write to fixed event enable register 0x%X", Event)); - } - else - { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X\n", Event)); - } - - (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiRemoveFixedEventHandler) - - -/******************************************************************************* - * * FUNCTION: AcpiInstallNotifyHandler * * PARAMETERS: Device - The device for which notifies will be handled @@ -730,6 +479,258 @@ ACPI_EXPORT_SYMBOL (AcpiRemoveNotifyHandler) /******************************************************************************* * + * FUNCTION: AcpiInstallExceptionHandler + * + * PARAMETERS: Handler - Pointer to the handler function for the + * event + * + * RETURN: Status + * + * DESCRIPTION: Saves the pointer to the handler function + * + ******************************************************************************/ + +ACPI_STATUS +AcpiInstallExceptionHandler ( + ACPI_EXCEPTION_HANDLER Handler) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiInstallExceptionHandler); + + + Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Don't allow two handlers. */ + + if (AcpiGbl_ExceptionHandler) + { + Status = AE_ALREADY_EXISTS; + goto Cleanup; + } + + /* Install the handler */ + + AcpiGbl_ExceptionHandler = Handler; + +Cleanup: + (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiInstallExceptionHandler) + + +#if (!ACPI_REDUCED_HARDWARE) +/******************************************************************************* + * + * FUNCTION: AcpiInstallGlobalEventHandler + * + * PARAMETERS: Handler - Pointer to the global event handler function + * Context - Value passed to the handler on each event + * + * RETURN: Status + * + * DESCRIPTION: Saves the pointer to the handler function. The global handler + * is invoked upon each incoming GPE and Fixed Event. It is + * invoked at interrupt level at the time of the event dispatch. + * Can be used to update event counters, etc. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiInstallGlobalEventHandler ( + ACPI_GBL_EVENT_HANDLER Handler, + void *Context) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiInstallGlobalEventHandler); + + + /* Parameter validation */ + + if (!Handler) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Don't allow two handlers. */ + + if (AcpiGbl_GlobalEventHandler) + { + Status = AE_ALREADY_EXISTS; + goto Cleanup; + } + + AcpiGbl_GlobalEventHandler = Handler; + AcpiGbl_GlobalEventHandlerContext = Context; + + +Cleanup: + (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiInstallGlobalEventHandler) + + +/******************************************************************************* + * + * FUNCTION: AcpiInstallFixedEventHandler + * + * PARAMETERS: Event - Event type to enable. + * Handler - Pointer to the handler function for the + * event + * Context - Value passed to the handler on each GPE + * + * RETURN: Status + * + * DESCRIPTION: Saves the pointer to the handler function and then enables the + * event. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiInstallFixedEventHandler ( + UINT32 Event, + ACPI_EVENT_HANDLER Handler, + void *Context) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiInstallFixedEventHandler); + + + /* Parameter validation */ + + if (Event > ACPI_EVENT_MAX) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Don't allow two handlers. */ + + if (NULL != AcpiGbl_FixedEventHandlers[Event].Handler) + { + Status = AE_ALREADY_EXISTS; + goto Cleanup; + } + + /* Install the handler before enabling the event */ + + AcpiGbl_FixedEventHandlers[Event].Handler = Handler; + AcpiGbl_FixedEventHandlers[Event].Context = Context; + + Status = AcpiEnableEvent (Event, 0); + if (ACPI_FAILURE (Status)) + { + ACPI_WARNING ((AE_INFO, "Could not enable fixed event 0x%X", Event)); + + /* Remove the handler */ + + AcpiGbl_FixedEventHandlers[Event].Handler = NULL; + AcpiGbl_FixedEventHandlers[Event].Context = NULL; + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Enabled fixed event %X, Handler=%p\n", Event, Handler)); + } + + +Cleanup: + (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiInstallFixedEventHandler) + + +/******************************************************************************* + * + * FUNCTION: AcpiRemoveFixedEventHandler + * + * PARAMETERS: Event - Event type to disable. + * Handler - Address of the handler + * + * RETURN: Status + * + * DESCRIPTION: Disables the event and unregisters the event handler. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiRemoveFixedEventHandler ( + UINT32 Event, + ACPI_EVENT_HANDLER Handler) +{ + ACPI_STATUS Status = AE_OK; + + + ACPI_FUNCTION_TRACE (AcpiRemoveFixedEventHandler); + + + /* Parameter validation */ + + if (Event > ACPI_EVENT_MAX) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Disable the event before removing the handler */ + + Status = AcpiDisableEvent (Event, 0); + + /* Always Remove the handler */ + + AcpiGbl_FixedEventHandlers[Event].Handler = NULL; + AcpiGbl_FixedEventHandlers[Event].Context = NULL; + + if (ACPI_FAILURE (Status)) + { + ACPI_WARNING ((AE_INFO, + "Could not write to fixed event enable register 0x%X", Event)); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X\n", Event)); + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiRemoveFixedEventHandler) + + +/******************************************************************************* + * * FUNCTION: AcpiInstallGpeHandler * * PARAMETERS: GpeDevice - Namespace node for the GPE (NULL for FADT @@ -1047,3 +1048,4 @@ AcpiReleaseGlobalLock ( ACPI_EXPORT_SYMBOL (AcpiReleaseGlobalLock) +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/events/evxfevnt.c b/source/components/events/evxfevnt.c index 9aebf046a..9e5bf6246 100644 --- a/source/components/events/evxfevnt.c +++ b/source/components/events/evxfevnt.c @@ -124,6 +124,7 @@ ACPI_MODULE_NAME ("evxfevnt") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: AcpiEnable @@ -449,4 +450,4 @@ AcpiGetEventStatus ( ACPI_EXPORT_SYMBOL (AcpiGetEventStatus) - +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c index 3b5fdfed7..7018513ba 100644 --- a/source/components/events/evxfgpe.c +++ b/source/components/events/evxfgpe.c @@ -125,6 +125,7 @@ ACPI_MODULE_NAME ("evxfgpe") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: AcpiUpdateAllGpes @@ -970,3 +971,5 @@ AcpiGetGpeDevice ( } ACPI_EXPORT_SYMBOL (AcpiGetGpeDevice) + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/hardware/hwacpi.c b/source/components/hardware/hwacpi.c index b6615debd..b95385a2b 100644 --- a/source/components/hardware/hwacpi.c +++ b/source/components/hardware/hwacpi.c @@ -124,6 +124,7 @@ ACPI_MODULE_NAME ("hwacpi") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /****************************************************************************** * * FUNCTION: AcpiHwSetMode @@ -276,3 +277,5 @@ AcpiHwGetMode ( return_UINT32 (ACPI_SYS_MODE_LEGACY); } } + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/hardware/hwgpe.c b/source/components/hardware/hwgpe.c index 44e966547..0483f62cd 100644 --- a/source/components/hardware/hwgpe.c +++ b/source/components/hardware/hwgpe.c @@ -121,6 +121,8 @@ #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME ("hwgpe") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static ACPI_STATUS @@ -610,3 +612,4 @@ AcpiHwEnableAllWakeupGpes ( return_ACPI_STATUS (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/hardware/hwregs.c b/source/components/hardware/hwregs.c index 018298d25..328b95d46 100644 --- a/source/components/hardware/hwregs.c +++ b/source/components/hardware/hwregs.c @@ -125,6 +125,8 @@ ACPI_MODULE_NAME ("hwregs") +#if (!ACPI_REDUCED_HARDWARE) + /* Local Prototypes */ static ACPI_STATUS @@ -139,6 +141,7 @@ AcpiHwWriteMultiple ( ACPI_GENERIC_ADDRESS *RegisterA, ACPI_GENERIC_ADDRESS *RegisterB); +#endif /* !ACPI_REDUCED_HARDWARE */ /****************************************************************************** * @@ -343,6 +346,7 @@ AcpiHwWrite ( } +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiHwClearAcpiStatus @@ -393,7 +397,7 @@ UnlockAndExit: /******************************************************************************* * - * FUNCTION: AcpiHwGetRegisterBitMask + * FUNCTION: AcpiHwGetBitRegisterInfo * * PARAMETERS: RegisterId - Index of ACPI Register to access * @@ -803,3 +807,4 @@ AcpiHwWriteMultiple ( return (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/hardware/hwsleep.c b/source/components/hardware/hwsleep.c index 3e197215c..fb3c9608f 100644 --- a/source/components/hardware/hwsleep.c +++ b/source/components/hardware/hwsleep.c @@ -257,6 +257,7 @@ AcpiHwExecuteWakeMethods ( } +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiHwLegacySleep @@ -545,6 +546,8 @@ AcpiHwLegacyWake ( return_ACPI_STATUS (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ + /******************************************************************************* * diff --git a/source/components/hardware/hwtimer.c b/source/components/hardware/hwtimer.c index 6b6e8ec2b..5f0e3df7a 100644 --- a/source/components/hardware/hwtimer.c +++ b/source/components/hardware/hwtimer.c @@ -121,6 +121,7 @@ ACPI_MODULE_NAME ("hwtimer") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /****************************************************************************** * * FUNCTION: AcpiGetTimerResolution @@ -286,3 +287,4 @@ AcpiGetTimerDuration ( ACPI_EXPORT_SYMBOL (AcpiGetTimerDuration) +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/source/components/hardware/hwxface.c b/source/components/hardware/hwxface.c index a90667a86..24d9bd10a 100644 --- a/source/components/hardware/hwxface.c +++ b/source/components/hardware/hwxface.c @@ -395,6 +395,7 @@ AcpiWrite ( ACPI_EXPORT_SYMBOL (AcpiWrite) +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiReadBitRegister @@ -577,6 +578,8 @@ UnlockAndExit: ACPI_EXPORT_SYMBOL (AcpiWriteBitRegister) +#endif /* !ACPI_REDUCED_HARDWARE */ + /******************************************************************************* * diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c index b04d273b9..6e4111b99 100644 --- a/source/components/hardware/hwxfsleep.c +++ b/source/components/hardware/hwxfsleep.c @@ -120,6 +120,8 @@ ACPI_MODULE_NAME ("hwxfsleep") +#if (!ACPI_REDUCED_HARDWARE) + /******************************************************************************* * * FUNCTION: AcpiSetFirmwareWakingVector @@ -272,6 +274,8 @@ AcpiEnterSleepStateS4bios ( ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios) +#endif /* !ACPI_REDUCED_HARDWARE */ + /******************************************************************************* * @@ -388,6 +392,8 @@ AcpiEnterSleepState ( return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } +#if (!ACPI_REDUCED_HARDWARE) + /* If Hardware Reduced flag is set, must use the extended sleep registers */ if (AcpiGbl_ReducedHardware || @@ -402,6 +408,11 @@ AcpiEnterSleepState ( Status = AcpiHwLegacySleep (SleepState); } +#else + Status = AcpiHwExtendedSleep (SleepState); + +#endif /* !ACPI_REDUCED_HARDWARE */ + return_ACPI_STATUS (Status); } @@ -431,6 +442,8 @@ AcpiLeaveSleepState ( ACPI_FUNCTION_TRACE (AcpiLeaveSleepState); +#if (!ACPI_REDUCED_HARDWARE) + /* If Hardware Reduced flag is set, must use the extended sleep registers */ if (AcpiGbl_ReducedHardware || @@ -445,6 +458,11 @@ AcpiLeaveSleepState ( Status = AcpiHwLegacyWake (SleepState); } +#else + Status = AcpiHwExtendedWake (SleepState); + +#endif /* !ACPI_REDUCED_HARDWARE */ + return_ACPI_STATUS (Status); } diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c index 788d2fdda..50738908e 100644 --- a/source/components/tables/tbutils.c +++ b/source/components/tables/tbutils.c @@ -140,6 +140,7 @@ AcpiTbGetRootTableEntry ( UINT32 TableEntrySize); +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiTbInitializeFacs @@ -172,6 +173,7 @@ AcpiTbInitializeFacs ( ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_FACS)); return (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* diff --git a/source/components/utilities/utglobal.c b/source/components/utilities/utglobal.c index abfe416a7..8ebbaec7e 100644 --- a/source/components/utilities/utglobal.c +++ b/source/components/utilities/utglobal.c @@ -227,6 +227,7 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = }; +#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * Event and Hardware globals @@ -271,6 +272,7 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, }; +#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* @@ -341,6 +343,8 @@ AcpiUtInitGlobals ( AcpiFixedEventCount[i] = 0; } +#if (!ACPI_REDUCED_HARDWARE) + /* GPE support */ AcpiGbl_AllGpesInitialized = FALSE; @@ -349,6 +353,10 @@ AcpiUtInitGlobals ( AcpiGbl_GpeFadtBlocks[1] = NULL; AcpiCurrentGpeCount = 0; + AcpiGbl_GlobalEventHandler = NULL; + +#endif /* !ACPI_REDUCED_HARDWARE */ + /* Global handlers */ AcpiGbl_SystemNotify.Handler = NULL; @@ -357,7 +365,6 @@ AcpiUtInitGlobals ( AcpiGbl_InitHandler = NULL; AcpiGbl_TableHandler = NULL; AcpiGbl_InterfaceHandler = NULL; - AcpiGbl_GlobalEventHandler = NULL; /* Global Lock support */ diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c index 7b0234494..9b5275589 100644 --- a/source/components/utilities/utinit.c +++ b/source/components/utilities/utinit.c @@ -130,21 +130,33 @@ static void AcpiUtTerminate ( void); +#if (!ACPI_REDUCED_HARDWARE) +static void +AcpiUtFreeGpeLists ( + void); + +#else + +#define AcpiUtFreeGpeLists() +#endif /* !ACPI_REDUCED_HARDWARE */ + + +#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * - * FUNCTION: AcpiUtTerminate + * FUNCTION: AcpiUtFreeGpeLists * * PARAMETERS: none * * RETURN: none * - * DESCRIPTION: Free global memory + * DESCRIPTION: Free global GPE lists * ******************************************************************************/ static void -AcpiUtTerminate ( +AcpiUtFreeGpeLists ( void) { ACPI_GPE_BLOCK_INFO *GpeBlock; @@ -153,9 +165,6 @@ AcpiUtTerminate ( ACPI_GPE_XRUPT_INFO *NextGpeXruptInfo; - ACPI_FUNCTION_TRACE (UtTerminate); - - /* Free global GPE blocks and related info structures */ GpeXruptInfo = AcpiGbl_GpeXruptListHead; @@ -175,7 +184,29 @@ AcpiUtTerminate ( ACPI_FREE (GpeXruptInfo); GpeXruptInfo = NextGpeXruptInfo; } +} +#endif /* !ACPI_REDUCED_HARDWARE */ + + +/****************************************************************************** + * + * FUNCTION: AcpiUtTerminate + * + * PARAMETERS: none + * + * RETURN: none + * + * DESCRIPTION: Free global memory + * + ******************************************************************************/ + +static void +AcpiUtTerminate ( + void) +{ + ACPI_FUNCTION_TRACE (UtTerminate); + AcpiUtFreeGpeLists (); AcpiUtDeleteAddressLists (); return_VOID; } diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c index a59467910..fa859739c 100644 --- a/source/components/utilities/utxface.c +++ b/source/components/utilities/utxface.c @@ -235,6 +235,8 @@ AcpiEnableSubsystem ( ACPI_FUNCTION_TRACE (AcpiEnableSubsystem); +#if (!ACPI_REDUCED_HARDWARE) + /* Enable ACPI mode */ if (!(Flags & ACPI_NO_ACPI_ENABLE)) @@ -262,6 +264,8 @@ AcpiEnableSubsystem ( return_ACPI_STATUS (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ + /* * Install the default OpRegion handlers. These are installed unless * other handlers have already been installed via the @@ -279,6 +283,7 @@ AcpiEnableSubsystem ( } } +#if (!ACPI_REDUCED_HARDWARE) /* * Initialize ACPI Event handling (Fixed and General Purpose) * @@ -321,6 +326,8 @@ AcpiEnableSubsystem ( } } +#endif /* !ACPI_REDUCED_HARDWARE */ + return_ACPI_STATUS (Status); } diff --git a/source/include/acconfig.h b/source/include/acconfig.h index 68ae0ebf8..4640e8d0c 100644 --- a/source/include/acconfig.h +++ b/source/include/acconfig.h @@ -158,6 +158,23 @@ */ #define ACPI_CHECKSUM_ABORT FALSE +/* + * Generate a version of ACPICA that only supports "reduced hardware" + * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized + * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware" + * model. In other words, no ACPI hardware is supported. + * + * If TRUE, this means no support for the following: + * PM Event and Control registers + * SCI interrupt (and handler) + * Fixed Events + * General Purpose Events (GPEs) + * Global Lock + * ACPI PM timer + * FACS table (Waking vectors and Global Lock) + */ +#define ACPI_REDUCED_HARDWARE TRUE + /****************************************************************************** * diff --git a/source/include/acdebug.h b/source/include/acdebug.h index bb50b8b09..d12a9655e 100644 --- a/source/include/acdebug.h +++ b/source/include/acdebug.h @@ -197,9 +197,10 @@ AcpiDbDisplayInterfaces ( char *ActionArg, char *InterfaceNameArg); -ACPI_STATUS -AcpiDbSleep ( - char *ObjectArg); +ACPI_HW_DEPENDENT_RETURN_OK (\ +ACPI_STATUS \ +AcpiDbSleep ( \ + char *ObjectArg)) void AcpiDbDisplayLocks ( @@ -209,18 +210,20 @@ void AcpiDbDisplayResources ( char *ObjectArg); -void -AcpiDbDisplayGpes ( - void); +ACPI_HW_DEPENDENT_RETURN_VOID (\ +void \ +AcpiDbDisplayGpes ( \ + void)) void AcpiDbDisplayHandlers ( void); -void -AcpiDbGenerateGpe ( - char *GpeArg, - char *BlockArg); +ACPI_HW_DEPENDENT_RETURN_VOID (\ +void \ +AcpiDbGenerateGpe ( \ + char *GpeArg, \ + char *BlockArg)) /* diff --git a/source/include/acevents.h b/source/include/acevents.h index 8487f063d..1d1a6cc99 100644 --- a/source/include/acevents.h +++ b/source/include/acevents.h @@ -157,13 +157,15 @@ ACPI_STATUS AcpiEvInitGlobalLockHandler ( void); -ACPI_STATUS -AcpiEvAcquireGlobalLock( - UINT16 Timeout); +ACPI_HW_DEPENDENT_RETURN_OK (\ +ACPI_STATUS \ +AcpiEvAcquireGlobalLock( \ + UINT16 Timeout)) -ACPI_STATUS -AcpiEvReleaseGlobalLock( - void); +ACPI_HW_DEPENDENT_RETURN_OK (\ +ACPI_STATUS \ +AcpiEvReleaseGlobalLock( \ + void)) ACPI_STATUS AcpiEvRemoveGlobalLockHandler ( @@ -226,9 +228,10 @@ AcpiEvInitializeGpeBlock ( ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context); -ACPI_STATUS -AcpiEvDeleteGpeBlock ( - ACPI_GPE_BLOCK_INFO *GpeBlock); +ACPI_HW_DEPENDENT_RETURN_OK ( \ +ACPI_STATUS \ +AcpiEvDeleteGpeBlock ( \ + ACPI_GPE_BLOCK_INFO *GpeBlock)) UINT32 AcpiEvGpeDispatch ( @@ -243,9 +246,10 @@ ACPI_STATUS AcpiEvGpeInitialize ( void); -void -AcpiEvUpdateGpes ( - ACPI_OWNER_ID TableOwnerId); +ACPI_HW_DEPENDENT_RETURN_VOID (\ +void \ +AcpiEvUpdateGpes (\ + ACPI_OWNER_ID TableOwnerId)) ACPI_STATUS AcpiEvMatchGpeMethod ( @@ -407,9 +411,9 @@ UINT32 AcpiEvInitializeSCI ( UINT32 ProgramSCI); -void -AcpiEvTerminate ( - void); - +ACPI_HW_DEPENDENT_RETURN_VOID ( \ +void \ +AcpiEvTerminate ( \ + void)) #endif /* __ACEVENTS_H__ */ diff --git a/source/include/acexcep.h b/source/include/acexcep.h index 4524b3073..712995430 100644 --- a/source/include/acexcep.h +++ b/source/include/acexcep.h @@ -164,8 +164,9 @@ #define AE_SAME_HANDLER (ACPI_STATUS) (0x0019 | AE_CODE_ENVIRONMENTAL) #define AE_NO_HANDLER (ACPI_STATUS) (0x001A | AE_CODE_ENVIRONMENTAL) #define AE_OWNER_ID_LIMIT (ACPI_STATUS) (0x001B | AE_CODE_ENVIRONMENTAL) +#define AE_NOT_CONFIGURED (ACPI_STATUS) (0x001C | AE_CODE_ENVIRONMENTAL) -#define AE_CODE_ENV_MAX 0x001B +#define AE_CODE_ENV_MAX 0x001C /* @@ -294,7 +295,8 @@ char const *AcpiGbl_ExceptionNames_Env[] = "AE_ABORT_METHOD", "AE_SAME_HANDLER", "AE_NO_HANDLER", - "AE_OWNER_ID_LIMIT" + "AE_OWNER_ID_LIMIT", + "AE_NOT_CONFIGURED" }; char const *AcpiGbl_ExceptionNames_Pgm[] = diff --git a/source/include/acglobal.h b/source/include/acglobal.h index 8a67fb0a2..b27ee3a45 100644 --- a/source/include/acglobal.h +++ b/source/include/acglobal.h @@ -222,8 +222,7 @@ BOOLEAN AcpiGbl_SystemAwakeAndRunning; */ BOOLEAN AcpiGbl_ReducedHardware; - -#endif +#endif /* DEFINE_ACPI_GLOBALS */ /* Do not disassemble buffers to resource descriptors */ @@ -240,8 +239,12 @@ ACPI_EXTERN UINT8 ACPI_INIT_GLOBAL (AcpiGbl_NoResourceDisassembly, FALSE); * found in the RSDT/XSDT. */ ACPI_EXTERN ACPI_TABLE_LIST AcpiGbl_RootTableList; + +#if (!ACPI_REDUCED_HARDWARE) ACPI_EXTERN ACPI_TABLE_FACS *AcpiGbl_FACS; +#endif /* !ACPI_REDUCED_HARDWARE */ + /* These addresses are calculated from the FADT Event Block addresses */ ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aStatus; @@ -453,6 +456,8 @@ ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB; * ****************************************************************************/ +#if (!ACPI_REDUCED_HARDWARE) + ACPI_EXTERN UINT8 AcpiGbl_AllGpesInitialized; ACPI_EXTERN ACPI_GPE_XRUPT_INFO *AcpiGbl_GpeXruptListHead; ACPI_EXTERN ACPI_GPE_BLOCK_INFO *AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]; @@ -461,6 +466,7 @@ ACPI_EXTERN void *AcpiGbl_GlobalEventHandlerContext; ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]; extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]; +#endif /* !ACPI_REDUCED_HARDWARE */ /***************************************************************************** * diff --git a/source/include/acmacros.h b/source/include/acmacros.h index d6d8be598..9a541fc4b 100644 --- a/source/include/acmacros.h +++ b/source/include/acmacros.h @@ -500,7 +500,6 @@ #endif /* ACPI_SIMPLE_RETURN_MACROS */ - /* Conditional execution */ #define ACPI_DEBUG_EXEC(a) a diff --git a/source/include/acpixf.h b/source/include/acpixf.h index cf8950bbb..98420f04f 100644 --- a/source/include/acpixf.h +++ b/source/include/acpixf.h @@ -122,6 +122,7 @@ #define ACPI_CA_VERSION 0x20120111 +#include "acconfig.h" #include "actypes.h" #include "actbl.h" @@ -153,6 +154,34 @@ extern UINT8 AcpiGbl_DisableAutoRepair; /* + * Hardware-reduced prototypes. All interfaces that use these macros will + * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag + * is set to TRUE. + */ +#if (!ACPI_REDUCED_HARDWARE) +#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \ + Prototype; + +#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \ + Prototype; + +#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \ + Prototype; + +#else +#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \ + static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);} + +#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \ + static ACPI_INLINE Prototype {return(AE_OK);} + +#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \ + static ACPI_INLINE Prototype {} + +#endif /* !ACPI_REDUCED_HARDWARE */ + + +/* * Initialization */ ACPI_STATUS @@ -181,13 +210,15 @@ AcpiTerminate ( /* * Miscellaneous global interfaces */ -ACPI_STATUS -AcpiEnable ( - void); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiEnable ( \ + void)) -ACPI_STATUS -AcpiDisable ( - void); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiDisable ( \ + void)) ACPI_STATUS AcpiSubsystemStatus ( @@ -393,35 +424,40 @@ AcpiInstallInitializationHandler ( ACPI_INIT_HANDLER Handler, UINT32 Function); -ACPI_STATUS +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ AcpiInstallGlobalEventHandler ( - ACPI_GBL_EVENT_HANDLER Handler, - void *Context); - -ACPI_STATUS -AcpiInstallFixedEventHandler ( - UINT32 AcpiEvent, - ACPI_EVENT_HANDLER Handler, - void *Context); - -ACPI_STATUS -AcpiRemoveFixedEventHandler ( - UINT32 AcpiEvent, - ACPI_EVENT_HANDLER Handler); - -ACPI_STATUS -AcpiInstallGpeHandler ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber, - UINT32 Type, - ACPI_GPE_HANDLER Address, - void *Context); - -ACPI_STATUS + ACPI_GBL_EVENT_HANDLER Handler, \ + void *Context)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiInstallFixedEventHandler ( \ + UINT32 AcpiEvent, \ + ACPI_EVENT_HANDLER Handler, \ + void *Context)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiRemoveFixedEventHandler ( \ + UINT32 AcpiEvent, \ + ACPI_EVENT_HANDLER Handler)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiInstallGpeHandler ( \ + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber, \ + UINT32 Type, \ + ACPI_GPE_HANDLER Address, \ + void *Context)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ AcpiRemoveGpeHandler ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber, - ACPI_GPE_HANDLER Address); + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber, \ + ACPI_GPE_HANDLER Address)) ACPI_STATUS AcpiInstallNotifyHandler ( @@ -462,14 +498,16 @@ AcpiInstallInterfaceHandler ( /* * Global Lock interfaces */ -ACPI_STATUS -AcpiAcquireGlobalLock ( - UINT16 Timeout, - UINT32 *Handle); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiAcquireGlobalLock ( \ + UINT16 Timeout, \ + UINT32 *Handle)) -ACPI_STATUS -AcpiReleaseGlobalLock ( - UINT32 Handle); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiReleaseGlobalLock ( \ + UINT32 Handle)) /* @@ -490,100 +528,118 @@ AcpiReleaseMutex ( /* * Fixed Event interfaces */ -ACPI_STATUS -AcpiEnableEvent ( - UINT32 Event, - UINT32 Flags); - -ACPI_STATUS -AcpiDisableEvent ( - UINT32 Event, - UINT32 Flags); - -ACPI_STATUS -AcpiClearEvent ( - UINT32 Event); - -ACPI_STATUS -AcpiGetEventStatus ( - UINT32 Event, - ACPI_EVENT_STATUS *EventStatus); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiEnableEvent ( \ + UINT32 Event, \ + UINT32 Flags)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiDisableEvent ( \ + UINT32 Event, \ + UINT32 Flags)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiClearEvent ( \ + UINT32 Event)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiGetEventStatus ( \ + UINT32 Event, \ + ACPI_EVENT_STATUS *EventStatus)) /* * General Purpose Event (GPE) Interfaces */ -ACPI_STATUS -AcpiUpdateAllGpes ( - void); - -ACPI_STATUS -AcpiEnableGpe ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); - -ACPI_STATUS -AcpiDisableGpe ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); - -ACPI_STATUS -AcpiClearGpe ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); - -ACPI_STATUS -AcpiSetGpe ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber, - UINT8 Action); - -ACPI_STATUS -AcpiFinishGpe ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); - -ACPI_STATUS -AcpiSetupGpeForWake ( - ACPI_HANDLE ParentDevice, - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); - -ACPI_STATUS -AcpiSetGpeWakeMask ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber, - UINT8 Action); - -ACPI_STATUS -AcpiGetGpeStatus ( - ACPI_HANDLE GpeDevice, - UINT32 GpeNumber, - ACPI_EVENT_STATUS *EventStatus); - -ACPI_STATUS -AcpiDisableAllGpes ( - void); - -ACPI_STATUS +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiUpdateAllGpes ( \ + void)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiEnableGpe ( \ + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiDisableGpe ( \ + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiClearGpe ( \ + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiSetGpe ( \ + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber, \ + UINT8 Action)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiFinishGpe ( \ + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiSetupGpeForWake ( \ + ACPI_HANDLE ParentDevice, \ + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiSetGpeWakeMask ( \ + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber, \ + UINT8 Action)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiGetGpeStatus ( \ + ACPI_HANDLE GpeDevice, \ + UINT32 GpeNumber, \ + ACPI_EVENT_STATUS *EventStatus)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiDisableAllGpes ( \ + void)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ AcpiEnableAllRuntimeGpes ( - void); + void)) -ACPI_STATUS -AcpiGetGpeDevice ( - UINT32 GpeIndex, - ACPI_HANDLE *GpeDevice); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiGetGpeDevice ( \ + UINT32 GpeIndex, \ + ACPI_HANDLE *GpeDevice)) -ACPI_STATUS -AcpiInstallGpeBlock ( - ACPI_HANDLE GpeDevice, - ACPI_GENERIC_ADDRESS *GpeBlockAddress, - UINT32 RegisterCount, - UINT32 InterruptNumber); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiInstallGpeBlock ( \ + ACPI_HANDLE GpeDevice, \ + ACPI_GENERIC_ADDRESS *GpeBlockAddress, \ + UINT32 RegisterCount, \ + UINT32 InterruptNumber)) -ACPI_STATUS -AcpiRemoveGpeBlock ( - ACPI_HANDLE GpeDevice); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiRemoveGpeBlock ( \ + ACPI_HANDLE GpeDevice)) /* @@ -662,16 +718,22 @@ AcpiWrite ( UINT64 Value, ACPI_GENERIC_ADDRESS *Reg); -ACPI_STATUS -AcpiReadBitRegister ( - UINT32 RegisterId, - UINT32 *ReturnValue); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiReadBitRegister ( \ + UINT32 RegisterId, \ + UINT32 *ReturnValue)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiWriteBitRegister ( \ + UINT32 RegisterId, \ + UINT32 Value)) -ACPI_STATUS -AcpiWriteBitRegister ( - UINT32 RegisterId, - UINT32 Value); +/* + * Sleep/Wake interfaces + */ ACPI_STATUS AcpiGetSleepTypeData ( UINT8 SleepState, @@ -686,41 +748,47 @@ ACPI_STATUS AcpiEnterSleepState ( UINT8 SleepState); -ACPI_STATUS -AcpiEnterSleepStateS4bios ( - void); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiEnterSleepStateS4bios ( \ + void)) ACPI_STATUS AcpiLeaveSleepState ( - UINT8 SleepState) - ; -ACPI_STATUS -AcpiSetFirmwareWakingVector ( - UINT32 PhysicalAddress); + UINT8 SleepState); + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiSetFirmwareWakingVector ( \ + UINT32 PhysicalAddress)) #if ACPI_MACHINE_WIDTH == 64 -ACPI_STATUS -AcpiSetFirmwareWakingVector64 ( - UINT64 PhysicalAddress); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiSetFirmwareWakingVector64 ( \ + UINT64 PhysicalAddress)) #endif /* * ACPI Timer interfaces */ -ACPI_STATUS -AcpiGetTimerResolution ( - UINT32 *Resolution); - -ACPI_STATUS -AcpiGetTimer ( - UINT32 *Ticks); - -ACPI_STATUS -AcpiGetTimerDuration ( - UINT32 StartTicks, - UINT32 EndTicks, - UINT32 *TimeElapsed); +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiGetTimerResolution ( \ + UINT32 *Resolution)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiGetTimer ( \ + UINT32 *Ticks)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( \ +ACPI_STATUS \ +AcpiGetTimerDuration ( \ + UINT32 StartTicks, \ + UINT32 EndTicks, \ + UINT32 *TimeElapsed)) /* diff --git a/source/tools/acpiexec/aeexec.c b/source/tools/acpiexec/aeexec.c index c5c4b3d33..3b21c0965 100644 --- a/source/tools/acpiexec/aeexec.c +++ b/source/tools/acpiexec/aeexec.c @@ -125,10 +125,6 @@ AeSetupConfiguration ( void *RegionAddr); static void -AfInstallGpeBlock ( - void); - -static void AeTestBufferArgument ( void); @@ -160,6 +156,12 @@ static void AeGenericRegisters ( void); +#if (!ACPI_REDUCED_HARDWARE) +static void +AfInstallGpeBlock ( + void); +#endif /* !ACPI_REDUCED_HARDWARE */ + extern unsigned char Ssdt3Code[]; @@ -198,6 +200,7 @@ AeSetupConfiguration ( } +#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * FUNCTION: AfInstallGpeBlock @@ -269,6 +272,7 @@ AfInstallGpeBlock ( AE_CHECK_OK (AcpiInstallGpeBlock, Status); } } +#endif /* !ACPI_REDUCED_HARDWARE */ /* Test using a Buffer object as a method argument */ @@ -537,6 +541,8 @@ static void AeHardwareInterfaces ( void) { +#if (!ACPI_REDUCED_HARDWARE) + ACPI_STATUS Status; UINT32 Value; @@ -572,6 +578,8 @@ AeHardwareInterfaces ( Status = AcpiReadBitRegister (ACPI_BITREG_ARB_DISABLE, &Value); AE_CHECK_OK (AcpiReadBitRegister, Status); + +#endif /* !ACPI_REDUCED_HARDWARE */ } @@ -587,14 +595,17 @@ void AeMiscellaneousTests ( void) { - ACPI_HANDLE Handle; ACPI_BUFFER ReturnBuf; char Buffer[32]; - ACPI_VENDOR_UUID Uuid = {0, {ACPI_INIT_UUID (0,0,0,0,0,0,0,0,0,0,0)}}; ACPI_STATUS Status; + ACPI_STATISTICS Stats; + +#if (!ACPI_REDUCED_HARDWARE) + ACPI_HANDLE Handle; + ACPI_VENDOR_UUID Uuid = {0, {ACPI_INIT_UUID (0,0,0,0,0,0,0,0,0,0,0)}}; UINT32 LockHandle1; UINT32 LockHandle2; - ACPI_STATISTICS Stats; +#endif /* !ACPI_REDUCED_HARDWARE */ AeHardwareInterfaces (); @@ -640,9 +651,6 @@ AeMiscellaneousTests ( Status = AcpiGetName (AcpiGbl_RootNode, ACPI_FULL_PATHNAME, &ReturnBuf); AE_CHECK_OK (AcpiGetName, Status); - Status = AcpiInstallGlobalEventHandler (AeGlobalEventHandler, NULL); - AE_CHECK_OK (AcpiInstallGlobalEventHandler, Status); - /* Get Devices */ Status = AcpiGetDevices (NULL, AeGetDevices, NULL, NULL); @@ -651,6 +659,12 @@ AeMiscellaneousTests ( Status = AcpiGetStatistics (&Stats); AE_CHECK_OK (AcpiGetStatistics, Status); + +#if (!ACPI_REDUCED_HARDWARE) + + Status = AcpiInstallGlobalEventHandler (AeGlobalEventHandler, NULL); + AE_CHECK_OK (AcpiInstallGlobalEventHandler, Status); + /* If Hardware Reduced flag is set, we are all done */ if (AcpiGbl_ReducedHardware) @@ -773,5 +787,6 @@ AeMiscellaneousTests ( Status = AcpiReleaseGlobalLock (LockHandle2); AE_CHECK_OK (AcpiReleaseGlobalLock, Status); +#endif /* !ACPI_REDUCED_HARDWARE */ } diff --git a/source/tools/acpiexec/aehandlers.c b/source/tools/acpiexec/aehandlers.c index 7d91688ea..e9b84455b 100644 --- a/source/tools/acpiexec/aehandlers.c +++ b/source/tools/acpiexec/aehandlers.c @@ -163,10 +163,19 @@ AeInterfaceHandler ( ACPI_STRING InterfaceName, UINT32 Supported); +#if (!ACPI_REDUCED_HARDWARE) static UINT32 AeEventHandler ( void *Context); +static char *TableEvents[] = +{ + "LOAD", + "UNLOAD", + "UNKNOWN" +}; +#endif /* !ACPI_REDUCED_HARDWARE */ + static UINT32 SigintCount = 0; static AE_DEBUG_REGIONS AeRegions; BOOLEAN AcpiGbl_DisplayRegionAccess = FALSE; @@ -458,20 +467,15 @@ AeExceptionHandler ( * *****************************************************************************/ -static char *TableEvents[] = -{ - "LOAD", - "UNLOAD", - "UNKNOWN" -}; - static ACPI_STATUS AeTableHandler ( UINT32 Event, void *Table, void *Context) { +#if (!ACPI_REDUCED_HARDWARE) ACPI_STATUS Status; +#endif /* !ACPI_REDUCED_HARDWARE */ if (Event > ACPI_NUM_TABLE_EVENTS) @@ -479,6 +483,7 @@ AeTableHandler ( Event = ACPI_NUM_TABLE_EVENTS; } +#if (!ACPI_REDUCED_HARDWARE) /* Enable any GPEs associated with newly-loaded GPE methods */ Status = AcpiUpdateAllGpes (); @@ -486,6 +491,8 @@ AeTableHandler ( printf ("[AcpiExec] Table Event %s, [%4.4s] %p\n", TableEvents[Event], ((ACPI_TABLE_HEADER *) Table)->Signature, Table); +#endif /* !ACPI_REDUCED_HARDWARE */ + return (AE_OK); } @@ -598,6 +605,7 @@ AeInterfaceHandler ( } +#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * FUNCTION: AeEventHandler @@ -612,6 +620,7 @@ AeEventHandler ( { return (0); } +#endif /* !ACPI_REDUCED_HARDWARE */ /****************************************************************************** @@ -662,6 +671,7 @@ AeInstallLateHandlers ( UINT32 i; +#if (!ACPI_REDUCED_HARDWARE) if (!AcpiGbl_ReducedHardware) { /* Install some fixed event handlers */ @@ -672,6 +682,7 @@ AeInstallLateHandlers ( Status = AcpiInstallFixedEventHandler (ACPI_EVENT_RTC, AeEventHandler, NULL); AE_CHECK_OK (AcpiInstallFixedEventHandler, Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ AeMyContext.Connection = NULL; AeMyContext.AccessLength = 0xA5; diff --git a/source/tools/acpinames/anstubs.c b/source/tools/acpinames/anstubs.c index 3e7142d41..8d2767686 100644 --- a/source/tools/acpinames/anstubs.c +++ b/source/tools/acpinames/anstubs.c @@ -256,16 +256,17 @@ AcpiEvInitializeOpRegions ( } ACPI_STATUS -AcpiEvDeleteGpeBlock ( - ACPI_GPE_BLOCK_INFO *GpeBlock) +AcpiEvInitializeRegion ( + ACPI_OPERAND_OBJECT *RegionObj, + BOOLEAN AcpiNsLocked) { return (AE_OK); } +#if (!ACPI_REDUCED_HARDWARE) ACPI_STATUS -AcpiEvInitializeRegion ( - ACPI_OPERAND_OBJECT *RegionObj, - BOOLEAN AcpiNsLocked) +AcpiEvDeleteGpeBlock ( + ACPI_GPE_BLOCK_INFO *GpeBlock) { return (AE_OK); } @@ -276,6 +277,7 @@ AcpiEnable ( { return (AE_OK); } +#endif /* !ACPI_REDUCED_HARDWARE */ /* AML Interpreter */ |