📄 utxface.c
字号:
* Note: Any objects accessed by the _REG methods will be automatically * initialized, even if they contain executable AML (see the call to * AcpiNsInitializeObjects below). */ if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Executing _REG OpRegion methods\n")); Status = AcpiEvInitializeOpRegions (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } /* * Initialize the objects that remain uninitialized. This runs the * executable AML that may be part of the declaration of these objects: * OperationRegions, BufferFields, Buffers, and Packages. */ if (!(Flags & ACPI_NO_OBJECT_INIT)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Completing Initialization of ACPI Objects\n")); Status = AcpiNsInitializeObjects (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } /* * Initialize all device objects in the namespace. This runs the device * _STA and _INI methods. */ if (!(Flags & ACPI_NO_DEVICE_INIT)) { ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Initializing ACPI Devices\n")); Status = AcpiNsInitializeDevices (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } } /* * Empty the caches (delete the cached objects) on the assumption that * the table load filled them up more than they will be at runtime -- * thus wasting non-paged memory. */ Status = AcpiPurgeCachedObjects (); AcpiGbl_StartupFlags |= ACPI_INITIALIZED_OK; return_ACPI_STATUS (Status);}ACPI_EXPORT_SYMBOL (AcpiInitializeObjects)#endif/******************************************************************************* * * FUNCTION: AcpiTerminate * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Shutdown the ACPI subsystem. Release all resources. * ******************************************************************************/ACPI_STATUSAcpiTerminate ( void){ ACPI_STATUS Status; ACPI_FUNCTION_TRACE (AcpiTerminate); /* Terminate the AML Debugger if present */ ACPI_DEBUGGER_EXEC(AcpiGbl_DbTerminateThreads = TRUE); /* Shutdown and free all resources */ AcpiUtSubsystemShutdown (); /* Free the mutex objects */ AcpiUtMutexTerminate ();#ifdef ACPI_DEBUGGER /* Shut down the debugger */ AcpiDbTerminate ();#endif /* Now we can shutdown the OS-dependent layer */ Status = AcpiOsTerminate (); return_ACPI_STATUS (Status);}ACPI_EXPORT_SYMBOL (AcpiTerminate)#ifndef ACPI_ASL_COMPILER/******************************************************************************* * * FUNCTION: AcpiSubsystemStatus * * PARAMETERS: None * * RETURN: Status of the ACPI subsystem * * DESCRIPTION: Other drivers that use the ACPI subsystem should call this * before making any other calls, to ensure the subsystem * initialized successfully. * ******************************************************************************/ACPI_STATUSAcpiSubsystemStatus ( void){ if (AcpiGbl_StartupFlags & ACPI_INITIALIZED_OK) { return (AE_OK); } else { return (AE_ERROR); }}ACPI_EXPORT_SYMBOL (AcpiSubsystemStatus)/******************************************************************************* * * FUNCTION: AcpiGetSystemInfo * * PARAMETERS: OutBuffer - A buffer to receive the resources for the * device * * RETURN: Status - the status of the call * * DESCRIPTION: This function is called to get information about the current * state of the ACPI subsystem. It will return system information * in the OutBuffer. * * If the function fails an appropriate status will be returned * and the value of OutBuffer is undefined. * ******************************************************************************/ACPI_STATUSAcpiGetSystemInfo ( ACPI_BUFFER *OutBuffer){ ACPI_SYSTEM_INFO *InfoPtr; ACPI_STATUS Status; ACPI_FUNCTION_TRACE (AcpiGetSystemInfo); /* Parameter validation */ Status = AcpiUtValidateBuffer (OutBuffer); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* Validate/Allocate/Clear caller buffer */ Status = AcpiUtInitializeBuffer (OutBuffer, sizeof (ACPI_SYSTEM_INFO)); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } /* * Populate the return buffer */ InfoPtr = (ACPI_SYSTEM_INFO *) OutBuffer->Pointer; InfoPtr->AcpiCaVersion = ACPI_CA_VERSION; /* System flags (ACPI capabilities) */ InfoPtr->Flags = ACPI_SYS_MODE_ACPI; /* Timer resolution - 24 or 32 bits */ if (AcpiGbl_FADT.Flags & ACPI_FADT_32BIT_TIMER) { InfoPtr->TimerResolution = 24; } else { InfoPtr->TimerResolution = 32; } /* Clear the reserved fields */ InfoPtr->Reserved1 = 0; InfoPtr->Reserved2 = 0; /* Current debug levels */ InfoPtr->DebugLayer = AcpiDbgLayer; InfoPtr->DebugLevel = AcpiDbgLevel; return_ACPI_STATUS (AE_OK);}ACPI_EXPORT_SYMBOL (AcpiGetSystemInfo)/******************************************************************************* * * FUNCTION: AcpiGetStatistics * * PARAMETERS: Stats - Where the statistics are returned * * RETURN: Status - the status of the call * * DESCRIPTION: Get the contents of the various system counters * ******************************************************************************/ACPI_STATUSAcpiGetStatistics ( ACPI_STATISTICS *Stats){ ACPI_FUNCTION_TRACE (AcpiGetStatistics); /* Parameter validation */ if (!Stats) { return_ACPI_STATUS (AE_BAD_PARAMETER); } /* Various interrupt-based event counters */ Stats->SciCount = AcpiSciCount; Stats->GpeCount = AcpiGpeCount; ACPI_MEMCPY (Stats->FixedEventCount, AcpiFixedEventCount, sizeof (AcpiFixedEventCount)); /* Other counters */ Stats->MethodCount = AcpiMethodCount; return_ACPI_STATUS (AE_OK);}ACPI_EXPORT_SYMBOL (AcpiGetStatistics)/***************************************************************************** * * FUNCTION: AcpiInstallInitializationHandler * * PARAMETERS: Handler - Callback procedure * Function - Not (currently) used, see below * * RETURN: Status * * DESCRIPTION: Install an initialization handler * * TBD: When a second function is added, must save the Function also. * ****************************************************************************/ACPI_STATUSAcpiInstallInitializationHandler ( ACPI_INIT_HANDLER Handler, UINT32 Function){ if (!Handler) { return (AE_BAD_PARAMETER); } if (AcpiGbl_InitHandler) { return (AE_ALREADY_EXISTS); } AcpiGbl_InitHandler = Handler; return AE_OK;}ACPI_EXPORT_SYMBOL (AcpiInstallInitializationHandler)/***************************************************************************** * * FUNCTION: AcpiPurgeCachedObjects * * PARAMETERS: None * * RETURN: Status * * DESCRIPTION: Empty all caches (delete the cached objects) * ****************************************************************************/ACPI_STATUSAcpiPurgeCachedObjects ( void){ ACPI_FUNCTION_TRACE (AcpiPurgeCachedObjects); (void) AcpiOsPurgeCache (AcpiGbl_StateCache); (void) AcpiOsPurgeCache (AcpiGbl_OperandCache); (void) AcpiOsPurgeCache (AcpiGbl_PsNodeCache); (void) AcpiOsPurgeCache (AcpiGbl_PsNodeExtCache); return_ACPI_STATUS (AE_OK);}ACPI_EXPORT_SYMBOL (AcpiPurgeCachedObjects)#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -