ReactOS 0.4.15-dev-7924-g5949c20
acutils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  acpi_pkg_info
 

Macros

#define ACPI_MSG_REDIRECT_BEGIN
 
#define ACPI_MSG_REDIRECT_END
 
#define ACPI_MSG_ERROR   "ACPI Error: "
 
#define ACPI_MSG_WARNING   "ACPI Warning: "
 
#define ACPI_MSG_INFO   "ACPI: "
 
#define ACPI_MSG_BIOS_ERROR   "Firmware Error (ACPI): "
 
#define ACPI_MSG_BIOS_WARNING   "Firmware Warning (ACPI): "
 
#define ACPI_MSG_SUFFIX    AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)
 
#define ACPI_IMPLICIT_CONVERSION   TRUE
 
#define ACPI_NO_IMPLICIT_CONVERSION   FALSE
 
#define ACPI_INVALID_RESOURCE   0
 
#define ACPI_FIXED_LENGTH   1
 
#define ACPI_VARIABLE_LENGTH   2
 
#define ACPI_SMALL_VARIABLE_LENGTH   3
 
#define REF_INCREMENT   (UINT16) 0
 
#define REF_DECREMENT   (UINT16) 1
 
#define DB_BYTE_DISPLAY   0x01
 
#define DB_WORD_DISPLAY   0x02
 
#define DB_DWORD_DISPLAY   0x04
 
#define DB_QWORD_DISPLAY   0x08
 
#define DB_DISPLAY_DATA_ONLY   0x10
 
#define AcpiUtCreateInternalObject(t)   AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)
 
#define AcpiUtAllocateObjectDesc()   AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)
 
#define ACPI_ANY_BASE   0
 

Typedefs

typedef ACPI_STATUS(* ACPI_WALK_AML_CALLBACK) (UINT8 *Aml, UINT32 Length, UINT32 Offset, UINT8 ResourceIndex, void **Context)
 
typedef ACPI_STATUS(* ACPI_PKG_CALLBACK) (UINT8 ObjectType, ACPI_OPERAND_OBJECT *SourceObject, ACPI_GENERIC_STATE *State, void *Context)
 
typedef struct acpi_pkg_info ACPI_PKG_INFO
 

Functions

BOOLEAN AcpiUtValidNameseg (char *Signature)
 
BOOLEAN AcpiUtValidNameChar (char Character, UINT32 Position)
 
void AcpiUtCheckAndRepairAscii (UINT8 *Name, char *RepairedName, UINT32 Count)
 
UINT8 AcpiUtGenerateChecksum (void *Table, UINT32 Length, UINT8 OriginalChecksum)
 
UINT8 AcpiUtChecksum (UINT8 *Buffer, UINT32 Length)
 
ACPI_STATUS AcpiUtVerifyCdatChecksum (ACPI_TABLE_CDAT *CdatTable, UINT32 Length)
 
ACPI_STATUS AcpiUtVerifyChecksum (ACPI_TABLE_HEADER *Table, UINT32 Length)
 
void AcpiUtStrupr (char *SrcString)
 
void AcpiUtStrlwr (char *SrcString)
 
int AcpiUtStricmp (char *String1, char *String2)
 
ACPI_STATUS AcpiUtConvertOctalString (char *String, UINT64 *ReturnValue)
 
ACPI_STATUS AcpiUtConvertDecimalString (char *String, UINT64 *ReturnValuePtr)
 
ACPI_STATUS AcpiUtConvertHexString (char *String, UINT64 *ReturnValuePtr)
 
char AcpiUtRemoveWhitespace (char **String)
 
char AcpiUtRemoveLeadingZeros (char **String)
 
BOOLEAN AcpiUtDetectHexPrefix (char **String)
 
void AcpiUtRemoveHexPrefix (char **String)
 
BOOLEAN AcpiUtDetectOctalPrefix (char **String)
 
ACPI_STATUS AcpiUtStrtoul64 (char *String, UINT64 *RetInteger)
 
UINT64 AcpiUtExplicitStrtoul64 (char *String)
 
UINT64 AcpiUtImplicitStrtoul64 (char *String)
 
ACPI_STATUS AcpiUtInitGlobals (void)
 
const charAcpiUtGetMutexName (UINT32 MutexId)
 
const charAcpiUtGetTypeName (ACPI_OBJECT_TYPE Type)
 
const charAcpiUtGetNodeName (void *Object)
 
const charAcpiUtGetDescriptorName (void *Object)
 
const charAcpiUtGetReferenceName (ACPI_OPERAND_OBJECT *Object)
 
const charAcpiUtGetObjectTypeName (ACPI_OPERAND_OBJECT *ObjDesc)
 
const charAcpiUtGetRegionName (UINT8 SpaceId)
 
const charAcpiUtGetEventName (UINT32 EventId)
 
const charAcpiUtGetArgumentTypeName (UINT32 ArgType)
 
char AcpiUtHexToAsciiChar (UINT64 Integer, UINT32 Position)
 
ACPI_STATUS AcpiUtAsciiToHexByte (char *TwoAsciiChars, UINT8 *ReturnByte)
 
UINT8 AcpiUtAsciiCharToHex (int HexChar)
 
BOOLEAN AcpiUtValidObjectType (ACPI_OBJECT_TYPE Type)
 
ACPI_STATUS AcpiUtHardwareInitialize (void)
 
void AcpiUtSubsystemShutdown (void)
 
ACPI_STATUS AcpiUtBuildSimpleObject (ACPI_OPERAND_OBJECT *Obj, ACPI_OBJECT *UserObj, UINT8 *DataSpace, UINT32 *BufferSpaceUsed)
 
ACPI_STATUS AcpiUtBuildPackageObject (ACPI_OPERAND_OBJECT *Obj, UINT8 *Buffer, UINT32 *SpaceUsed)
 
ACPI_STATUS AcpiUtCopyIobjectToEobject (ACPI_OPERAND_OBJECT *Obj, ACPI_BUFFER *RetBuffer)
 
ACPI_STATUS AcpiUtCopyEobjectToIobject (ACPI_OBJECT *Obj, ACPI_OPERAND_OBJECT **InternalObj)
 
ACPI_STATUS AcpiUtCopyISimpleToIsimple (ACPI_OPERAND_OBJECT *SourceObj, ACPI_OPERAND_OBJECT *DestObj)
 
ACPI_STATUS AcpiUtCopyIobjectToIobject (ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT **DestDesc, ACPI_WALK_STATE *WalkState)
 
ACPI_STATUS AcpiUtUpdateObjectReference (ACPI_OPERAND_OBJECT *Object, UINT16 Action)
 
void AcpiUtInitStackPtrTrace (void)
 
void AcpiUtTrackStackPtr (void)
 
void AcpiUtTrace (UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId)
 
void AcpiUtTracePtr (UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const void *Pointer)
 
void AcpiUtTraceU32 (UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, UINT32 Integer)
 
void AcpiUtTraceStr (UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const char *String)
 
void AcpiUtExit (UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId)
 
void AcpiUtStatusExit (UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, ACPI_STATUS Status)
 
void AcpiUtValueExit (UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, UINT64 Value)
 
void AcpiUtPtrExit (UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, UINT8 *Ptr)
 
void AcpiUtStrExit (UINT32 LineNumber, const char *FunctionName, const char *ModuleName, UINT32 ComponentId, const char *String)
 
void AcpiUtDebugDumpBuffer (UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 ComponentId)
 
void AcpiUtDumpBuffer (UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 Offset)
 
void AcpiUtReportError (char *ModuleName, UINT32 LineNumber)
 
void AcpiUtReportInfo (char *ModuleName, UINT32 LineNumber)
 
void AcpiUtReportWarning (char *ModuleName, UINT32 LineNumber)
 
void AcpiUtAddReference (ACPI_OPERAND_OBJECT *Object)
 
void AcpiUtRemoveReference (ACPI_OPERAND_OBJECT *Object)
 
void AcpiUtDeleteInternalPackageObject (ACPI_OPERAND_OBJECT *Object)
 
void AcpiUtDeleteInternalSimpleObject (ACPI_OPERAND_OBJECT *Object)
 
void AcpiUtDeleteInternalObjectList (ACPI_OPERAND_OBJECT **ObjList)
 
ACPI_STATUS AcpiUtEvaluateObject (ACPI_NAMESPACE_NODE *PrefixNode, const char *Path, UINT32 ExpectedReturnBtypes, ACPI_OPERAND_OBJECT **ReturnDesc)
 
ACPI_STATUS AcpiUtEvaluateNumericObject (const char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, UINT64 *Value)
 
ACPI_STATUS AcpiUtExecute_STA (ACPI_NAMESPACE_NODE *DeviceNode, UINT32 *StatusFlags)
 
ACPI_STATUS AcpiUtExecutePowerMethods (ACPI_NAMESPACE_NODE *DeviceNode, const char **MethodNames, UINT8 MethodCount, UINT8 *OutValues)
 
ACPI_STATUS AcpiUtExecute_HID (ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId)
 
ACPI_STATUS AcpiUtExecute_UID (ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId)
 
ACPI_STATUS AcpiUtExecute_CID (ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID_LIST **ReturnCidList)
 
ACPI_STATUS AcpiUtExecute_CLS (ACPI_NAMESPACE_NODE *DeviceNode, ACPI_PNP_DEVICE_ID **ReturnId)
 
ACPI_STATUS AcpiUtCreateRwLock (ACPI_RW_LOCK *Lock)
 
void AcpiUtDeleteRwLock (ACPI_RW_LOCK *Lock)
 
ACPI_STATUS AcpiUtAcquireReadLock (ACPI_RW_LOCK *Lock)
 
ACPI_STATUS AcpiUtReleaseReadLock (ACPI_RW_LOCK *Lock)
 
ACPI_STATUS AcpiUtAcquireWriteLock (ACPI_RW_LOCK *Lock)
 
void AcpiUtReleaseWriteLock (ACPI_RW_LOCK *Lock)
 
ACPI_OPERAND_OBJECTAcpiUtCreateInternalObjectDbg (const char *ModuleName, UINT32 LineNumber, UINT32 ComponentId, ACPI_OBJECT_TYPE Type)
 
voidAcpiUtAllocateObjectDescDbg (const char *ModuleName, UINT32 LineNumber, UINT32 ComponentId)
 
void AcpiUtDeleteObjectDesc (ACPI_OPERAND_OBJECT *Object)
 
BOOLEAN AcpiUtValidInternalObject (void *Object)
 
ACPI_OPERAND_OBJECTAcpiUtCreatePackageObject (UINT32 Count)
 
ACPI_OPERAND_OBJECTAcpiUtCreateIntegerObject (UINT64 Value)
 
ACPI_OPERAND_OBJECTAcpiUtCreateBufferObject (ACPI_SIZE BufferSize)
 
ACPI_OPERAND_OBJECTAcpiUtCreateStringObject (ACPI_SIZE StringSize)
 
ACPI_STATUS AcpiUtGetObjectSize (ACPI_OPERAND_OBJECT *Obj, ACPI_SIZE *ObjLength)
 
ACPI_STATUS AcpiUtInitializeInterfaces (void)
 
ACPI_STATUS AcpiUtInterfaceTerminate (void)
 
ACPI_STATUS AcpiUtInstallInterface (ACPI_STRING InterfaceName)
 
ACPI_STATUS AcpiUtRemoveInterface (ACPI_STRING InterfaceName)
 
ACPI_STATUS AcpiUtUpdateInterfaces (UINT8 Action)
 
ACPI_INTERFACE_INFOAcpiUtGetInterface (ACPI_STRING InterfaceName)
 
ACPI_STATUS AcpiUtOsiImplementation (ACPI_WALK_STATE *WalkState)
 
const ACPI_PREDEFINED_INFOAcpiUtGetNextPredefinedMethod (const ACPI_PREDEFINED_INFO *ThisName)
 
const ACPI_PREDEFINED_INFOAcpiUtMatchPredefinedMethod (char *Name)
 
void AcpiUtGetExpectedReturnTypes (char *Buffer, UINT32 ExpectedBtypes)
 
void AcpiUtPushGenericState (ACPI_GENERIC_STATE **ListHead, ACPI_GENERIC_STATE *State)
 
ACPI_GENERIC_STATEAcpiUtPopGenericState (ACPI_GENERIC_STATE **ListHead)
 
ACPI_GENERIC_STATEAcpiUtCreateGenericState (void)
 
ACPI_THREAD_STATEAcpiUtCreateThreadState (void)
 
ACPI_GENERIC_STATEAcpiUtCreateUpdateState (ACPI_OPERAND_OBJECT *Object, UINT16 Action)
 
ACPI_GENERIC_STATEAcpiUtCreatePkgState (void *InternalObject, void *ExternalObject, UINT32 Index)
 
ACPI_STATUS AcpiUtCreateUpdateStateAndPush (ACPI_OPERAND_OBJECT *Object, UINT16 Action, ACPI_GENERIC_STATE **StateList)
 
ACPI_GENERIC_STATEAcpiUtCreateControlState (void)
 
void AcpiUtDeleteGenericState (ACPI_GENERIC_STATE *State)
 
ACPI_STATUS AcpiUtDivide (UINT64 InDividend, UINT64 InDivisor, UINT64 *OutQuotient, UINT64 *OutRemainder)
 
ACPI_STATUS AcpiUtShortDivide (UINT64 InDividend, UINT32 Divisor, UINT64 *OutQuotient, UINT32 *OutRemainder)
 
ACPI_STATUS AcpiUtShortMultiply (UINT64 InMultiplicand, UINT32 Multiplier, UINT64 *Outproduct)
 
ACPI_STATUS AcpiUtShortShiftLeft (UINT64 Operand, UINT32 Count, UINT64 *OutResult)
 
ACPI_STATUS AcpiUtShortShiftRight (UINT64 Operand, UINT32 Count, UINT64 *OutResult)
 
const ACPI_EXCEPTION_INFOAcpiUtValidateException (ACPI_STATUS Status)
 
BOOLEAN AcpiUtIsPciRootBridge (char *Id)
 
ACPI_STATUS AcpiUtWalkPackageTree (ACPI_OPERAND_OBJECT *SourceObject, void *TargetObject, ACPI_PKG_CALLBACK WalkCallback, void *Context)
 
UINT32 AcpiUtDwordByteSwap (UINT32 Value)
 
void AcpiUtSetIntegerWidth (UINT8 Revision)
 
ACPI_STATUS AcpiUtAllocateOwnerId (ACPI_OWNER_ID *OwnerId)
 
void AcpiUtReleaseOwnerId (ACPI_OWNER_ID *OwnerId)
 
ACPI_STATUS AcpiUtWalkAmlResources (ACPI_WALK_STATE *WalkState, UINT8 *Aml, ACPI_SIZE AmlLength, ACPI_WALK_AML_CALLBACK UserFunction, void **Context)
 
ACPI_STATUS AcpiUtValidateResource (ACPI_WALK_STATE *WalkState, void *Aml, UINT8 *ReturnIndex)
 
UINT32 AcpiUtGetDescriptorLength (void *Aml)
 
UINT16 AcpiUtGetResourceLength (void *Aml)
 
UINT8 AcpiUtGetResourceHeaderLength (void *Aml)
 
UINT8 AcpiUtGetResourceType (void *Aml)
 
ACPI_STATUS AcpiUtGetResourceEndTag (ACPI_OPERAND_OBJECT *ObjDesc, UINT8 **EndTag)
 
void AcpiUtPrintString (char *String, UINT16 MaxLength)
 
void AcpiUtRepairName (char *Name)
 
ACPI_STATUS AcpiUtMutexInitialize (void)
 
void AcpiUtMutexTerminate (void)
 
ACPI_STATUS AcpiUtAcquireMutex (ACPI_MUTEX_HANDLE MutexId)
 
ACPI_STATUS AcpiUtReleaseMutex (ACPI_MUTEX_HANDLE MutexId)
 
ACPI_STATUS AcpiUtCreateCaches (void)
 
ACPI_STATUS AcpiUtDeleteCaches (void)
 
ACPI_STATUS AcpiUtValidateBuffer (ACPI_BUFFER *Buffer)
 
ACPI_STATUS AcpiUtInitializeBuffer (ACPI_BUFFER *Buffer, ACPI_SIZE RequiredLength)
 
ACPI_STATUS AcpiUtAddAddressRange (ACPI_ADR_SPACE_TYPE SpaceId, ACPI_PHYSICAL_ADDRESS Address, UINT32 Length, ACPI_NAMESPACE_NODE *RegionNode)
 
void AcpiUtRemoveAddressRange (ACPI_ADR_SPACE_TYPE SpaceId, ACPI_NAMESPACE_NODE *RegionNode)
 
UINT32 AcpiUtCheckAddressRange (ACPI_ADR_SPACE_TYPE SpaceId, ACPI_PHYSICAL_ADDRESS Address, UINT32 Length, BOOLEAN Warn)
 
void AcpiUtDeleteAddressLists (void)
 
void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedWarning (const char *ModuleName, UINT32 LineNumber, char *Pathname, UINT16 NodeFlags, const char *Format,...)
 
void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedInfo (const char *ModuleName, UINT32 LineNumber, char *Pathname, UINT16 NodeFlags, const char *Format,...)
 
void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedBiosError (const char *ModuleName, UINT32 LineNumber, char *Pathname, UINT16 NodeFlags, const char *Format,...)
 
void AcpiUtPrefixedNamespaceError (const char *ModuleName, UINT32 LineNumber, ACPI_GENERIC_STATE *PrefixScope, const char *InternalName, ACPI_STATUS LookupStatus)
 
void AcpiUtMethodError (const char *ModuleName, UINT32 LineNumber, const char *Message, ACPI_NAMESPACE_NODE *Node, const char *Path, ACPI_STATUS LookupStatus)
 
const AH_PREDEFINED_NAMEAcpiAhMatchPredefinedName (char *Nameseg)
 
const AH_DEVICE_IDAcpiAhMatchHardwareId (char *Hid)
 
const charAcpiAhMatchUuid (UINT8 *Data)
 

Variables

const UINT8 AcpiGbl_ResourceAmlSizes []
 
const UINT8 AcpiGbl_ResourceAmlSerialBusSizes []
 

Macro Definition Documentation

◆ ACPI_ANY_BASE

#define ACPI_ANY_BASE   0

Definition at line 889 of file acutils.h.

◆ ACPI_FIXED_LENGTH

#define ACPI_FIXED_LENGTH   1

Definition at line 151 of file acutils.h.

◆ ACPI_IMPLICIT_CONVERSION

#define ACPI_IMPLICIT_CONVERSION   TRUE

Definition at line 145 of file acutils.h.

◆ ACPI_INVALID_RESOURCE

#define ACPI_INVALID_RESOURCE   0

Definition at line 150 of file acutils.h.

◆ ACPI_MSG_BIOS_ERROR

#define ACPI_MSG_BIOS_ERROR   "Firmware Error (ACPI): "

Definition at line 131 of file acutils.h.

◆ ACPI_MSG_BIOS_WARNING

#define ACPI_MSG_BIOS_WARNING   "Firmware Warning (ACPI): "

Definition at line 134 of file acutils.h.

◆ ACPI_MSG_ERROR

#define ACPI_MSG_ERROR   "ACPI Error: "

Definition at line 121 of file acutils.h.

◆ ACPI_MSG_INFO

#define ACPI_MSG_INFO   "ACPI: "

Definition at line 127 of file acutils.h.

◆ ACPI_MSG_REDIRECT_BEGIN

#define ACPI_MSG_REDIRECT_BEGIN

Definition at line 113 of file acutils.h.

◆ ACPI_MSG_REDIRECT_END

#define ACPI_MSG_REDIRECT_END

Definition at line 114 of file acutils.h.

◆ ACPI_MSG_SUFFIX

#define ACPI_MSG_SUFFIX    AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)

Definition at line 140 of file acutils.h.

◆ ACPI_MSG_WARNING

#define ACPI_MSG_WARNING   "ACPI Warning: "

Definition at line 124 of file acutils.h.

◆ ACPI_NO_IMPLICIT_CONVERSION

#define ACPI_NO_IMPLICIT_CONVERSION   FALSE

Definition at line 146 of file acutils.h.

◆ ACPI_SMALL_VARIABLE_LENGTH

#define ACPI_SMALL_VARIABLE_LENGTH   3

Definition at line 153 of file acutils.h.

◆ ACPI_VARIABLE_LENGTH

#define ACPI_VARIABLE_LENGTH   2

Definition at line 152 of file acutils.h.

◆ AcpiUtAllocateObjectDesc

#define AcpiUtAllocateObjectDesc ( )    AcpiUtAllocateObjectDescDbg (_AcpiModuleName,__LINE__,_COMPONENT)

Definition at line 682 of file acutils.h.

◆ AcpiUtCreateInternalObject

#define AcpiUtCreateInternalObject (   t)    AcpiUtCreateInternalObjectDbg (_AcpiModuleName,__LINE__,_COMPONENT,t)

Definition at line 681 of file acutils.h.

◆ DB_BYTE_DISPLAY

#define DB_BYTE_DISPLAY   0x01

Definition at line 186 of file acutils.h.

◆ DB_DISPLAY_DATA_ONLY

#define DB_DISPLAY_DATA_ONLY   0x10

Definition at line 190 of file acutils.h.

◆ DB_DWORD_DISPLAY

#define DB_DWORD_DISPLAY   0x04

Definition at line 188 of file acutils.h.

◆ DB_QWORD_DISPLAY

#define DB_QWORD_DISPLAY   0x08

Definition at line 189 of file acutils.h.

◆ DB_WORD_DISPLAY

#define DB_WORD_DISPLAY   0x02

Definition at line 187 of file acutils.h.

◆ REF_DECREMENT

#define REF_DECREMENT   (UINT16) 1

Definition at line 182 of file acutils.h.

◆ REF_INCREMENT

#define REF_INCREMENT   (UINT16) 0

Definition at line 181 of file acutils.h.

Typedef Documentation

◆ ACPI_PKG_CALLBACK

typedef ACPI_STATUS(* ACPI_PKG_CALLBACK) (UINT8 ObjectType, ACPI_OPERAND_OBJECT *SourceObject, ACPI_GENERIC_STATE *State, void *Context)

Definition at line 164 of file acutils.h.

◆ ACPI_PKG_INFO

◆ ACPI_WALK_AML_CALLBACK

typedef ACPI_STATUS(* ACPI_WALK_AML_CALLBACK) (UINT8 *Aml, UINT32 Length, UINT32 Offset, UINT8 ResourceIndex, void **Context)

Definition at line 156 of file acutils.h.

Function Documentation

◆ AcpiAhMatchHardwareId()

const AH_DEVICE_ID * AcpiAhMatchHardwareId ( char Hid)

◆ AcpiAhMatchPredefinedName()

const AH_PREDEFINED_NAME * AcpiAhMatchPredefinedName ( char Nameseg)

◆ AcpiAhMatchUuid()

const char * AcpiAhMatchUuid ( UINT8 Data)

◆ AcpiUtAcquireMutex()

ACPI_STATUS AcpiUtAcquireMutex ( ACPI_MUTEX_HANDLE  MutexId)

Definition at line 256 of file utmutex.c.

258{
260 ACPI_THREAD_ID ThisThreadId;
261
262
263 ACPI_FUNCTION_NAME (UtAcquireMutex);
264
265
266 if (MutexId > ACPI_MAX_MUTEX)
267 {
268 return (AE_BAD_PARAMETER);
269 }
270
271 ThisThreadId = AcpiOsGetThreadId ();
272
273#ifdef ACPI_MUTEX_DEBUG
274 {
275 UINT32 i;
276 /*
277 * Mutex debug code, for internal debugging only.
278 *
279 * Deadlock prevention. Check if this thread owns any mutexes of value
280 * greater than or equal to this one. If so, the thread has violated
281 * the mutex ordering rule. This indicates a coding error somewhere in
282 * the ACPI subsystem code.
283 */
284 for (i = MutexId; i < ACPI_NUM_MUTEX; i++)
285 {
286 if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId)
287 {
288 if (i == MutexId)
289 {
291 "Mutex [%s] already acquired by this thread [%u]",
292 AcpiUtGetMutexName (MutexId),
293 (UINT32) ThisThreadId));
294
295 return (AE_ALREADY_ACQUIRED);
296 }
297
299 "Invalid acquire order: Thread %u owns [%s], wants [%s]",
300 (UINT32) ThisThreadId, AcpiUtGetMutexName (i),
301 AcpiUtGetMutexName (MutexId)));
302
303 return (AE_ACQUIRE_DEADLOCK);
304 }
305 }
306 }
307#endif
308
310 "Thread %u attempting to acquire Mutex [%s]\n",
311 (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
312
314 AcpiGbl_MutexInfo[MutexId].Mutex, ACPI_WAIT_FOREVER);
315 if (ACPI_SUCCESS (Status))
316 {
318 "Thread %u acquired Mutex [%s]\n",
319 (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
320
321 AcpiGbl_MutexInfo[MutexId].UseCount++;
322 AcpiGbl_MutexInfo[MutexId].ThreadId = ThisThreadId;
323 }
324 else
325 {
327 "Thread %u could not acquire Mutex [%s] (0x%X)",
328 (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId), MutexId));
329 }
330
331 return (Status);
332}
unsigned int UINT32
#define AE_ALREADY_ACQUIRED
Definition: acexcep.h:129
#define AE_ACQUIRE_DEADLOCK
Definition: acexcep.h:126
#define AE_BAD_PARAMETER
Definition: acexcep.h:151
#define ACPI_SUCCESS(a)
Definition: acexcep.h:94
#define ACPI_MAX_MUTEX
Definition: aclocal.h:91
#define ACPI_NUM_MUTEX
Definition: aclocal.h:92
#define ACPI_DEBUG_PRINT(pl)
Definition: acoutput.h:475
#define ACPI_EXCEPTION(plist)
Definition: acoutput.h:239
#define ACPI_ERROR(plist)
Definition: acoutput.h:240
#define AE_INFO
Definition: acoutput.h:230
#define ACPI_FUNCTION_NAME(a)
Definition: acoutput.h:479
#define ACPI_DB_MUTEX
Definition: acoutput.h:182
ACPI_THREAD_ID AcpiOsGetThreadId(void)
Definition: osl.c:217
#define AcpiOsAcquireMutex(Handle, Time)
Definition: actypes.h:276
UINT32 ACPI_STATUS
Definition: actypes.h:460
#define ACPI_WAIT_FOREVER
Definition: actypes.h:501
#define ACPI_THREAD_ID
Definition: actypes.h:144
const char * AcpiUtGetMutexName(UINT32 MutexId)
Definition: utdecode.c:479
Definition: Mutex.h:16
Status
Definition: gdiplustypes.h:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by AcpiAnyGpeStatusSet(), AcpiAttachData(), AcpiCheckAddressRange(), AcpiDebugTrace(), AcpiDetachData(), AcpiDisableAllGpes(), AcpiEnableAllRuntimeGpes(), AcpiEnableAllWakeupGpes(), AcpiEvDeleteGpeBlock(), AcpiEvDetachRegion(), AcpiEvExecuteOrphanRegMethod(), AcpiEvGpeInitialize(), AcpiEvInitializeOpRegions(), AcpiEvInstallGpeBlock(), AcpiEvInstallGpeHandler(), AcpiEvInstallRegionHandlers(), AcpiEvUpdateGpes(), AcpiExEnterInterpreter(), AcpiGetData(), AcpiGetDevices(), AcpiGetName(), AcpiGetNextObject(), AcpiGetObjectInfo(), AcpiGetParent(), AcpiGetTable(), AcpiGetTableByIndex(), AcpiGetType(), AcpiInstallAddressSpaceHandler(), AcpiInstallExceptionHandler(), AcpiInstallFixedEventHandler(), AcpiInstallGlobalEventHandler(), AcpiInstallGpeBlock(), AcpiInstallMethod(), AcpiInstallNotifyHandler(), AcpiInstallSciHandler(), AcpiInstallTableHandler(), AcpiNsDeleteNamespaceByOwner(), AcpiNsDeleteNamespaceSubtree(), AcpiNsGetDeviceCallback(), AcpiNsGetNode(), AcpiNsRootInitialize(), AcpiNsTerminate(), AcpiNsWalkNamespace(), AcpiPutTable(), AcpiReallocateRootTable(), AcpiRemoveAddressSpaceHandler(), AcpiRemoveFixedEventHandler(), AcpiRemoveGpeBlock(), AcpiRemoveGpeHandler(), AcpiRemoveNotifyHandler(), AcpiRemoveSciHandler(), AcpiRemoveTableHandler(), AcpiTbAllocateOwnerId(), AcpiTbDeleteNamespaceByOwner(), AcpiTbFindTable(), AcpiTbGetOwnerId(), AcpiTbInstallStandardTable(), AcpiTbIsTableLoaded(), AcpiTbLoadNamespace(), AcpiTbReleaseOwnerId(), AcpiTbSetTableLoadedFlag(), AcpiTbTerminate(), AcpiUnloadParentTable(), AcpiUpdateAllGpes(), AcpiUtAllocateOwnerId(), AcpiUtReleaseOwnerId(), and AcpiWalkNamespace().

◆ AcpiUtAcquireReadLock()

ACPI_STATUS AcpiUtAcquireReadLock ( ACPI_RW_LOCK Lock)

Definition at line 117 of file utlock.c.

119{
121
122
124 if (ACPI_FAILURE (Status))
125 {
126 return (Status);
127 }
128
129 /* Acquire the write lock only for the first reader */
130
131 Lock->NumReaders++;
132 if (Lock->NumReaders == 1)
133 {
135 }
136
137 AcpiOsReleaseMutex (Lock->ReaderMutex);
138 return (Status);
139}
#define ACPI_FAILURE(a)
Definition: acexcep.h:95
#define AcpiOsReleaseMutex(Handle)
Definition: actypes.h:277
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127

Referenced by AcpiWalkNamespace().

◆ AcpiUtAcquireWriteLock()

ACPI_STATUS AcpiUtAcquireWriteLock ( ACPI_RW_LOCK Lock)

Definition at line 185 of file utlock.c.

187{
189
190
192 return (Status);
193}

Referenced by AcpiTbDeleteNamespaceByOwner().

◆ AcpiUtAddAddressRange()

ACPI_STATUS AcpiUtAddAddressRange ( ACPI_ADR_SPACE_TYPE  SpaceId,
ACPI_PHYSICAL_ADDRESS  Address,
UINT32  Length,
ACPI_NAMESPACE_NODE RegionNode 
)

Definition at line 78 of file utaddress.c.

83{
84 ACPI_ADDRESS_RANGE *RangeInfo;
85
86
87 ACPI_FUNCTION_TRACE (UtAddAddressRange);
88
89
92 {
94 }
95
96 /* Allocate/init a new info block, add it to the appropriate list */
97
98 RangeInfo = ACPI_ALLOCATE (sizeof (ACPI_ADDRESS_RANGE));
99 if (!RangeInfo)
100 {
102 }
103
104 RangeInfo->StartAddress = Address;
105 RangeInfo->EndAddress = (Address + Length - 1);
106 RangeInfo->RegionNode = RegionNode;
107
108 RangeInfo->Next = AcpiGbl_AddressRangeList[SpaceId];
109 AcpiGbl_AddressRangeList[SpaceId] = RangeInfo;
110
112 "\nAdded [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
113 AcpiUtGetNodeName (RangeInfo->RegionNode),
115 ACPI_FORMAT_UINT64 (RangeInfo->EndAddress)));
116
118}
#define AE_NO_MEMORY
Definition: acexcep.h:112
#define AE_OK
Definition: acexcep.h:97
#define ACPI_FORMAT_UINT64(i)
Definition: acmacros.h:71
#define return_ACPI_STATUS(s)
Definition: acoutput.h:496
#define ACPI_FUNCTION_TRACE(a)
Definition: acoutput.h:480
#define ACPI_DB_NAMES
Definition: acoutput.h:166
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE SpaceId
Definition: acpixf.h:832
#define ACPI_ADR_SPACE_SYSTEM_IO
Definition: actypes.h:862
#define ACPI_ADR_SPACE_SYSTEM_MEMORY
Definition: actypes.h:861
#define ACPI_ALLOCATE(a)
Definition: actypes.h:384
const char * AcpiUtGetNodeName(void *Object)
Definition: utdecode.c:306
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
static WCHAR Address[46]
Definition: ping.c:68
ACPI_PHYSICAL_ADDRESS EndAddress
Definition: aclocal.h:852
struct acpi_address_range * Next
Definition: aclocal.h:849
ACPI_PHYSICAL_ADDRESS StartAddress
Definition: aclocal.h:851
ACPI_NAMESPACE_NODE * RegionNode
Definition: aclocal.h:850

Referenced by AcpiDsEvalRegionOperands(), and AcpiDsGetRegionArguments().

◆ AcpiUtAddReference()

void AcpiUtAddReference ( ACPI_OPERAND_OBJECT Object)

Definition at line 752 of file utdelete.c.

754{
755
756 ACPI_FUNCTION_NAME (UtAddReference);
757
758
759 /* Ensure that we have a valid object */
760
762 {
763 return;
764 }
765
767 "Obj %p Current Refs=%X [To Be Incremented]\n",
768 Object, Object->Common.ReferenceCount));
769
770 /* Increment the reference count */
771
773 return;
774}
#define ACPI_DB_ALLOCATIONS
Definition: acoutput.h:175
BOOLEAN AcpiUtValidInternalObject(void *Object)
Definition: utobject.c:376
#define REF_INCREMENT
Definition: acutils.h:181
ACPI_STATUS AcpiUtUpdateObjectReference(ACPI_OPERAND_OBJECT *Object, UINT16 Action)
Definition: utdelete.c:548
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object

Referenced by AcpiDsBuildInternalPackageObj(), AcpiDsDoImplicitReturn(), AcpiDsExecEndOp(), AcpiDsMethodDataGetValue(), AcpiDsMethodDataSetValue(), AcpiEvAttachRegion(), AcpiExOpcode_1A_0T_1R(), AcpiExOpcode_1A_1T_1R(), AcpiExOpcode_2A_1T_1R(), AcpiExPrepFieldValue(), AcpiExResolveNodeToValue(), AcpiExResolveObjectToValue(), AcpiExStoreObjectToIndex(), AcpiInstallNotifyHandler(), AcpiNsAttachObject(), AcpiNsConvertToReference(), AcpiNsResolveReferences(), and AcpiUtCopySimpleObject().

◆ AcpiUtAllocateObjectDescDbg()

void * AcpiUtAllocateObjectDescDbg ( const char ModuleName,
UINT32  LineNumber,
UINT32  ComponentId 
)

Definition at line 429 of file utobject.c.

433{
435
436
437 ACPI_FUNCTION_TRACE (UtAllocateObjectDescDbg);
438
439
440 Object = AcpiOsAcquireObject (AcpiGbl_OperandCache);
441 if (!Object)
442 {
444 "Could not allocate an object descriptor"));
445
447 }
448
449 /* Mark the descriptor type */
450
452
453 ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
454 Object, (UINT32) sizeof (ACPI_OPERAND_OBJECT)));
455
457}
#define ACPI_SET_DESCRIPTOR_TYPE(d, t)
Definition: acmacros.h:415
#define ACPI_DESC_TYPE_OPERAND
Definition: acobject.h:576
#define return_PTR(s)
Definition: acoutput.h:497
void * AcpiOsAcquireObject(ACPI_CACHE_T *Cache)
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1220
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1280
#define NULL
Definition: types.h:112

Referenced by AcpiUtCreateInternalObjectDbg().

◆ AcpiUtAllocateOwnerId()

ACPI_STATUS AcpiUtAllocateOwnerId ( ACPI_OWNER_ID OwnerId)

Definition at line 68 of file utownerid.c.

70{
71 UINT32 i;
72 UINT32 j;
73 UINT32 k;
75
76
77 ACPI_FUNCTION_TRACE (UtAllocateOwnerId);
78
79
80 /* Guard against multiple allocations of ID to the same location */
81
82 if (*OwnerId)
83 {
85 "Owner ID [0x%3.3X] already exists", *OwnerId));
87 }
88
89 /* Mutex for the global ID mask */
90
92 if (ACPI_FAILURE (Status))
93 {
95 }
96
97 /*
98 * Find a free owner ID, cycle through all possible IDs on repeated
99 * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index
100 * may have to be scanned twice.
101 */
102 for (i = 0, j = AcpiGbl_LastOwnerIdIndex;
104 i++, j++)
105 {
107 {
108 j = 0; /* Wraparound to start of mask array */
109 }
110
111 for (k = AcpiGbl_NextOwnerIdOffset; k < 32; k++)
112 {
113 if (AcpiGbl_OwnerIdMask[j] == ACPI_UINT32_MAX)
114 {
115 /* There are no free IDs in this mask */
116
117 break;
118 }
119
120 /*
121 * Note: the UINT32 cast ensures that 1 is stored as a unsigned
122 * integer. Omitting the cast may result in 1 being stored as an
123 * int. Some compilers or runtime error detection may flag this as
124 * an error.
125 */
126 if (!(AcpiGbl_OwnerIdMask[j] & ((UINT32) 1 << k)))
127 {
128 /*
129 * Found a free ID. The actual ID is the bit index plus one,
130 * making zero an invalid Owner ID. Save this as the last ID
131 * allocated and update the global ID mask.
132 */
133 AcpiGbl_OwnerIdMask[j] |= ((UINT32) 1 << k);
134
135 AcpiGbl_LastOwnerIdIndex = (UINT8) j;
136 AcpiGbl_NextOwnerIdOffset = (UINT8) (k + 1);
137
138 /*
139 * Construct encoded ID from the index and bit position
140 *
141 * Note: Last [j].k (bit 4095) is never used and is marked
142 * permanently allocated (prevents +1 overflow)
143 */
144 *OwnerId = (ACPI_OWNER_ID) ((k + 1) + ACPI_MUL_32 (j));
145
147 "Allocated OwnerId: 0x%3.3X\n", (unsigned int) *OwnerId));
148 goto Exit;
149 }
150 }
151
152 AcpiGbl_NextOwnerIdOffset = 0;
153 }
154
155 /*
156 * All OwnerIds have been allocated. This typically should
157 * not happen since the IDs are reused after deallocation. The IDs are
158 * allocated upon table load (one per table) and method execution, and
159 * they are released when a table is unloaded or a method completes
160 * execution.
161 *
162 * If this error happens, there may be very deep nesting of invoked
163 * control methods, or there may be a bug where the IDs are not released.
164 */
167 "Could not allocate new OwnerId (4095 max), AE_OWNER_ID_LIMIT"));
168
169Exit:
172}
unsigned char UINT8
#define AE_OWNER_ID_LIMIT
Definition: acexcep.h:135
#define AE_ALREADY_EXISTS
Definition: acexcep.h:115
#define ACPI_MTX_CACHES
Definition: aclocal.h:88
#define ACPI_MUL_32(a)
Definition: acmacros.h:223
#define ACPI_DB_VALUES
Definition: acoutput.h:173
#define ACPI_UINT32_MAX
Definition: actypes.h:66
UINT16 ACPI_OWNER_ID
Definition: actypes.h:486
ACPI_STATUS AcpiUtAcquireMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:256
ACPI_STATUS AcpiUtReleaseMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:348
#define ACPI_NUM_OWNERID_MASKS
Definition: acconfig.h:136
_Must_inspect_result_ _In_opt_ PVOID OwnerId
Definition: fsrtlfuncs.h:907
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
int k
Definition: mpi.c:3369
static void Exit(void)
Definition: sock.c:1330

Referenced by AcpiDsBeginMethodExecution(), and AcpiTbAllocateOwnerId().

◆ AcpiUtAsciiCharToHex()

UINT8 AcpiUtAsciiCharToHex ( int  HexChar)

Definition at line 135 of file uthex.c.

137{
138
139 /* Values 0-9 */
140
141 if (HexChar <= '9')
142 {
143 return ((UINT8) (HexChar - '0'));
144 }
145
146 /* Upper case A-F */
147
148 if (HexChar <= 'F')
149 {
150 return ((UINT8) (HexChar - 0x37));
151 }
152
153 /* Lower case a-f */
154
155 return ((UINT8) (HexChar - 0x57));
156}

Referenced by AcpiUtAsciiToHexByte(), and AcpiUtInsertDigit().

◆ AcpiUtAsciiToHexByte()

ACPI_STATUS AcpiUtAsciiToHexByte ( char TwoAsciiChars,
UINT8 ReturnByte 
)

Definition at line 100 of file uthex.c.

103{
104
105 /* Both ASCII characters must be valid hex digits */
106
107 if (!isxdigit ((int) TwoAsciiChars[0]) ||
108 !isxdigit ((int) TwoAsciiChars[1]))
109 {
110 return (AE_BAD_HEX_CONSTANT);
111 }
112
113 *ReturnByte =
114 AcpiUtAsciiCharToHex (TwoAsciiChars[1]) |
115 (AcpiUtAsciiCharToHex (TwoAsciiChars[0]) << 4);
116
117 return (AE_OK);
118}
#define isxdigit(c)
Definition: acclib.h:70
#define AE_BAD_HEX_CONSTANT
Definition: acexcep.h:155
UINT8 AcpiUtAsciiCharToHex(int HexChar)
Definition: uthex.c:135

Referenced by AcpiEvMatchGpeMethod().

◆ AcpiUtBuildPackageObject()

ACPI_STATUS AcpiUtBuildPackageObject ( ACPI_OPERAND_OBJECT Obj,
UINT8 Buffer,
UINT32 SpaceUsed 
)

◆ AcpiUtBuildSimpleObject()

ACPI_STATUS AcpiUtBuildSimpleObject ( ACPI_OPERAND_OBJECT Obj,
ACPI_OBJECT UserObj,
UINT8 DataSpace,
UINT32 BufferSpaceUsed 
)

◆ AcpiUtCheckAddressRange()

UINT32 AcpiUtCheckAddressRange ( ACPI_ADR_SPACE_TYPE  SpaceId,
ACPI_PHYSICAL_ADDRESS  Address,
UINT32  Length,
BOOLEAN  Warn 
)

Definition at line 211 of file utaddress.c.

216{
217 ACPI_ADDRESS_RANGE *RangeInfo;
218 ACPI_PHYSICAL_ADDRESS EndAddress;
219 char *Pathname;
220 UINT32 OverlapCount = 0;
221
222
223 ACPI_FUNCTION_TRACE (UtCheckAddressRange);
224
225
228 {
229 return_UINT32 (0);
230 }
231
232 RangeInfo = AcpiGbl_AddressRangeList[SpaceId];
233 EndAddress = Address + Length - 1;
234
235 /* Check entire list for all possible conflicts */
236
237 while (RangeInfo)
238 {
239 /*
240 * Check if the requested address/length overlaps this
241 * address range. There are four cases to consider:
242 *
243 * 1) Input address/length is contained completely in the
244 * address range
245 * 2) Input address/length overlaps range at the range start
246 * 3) Input address/length overlaps range at the range end
247 * 4) Input address/length completely encompasses the range
248 */
249 if ((Address <= RangeInfo->EndAddress) &&
250 (EndAddress >= RangeInfo->StartAddress))
251 {
252 /* Found an address range overlap */
253
254 OverlapCount++;
255 if (Warn) /* Optional warning message */
256 {
258
260 "%s range 0x%8.8X%8.8X-0x%8.8X%8.8X conflicts with OpRegion 0x%8.8X%8.8X-0x%8.8X%8.8X (%s)",
263 ACPI_FORMAT_UINT64 (EndAddress),
264 ACPI_FORMAT_UINT64 (RangeInfo->StartAddress),
265 ACPI_FORMAT_UINT64 (RangeInfo->EndAddress),
266 Pathname));
268 }
269 }
270
271 RangeInfo = RangeInfo->Next;
272 }
273
274 return_UINT32 (OverlapCount);
275}
char * AcpiNsGetNormalizedPathname(ACPI_NAMESPACE_NODE *Node, BOOLEAN NoTrailing)
Definition: nsnames.c:367
#define ACPI_WARNING(plist)
Definition: acoutput.h:238
#define return_UINT32(s)
Definition: acoutput.h:501
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING Pathname
Definition: acpixf.h:704
#define ACPI_FREE(a)
Definition: actypes.h:386
const char * AcpiUtGetRegionName(UINT8 SpaceId)
Definition: utdecode.c:125
#define TRUE
Definition: types.h:120
@ Warn
Definition: video.h:589

Referenced by AcpiCheckAddressRange().

◆ AcpiUtCheckAndRepairAscii()

void AcpiUtCheckAndRepairAscii ( UINT8 Name,
char RepairedName,
UINT32  Count 
)

Definition at line 140 of file utascii.c.

144{
145 UINT32 i;
146
147
148 for (i = 0; i < Count; i++)
149 {
150 RepairedName[i] = (char) Name[i];
151
152 if (!Name[i])
153 {
154 return;
155 }
156 if (!isprint (Name[i]))
157 {
158 RepairedName[i] = ' ';
159 }
160 }
161}
#define isprint(c)
Definition: acclib.h:73
unsigned char
Definition: typeof.h:29
int Count
Definition: noreturn.cpp:7

◆ AcpiUtChecksum()

UINT8 AcpiUtChecksum ( UINT8 Buffer,
UINT32  Length 
)

Definition at line 213 of file utcksum.c.

216{
217 UINT8 Sum = 0;
218 UINT8 *End = Buffer + Length;
219
220
221 while (Buffer < End)
222 {
223 Sum = (UINT8) (Sum + *(Buffer++));
224 }
225
226 return (Sum);
227}
Definition: bufpool.h:45

Referenced by AcpiTbValidateRsdp(), and AcpiUtGenerateChecksum().

◆ AcpiUtConvertDecimalString()

ACPI_STATUS AcpiUtConvertDecimalString ( char String,
UINT64 ReturnValuePtr 
)

Definition at line 152 of file utstrsuppt.c.

155{
156 UINT64 AccumulatedValue = 0;
158
159
160 /* Convert each ASCII byte in the input string */
161
162 while (*String)
163 {
164 /*
165 * Character must be ASCII 0-9, otherwise:
166 * 1) Runtime: terminate with no error, per the ACPI spec
167 * 2) Compiler: return an error
168 */
169 if (!isdigit ((int) *String))
170 {
171#ifdef ACPI_ASL_COMPILER
173#endif
174 break;
175 }
176
177 /* Convert and insert this decimal digit into the accumulator */
178
179 Status = AcpiUtInsertDigit (&AccumulatedValue, 10, *String);
180 if (ACPI_FAILURE (Status))
181 {
183 break;
184 }
185
186 String++;
187 }
188
189 /* Always return the value that has been accumulated */
190
191 *ReturnValuePtr = AccumulatedValue;
192 return (Status);
193}
unsigned long long UINT64
#define isdigit(c)
Definition: acclib.h:68
#define AE_DECIMAL_OVERFLOW
Definition: acexcep.h:141
#define AE_BAD_DECIMAL_CONSTANT
Definition: acexcep.h:157
static ACPI_STATUS AcpiUtInsertDigit(UINT64 *AccumulatedValue, UINT32 Base, int AsciiDigit)
Definition: utstrsuppt.c:424
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433

Referenced by AcpiUtExplicitStrtoul64(), and AcpiUtStrtoul64().

◆ AcpiUtConvertHexString()

ACPI_STATUS AcpiUtConvertHexString ( char String,
UINT64 ReturnValuePtr 
)

Definition at line 214 of file utstrsuppt.c.

217{
218 UINT64 AccumulatedValue = 0;
220
221
222 /* Convert each ASCII byte in the input string */
223
224 while (*String)
225 {
226 /*
227 * Character must be ASCII A-F, a-f, or 0-9, otherwise:
228 * 1) Runtime: terminate with no error, per the ACPI spec
229 * 2) Compiler: return an error
230 */
231 if (!isxdigit ((int) *String))
232 {
233#ifdef ACPI_ASL_COMPILER
235#endif
236 break;
237 }
238
239 /* Convert and insert this hex digit into the accumulator */
240
241 Status = AcpiUtInsertDigit (&AccumulatedValue, 16, *String);
242 if (ACPI_FAILURE (Status))
243 {
245 break;
246 }
247
248 String++;
249 }
250
251 /* Always return the value that has been accumulated */
252
253 *ReturnValuePtr = AccumulatedValue;
254 return (Status);
255}
#define AE_HEX_OVERFLOW
Definition: acexcep.h:140

Referenced by AcpiUtExplicitStrtoul64(), AcpiUtImplicitStrtoul64(), and AcpiUtStrtoul64().

◆ AcpiUtConvertOctalString()

ACPI_STATUS AcpiUtConvertOctalString ( char String,
UINT64 ReturnValue 
)

Definition at line 90 of file utstrsuppt.c.

93{
94 UINT64 AccumulatedValue = 0;
96
97
98 /* Convert each ASCII byte in the input string */
99
100 while (*String)
101 {
102 /*
103 * Character must be ASCII 0-7, otherwise:
104 * 1) Runtime: terminate with no error, per the ACPI spec
105 * 2) Compiler: return an error
106 */
107 if (!(ACPI_IS_OCTAL_DIGIT (*String)))
108 {
109#ifdef ACPI_ASL_COMPILER
111#endif
112 break;
113 }
114
115 /* Convert and insert this octal digit into the accumulator */
116
117 Status = AcpiUtInsertDigit (&AccumulatedValue, 8, *String);
118 if (ACPI_FAILURE (Status))
119 {
121 break;
122 }
123
124 String++;
125 }
126
127 /* Always return the value that has been accumulated */
128
129 *ReturnValuePtr = AccumulatedValue;
130 return (Status);
131}
#define AE_BAD_OCTAL_CONSTANT
Definition: acexcep.h:156
#define AE_OCTAL_OVERFLOW
Definition: acexcep.h:142
#define ACPI_IS_OCTAL_DIGIT(d)
Definition: acmacros.h:501

Referenced by AcpiUtStrtoul64().

◆ AcpiUtCopyEobjectToIobject()

ACPI_STATUS AcpiUtCopyEobjectToIobject ( ACPI_OBJECT Obj,
ACPI_OPERAND_OBJECT **  InternalObj 
)

Definition at line 670 of file utcopy.c.

673{
675
676
677 ACPI_FUNCTION_TRACE (UtCopyEobjectToIobject);
678
679
680 if (ExternalObject->Type == ACPI_TYPE_PACKAGE)
681 {
683 ExternalObject, InternalObject);
684 }
685 else
686 {
687 /*
688 * Build a simple object (no nested objects)
689 */
690 Status = AcpiUtCopyEsimpleToIsimple (ExternalObject,
691 InternalObject);
692 }
693
695}
#define ACPI_TYPE_PACKAGE
Definition: actypes.h:691
static ACPI_STATUS AcpiUtCopyEsimpleToIsimple(ACPI_OBJECT *UserObj, ACPI_OPERAND_OBJECT **ReturnObj)
Definition: utcopy.c:471
static ACPI_STATUS AcpiUtCopyEpackageToIpackage(ACPI_OBJECT *ExternalObject, ACPI_OPERAND_OBJECT **InternalObject)
Definition: utcopy.c:603

Referenced by AcpiEvaluateObject(), and AcpiUtCopyEpackageToIpackage().

◆ AcpiUtCopyIobjectToEobject()

ACPI_STATUS AcpiUtCopyIobjectToEobject ( ACPI_OPERAND_OBJECT Obj,
ACPI_BUFFER RetBuffer 
)

Definition at line 414 of file utcopy.c.

417{
419
420
421 ACPI_FUNCTION_TRACE (UtCopyIobjectToEobject);
422
423
424 if (InternalObject->Common.Type == ACPI_TYPE_PACKAGE)
425 {
426 /*
427 * Package object: Copy all subobjects (including
428 * nested packages)
429 */
430 Status = AcpiUtCopyIpackageToEpackage (InternalObject,
431 RetBuffer->Pointer, &RetBuffer->Length);
432 }
433 else
434 {
435 /*
436 * Build a simple object (no nested objects)
437 */
438 Status = AcpiUtCopyIsimpleToEsimple (InternalObject,
439 ACPI_CAST_PTR (ACPI_OBJECT, RetBuffer->Pointer),
440 ACPI_ADD_PTR (UINT8, RetBuffer->Pointer,
442 &RetBuffer->Length);
443 /*
444 * build simple does not include the object size in the length
445 * so we add it in here
446 */
447 RetBuffer->Length += sizeof (ACPI_OBJECT);
448 }
449
451}
#define ACPI_ROUND_UP_TO_NATIVE_WORD(a)
Definition: acmacros.h:254
union acpi_object ACPI_OBJECT
#define ACPI_ADD_PTR(t, a, b)
Definition: actypes.h:546
#define ACPI_CAST_PTR(t, p)
Definition: actypes.h:544
void * Pointer
Definition: actypes.h:1054
ACPI_SIZE Length
Definition: actypes.h:1053
static ACPI_STATUS AcpiUtCopyIsimpleToEsimple(ACPI_OPERAND_OBJECT *InternalObject, ACPI_OBJECT *ExternalObject, UINT8 *DataSpace, ACPI_SIZE *BufferSpaceUsed)
Definition: utcopy.c:124
static ACPI_STATUS AcpiUtCopyIpackageToEpackage(ACPI_OPERAND_OBJECT *InternalObject, UINT8 *Buffer, ACPI_SIZE *SpaceUsed)
Definition: utcopy.c:350

Referenced by AcpiEvaluateObject().

◆ AcpiUtCopyIobjectToIobject()

ACPI_STATUS AcpiUtCopyIobjectToIobject ( ACPI_OPERAND_OBJECT SourceDesc,
ACPI_OPERAND_OBJECT **  DestDesc,
ACPI_WALK_STATE WalkState 
)

Definition at line 1037 of file utcopy.c.

1041{
1043
1044
1045 ACPI_FUNCTION_TRACE (UtCopyIobjectToIobject);
1046
1047
1048 /* Create the top level object */
1049
1050 *DestDesc = AcpiUtCreateInternalObject (SourceDesc->Common.Type);
1051 if (!*DestDesc)
1052 {
1054 }
1055
1056 /* Copy the object and possible subobjects */
1057
1058 if (SourceDesc->Common.Type == ACPI_TYPE_PACKAGE)
1059 {
1061 SourceDesc, *DestDesc, WalkState);
1062 }
1063 else
1064 {
1065 Status = AcpiUtCopySimpleObject (SourceDesc, *DestDesc);
1066 }
1067
1068 /* Delete the allocated object if copy failed */
1069
1070 if (ACPI_FAILURE (Status))
1071 {
1072 AcpiUtRemoveReference (*DestDesc);
1073 }
1074
1076}
#define AcpiUtCreateInternalObject(t)
Definition: acutils.h:681
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:790
ACPI_OBJECT_COMMON Common
Definition: acobject.h:519
static ACPI_STATUS AcpiUtCopySimpleObject(ACPI_OPERAND_OBJECT *SourceDesc, ACPI_OPERAND_OBJECT *DestDesc)
Definition: utcopy.c:713
static ACPI_STATUS AcpiUtCopyIpackageToIpackage(ACPI_OPERAND_OBJECT *SourceObj, ACPI_OPERAND_OBJECT *DestObj, ACPI_WALK_STATE *WalkState)
Definition: utcopy.c:978

Referenced by AcpiDsEvaluateNamePath(), AcpiDsStoreObjectToLocal(), AcpiExOpcode_1A_1T_1R(), AcpiExStoreDirectToNode(), AcpiExStoreObjectToIndex(), and AcpiExStoreObjectToObject().

◆ AcpiUtCopyISimpleToIsimple()

ACPI_STATUS AcpiUtCopyISimpleToIsimple ( ACPI_OPERAND_OBJECT SourceObj,
ACPI_OPERAND_OBJECT DestObj 
)

◆ AcpiUtCreateBufferObject()

ACPI_OPERAND_OBJECT * AcpiUtCreateBufferObject ( ACPI_SIZE  BufferSize)

Definition at line 258 of file utobject.c.

260{
261 ACPI_OPERAND_OBJECT *BufferDesc;
262 UINT8 *Buffer = NULL;
263
264
265 ACPI_FUNCTION_TRACE_U32 (UtCreateBufferObject, BufferSize);
266
267
268 /* Create a new Buffer object */
269
271 if (!BufferDesc)
272 {
274 }
275
276 /* Create an actual buffer only if size > 0 */
277
278 if (BufferSize > 0)
279 {
280 /* Allocate the actual buffer */
281
283 if (!Buffer)
284 {
285 ACPI_ERROR ((AE_INFO, "Could not allocate size %u",
286 (UINT32) BufferSize));
287
288 AcpiUtRemoveReference (BufferDesc);
290 }
291 }
292
293 /* Complete buffer object initialization */
294
295 BufferDesc->Buffer.Flags |= AOPOBJ_DATA_VALID;
296 BufferDesc->Buffer.Pointer = Buffer;
297 BufferDesc->Buffer.Length = (UINT32) BufferSize;
298
299 /* Return the new buffer descriptor */
300
301 return_PTR (BufferDesc);
302}
#define AOPOBJ_DATA_VALID
Definition: acobject.h:96
#define ACPI_FUNCTION_TRACE_U32(a, b)
Definition: acoutput.h:482
#define ACPI_TYPE_BUFFER
Definition: actypes.h:690
#define ACPI_ALLOCATE_ZEROED(a)
Definition: actypes.h:385
ACPI_OBJECT_BUFFER Buffer
Definition: acobject.h:522
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

Referenced by AcpiExConcatTemplate(), AcpiExConvertToBuffer(), AcpiExDoConcatenate(), AcpiExReadDataFromField(), AcpiExReadSerialBus(), AcpiExWriteSerialBus(), AcpiNsConvertToBuffer(), AcpiNsConvertToResource(), AcpiNsConvertToUnicode(), AcpiNsRepair_FDE(), and AcpiNsRepairNullElement().

◆ AcpiUtCreateCaches()

ACPI_STATUS AcpiUtCreateCaches ( void  )

Definition at line 104 of file utalloc.c.

106{
108
109
110 /* Object Caches, for frequently used objects */
111
112 Status = AcpiOsCreateCache ("Acpi-Namespace", sizeof (ACPI_NAMESPACE_NODE),
113 ACPI_MAX_NAMESPACE_CACHE_DEPTH, &AcpiGbl_NamespaceCache);
114 if (ACPI_FAILURE (Status))
115 {
116 return (Status);
117 }
118
119 Status = AcpiOsCreateCache ("Acpi-State", sizeof (ACPI_GENERIC_STATE),
120 ACPI_MAX_STATE_CACHE_DEPTH, &AcpiGbl_StateCache);
121 if (ACPI_FAILURE (Status))
122 {
123 return (Status);
124 }
125
126 Status = AcpiOsCreateCache ("Acpi-Parse", sizeof (ACPI_PARSE_OBJ_COMMON),
127 ACPI_MAX_PARSE_CACHE_DEPTH, &AcpiGbl_PsNodeCache);
128 if (ACPI_FAILURE (Status))
129 {
130 return (Status);
131 }
132
133 Status = AcpiOsCreateCache ("Acpi-ParseExt", sizeof (ACPI_PARSE_OBJ_NAMED),
134 ACPI_MAX_EXTPARSE_CACHE_DEPTH, &AcpiGbl_PsNodeExtCache);
135 if (ACPI_FAILURE (Status))
136 {
137 return (Status);
138 }
139
140 Status = AcpiOsCreateCache ("Acpi-Operand", sizeof (ACPI_OPERAND_OBJECT),
141 ACPI_MAX_OBJECT_CACHE_DEPTH, &AcpiGbl_OperandCache);
142 if (ACPI_FAILURE (Status))
143 {
144 return (Status);
145 }
146
147#ifdef ACPI_ASL_COMPILER
148 /*
149 * For use with the ASL-/ASL+ option. This cache keeps track of regular
150 * 0xA9 0x01 comments.
151 */
152 Status = AcpiOsCreateCache ("Acpi-Comment", sizeof (ACPI_COMMENT_NODE),
153 ACPI_MAX_COMMENT_CACHE_DEPTH, &AcpiGbl_RegCommentCache);
154 if (ACPI_FAILURE (Status))
155 {
156 return (Status);
157 }
158
159 /*
160 * This cache keeps track of the starting addresses of where the comments
161 * lie. This helps prevent duplication of comments.
162 */
163 Status = AcpiOsCreateCache ("Acpi-Comment-Addr", sizeof (ACPI_COMMENT_ADDR_NODE),
164 ACPI_MAX_COMMENT_CACHE_DEPTH, &AcpiGbl_CommentAddrCache);
165 if (ACPI_FAILURE (Status))
166 {
167 return (Status);
168 }
169
170 /*
171 * This cache will be used for nodes that represent files.
172 */
173 Status = AcpiOsCreateCache ("Acpi-File", sizeof (ACPI_FILE_NODE),
174 ACPI_MAX_COMMENT_CACHE_DEPTH, &AcpiGbl_FileCache);
175 if (ACPI_FAILURE (Status))
176 {
177 return (Status);
178 }
179#endif
180
181
182#ifdef ACPI_DBG_TRACK_ALLOCATIONS
183
184 /* Memory allocation lists */
185
186 Status = AcpiUtCreateList ("Acpi-Global", 0,
187 &AcpiGbl_GlobalList);
188 if (ACPI_FAILURE (Status))
189 {
190 return (Status);
191 }
192
193 Status = AcpiUtCreateList ("Acpi-Namespace", sizeof (ACPI_NAMESPACE_NODE),
194 &AcpiGbl_NsNodeList);
195 if (ACPI_FAILURE (Status))
196 {
197 return (Status);
198 }
199#endif
200
201 return (AE_OK);
202}
ACPI_STATUS AcpiOsCreateCache(char *CacheName, UINT16 ObjectSize, UINT16 MaxDepth, ACPI_CACHE_T **ReturnCache)
#define ACPI_MAX_NAMESPACE_CACHE_DEPTH
Definition: acconfig.h:81
#define ACPI_MAX_OBJECT_CACHE_DEPTH
Definition: acconfig.h:80
#define ACPI_MAX_EXTPARSE_CACHE_DEPTH
Definition: acconfig.h:79
#define ACPI_MAX_STATE_CACHE_DEPTH
Definition: acconfig.h:77
#define ACPI_MAX_PARSE_CACHE_DEPTH
Definition: acconfig.h:78
#define ACPI_MAX_COMMENT_CACHE_DEPTH
Definition: acconfig.h:82

Referenced by AcpiUtInitGlobals().

◆ AcpiUtCreateControlState()

ACPI_GENERIC_STATE * AcpiUtCreateControlState ( void  )

Definition at line 300 of file utstate.c.

302{
304
305
307
308
309 /* Create the generic state object */
310
312 if (!State)
313 {
314 return (NULL);
315 }
316
317 /* Init fields specific to the control struct */
318
319 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_CONTROL;
321
322 return (State);
323}
#define ACPI_CONTROL_CONDITIONAL_EXECUTING
Definition: aclocal.h:670
#define ACPI_DESC_TYPE_STATE_CONTROL
Definition: acobject.h:567
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
State(char *beg, char *end)
ACPI_GENERIC_STATE * AcpiUtCreateGenericState(void)
Definition: utstate.c:130

Referenced by AcpiDsExecBeginControlOp().

◆ AcpiUtCreateGenericState()

ACPI_GENERIC_STATE * AcpiUtCreateGenericState ( void  )

Definition at line 130 of file utstate.c.

132{
134
135
137
138
139 State = AcpiOsAcquireObject (AcpiGbl_StateCache);
140 if (State)
141 {
142 /* Initialize */
143 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE;
144 }
145
146 return (State);
147}
#define ACPI_DESC_TYPE_STATE
Definition: acobject.h:564

Referenced by AcpiDsResultStackPush(), AcpiDsScopeStackPush(), AcpiEvQueueNotifyRequest(), AcpiPsInitScope(), AcpiPsPushScope(), AcpiUtCreateControlState(), AcpiUtCreatePkgState(), AcpiUtCreateThreadState(), and AcpiUtCreateUpdateState().

◆ AcpiUtCreateIntegerObject()

ACPI_OPERAND_OBJECT * AcpiUtCreateIntegerObject ( UINT64  Value)

Definition at line 223 of file utobject.c.

225{
226 ACPI_OPERAND_OBJECT *IntegerDesc;
227
228
229 ACPI_FUNCTION_TRACE (UtCreateIntegerObject);
230
231
232 /* Create and initialize a new integer object */
233
235 if (!IntegerDesc)
236 {
238 }
239
240 IntegerDesc->Integer.Value = InitialValue;
241 return_PTR (IntegerDesc);
242}
#define ACPI_TYPE_INTEGER
Definition: actypes.h:688
ACPI_OBJECT_INTEGER Integer
Definition: acobject.h:520

Referenced by AcpiDsMethodDataGetValue(), AcpiEvExecuteRegMethod(), AcpiExConvertToInteger(), AcpiExLoadTableOp(), AcpiExOpcode_0A_0T_1R(), AcpiExOpcode_1A_0T_1R(), AcpiExOpcode_6A_0T_1R(), AcpiExReadDataFromField(), AcpiNsConvertToInteger(), AcpiNsRepairNullElement(), AcpiPsExecuteMethod(), and AcpiPsParseAml().

◆ AcpiUtCreateInternalObjectDbg()

ACPI_OPERAND_OBJECT * AcpiUtCreateInternalObjectDbg ( const char ModuleName,
UINT32  LineNumber,
UINT32  ComponentId,
ACPI_OBJECT_TYPE  Type 
)

Definition at line 94 of file utobject.c.

99{
101 ACPI_OPERAND_OBJECT *SecondObject;
102
103
104 ACPI_FUNCTION_TRACE_STR (UtCreateInternalObjectDbg,
106
107
108 /* Allocate the raw object descriptor */
109
112 if (!Object)
113 {
115 }
116
117 switch (Type)
118 {
119 case ACPI_TYPE_REGION:
122
123 /* These types require a secondary object */
124
125 SecondObject = AcpiUtAllocateObjectDescDbg (
127 if (!SecondObject)
128 {
131 }
132
133 SecondObject->Common.Type = ACPI_TYPE_LOCAL_EXTRA;
134 SecondObject->Common.ReferenceCount = 1;
135
136 /* Link the second object to the first */
137
138 Object->Common.NextObject = SecondObject;
139 break;
140
141 default:
142
143 /* All others have no secondary object */
144 break;
145 }
146
147 /* Save the object type in the object descriptor */
148
149 Object->Common.Type = (UINT8) Type;
150
151 /* Init the reference count */
152
153 Object->Common.ReferenceCount = 1;
154
155 /* Any per-type initialization should go here */
156
158}
Type
Definition: Type.h:7
#define ACPI_FUNCTION_TRACE_STR(a, b)
Definition: acoutput.h:483
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1281
#define ACPI_TYPE_BUFFER_FIELD
Definition: actypes.h:701
#define ACPI_TYPE_LOCAL_BANK_FIELD
Definition: actypes.h:717
#define ACPI_TYPE_REGION
Definition: actypes.h:697
#define ACPI_TYPE_LOCAL_EXTRA
Definition: actypes.h:735
const char * AcpiUtGetTypeName(ACPI_OBJECT_TYPE Type)
Definition: utdecode.c:250
void AcpiUtDeleteObjectDesc(ACPI_OPERAND_OBJECT *Object)
Definition: utobject.c:473
void * AcpiUtAllocateObjectDescDbg(const char *ModuleName, UINT32 LineNumber, UINT32 ComponentId)
Definition: utobject.c:429

◆ AcpiUtCreatePackageObject()

ACPI_OPERAND_OBJECT * AcpiUtCreatePackageObject ( UINT32  Count)

Definition at line 174 of file utobject.c.

176{
177 ACPI_OPERAND_OBJECT *PackageDesc;
178 ACPI_OPERAND_OBJECT **PackageElements;
179
180
181 ACPI_FUNCTION_TRACE_U32 (UtCreatePackageObject, Count);
182
183
184 /* Create a new Package object */
185
187 if (!PackageDesc)
188 {
190 }
191
192 /*
193 * Create the element array. Count+1 allows the array to be null
194 * terminated.
195 */
196 PackageElements = ACPI_ALLOCATE_ZEROED (
197 ((ACPI_SIZE) Count + 1) * sizeof (void *));
198 if (!PackageElements)
199 {
200 ACPI_FREE (PackageDesc);
202 }
203
204 PackageDesc->Package.Count = Count;
205 PackageDesc->Package.Elements = PackageElements;
206 return_PTR (PackageDesc);
207}
union acpi_operand_object ** Elements
Definition: acobject.h:161
ACPI_OBJECT_PACKAGE Package
Definition: acobject.h:523

Referenced by AcpiNsWrapWithPackage(), AcpiUtCopyEpackageToIpackage(), and AcpiUtCopyIelementToIelement().

◆ AcpiUtCreatePkgState()

ACPI_GENERIC_STATE * AcpiUtCreatePkgState ( void InternalObject,
void ExternalObject,
UINT32  Index 
)

Definition at line 255 of file utstate.c.

259{
261
262
264
265
266 /* Create the generic state object */
267
269 if (!State)
270 {
271 return (NULL);
272 }
273
274 /* Init fields specific to the update struct */
275
276 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_PACKAGE;
277 State->Pkg.SourceObject = (ACPI_OPERAND_OBJECT *) InternalObject;
278 State->Pkg.DestObject = ExternalObject;
279 State->Pkg.Index= Index;
280 State->Pkg.NumPackages = 1;
281
282 return (State);
283}
#define ACPI_DESC_TYPE_STATE_PACKAGE
Definition: acobject.h:566
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by AcpiUtWalkPackageTree().

◆ AcpiUtCreateRwLock()

ACPI_STATUS AcpiUtCreateRwLock ( ACPI_RW_LOCK Lock)

Definition at line 66 of file utlock.c.

68{
70
71
72 Lock->NumReaders = 0;
73 Status = AcpiOsCreateMutex (&Lock->ReaderMutex);
74 if (ACPI_FAILURE (Status))
75 {
76 return (Status);
77 }
78
79 Status = AcpiOsCreateMutex (&Lock->WriterMutex);
80 return (Status);
81}
#define AcpiOsCreateMutex(OutHandle)
Definition: actypes.h:274

Referenced by AcpiUtMutexInitialize().

◆ AcpiUtCreateStringObject()

ACPI_OPERAND_OBJECT * AcpiUtCreateStringObject ( ACPI_SIZE  StringSize)

Definition at line 320 of file utobject.c.

322{
323 ACPI_OPERAND_OBJECT *StringDesc;
324 char *String;
325
326
327 ACPI_FUNCTION_TRACE_U32 (UtCreateStringObject, StringSize);
328
329
330 /* Create a new String object */
331
333 if (!StringDesc)
334 {
336 }
337
338 /*
339 * Allocate the actual string buffer -- (Size + 1) for NULL terminator.
340 * NOTE: Zero-length strings are NULL terminated
341 */
342 String = ACPI_ALLOCATE_ZEROED (StringSize + 1);
343 if (!String)
344 {
345 ACPI_ERROR ((AE_INFO, "Could not allocate size %u",
346 (UINT32) StringSize));
347
348 AcpiUtRemoveReference (StringDesc);
350 }
351
352 /* Complete string object initialization */
353
354 StringDesc->String.Pointer = String;
355 StringDesc->String.Length = (UINT32) StringSize;
356
357 /* Return the new string descriptor */
358
359 return_PTR (StringDesc);
360}
#define ACPI_TYPE_STRING
Definition: actypes.h:689
ACPI_OBJECT_STRING String
Definition: acobject.h:521

Referenced by AcpiExConvertToObjectTypeString(), AcpiExConvertToString(), AcpiExDoConcatenate(), AcpiExOpcode_2A_1T_1R(), AcpiNsConvertToString(), AcpiNsRepair_HID(), and AcpiNsRepairNullElement().

◆ AcpiUtCreateThreadState()

ACPI_THREAD_STATE * AcpiUtCreateThreadState ( void  )

Definition at line 164 of file utstate.c.

166{
168
169
171
172
173 /* Create the generic state object */
174
176 if (!State)
177 {
178 return (NULL);
179 }
180
181 /* Init fields specific to the update struct */
182
183 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_THREAD;
184 State->Thread.ThreadId = AcpiOsGetThreadId ();
185
186 /* Check for invalid thread ID - zero is very bad, it will break things */
187
188 if (!State->Thread.ThreadId)
189 {
190 ACPI_ERROR ((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId"));
191 State->Thread.ThreadId = (ACPI_THREAD_ID) 1;
192 }
193
194 return ((ACPI_THREAD_STATE *) State);
195}
#define ACPI_DESC_TYPE_STATE_THREAD
Definition: acobject.h:573

Referenced by AcpiPsParseAml().

◆ AcpiUtCreateUpdateState()

ACPI_GENERIC_STATE * AcpiUtCreateUpdateState ( ACPI_OPERAND_OBJECT Object,
UINT16  Action 
)

Definition at line 214 of file utstate.c.

217{
219
220
222
223
224 /* Create the generic state object */
225
227 if (!State)
228 {
229 return (NULL);
230 }
231
232 /* Init fields specific to the update struct */
233
234 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_UPDATE;
235 State->Update.Object = Object;
236 State->Update.Value = Action;
237 return (State);
238}
#define ACPI_DESC_TYPE_STATE_UPDATE
Definition: acobject.h:565
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510

Referenced by AcpiUtCreateUpdateStateAndPush().

◆ AcpiUtCreateUpdateStateAndPush()

ACPI_STATUS AcpiUtCreateUpdateStateAndPush ( ACPI_OPERAND_OBJECT Object,
UINT16  Action,
ACPI_GENERIC_STATE **  StateList 
)

Definition at line 219 of file utmisc.c.

223{
225
226
228
229
230 /* Ignore null objects; these are expected */
231
232 if (!Object)
233 {
234 return (AE_OK);
235 }
236
238 if (!State)
239 {
240 return (AE_NO_MEMORY);
241 }
242
243 AcpiUtPushGenericState (StateList, State);
244 return (AE_OK);
245}
ACPI_GENERIC_STATE * AcpiUtCreateUpdateState(ACPI_OPERAND_OBJECT *Object, UINT16 Action)
Definition: utstate.c:214
void AcpiUtPushGenericState(ACPI_GENERIC_STATE **ListHead, ACPI_GENERIC_STATE *State)
Definition: utstate.c:65

Referenced by AcpiUtUpdateObjectReference().

◆ AcpiUtDebugDumpBuffer()

void AcpiUtDebugDumpBuffer ( UINT8 Buffer,
UINT32  Count,
UINT32  Display,
UINT32  ComponentId 
)

Definition at line 219 of file utbuffer.c.

224{
225
226 /* Only dump the buffer if tracing is enabled */
227
228 if (!((ACPI_LV_TABLES & AcpiDbgLevel) &&
229 (ComponentId & AcpiDbgLayer)))
230 {
231 return;
232 }
233
235}
#define ACPI_LV_TABLES
Definition: acoutput.h:105
void AcpiUtDumpBuffer(UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 BaseOffset)
Definition: utbuffer.c:71
int Display
Definition: x11stubs.h:25

◆ AcpiUtDeleteAddressLists()

void AcpiUtDeleteAddressLists ( void  )

Definition at line 292 of file utaddress.c.

294{
295 ACPI_ADDRESS_RANGE *Next;
296 ACPI_ADDRESS_RANGE *RangeInfo;
297 int i;
298
299
300 /* Delete all elements in all address range lists */
301
302 for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
303 {
304 Next = AcpiGbl_AddressRangeList[i];
305
306 while (Next)
307 {
308 RangeInfo = Next;
309 Next = RangeInfo->Next;
310 ACPI_FREE (RangeInfo);
311 }
312
313 AcpiGbl_AddressRangeList[i] = NULL;
314 }
315}
#define ACPI_ADDRESS_RANGE_MAX
Definition: acconfig.h:148

Referenced by AcpiUtTerminate().

◆ AcpiUtDeleteCaches()

ACPI_STATUS AcpiUtDeleteCaches ( void  )

Definition at line 218 of file utalloc.c.

220{
221#ifdef ACPI_DBG_TRACK_ALLOCATIONS
222 char Buffer[7];
223
224
225 if (AcpiGbl_DisplayFinalMemStats)
226 {
227 strcpy (Buffer, "MEMORY");
229 }
230#endif
231
232 (void) AcpiOsDeleteCache (AcpiGbl_NamespaceCache);
233 AcpiGbl_NamespaceCache = NULL;
234
235 (void) AcpiOsDeleteCache (AcpiGbl_StateCache);
236 AcpiGbl_StateCache = NULL;
237
238 (void) AcpiOsDeleteCache (AcpiGbl_OperandCache);
239 AcpiGbl_OperandCache = NULL;
240
241 (void) AcpiOsDeleteCache (AcpiGbl_PsNodeCache);
242 AcpiGbl_PsNodeCache = NULL;
243
244 (void) AcpiOsDeleteCache (AcpiGbl_PsNodeExtCache);
245 AcpiGbl_PsNodeExtCache = NULL;
246
247#ifdef ACPI_ASL_COMPILER
248 (void) AcpiOsDeleteCache (AcpiGbl_RegCommentCache);
249 AcpiGbl_RegCommentCache = NULL;
250
251 (void) AcpiOsDeleteCache (AcpiGbl_CommentAddrCache);
252 AcpiGbl_CommentAddrCache = NULL;
253
254 (void) AcpiOsDeleteCache (AcpiGbl_FileCache);
255 AcpiGbl_FileCache = NULL;
256#endif
257
258#ifdef ACPI_DBG_TRACK_ALLOCATIONS
259
260 /* Debug only - display leftover memory allocation, if any */
261
262 AcpiUtDumpAllocations (ACPI_UINT32_MAX, NULL);
263
264 /* Free memory lists */
265
266 AcpiOsFree (AcpiGbl_GlobalList);
267 AcpiGbl_GlobalList = NULL;
268
269 AcpiOsFree (AcpiGbl_NsNodeList);
270 AcpiGbl_NsNodeList = NULL;
271#endif
272
273 return (AE_OK);
274}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
ACPI_STATUS AcpiDbDisplayStatistics(char *TypeArg)
ACPI_STATUS AcpiOsDeleteCache(ACPI_CACHE_T *Cache)
void AcpiOsFree(void *Memory)
Definition: osl.c:167

Referenced by AcpiUtSubsystemShutdown().

◆ AcpiUtDeleteGenericState()

void AcpiUtDeleteGenericState ( ACPI_GENERIC_STATE State)

Definition at line 340 of file utstate.c.

342{
344
345
346 /* Ignore null state */
347
348 if (State)
349 {
350 (void) AcpiOsReleaseObject (AcpiGbl_StateCache, State);
351 }
352
353 return;
354}
ACPI_STATUS AcpiOsReleaseObject(ACPI_CACHE_T *Cache, void *Object)

Referenced by AcpiDsDeleteWalkState(), AcpiDsExecEndControlOp(), AcpiDsResultStackPop(), AcpiDsScopeStackClear(), AcpiDsScopeStackPop(), AcpiEvNotifyDispatch(), AcpiEvQueueNotifyRequest(), AcpiPsCleanupScope(), AcpiPsCompleteOp(), AcpiPsParseAml(), AcpiPsPopScope(), AcpiUtUpdateObjectReference(), and AcpiUtWalkPackageTree().

◆ AcpiUtDeleteInternalObjectList()

void AcpiUtDeleteInternalObjectList ( ACPI_OPERAND_OBJECT **  ObjList)

Definition at line 384 of file utdelete.c.

386{
387 ACPI_OPERAND_OBJECT **InternalObj;
388
389
391
392
393 /* Walk the null-terminated internal list */
394
395 for (InternalObj = ObjList; *InternalObj; InternalObj++)
396 {
397 AcpiUtRemoveReference (*InternalObj);
398 }
399
400 /* Free the combined parameter pointer list and object array */
401
402 ACPI_FREE (ObjList);
403 return;
404}
void AcpiUtRemoveReference(ACPI_OPERAND_OBJECT *Object)
Definition: utdelete.c:790

Referenced by AcpiEvaluateObject().

◆ AcpiUtDeleteInternalPackageObject()

void AcpiUtDeleteInternalPackageObject ( ACPI_OPERAND_OBJECT Object)

◆ AcpiUtDeleteInternalSimpleObject()

void AcpiUtDeleteInternalSimpleObject ( ACPI_OPERAND_OBJECT Object)

◆ AcpiUtDeleteObjectDesc()

void AcpiUtDeleteObjectDesc ( ACPI_OPERAND_OBJECT Object)

Definition at line 473 of file utobject.c.

475{
476 ACPI_FUNCTION_TRACE_PTR (UtDeleteObjectDesc, Object);
477
478
479 /* Object must be of type ACPI_OPERAND_OBJECT */
480
482 {
484 "%p is not an ACPI Operand object [%s]", Object,
487 }
488
489 (void) AcpiOsReleaseObject (AcpiGbl_OperandCache, Object);
491}
#define ACPI_GET_DESCRIPTOR_TYPE(d)
Definition: acmacros.h:414
#define ACPI_FUNCTION_TRACE_PTR(a, b)
Definition: acoutput.h:481
#define return_VOID
Definition: acoutput.h:495
const char * AcpiUtGetDescriptorName(void *Object)
Definition: utdecode.c:382

Referenced by AcpiDsBuildInternalBufferObj(), AcpiDsBuildInternalPackageObj(), AcpiDsCreateMethodMutex(), AcpiDsCreateOperand(), AcpiExPrepFieldValue(), AcpiUtCreateInternalObjectDbg(), and AcpiUtDeleteInternalObj().

◆ AcpiUtDeleteRwLock()

void AcpiUtDeleteRwLock ( ACPI_RW_LOCK Lock)

Definition at line 85 of file utlock.c.

87{
88
89 AcpiOsDeleteMutex (Lock->ReaderMutex);
90 AcpiOsDeleteMutex (Lock->WriterMutex);
91
92 Lock->NumReaders = 0;
93 Lock->ReaderMutex = NULL;
94 Lock->WriterMutex = NULL;
95}
#define AcpiOsDeleteMutex(Handle)
Definition: actypes.h:275

Referenced by AcpiUtMutexTerminate().

◆ AcpiUtDetectHexPrefix()

BOOLEAN AcpiUtDetectHexPrefix ( char **  String)

Definition at line 329 of file utstrsuppt.c.

331{
332 char *InitialPosition = *String;
333
335 if (*String != InitialPosition)
336 {
337 return (TRUE); /* String is past leading 0x */
338 }
339
340 return (FALSE); /* Not a hex string */
341}
#define FALSE
Definition: types.h:117
void AcpiUtRemoveHexPrefix(char **String)
Definition: utstrsuppt.c:357

Referenced by AcpiUtExplicitStrtoul64(), and AcpiUtStrtoul64().

◆ AcpiUtDetectOctalPrefix()

BOOLEAN AcpiUtDetectOctalPrefix ( char **  String)

Definition at line 382 of file utstrsuppt.c.

384{
385
386 if (**String == ACPI_ASCII_ZERO)
387 {
388 *String += 1; /* Go past the leading 0 */
389 return (TRUE);
390 }
391
392 return (FALSE); /* Not an octal string */
393}
#define ACPI_ASCII_ZERO
Definition: aclocal.h:1356

Referenced by AcpiUtStrtoul64().

◆ AcpiUtDivide()

ACPI_STATUS AcpiUtDivide ( UINT64  InDividend,
UINT64  InDivisor,
UINT64 OutQuotient,
UINT64 OutRemainder 
)

Definition at line 402 of file utmath.c.

407{
408 UINT64_OVERLAY Dividend;
410 UINT64_OVERLAY Quotient;
412 UINT64_OVERLAY NormalizedDividend;
413 UINT64_OVERLAY NormalizedDivisor;
414 UINT32 Partial1;
415 UINT64_OVERLAY Partial2;
416 UINT64_OVERLAY Partial3;
417
418
419 ACPI_FUNCTION_TRACE (UtDivide);
420
421
422 /* Always check for a zero divisor */
423
424 if (InDivisor == 0)
425 {
426 ACPI_ERROR ((AE_INFO, "Divide by zero"));
428 }
429
430 Divisor.Full = InDivisor;
431 Dividend.Full = InDividend;
432 if (Divisor.Part.Hi == 0)
433 {
434 /*
435 * 1) Simplest case is where the divisor is 32 bits, we can
436 * just do two divides
437 */
438 Remainder.Part.Hi = 0;
439
440 /*
441 * The quotient is 64 bits, the remainder is always 32 bits,
442 * and is generated by the second divide.
443 */
444 ACPI_DIV_64_BY_32 (0, Dividend.Part.Hi, Divisor.Part.Lo,
445 Quotient.Part.Hi, Partial1);
446
447 ACPI_DIV_64_BY_32 (Partial1, Dividend.Part.Lo, Divisor.Part.Lo,
448 Quotient.Part.Lo, Remainder.Part.Lo);
449 }
450
451 else
452 {
453 /*
454 * 2) The general case where the divisor is a full 64 bits
455 * is more difficult
456 */
457 Quotient.Part.Hi = 0;
458 NormalizedDividend = Dividend;
459 NormalizedDivisor = Divisor;
460
461 /* Normalize the operands (shift until the divisor is < 32 bits) */
462
463 do
464 {
466 NormalizedDivisor.Part.Hi, NormalizedDivisor.Part.Lo);
468 NormalizedDividend.Part.Hi, NormalizedDividend.Part.Lo);
469
470 } while (NormalizedDivisor.Part.Hi != 0);
471
472 /* Partial divide */
473
474 ACPI_DIV_64_BY_32 (
475 NormalizedDividend.Part.Hi, NormalizedDividend.Part.Lo,
476 NormalizedDivisor.Part.Lo, Quotient.Part.Lo, Partial1);
477
478 /*
479 * The quotient is always 32 bits, and simply requires
480 * adjustment. The 64-bit remainder must be generated.
481 */
482 Partial1 = Quotient.Part.Lo * Divisor.Part.Hi;
483 Partial2.Full = (UINT64) Quotient.Part.Lo * Divisor.Part.Lo;
484 Partial3.Full = (UINT64) Partial2.Part.Hi + Partial1;
485
486 Remainder.Part.Hi = Partial3.Part.Lo;
487 Remainder.Part.Lo = Partial2.Part.Lo;
488
489 if (Partial3.Part.Hi == 0)
490 {
491 if (Partial3.Part.Lo >= Dividend.Part.Hi)
492 {
493 if (Partial3.Part.Lo == Dividend.Part.Hi)
494 {
495 if (Partial2.Part.Lo > Dividend.Part.Lo)
496 {
497 Quotient.Part.Lo--;
498 Remainder.Full -= Divisor.Full;
499 }
500 }
501 else
502 {
503 Quotient.Part.Lo--;
504 Remainder.Full -= Divisor.Full;
505 }
506 }
507
508 Remainder.Full = Remainder.Full - Dividend.Full;
509 Remainder.Part.Hi = (UINT32) -((INT32) Remainder.Part.Hi);
510 Remainder.Part.Lo = (UINT32) -((INT32) Remainder.Part.Lo);
511
512 if (Remainder.Part.Lo)
513 {
514 Remainder.Part.Hi--;
515 }
516 }
517 }
518
519 /* Return only what was requested */
520
521 if (OutQuotient)
522 {
523 *OutQuotient = Quotient.Full;
524 }
525 if (OutRemainder)
526 {
527 *OutRemainder = Remainder.Full;
528 }
529
531}
signed int INT32
#define AE_AML_DIVIDE_BY_ZERO
Definition: acexcep.h:191
#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo)
Definition: acos2.h:84
UINT32 Hi
Definition: utmath.c:56
UINT32 Lo
Definition: utmath.c:55
UINT64 Full
Definition: utmath.c:62
UINT64_STRUCT Part
Definition: utmath.c:63
_In_ LARGE_INTEGER Divisor
Definition: rtlfuncs.h:3044
_In_ LARGE_INTEGER _Out_opt_ PLARGE_INTEGER Remainder
Definition: rtlfuncs.h:3045

Referenced by AcpiExOpcode_2A_1T_1R(), AcpiExOpcode_2A_2T_1R(), and AcpiUtPutNumber().

◆ AcpiUtDumpBuffer()

void AcpiUtDumpBuffer ( UINT8 Buffer,
UINT32  Count,
UINT32  Display,
UINT32  Offset 
)

Definition at line 71 of file utbuffer.c.

76{
77 UINT32 i = 0;
78 UINT32 j;
79 UINT32 Temp32;
80 UINT8 BufChar;
81 UINT32 DisplayDataOnly = Display & DB_DISPLAY_DATA_ONLY;
82
83
84 Display &= ~DB_DISPLAY_DATA_ONLY;
85 if (!Buffer)
86 {
87 AcpiOsPrintf ("Null Buffer Pointer in DumpBuffer!\n");
88 return;
89 }
90
91 if ((Count < 4) || (Count & 0x01))
92 {
94 }
95
96 /* Nasty little dump buffer routine! */
97
98 while (i < Count)
99 {
100 /* Print current offset */
101
102 if (!DisplayDataOnly)
103 {
104 AcpiOsPrintf ("%8.4X: ", (BaseOffset + i));
105 }
106
107 /* Print 16 hex chars */
108
109 for (j = 0; j < 16;)
110 {
111 if (i + j >= Count)
112 {
113 /* Dump fill spaces */
114
115 AcpiOsPrintf ("%*s", ((Display * 2) + 1), " ");
116 j += Display;
117 continue;
118 }
119
120 switch (Display)
121 {
122 case DB_BYTE_DISPLAY:
123 default: /* Default is BYTE display */
124
125 AcpiOsPrintf ("%02X ", Buffer[(ACPI_SIZE) i + j]);
126 break;
127
128 case DB_WORD_DISPLAY:
129
130 ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
131 AcpiOsPrintf ("%04X ", Temp32);
132 break;
133
134 case DB_DWORD_DISPLAY:
135
136 ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
137 AcpiOsPrintf ("%08X ", Temp32);
138 break;
139
140 case DB_QWORD_DISPLAY:
141
142 ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]);
143 AcpiOsPrintf ("%08X", Temp32);
144
145 ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]);
146 AcpiOsPrintf ("%08X ", Temp32);
147 break;
148 }
149
150 j += Display;
151 }
152
153 /*
154 * Print the ASCII equivalent characters but watch out for the bad
155 * unprintable ones (printable chars are 0x20 through 0x7E)
156 */
157 if (!DisplayDataOnly)
158 {
159 AcpiOsPrintf (" ");
160 for (j = 0; j < 16; j++)
161 {
162 if (i + j >= Count)
163 {
164 AcpiOsPrintf ("\n");
165 return;
166 }
167
168 /*
169 * Add comment characters so rest of line is ignored when
170 * compiled
171 */
172 if (j == 0)
173 {
174 AcpiOsPrintf ("// ");
175 }
176
177 BufChar = Buffer[(ACPI_SIZE) i + j];
178 if (isprint (BufChar))
179 {
180 AcpiOsPrintf ("%c", BufChar);
181 }
182 else
183 {
184 AcpiOsPrintf (".");
185 }
186 }
187
188 /* Done with that line. */
189
190 AcpiOsPrintf ("\n");
191 }
192 i += 16;
193 }
194
195 return;
196}
#define ACPI_MOVE_16_TO_32(d, s)
Definition: acmacros.h:142
#define ACPI_MOVE_32_TO_32(d, s)
Definition: acmacros.h:148
void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf(const char *Format,...)
Definition: osl.c:851
#define DB_QWORD_DISPLAY
Definition: acutils.h:189
#define DB_DISPLAY_DATA_ONLY
Definition: acutils.h:190
#define DB_WORD_DISPLAY
Definition: acutils.h:187
#define DB_DWORD_DISPLAY
Definition: acutils.h:188
#define DB_BYTE_DISPLAY
Definition: acutils.h:186

Referenced by AcpiExDoDebugObject(), AcpiPsGetAmlOpcode(), and AcpiUtDebugDumpBuffer().

◆ AcpiUtDwordByteSwap()

UINT32 AcpiUtDwordByteSwap ( UINT32  Value)

Definition at line 136 of file utmisc.c.

138{
139 union
140 {
142 UINT8 Bytes[4];
143 } Out;
144 union
145 {
147 UINT8 Bytes[4];
148 } In;
149
150
152
153
154 In.Value = Value;
155
156 Out.Bytes[0] = In.Bytes[3];
157 Out.Bytes[1] = In.Bytes[2];
158 Out.Bytes[2] = In.Bytes[1];
159 Out.Bytes[3] = In.Bytes[0];
160
161 return (Out.Value);
162}
@ Out
@ In
_In_ UINT Bytes
Definition: mmcopy.h:9
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by AcpiExEisaIdToString().

◆ AcpiUtEvaluateNumericObject()

ACPI_STATUS AcpiUtEvaluateNumericObject ( const char ObjectName,
ACPI_NAMESPACE_NODE DeviceNode,
UINT64 Value 
)

Definition at line 221 of file uteval.c.

225{
226 ACPI_OPERAND_OBJECT *ObjDesc;
228
229
230 ACPI_FUNCTION_TRACE (UtEvaluateNumericObject);
231
232
234 ACPI_BTYPE_INTEGER, &ObjDesc);
235 if (ACPI_FAILURE (Status))
236 {
238 }
239
240 /* Get the returned Integer */
241
242 *Value = ObjDesc->Integer.Value;
243
244 /* On exit, we must delete the return object */
245
246 AcpiUtRemoveReference (ObjDesc);
248}
@ DeviceNode
Definition: Node.h:9
#define ACPI_BTYPE_INTEGER
Definition: aclocal.h:332
ACPI_STATUS AcpiUtEvaluateObject(ACPI_NAMESPACE_NODE *PrefixNode, const char *Path, UINT32 ExpectedReturnBtypes, ACPI_OPERAND_OBJECT **ReturnDesc)
Definition: uteval.c:73
_In_ PVOID _Out_opt_ PULONG_PTR _Outptr_opt_ PCUNICODE_STRING * ObjectName
Definition: cmfuncs.h:64

Referenced by AcpiEvPciConfigRegionSetup(), AcpiGetObjectInfo(), and AcpiHwGetPciDeviceInfo().

◆ AcpiUtEvaluateObject()

ACPI_STATUS AcpiUtEvaluateObject ( ACPI_NAMESPACE_NODE PrefixNode,
const char Path,
UINT32  ExpectedReturnBtypes,
ACPI_OPERAND_OBJECT **  ReturnDesc 
)

Definition at line 73 of file uteval.c.

78{
81 UINT32 ReturnBtype;
82
83
84 ACPI_FUNCTION_TRACE (UtEvaluateObject);
85
86
87 /* Allocate the evaluation information block */
88
90 if (!Info)
91 {
93 }
94
95 Info->PrefixNode = PrefixNode;
96 Info->RelativePathname = Path;
97
98 /* Evaluate the object/method */
99
101 if (ACPI_FAILURE (Status))
102 {
103 if (Status == AE_NOT_FOUND)
104 {
105 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s.%s] was not found\n",
106 AcpiUtGetNodeName (PrefixNode), Path));
107 }
108 else
109 {
110 ACPI_ERROR_METHOD ("Method execution failed",
111 PrefixNode, Path, Status);
112 }
113
114 goto Cleanup;
115 }
116
117 /* Did we get a return object? */
118
119 if (!Info->ReturnObject)
120 {
121 if (ExpectedReturnBtypes)
122 {
123 ACPI_ERROR_METHOD ("No object was returned from",
124 PrefixNode, Path, AE_NOT_EXIST);
125
127 }
128
129 goto Cleanup;
130 }
131
132 /* Map the return object type to the bitmapped type */
133
134 switch ((Info->ReturnObject)->Common.Type)
135 {
137
138 ReturnBtype = ACPI_BTYPE_INTEGER;
139 break;
140
141 case ACPI_TYPE_BUFFER:
142
143 ReturnBtype = ACPI_BTYPE_BUFFER;
144 break;
145
146 case ACPI_TYPE_STRING:
147
148 ReturnBtype = ACPI_BTYPE_STRING;
149 break;
150
152
153 ReturnBtype = ACPI_BTYPE_PACKAGE;
154 break;
155
156 default:
157
158 ReturnBtype = 0;
159 break;
160 }
161
162 if ((AcpiGbl_EnableInterpreterSlack) &&
163 (!ExpectedReturnBtypes))
164 {
165 /*
166 * We received a return object, but one was not expected. This can
167 * happen frequently if the "implicit return" feature is enabled.
168 * Just delete the return object and return AE_OK.
169 */
170 AcpiUtRemoveReference (Info->ReturnObject);
171 goto Cleanup;
172 }
173
174 /* Is the return object one of the expected types? */
175
176 if (!(ExpectedReturnBtypes & ReturnBtype))
177 {
178 ACPI_ERROR_METHOD ("Return object type is incorrect",
179 PrefixNode, Path, AE_TYPE);
180
182 "Type returned from %s was incorrect: %s, expected Btypes: 0x%X",
183 Path, AcpiUtGetObjectTypeName (Info->ReturnObject),
184 ExpectedReturnBtypes));
185
186 /* On error exit, we must delete the return object */
187
188 AcpiUtRemoveReference (Info->ReturnObject);
189 Status = AE_TYPE;
190 goto Cleanup;
191 }
192
193 /* Object type is OK, return it */
194
195 *ReturnDesc = Info->ReturnObject;
196
197Cleanup:
198 ACPI_FREE (Info);
200}
PRTL_UNICODE_STRING_BUFFER Path
#define AE_NOT_FOUND
Definition: acexcep.h:113
#define AE_NOT_EXIST
Definition: acexcep.h:114
#define AE_TYPE
Definition: acexcep.h:116
#define ACPI_BTYPE_PACKAGE
Definition: aclocal.h:335
#define ACPI_BTYPE_STRING
Definition: aclocal.h:333
#define ACPI_BTYPE_BUFFER
Definition: aclocal.h:334
#define ACPI_ERROR_METHOD(s, n, p, e)
Definition: acmacros.h:463
ACPI_STATUS AcpiNsEvaluate(ACPI_EVALUATE_INFO *Info)
Definition: nseval.c:82
#define ACPI_DB_EXEC
Definition: acoutput.h:165
const char * AcpiUtGetObjectTypeName(ACPI_OPERAND_OBJECT *ObjDesc)
Definition: utdecode.c:264
static const WCHAR Cleanup[]
Definition: register.c:80
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by AcpiRsGetAeiMethodData(), AcpiRsGetCrsMethodData(), AcpiRsGetMethodData(), AcpiRsGetPrsMethodData(), AcpiRsGetPrtMethodData(), AcpiUtEvaluateNumericObject(), AcpiUtExecute_CID(), AcpiUtExecute_CLS(), AcpiUtExecute_HID(), AcpiUtExecute_STA(), AcpiUtExecute_UID(), and AcpiUtExecutePowerMethods().

◆ AcpiUtExecute_CID()

ACPI_STATUS AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE DeviceNode,
ACPI_PNP_DEVICE_ID_LIST **  ReturnCidList 
)

Definition at line 253 of file utids.c.

256{
257 ACPI_OPERAND_OBJECT **CidObjects;
258 ACPI_OPERAND_OBJECT *ObjDesc;
260 char *NextIdString;
261 UINT32 StringAreaSize;
263 UINT32 CidListSize;
266 UINT32 i;
267
268
269 ACPI_FUNCTION_TRACE (UtExecute_CID);
270
271
272 /* Evaluate the _CID method for this device */
273
276 &ObjDesc);
277 if (ACPI_FAILURE (Status))
278 {
280 }
281
282 /*
283 * Get the count and size of the returned _CIDs. _CID can return either
284 * a Package of Integers/Strings or a single Integer or String.
285 * Note: This section also validates that all CID elements are of the
286 * correct type (Integer or String).
287 */
288 if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE)
289 {
290 Count = ObjDesc->Package.Count;
291 CidObjects = ObjDesc->Package.Elements;
292 }
293 else /* Single Integer or String CID */
294 {
295 Count = 1;
296 CidObjects = &ObjDesc;
297 }
298
299 StringAreaSize = 0;
300 for (i = 0; i < Count; i++)
301 {
302 /* String lengths include null terminator */
303
304 switch (CidObjects[i]->Common.Type)
305 {
307
308 StringAreaSize += ACPI_EISAID_STRING_SIZE;
309 break;
310
311 case ACPI_TYPE_STRING:
312
313 StringAreaSize += CidObjects[i]->String.Length + 1;
314 break;
315
316 default:
317
318 Status = AE_TYPE;
319 goto Cleanup;
320 }
321 }
322
323 /*
324 * Now that we know the length of the CIDs, allocate return buffer:
325 * 1) Size of the base structure +
326 * 2) Size of the CID PNP_DEVICE_ID array +
327 * 3) Size of the actual CID strings
328 */
329 CidListSize = sizeof (ACPI_PNP_DEVICE_ID_LIST) +
330 (Count * sizeof (ACPI_PNP_DEVICE_ID)) +
331 StringAreaSize;
332
333 CidList = ACPI_ALLOCATE_ZEROED (CidListSize);
334 if (!CidList)
335 {
337 goto Cleanup;
338 }
339
340 /* Area for CID strings starts after the CID PNP_DEVICE_ID array */
341
342 NextIdString = ACPI_CAST_PTR (char, CidList->Ids) +
343 ((ACPI_SIZE) Count * sizeof (ACPI_PNP_DEVICE_ID));
344
345 /* Copy/convert the CIDs to the return buffer */
346
347 for (i = 0; i < Count; i++)
348 {
349 if (CidObjects[i]->Common.Type == ACPI_TYPE_INTEGER)
350 {
351 /* Convert the Integer (EISAID) CID to a string */
352
354 NextIdString, CidObjects[i]->Integer.Value);
356 }
357 else /* ACPI_TYPE_STRING */
358 {
359 /* Copy the String CID from the returned object */
360
361 strcpy (NextIdString, CidObjects[i]->String.Pointer);
362 Length = CidObjects[i]->String.Length + 1;
363 }
364
365 CidList->Ids[i].String = NextIdString;
366 CidList->Ids[i].Length = Length;
367 NextIdString += Length;
368 }
369
370 /* Finish the CID list */
371
372 CidList->Count = Count;
373 CidList->ListSize = CidListSize;
374 *ReturnCidList = CidList;
375
376
377Cleanup:
378
379 /* On exit, we must delete the _CID return object */
380
381 AcpiUtRemoveReference (ObjDesc);
383}
#define METHOD_NAME__CID
Definition: acnames.h:53
#define ACPI_EISAID_STRING_SIZE
Definition: actypes.h:1273
struct acpi_pnp_device_id_list ACPI_PNP_DEVICE_ID_LIST
ACPI_STATUS AcpiUtEvaluateObject(ACPI_NAMESPACE_NODE *PrefixNode, const char *Path, UINT32 ExpectedReturnBtypes, ACPI_OPERAND_OBJECT **ReturnDesc)
Definition: uteval.c:73
void AcpiExEisaIdToString(char *OutString, UINT64 CompressedId)
Definition: exutils.c:366
ACPI_PNP_DEVICE_ID Ids[]
Definition: actypes.h:1297

Referenced by AcpiEvIsPciRootBridge(), AcpiGetObjectInfo(), and AcpiNsGetDeviceCallback().

◆ AcpiUtExecute_CLS()

ACPI_STATUS AcpiUtExecute_CLS ( ACPI_NAMESPACE_NODE DeviceNode,
ACPI_PNP_DEVICE_ID **  ReturnId 
)

Definition at line 406 of file utids.c.

409{
410 ACPI_OPERAND_OBJECT *ObjDesc;
411 ACPI_OPERAND_OBJECT **ClsObjects;
416 UINT8 ClassCode[3] = {0, 0, 0};
417
418
419 ACPI_FUNCTION_TRACE (UtExecute_CLS);
420
421
423 ACPI_BTYPE_PACKAGE, &ObjDesc);
424 if (ACPI_FAILURE (Status))
425 {
427 }
428
429 /* Get the size of the String to be returned, includes null terminator */
430
432 ClsObjects = ObjDesc->Package.Elements;
433 Count = ObjDesc->Package.Count;
434
435 if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE)
436 {
437 if (Count > 0 && ClsObjects[0]->Common.Type == ACPI_TYPE_INTEGER)
438 {
439 ClassCode[0] = (UINT8) ClsObjects[0]->Integer.Value;
440 }
441 if (Count > 1 && ClsObjects[1]->Common.Type == ACPI_TYPE_INTEGER)
442 {
443 ClassCode[1] = (UINT8) ClsObjects[1]->Integer.Value;
444 }
445 if (Count > 2 && ClsObjects[2]->Common.Type == ACPI_TYPE_INTEGER)
446 {
447 ClassCode[2] = (UINT8) ClsObjects[2]->Integer.Value;
448 }
449 }
450
451 /* Allocate a buffer for the CLS */
452
454 sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
455 if (!Cls)
456 {
458 goto Cleanup;
459 }
460
461 /* Area for the string starts after PNP_DEVICE_ID struct */
462
463 Cls->String = ACPI_ADD_PTR (char, Cls, sizeof (ACPI_PNP_DEVICE_ID));
464
465 /* Simply copy existing string */
466
467 AcpiExPciClsToString (Cls->String, ClassCode);
468 Cls->Length = Length;
469 *ReturnId = Cls;
470
471
472Cleanup:
473
474 /* On exit, we must delete the return object */
475
476 AcpiUtRemoveReference (ObjDesc);
478}
#define METHOD_NAME__CLS
Definition: acnames.h:54
#define ACPI_PCICLS_STRING_SIZE
Definition: actypes.h:1281
void AcpiExPciClsToString(char *OutString, UINT8 ClassCode[3])
Definition: exutils.c:461

Referenced by AcpiGetObjectInfo().

◆ AcpiUtExecute_HID()

ACPI_STATUS AcpiUtExecute_HID ( ACPI_NAMESPACE_NODE DeviceNode,
ACPI_PNP_DEVICE_ID **  ReturnId 
)

Definition at line 72 of file utids.c.

75{
76 ACPI_OPERAND_OBJECT *ObjDesc;
80
81
82 ACPI_FUNCTION_TRACE (UtExecute_HID);
83
84
87 if (ACPI_FAILURE (Status))
88 {
90 }
91
92 /* Get the size of the String to be returned, includes null terminator */
93
94 if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
95 {
97 }
98 else
99 {
100 Length = ObjDesc->String.Length + 1;
101 }
102
103 /* Allocate a buffer for the HID */
104
106 sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
107 if (!Hid)
108 {
110 goto Cleanup;
111 }
112
113 /* Area for the string starts after PNP_DEVICE_ID struct */
114
115 Hid->String = ACPI_ADD_PTR (char, Hid, sizeof (ACPI_PNP_DEVICE_ID));
116
117 /* Convert EISAID to a string or simply copy existing string */
118
119 if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
120 {
121 AcpiExEisaIdToString (Hid->String, ObjDesc->Integer.Value);
122 }
123 else
124 {
125 strcpy (Hid->String, ObjDesc->String.Pointer);
126 }
127
128 Hid->Length = Length;
129 *ReturnId = Hid;
130
131
132Cleanup:
133
134 /* On exit, we must delete the return object */
135
136 AcpiUtRemoveReference (ObjDesc);
138}
#define METHOD_NAME__HID
Definition: acnames.h:59

Referenced by AcpiEvIsPciRootBridge(), AcpiGetObjectInfo(), and AcpiNsGetDeviceCallback().

◆ AcpiUtExecute_STA()

ACPI_STATUS AcpiUtExecute_STA ( ACPI_NAMESPACE_NODE DeviceNode,
UINT32 StatusFlags 
)

Definition at line 269 of file uteval.c.

272{
273 ACPI_OPERAND_OBJECT *ObjDesc;
275
276
277 ACPI_FUNCTION_TRACE (UtExecute_STA);
278
279
281 ACPI_BTYPE_INTEGER, &ObjDesc);
282 if (ACPI_FAILURE (Status))
283 {
284 if (AE_NOT_FOUND == Status)
285 {
286 /*
287 * if _STA does not exist, then (as per the ACPI specification),
288 * the returned flags will indicate that the device is present,
289 * functional, and enabled.
290 */
292 "_STA on %4.4s was not found, assuming device is present\n",
294
296 Status = AE_OK;
297 }
298
300 }
301
302 /* Extract the status flags */
303
304 *Flags = (UINT32) ObjDesc->Integer.Value;
305
306 /* On exit, we must delete the return object */
307
308 AcpiUtRemoveReference (ObjDesc);
310}
#define METHOD_NAME__STA
Definition: acnames.h:74
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by AcpiNsGetDeviceCallback(), and AcpiNsInitOneDevice().

◆ AcpiUtExecute_UID()

ACPI_STATUS AcpiUtExecute_UID ( ACPI_NAMESPACE_NODE DeviceNode,
ACPI_PNP_DEVICE_ID **  ReturnId 
)

Definition at line 160 of file utids.c.

163{
164 ACPI_OPERAND_OBJECT *ObjDesc;
168
169
170 ACPI_FUNCTION_TRACE (UtExecute_UID);
171
172
175 if (ACPI_FAILURE (Status))
176 {
178 }
179
180 /* Get the size of the String to be returned, includes null terminator */
181
182 if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
183 {
185 }
186 else
187 {
188 Length = ObjDesc->String.Length + 1;
189 }
190
191 /* Allocate a buffer for the UID */
192
194 sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
195 if (!Uid)
196 {
198 goto Cleanup;
199 }
200
201 /* Area for the string starts after PNP_DEVICE_ID struct */
202
203 Uid->String = ACPI_ADD_PTR (char, Uid, sizeof (ACPI_PNP_DEVICE_ID));
204
205 /* Convert an Integer to string, or just copy an existing string */
206
207 if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
208 {
209 AcpiExIntegerToString (Uid->String, ObjDesc->Integer.Value);
210 }
211 else
212 {
213 strcpy (Uid->String, ObjDesc->String.Pointer);
214 }
215
216 Uid->Length = Length;
217 *ReturnId = Uid;
218
219
220Cleanup:
221
222 /* On exit, we must delete the return object */
223
224 AcpiUtRemoveReference (ObjDesc);
226}
#define METHOD_NAME__UID
Definition: acnames.h:76
#define ACPI_MAX64_DECIMAL_DIGITS
Definition: actypes.h:492
void AcpiExIntegerToString(char *OutString, UINT64 Value)
Definition: exutils.c:421

Referenced by AcpiGetObjectInfo().

◆ AcpiUtExecutePowerMethods()

ACPI_STATUS AcpiUtExecutePowerMethods ( ACPI_NAMESPACE_NODE DeviceNode,
const char **  MethodNames,
UINT8  MethodCount,
UINT8 OutValues 
)

Definition at line 332 of file uteval.c.

337{
338 ACPI_OPERAND_OBJECT *ObjDesc;
340 ACPI_STATUS FinalStatus = AE_NOT_FOUND;
341 UINT32 i;
342
343
344 ACPI_FUNCTION_TRACE (UtExecutePowerMethods);
345
346
347 for (i = 0; i < MethodCount; i++)
348 {
349 /*
350 * Execute the power method (_SxD or _SxW). The only allowable
351 * return type is an Integer.
352 */
354 ACPI_CAST_PTR (char, MethodNames[i]),
355 ACPI_BTYPE_INTEGER, &ObjDesc);
356 if (ACPI_SUCCESS (Status))
357 {
358 OutValues[i] = (UINT8) ObjDesc->Integer.Value;
359
360 /* Delete the return object */
361
362 AcpiUtRemoveReference (ObjDesc);
363 FinalStatus = AE_OK; /* At least one value is valid */
364 continue;
365 }
366
367 OutValues[i] = ACPI_UINT8_MAX;
368 if (Status == AE_NOT_FOUND)
369 {
370 continue; /* Ignore if not found */
371 }
372
373 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Failed %s on Device %4.4s, %s\n",
374 ACPI_CAST_PTR (char, MethodNames[i]),
376 }
377
378 return_ACPI_STATUS (FinalStatus);
379}
#define ACPI_UINT8_MAX
Definition: actypes.h:64
const char * AcpiFormatException(ACPI_STATUS Status)
Definition: utexcep.c:70

Referenced by AcpiGetObjectInfo().

◆ AcpiUtExit()

void AcpiUtExit ( UINT32  LineNumber,
const char FunctionName,
const char ModuleName,
UINT32  ComponentId 
)

◆ AcpiUtExplicitStrtoul64()

UINT64 AcpiUtExplicitStrtoul64 ( char String)

Definition at line 347 of file utstrtoul64.c.

349{
350 UINT64 ConvertedInteger = 0;
351 UINT32 Base = 10; /* Default is decimal */
352
353
354 ACPI_FUNCTION_TRACE_STR (UtExplicitStrtoul64, String);
355
356
358 {
359 return_VALUE (0);
360 }
361
362 /*
363 * Only Hex and Decimal are supported, as per the ACPI specification.
364 * A "0x" prefix indicates hex; otherwise decimal is assumed.
365 */
367 {
368 Base = 16;
369 }
370
372 {
373 return_VALUE (0);
374 }
375
376 /*
377 * Ignore overflow as per the ACPI specification. This is implemented by
378 * ignoring the return status from the conversion functions called below.
379 * On overflow, the input string is simply truncated.
380 */
381 switch (Base)
382 {
383 case 10:
384 default:
385 AcpiUtConvertDecimalString (String, &ConvertedInteger);
386 break;
387
388 case 16:
389 AcpiUtConvertHexString (String, &ConvertedInteger);
390 break;
391 }
392
393 return_VALUE (ConvertedInteger);
394}
#define return_VALUE(s)
Definition: acoutput.h:499
char AcpiUtRemoveLeadingZeros(char **String)
Definition: utstrsuppt.c:274
char AcpiUtRemoveWhitespace(char **String)
Definition: utstrsuppt.c:303
ACPI_STATUS AcpiUtConvertHexString(char *String, UINT64 *ReturnValuePtr)
Definition: utstrsuppt.c:214
ACPI_STATUS AcpiUtConvertDecimalString(char *String, UINT64 *ReturnValuePtr)
Definition: utstrsuppt.c:152
BOOLEAN AcpiUtDetectHexPrefix(char **String)
Definition: utstrsuppt.c:329
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2439

Referenced by AcpiExConvertToInteger().

◆ AcpiUtGenerateChecksum()

UINT8 AcpiUtGenerateChecksum ( void Table,
UINT32  Length,
UINT8  OriginalChecksum 
)

Definition at line 176 of file utcksum.c.

180{
181 UINT8 Checksum;
182
183
184 /* Sum the entire table as-is */
185
186 Checksum = AcpiUtChecksum ((UINT8 *) Table, Length);
187
188 /* Subtract off the existing checksum value in the table */
189
190 Checksum = (UINT8) (Checksum - OriginalChecksum);
191
192 /* Compute and return the final checksum */
193
194 Checksum = (UINT8) (0 - Checksum);
195 return (Checksum);
196}
ASMGENDATA Table[]
Definition: genincdata.c:61
UINT8 AcpiUtChecksum(UINT8 *Buffer, UINT32 Length)
Definition: utcksum.c:213

Referenced by AcpiUtVerifyCdatChecksum(), and AcpiUtVerifyChecksum().

◆ AcpiUtGetArgumentTypeName()

const char * AcpiUtGetArgumentTypeName ( UINT32  ArgType)

Referenced by AcpiPsGetNextArg().

◆ AcpiUtGetDescriptorLength()

UINT32 AcpiUtGetDescriptorLength ( void Aml)

Definition at line 606 of file utresrc.c.

608{
610
611
612 /*
613 * Get the Resource Length (does not include header length) and add
614 * the header length (depends on if this is a small or large resource)
615 */
616 return (AcpiUtGetResourceLength (Aml) +
618}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN UINT8 * Aml
Definition: acpixf.h:1302
UINT16 AcpiUtGetResourceLength(void *Aml)
Definition: utresrc.c:527
UINT8 AcpiUtGetResourceHeaderLength(void *Aml)
Definition: utresrc.c:572

Referenced by AcpiRsConvertResourcesToAml(), AcpiRsGetListLength(), and AcpiUtWalkAmlResources().

◆ AcpiUtGetDescriptorName()

const char * AcpiUtGetDescriptorName ( void Object)

Definition at line 382 of file utdecode.c.

384{
385
386 if (!Object)
387 {
388 return ("NULL OBJECT");
389 }
390
392 {
393 return ("Not a Descriptor");
394 }
395
397}
#define ACPI_DESC_TYPE_MAX
Definition: acobject.h:578
static const char * AcpiGbl_DescTypeNames[]
Definition: utdecode.c:360

Referenced by AcpiDsInitBufferField(), AcpiExResolveMultiple(), AcpiExResolveOperands(), AcpiNsAttachObject(), AcpiNsLookup(), AcpiUtDeleteObjectDesc(), AcpiUtGetObjectTypeName(), and AcpiUtValidInternalObject().

◆ AcpiUtGetEventName()

const char * AcpiUtGetEventName ( UINT32  EventId)

Definition at line 175 of file utdecode.c.

177{
178
179 if (EventId > ACPI_EVENT_MAX)
180 {
181 return ("InvalidEventID");
182 }
183
184 return (AcpiGbl_EventTypes[EventId]);
185}
#define ACPI_EVENT_MAX
Definition: actypes.h:769
static const char * AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS]
Definition: utdecode.c:164

Referenced by AcpiDisableEvent(), AcpiEnableEvent(), AcpiEvFixedEventDispatch(), AcpiInstallFixedEventHandler(), and AcpiRemoveFixedEventHandler().

◆ AcpiUtGetExpectedReturnTypes()

void AcpiUtGetExpectedReturnTypes ( char Buffer,
UINT32  ExpectedBtypes 
)

Definition at line 158 of file utpredef.c.

161{
162 UINT32 ThisRtype;
163 UINT32 i;
164 UINT32 j;
165
166
167 if (!ExpectedBtypes)
168 {
169 strcpy (Buffer, "NONE");
170 return;
171 }
172
173 j = 1;
174 Buffer[0] = 0;
175 ThisRtype = ACPI_RTYPE_INTEGER;
176
177 for (i = 0; i < ACPI_NUM_RTYPES; i++)
178 {
179 /* If one of the expected types, concatenate the name of this type */
180
181 if (ExpectedBtypes & ThisRtype)
182 {
184 j = 0; /* Use name separator from now on */
185 }
186
187 ThisRtype <<= 1; /* Next Rtype */
188 }
189}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
#define ACPI_NUM_RTYPES
Definition: aclocal.h:485
#define ACPI_RTYPE_INTEGER
Definition: aclocal.h:478
static const char * UtRtypeNames[]
Definition: utpredef.c:57

Referenced by AcpiNsCheckObjectType().

◆ AcpiUtGetInterface()

ACPI_INTERFACE_INFO * AcpiUtGetInterface ( ACPI_STRING  InterfaceName)

Definition at line 425 of file utosi.c.

427{
428 ACPI_INTERFACE_INFO *NextInterface;
429
430
431 NextInterface = AcpiGbl_SupportedInterfaces;
432 while (NextInterface)
433 {
434 if (!strcmp (InterfaceName, NextInterface->Name))
435 {
436 return (NextInterface);
437 }
438
439 NextInterface = NextInterface->Next;
440 }
441
442 return (NULL);
443}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
struct acpi_interface_info * Next
Definition: aclocal.h:1264

Referenced by AcpiInstallInterface(), and AcpiUtOsiImplementation().

◆ AcpiUtGetMutexName()

const char * AcpiUtGetMutexName ( UINT32  MutexId)

Definition at line 479 of file utdecode.c.

481{
482
483 if (MutexId > ACPI_MAX_MUTEX)
484 {
485 return ("Invalid Mutex ID");
486 }
487
488 return (AcpiGbl_MutexNames[MutexId]);
489}
static const char * AcpiGbl_MutexNames[ACPI_NUM_MUTEX]
Definition: utdecode.c:468

Referenced by AcpiUtAcquireMutex(), and AcpiUtReleaseMutex().

◆ AcpiUtGetNextPredefinedMethod()

const ACPI_PREDEFINED_INFO * AcpiUtGetNextPredefinedMethod ( const ACPI_PREDEFINED_INFO ThisName)

Definition at line 82 of file utpredef.c.

84{
85
86 /*
87 * Skip next entry in the table if this name returns a Package
88 * (next entry contains the package info)
89 */
90 if ((ThisName->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE) &&
91 (ThisName->Info.ExpectedBtypes != ACPI_RTYPE_ALL))
92 {
93 ThisName++;
94 }
95
96 ThisName++;
97 return (ThisName);
98}
#define ACPI_RTYPE_ALL
Definition: aclocal.h:483
#define ACPI_RTYPE_PACKAGE
Definition: aclocal.h:481
UINT8 ExpectedBtypes
Definition: aclocal.h:377
ACPI_NAME_INFO Info
Definition: aclocal.h:441

Referenced by AcpiUtMatchPredefinedMethod().

◆ AcpiUtGetNodeName()

const char * AcpiUtGetNodeName ( void Object)

Definition at line 306 of file utdecode.c.

308{
310
311
312 /* Must return a string of exactly 4 characters == ACPI_NAMESEG_SIZE */
313
314 if (!Object)
315 {
316 return ("NULL");
317 }
318
319 /* Check for Root node */
320
321 if ((Object == ACPI_ROOT_OBJECT) ||
322 (Object == AcpiGbl_RootNode))
323 {
324 return ("\"\\\" ");
325 }
326
327 /* Descriptor must be a namespace node */
328
330 {
331 return ("####");
332 }
333
334 /*
335 * Ensure name is valid. The name was validated/repaired when the node
336 * was created, but make sure it has not been corrupted.
337 */
338 AcpiUtRepairName (Node->Name.Ascii);
339
340 /* Return the name */
341
342 return (Node->Name.Ascii);
343}
#define ACPI_DESC_TYPE_NAMED
Definition: acobject.h:577
#define ACPI_ROOT_OBJECT
Definition: actypes.h:500
void AcpiUtRepairName(char *Name)
Definition: utstring.c:183
Definition: dlist.c:348

Referenced by AcpiDsAutoSerializeMethod(), AcpiDsBeginMethodExecution(), AcpiDsGetBankFieldArguments(), AcpiDsGetBufferFieldArguments(), AcpiDsGetRegionArguments(), AcpiDsInitBufferField(), AcpiDsInitOneObject(), AcpiDsLoad1BeginOp(), AcpiDsLoad2BeginOp(), AcpiDsRestartControlMethod(), AcpiDsScopeStackPop(), AcpiDsScopeStackPush(), AcpiEvAddressSpaceDispatch(), AcpiEvAsynchExecuteGpeMethod(), AcpiEvAttachRegion(), AcpiEvInstallSpaceHandler(), AcpiEvPciConfigRegionSetup(), AcpiEvQueueNotifyRequest(), AcpiExAcquireMutex(), AcpiExPrepFieldValue(), AcpiExReleaseMutex(), AcpiExResolveMultiple(), AcpiExSetupRegion(), AcpiNsAttachObject(), AcpiNsDetachObject(), AcpiNsHandleToName(), AcpiNsInitOneObject(), AcpiNsInstallNode(), AcpiNsLookup(), AcpiNsSearchOneScope(), AcpiNsSearchParentTree(), AcpiUtAddAddressRange(), AcpiUtEvaluateObject(), AcpiUtExecute_STA(), AcpiUtExecutePowerMethods(), and AcpiUtRemoveAddressRange().

◆ AcpiUtGetObjectSize()

ACPI_STATUS AcpiUtGetObjectSize ( ACPI_OPERAND_OBJECT Obj,
ACPI_SIZE *  ObjLength 
)

Definition at line 762 of file utobject.c.

765{
767
768
770
771
772 if ((ACPI_GET_DESCRIPTOR_TYPE (InternalObject) ==
774 (InternalObject->Common.Type == ACPI_TYPE_PACKAGE))
775 {
776 Status = AcpiUtGetPackageObjectSize (InternalObject, ObjLength);
777 }
778 else
779 {
780 Status = AcpiUtGetSimpleObjectSize (InternalObject, ObjLength);
781 }
782
783 return (Status);
784}
static ACPI_STATUS AcpiUtGetPackageObjectSize(ACPI_OPERAND_OBJECT *Obj, ACPI_SIZE *ObjLength)
Definition: utobject.c:710
static ACPI_STATUS AcpiUtGetSimpleObjectSize(ACPI_OPERAND_OBJECT *Obj, ACPI_SIZE *ObjLength)
Definition: utobject.c:512

Referenced by AcpiEvaluateObject().

◆ AcpiUtGetObjectTypeName()

const char * AcpiUtGetObjectTypeName ( ACPI_OPERAND_OBJECT ObjDesc)

Definition at line 264 of file utdecode.c.

266{
267 ACPI_FUNCTION_TRACE (UtGetObjectTypeName);
268
269
270 if (!ObjDesc)
271 {
272 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n"));
273 return_STR ("[NULL Object Descriptor]");
274 }
275
276 /* These descriptor types share a common area */
277
280 {
282 "Invalid object descriptor type: 0x%2.2X [%s] (%p)\n",
283 ACPI_GET_DESCRIPTOR_TYPE (ObjDesc),
284 AcpiUtGetDescriptorName (ObjDesc), ObjDesc));
285
286 return_STR ("Invalid object");
287 }
288
289 return_STR (AcpiUtGetTypeName (ObjDesc->Common.Type));
290}
#define return_STR(s)
Definition: acoutput.h:498
const char * AcpiUtGetTypeName(ACPI_OBJECT_TYPE Type)
Definition: utdecode.c:250
const char * AcpiUtGetDescriptorName(void *Object)
Definition: utdecode.c:382

Referenced by AcpiDsInitBufferField(), AcpiDsObjStackPush(), AcpiDsResultPop(), AcpiDsResultPush(), AcpiExConvertToTargetType(), AcpiExDoDebugObject(), AcpiExGetObjectReference(), AcpiExResolveNodeToValue(), AcpiExResolveObject(), AcpiExResolveOperands(), AcpiExSetupRegion(), AcpiExStore(), AcpiExStoreDirectToNode(), AcpiExStoreObjectToIndex(), AcpiExStoreObjectToNode(), AcpiExStoreObjectToObject(), AcpiExWriteSerialBus(), AcpiNsCheckObjectType(), AcpiNsEvaluate(), AcpiNsRepairNullElement(), AcpiNsSimpleRepair(), AcpiNsWrapWithPackage(), AcpiRsCreatePciRoutingTable(), AcpiUtDeleteInternalObj(), AcpiUtEvaluateObject(), AcpiUtGetSimpleObjectSize(), and AcpiUtUpdateRefCount().

◆ AcpiUtGetReferenceName()

const char * AcpiUtGetReferenceName ( ACPI_OPERAND_OBJECT Object)

Definition at line 426 of file utdecode.c.

428{
429
430 if (!Object)
431 {
432 return ("NULL Object");
433 }
434
436 {
437 return ("Not an Operand object");
438 }
439
440 if (Object->Common.Type != ACPI_TYPE_LOCAL_REFERENCE)
441 {
442 return ("Not a Reference object");
443 }
444
445 if (Object->Reference.Class > ACPI_REFCLASS_MAX)
446 {
447 return ("Unknown Reference class");
448 }
449
450 return (AcpiGbl_RefClassNames[Object->Reference.Class]);
451}
@ ACPI_REFCLASS_MAX
Definition: acobject.h:467
#define ACPI_TYPE_LOCAL_REFERENCE
Definition: actypes.h:719
static const char * AcpiGbl_RefClassNames[]
Definition: utdecode.c:414

Referenced by AcpiExDoDebugObject(), AcpiExResolveOperands(), AcpiNsCheckReference(), and AcpiUtGetSimpleObjectSize().

◆ AcpiUtGetRegionName()

const char * AcpiUtGetRegionName ( UINT8  SpaceId)

Definition at line 125 of file utdecode.c.

127{
128
130 {
131 return ("UserDefinedRegion");
132 }
134 {
135 return ("DataTable");
136 }
138 {
139 return ("FunctionalFixedHW");
140 }
142 {
143 return ("InvalidSpaceId");
144 }
145
147}
#define ACPI_NUM_PREDEFINED_REGIONS
Definition: actypes.h:874
#define ACPI_ADR_SPACE_FIXED_HARDWARE
Definition: actypes.h:885
#define ACPI_ADR_SPACE_DATA_TABLE
Definition: actypes.h:884
#define ACPI_USER_REGION_BEGIN
Definition: acconfig.h:197
const char * AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS]
Definition: utdecode.c:107

Referenced by AcpiEvAddressSpaceDispatch(), AcpiEvAttachRegion(), AcpiEvDetachRegion(), AcpiEvExecuteRegMethods(), AcpiEvInitializeRegion(), AcpiEvInstallHandler(), AcpiEvInstallSpaceHandler(), AcpiExAccessRegion(), AcpiExCreateRegion(), AcpiHwRead(), AcpiHwWrite(), AcpiRemoveAddressSpaceHandler(), and AcpiUtCheckAddressRange().

◆ AcpiUtGetResourceEndTag()

ACPI_STATUS AcpiUtGetResourceEndTag ( ACPI_OPERAND_OBJECT ObjDesc,
UINT8 **  EndTag 
)

Definition at line 636 of file utresrc.c.

639{
641
642
643 ACPI_FUNCTION_TRACE (UtGetResourceEndTag);
644
645
646 /* Allow a buffer length of zero */
647
648 if (!ObjDesc->Buffer.Length)
649 {
650 *EndTag = ObjDesc->Buffer.Pointer;
652 }
653
654 /* Validate the template and get a pointer to the EndTag */
655
656 Status = AcpiUtWalkAmlResources (NULL, ObjDesc->Buffer.Pointer,
657 ObjDesc->Buffer.Length, NULL, (void **) EndTag);
658
660}
ACPI_STATUS AcpiUtWalkAmlResources(ACPI_WALK_STATE *WalkState, UINT8 *Aml, ACPI_SIZE AmlLength, ACPI_WALK_AML_CALLBACK UserFunction, void **Context)
Definition: utresrc.c:181

Referenced by AcpiExConcatTemplate().

◆ AcpiUtGetResourceHeaderLength()

UINT8 AcpiUtGetResourceHeaderLength ( void Aml)

Definition at line 572 of file utresrc.c.

574{
576
577
578 /* Examine the large/small bit in the resource header */
579
581 {
582 return (sizeof (AML_RESOURCE_LARGE_HEADER));
583 }
584 else
585 {
586 return (sizeof (AML_RESOURCE_SMALL_HEADER));
587 }
588}
#define ACPI_RESOURCE_NAME_LARGE
Definition: aclocal.h:1300
#define ACPI_GET8(ptr)
Definition: acmacros.h:57

Referenced by AcpiRsGetListLength(), AcpiRsSetResourceLength(), and AcpiUtGetDescriptorLength().

◆ AcpiUtGetResourceLength()

UINT16 AcpiUtGetResourceLength ( void Aml)

Definition at line 527 of file utresrc.c.

529{
530 ACPI_RS_LENGTH ResourceLength;
531
532
534
535
536 /*
537 * Byte 0 contains the descriptor name (Resource Type)
538 * Examine the large/small bit in the resource header
539 */
541 {
542 /* Large Resource type -- bytes 1-2 contain the 16-bit length */
543
544 ACPI_MOVE_16_TO_16 (&ResourceLength, ACPI_ADD_PTR (UINT8, Aml, 1));
545
546 }
547 else
548 {
549 /* Small Resource type -- bits 2:0 of byte 0 contain the length */
550
551 ResourceLength = (UINT16) (ACPI_GET8 (Aml) &
553 }
554
555 return (ResourceLength);
556}
unsigned short UINT16
#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK
Definition: aclocal.h:1304
#define ACPI_MOVE_16_TO_16(d, s)
Definition: acmacros.h:141
UINT16 ACPI_RS_LENGTH
Definition: acrestyp.h:51

Referenced by AcpiRsConvertAmlToResource(), AcpiRsGetListLength(), AcpiUtGetDescriptorLength(), and AcpiUtValidateResource().

◆ AcpiUtGetResourceType()

UINT8 AcpiUtGetResourceType ( void Aml)

Definition at line 487 of file utresrc.c.

489{
491
492
493 /*
494 * Byte 0 contains the descriptor name (Resource Type)
495 * Examine the large/small bit in the resource header
496 */
498 {
499 /* Large Resource Type -- bits 6:0 contain the name */
500
501 return (ACPI_GET8 (Aml));
502 }
503 else
504 {
505 /* Small Resource Type -- bits 6:3 contain the name */
506
508 }
509}
#define ACPI_RESOURCE_NAME_SMALL_MASK
Definition: aclocal.h:1303

Referenced by AcpiRsConvertAmlToResources(), AcpiRsGetListLength(), and AcpiUtWalkAmlResources().

◆ AcpiUtGetTypeName()

◆ AcpiUtHardwareInitialize()

ACPI_STATUS AcpiUtHardwareInitialize ( void  )

◆ AcpiUtHexToAsciiChar()

char AcpiUtHexToAsciiChar ( UINT64  Integer,
UINT32  Position 
)

Definition at line 74 of file uthex.c.

77{
79
81 return (AcpiGbl_HexToAscii[Index & 0xF]);
82}
ACPI_STATUS AcpiUtShortShiftRight(UINT64 Operand, UINT32 Count, UINT64 *OutResult)
Definition: utmath.c:184
static COORD Position
Definition: mouse.c:34
static const char AcpiGbl_HexToAscii[]
Definition: uthex.c:53

Referenced by AcpiExConvertToAscii(), AcpiExEisaIdToString(), and AcpiExPciClsToString().

◆ AcpiUtImplicitStrtoul64()

UINT64 AcpiUtImplicitStrtoul64 ( char String)

Definition at line 259 of file utstrtoul64.c.

261{
262 UINT64 ConvertedInteger = 0;
263
264
265 ACPI_FUNCTION_TRACE_STR (UtImplicitStrtoul64, String);
266
267
269 {
270 return_VALUE (0);
271 }
272
273 /*
274 * Per the ACPI specification, only hexadecimal is supported for
275 * implicit conversions, and the "0x" prefix is "not allowed".
276 * However, allow a "0x" prefix as an ACPI extension.
277 */
279
281 {
282 return_VALUE (0);
283 }
284
285 /*
286 * Ignore overflow as per the ACPI specification. This is implemented by
287 * ignoring the return status from the conversion function called below.
288 * On overflow, the input string is simply truncated.
289 */
290 AcpiUtConvertHexString (String, &ConvertedInteger);
291 return_VALUE (ConvertedInteger);
292}
void AcpiUtRemoveHexPrefix(char **String)
Definition: utstrsuppt.c:357

Referenced by AcpiExConvertToInteger().

◆ AcpiUtInitGlobals()

ACPI_STATUS AcpiUtInitGlobals ( void  )

Definition at line 131 of file utinit.c.

133{
135 UINT32 i;
136
137
138 ACPI_FUNCTION_TRACE (UtInitGlobals);
139
140
141 /* Create all memory caches */
142
144 if (ACPI_FAILURE (Status))
145 {
147 }
148
149 /* Address Range lists */
150
151 for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++)
152 {
153 AcpiGbl_AddressRangeList[i] = NULL;
154 }
155
156 /* Mutex locked flags */
157
158 for (i = 0; i < ACPI_NUM_MUTEX; i++)
159 {
160 AcpiGbl_MutexInfo[i].Mutex = NULL;
161 AcpiGbl_MutexInfo[i].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
162 AcpiGbl_MutexInfo[i].UseCount = 0;
163 }
164
165 for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++)
166 {
167 AcpiGbl_OwnerIdMask[i] = 0;
168 }
169
170 /* Last OwnerID is never valid */
171
172 AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;
173
174 /* Event counters */
175
176 AcpiMethodCount = 0;
177 AcpiSciCount = 0;
178 AcpiGpeCount = 0;
179
180 for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
181 {
182 AcpiFixedEventCount[i] = 0;
183 }
184
185#if (!ACPI_REDUCED_HARDWARE)
186
187 /* GPE/SCI support */
188
189 AcpiGbl_AllGpesInitialized = FALSE;
190 AcpiGbl_GpeXruptListHead = NULL;
191 AcpiGbl_GpeFadtBlocks[0] = NULL;
192 AcpiGbl_GpeFadtBlocks[1] = NULL;
193 AcpiCurrentGpeCount = 0;
194
195 AcpiGbl_GlobalEventHandler = NULL;
196 AcpiGbl_SciHandlerList = NULL;
197
198#endif /* !ACPI_REDUCED_HARDWARE */
199
200 /* Global handlers */
201
202 AcpiGbl_GlobalNotify[0].Handler = NULL;
203 AcpiGbl_GlobalNotify[1].Handler = NULL;
204 AcpiGbl_ExceptionHandler = NULL;
205 AcpiGbl_InitHandler = NULL;
206 AcpiGbl_TableHandler = NULL;
207 AcpiGbl_InterfaceHandler = NULL;
208
209 /* Global Lock support */
210
211 AcpiGbl_GlobalLockSemaphore = NULL;
212 AcpiGbl_GlobalLockMutex = NULL;
213 AcpiGbl_GlobalLockAcquired = FALSE;
214 AcpiGbl_GlobalLockHandle = 0;
215 AcpiGbl_GlobalLockPresent = FALSE;
216
217 /* Miscellaneous variables */
218
219 AcpiGbl_DSDT = NULL;
220 AcpiGbl_CmSingleStep = FALSE;
221 AcpiGbl_Shutdown = FALSE;
222 AcpiGbl_NsLookupCount = 0;
223 AcpiGbl_PsFindCount = 0;
224 AcpiGbl_AcpiHardwarePresent = TRUE;
225 AcpiGbl_LastOwnerIdIndex = 0;
226 AcpiGbl_NextOwnerIdOffset = 0;
227 AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
228 AcpiGbl_OsiMutex = NULL;
229
230 /* Hardware oriented */
231
232 AcpiGbl_EventsInitialized = FALSE;
233 AcpiGbl_SystemAwakeAndRunning = TRUE;
234
235 /* Namespace */
236
237 AcpiGbl_RootNode = NULL;
238 AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
239 AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;
240 AcpiGbl_RootNodeStruct.Type = ACPI_TYPE_DEVICE;
241 AcpiGbl_RootNodeStruct.Parent = NULL;
242 AcpiGbl_RootNodeStruct.Child = NULL;
243 AcpiGbl_RootNodeStruct.Peer = NULL;
244 AcpiGbl_RootNodeStruct.Object = NULL;
245
246
247#ifdef ACPI_DISASSEMBLER
248 AcpiGbl_ExternalList = NULL;
249 AcpiGbl_NumExternalMethods = 0;
250 AcpiGbl_ResolvedExternalMethods = 0;
251#endif
252
253#ifdef ACPI_DEBUG_OUTPUT
254 AcpiGbl_LowestStackPointer = ACPI_CAST_PTR (ACPI_SIZE, ACPI_SIZE_MAX);
255#endif
256
257#ifdef ACPI_DBG_TRACK_ALLOCATIONS
258 AcpiGbl_DisplayFinalMemStats = FALSE;
259 AcpiGbl_DisableMemTracking = FALSE;
260#endif
261
263}
#define DEBUGGER_THREADING
Definition: acefi.h:52
#define ACPI_MUTEX_NOT_ACQUIRED
Definition: aclocal.h:119
#define ACPI_ROOT_NAME
Definition: acnames.h:92
#define ACPI_TYPE_DEVICE
Definition: actypes.h:693
#define ACPI_NUM_FIXED_EVENTS
Definition: actypes.h:770
ACPI_STATUS AcpiUtCreateCaches(void)
Definition: utalloc.c:104

Referenced by AcpiInitializeSubsystem().

◆ AcpiUtInitializeBuffer()

ACPI_STATUS AcpiUtInitializeBuffer ( ACPI_BUFFER Buffer,
ACPI_SIZE  RequiredLength 
)

Definition at line 336 of file utalloc.c.

339{
340 ACPI_SIZE InputBufferLength;
341
342
343 /* Parameter validation */
344
345 if (!Buffer || !RequiredLength)
346 {
347 return (AE_BAD_PARAMETER);
348 }
349
350 /*
351 * Buffer->Length is used as both an input and output parameter. Get the
352 * input actual length and set the output required buffer length.
353 */
354 InputBufferLength = Buffer->Length;
355 Buffer->Length = RequiredLength;
356
357 /*
358 * The input buffer length contains the actual buffer length, or the type
359 * of buffer to be allocated by this routine.
360 */
361 switch (InputBufferLength)
362 {
363 case ACPI_NO_BUFFER:
364
365 /* Return the exception (and the required buffer length) */
366
367 return (AE_BUFFER_OVERFLOW);
368
370 /*
371 * Allocate a new buffer. We directectly call AcpiOsAllocate here to
372 * purposefully bypass the (optionally enabled) internal allocation
373 * tracking mechanism since we only want to track internal
374 * allocations. Note: The caller should use AcpiOsFree to free this
375 * buffer created via ACPI_ALLOCATE_BUFFER.
376 */
378 break;
379
381
382 /* Allocate a new buffer with local interface to allow tracking */
383
385 break;
386
387 default:
388
389 /* Existing buffer: Validate the size of the buffer */
390
392 {
393 return (AE_BUFFER_OVERFLOW);
394 }
395 break;
396 }
397
398 /* Validate allocation from above or input buffer pointer */
399
400 if (!Buffer->Pointer)
401 {
402 return (AE_NO_MEMORY);
403 }
404
405 /* Have a valid buffer, clear it */
406
407 memset (Buffer->Pointer, 0, RequiredLength);
408 return (AE_OK);
409}
#define AE_BUFFER_OVERFLOW
Definition: acexcep.h:119
void * AcpiOsAllocate(ACPI_SIZE Size)
Definition: osl.c:160
#define ACPI_ALLOCATE_BUFFER
Definition: actypes.h:1046
#define ACPI_NO_BUFFER
Definition: actypes.h:1037
#define ACPI_ALLOCATE_LOCAL_BUFFER
Definition: actypes.h:1047
#define memset(x, y, z)
Definition: compat.h:39
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_In_ ULONG _Out_opt_ PULONG RequiredLength
Definition: wmifuncs.h:30

Referenced by AcpiEvaluateObject(), AcpiGetSystemInfo(), AcpiNsHandleToName(), AcpiNsHandleToPathname(), AcpiRsCreateAmlResources(), AcpiRsCreatePciRoutingTable(), AcpiRsCreateResourceList(), and AcpiRsMatchVendorResource().

◆ AcpiUtInitializeInterfaces()

ACPI_STATUS AcpiUtInitializeInterfaces ( void  )

Definition at line 150 of file utosi.c.

152{
154 UINT32 i;
155
156
157 Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
158 if (ACPI_FAILURE (Status))
159 {
160 return (Status);
161 }
162
163 AcpiGbl_SupportedInterfaces = AcpiDefaultSupportedInterfaces;
164
165 /* Link the static list of supported interfaces */
166
167 for (i = 0;
169 i++)
170 {
172 &AcpiDefaultSupportedInterfaces[(ACPI_SIZE) i + 1];
173 }
174
175 AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
176 return (AE_OK);
177}
#define ACPI_ARRAY_LENGTH(x)
Definition: actypes.h:540
static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[]
Definition: utosi.c:91

Referenced by AcpiInitializeSubsystem().

◆ AcpiUtInitStackPtrTrace()

void AcpiUtInitStackPtrTrace ( void  )

Referenced by AcpiInitializeSubsystem().

◆ AcpiUtInstallInterface()

ACPI_STATUS AcpiUtInstallInterface ( ACPI_STRING  InterfaceName)

Definition at line 255 of file utosi.c.

257{
258 ACPI_INTERFACE_INFO *InterfaceInfo;
259
260
261 /* Allocate info block and space for the name string */
262
263 InterfaceInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_INTERFACE_INFO));
264 if (!InterfaceInfo)
265 {
266 return (AE_NO_MEMORY);
267 }
268
269 InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (strlen (InterfaceName) + 1);
270 if (!InterfaceInfo->Name)
271 {
272 ACPI_FREE (InterfaceInfo);
273 return (AE_NO_MEMORY);
274 }
275
276 /* Initialize new info and insert at the head of the global list */
277
278 strcpy (InterfaceInfo->Name, InterfaceName);
279 InterfaceInfo->Flags = ACPI_OSI_DYNAMIC;
280 InterfaceInfo->Next = AcpiGbl_SupportedInterfaces;
281
282 AcpiGbl_SupportedInterfaces = InterfaceInfo;
283 return (AE_OK);
284}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ACPI_OSI_DYNAMIC
Definition: aclocal.h:1271

Referenced by AcpiInstallInterface().

◆ AcpiUtInterfaceTerminate()

ACPI_STATUS AcpiUtInterfaceTerminate ( void  )

Definition at line 194 of file utosi.c.

196{
198 ACPI_INTERFACE_INFO *NextInterface;
199
200
201 Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
202 if (ACPI_FAILURE (Status))
203 {
204 return (Status);
205 }
206
207 NextInterface = AcpiGbl_SupportedInterfaces;
208 while (NextInterface)
209 {
210 AcpiGbl_SupportedInterfaces = NextInterface->Next;
211
212 if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
213 {
214 /* Only interfaces added at runtime can be freed */
215
216 ACPI_FREE (NextInterface->Name);
217 ACPI_FREE (NextInterface);
218 }
219 else
220 {
221 /* Interface is in static list. Reset it to invalid or valid. */
222
223 if (NextInterface->Flags & ACPI_OSI_DEFAULT_INVALID)
224 {
225 NextInterface->Flags |= ACPI_OSI_INVALID;
226 }
227 else
228 {
229 NextInterface->Flags &= ~ACPI_OSI_INVALID;
230 }
231 }
232
233 NextInterface = AcpiGbl_SupportedInterfaces;
234 }
235
236 AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
237 return (AE_OK);
238}
#define ACPI_OSI_DEFAULT_INVALID
Definition: aclocal.h:1273
#define ACPI_OSI_INVALID
Definition: aclocal.h:1270

Referenced by AcpiUtSubsystemShutdown().

◆ AcpiUtIsPciRootBridge()

BOOLEAN AcpiUtIsPciRootBridge ( char Id)

Definition at line 66 of file utmisc.c.

68{
69
70 /*
71 * Check if this is a PCI root bridge.
72 * ACPI 3.0+: check for a PCI Express root also.
73 */
74 if (!(strcmp (Id,
76
77 !(strcmp (Id,
79 {
80 return (TRUE);
81 }
82
83 return (FALSE);
84}
DWORD Id
#define PCI_ROOT_HID_STRING
Definition: actypes.h:426
#define PCI_EXPRESS_ROOT_HID_STRING
Definition: actypes.h:427

Referenced by AcpiEvIsPciRootBridge(), and AcpiGetObjectInfo().

◆ AcpiUtMatchPredefinedMethod()

const ACPI_PREDEFINED_INFO * AcpiUtMatchPredefinedMethod ( char Name)

Definition at line 114 of file utpredef.c.

116{
117 const ACPI_PREDEFINED_INFO *ThisName;
118
119
120 /* Quick check for a predefined name, first character must be underscore */
121
122 if (Name[0] != '_')
123 {
124 return (NULL);
125 }
126
127 /* Search info table for a predefined method/object name */
128
129 ThisName = AcpiGbl_PredefinedMethods;
130 while (ThisName->Info.Name[0])
131 {
132 if (ACPI_COMPARE_NAMESEG (Name, ThisName->Info.Name))
133 {
134 return (ThisName);
135 }
136
137 ThisName = AcpiUtGetNextPredefinedMethod (ThisName);
138 }
139
140 return (NULL); /* Not found */
141}
const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[]
#define ACPI_COMPARE_NAMESEG(a, b)
Definition: actypes.h:564
char Name[ACPI_NAMESEG_SIZE]
Definition: aclocal.h:375
const ACPI_PREDEFINED_INFO * AcpiUtGetNextPredefinedMethod(const ACPI_PREDEFINED_INFO *ThisName)
Definition: utpredef.c:82

Referenced by AcpiNsEvaluate().

◆ AcpiUtMethodError()

void AcpiUtMethodError ( const char ModuleName,
UINT32  LineNumber,
const char Message,
ACPI_NAMESPACE_NODE Node,
const char Path,
ACPI_STATUS  LookupStatus 
)

Definition at line 369 of file uterror.c.

376{
378 ACPI_NAMESPACE_NODE *Node = PrefixNode;
379
380
383
384 if (Path)
385 {
386 Status = AcpiNsGetNode (PrefixNode, Path,
388 if (ACPI_FAILURE (Status))
389 {
390 AcpiOsPrintf ("[Could not get node by pathname]");
391 }
392 }
393
395 AcpiOsPrintf (" due to previous error (%s)",
396 AcpiFormatException (MethodStatus));
397
400}
ACPI_STATUS AcpiNsGetNode(ACPI_NAMESPACE_NODE *PrefixNode, const char *ExternalPathname, UINT32 Flags, ACPI_NAMESPACE_NODE **OutNode)
Definition: nsutils.c:863
#define ACPI_NS_NO_UPSEARCH
Definition: acnamesp.h:62
void AcpiNsPrintNodePathname(ACPI_NAMESPACE_NODE *Node, const char *Msg)
Definition: nsutils.c:75
#define ACPI_MSG_ERROR
Definition: acutils.h:121
#define ACPI_MSG_REDIRECT_BEGIN
Definition: acutils.h:113
#define ACPI_MSG_SUFFIX
Definition: acutils.h:140
#define ACPI_MSG_REDIRECT_END
Definition: acutils.h:114
static const WCHAR Message[]
Definition: register.c:74

◆ AcpiUtMutexInitialize()

ACPI_STATUS AcpiUtMutexInitialize ( void  )

Definition at line 75 of file utmutex.c.

77{
78 UINT32 i;
80
81
82 ACPI_FUNCTION_TRACE (UtMutexInitialize);
83
84
85 /* Create each of the predefined mutex objects */
86
87 for (i = 0; i < ACPI_NUM_MUTEX; i++)
88 {
90 if (ACPI_FAILURE (Status))
91 {
93 }
94 }
95
96 /* Create the spinlocks for use at interrupt level or for speed */
97
98 Status = AcpiOsCreateLock (&AcpiGbl_GpeLock);
99 if (ACPI_FAILURE (Status))
100 {
102 }
103
104 Status = AcpiOsCreateLock (&AcpiGbl_HardwareLock);
105 if (ACPI_FAILURE (Status))
106 {
108 }
109
110 Status = AcpiOsCreateLock (&AcpiGbl_ReferenceCountLock);
111 if (ACPI_FAILURE (Status))
112 {
114 }
115
116 /* Mutex for _OSI support */
117
118 Status = AcpiOsCreateMutex (&AcpiGbl_OsiMutex);
119 if (ACPI_FAILURE (Status))
120 {
122 }
123
124 /* Create the reader/writer lock for namespace access */
125
126 Status = AcpiUtCreateRwLock (&AcpiGbl_NamespaceRwLock);
127 if (ACPI_FAILURE (Status))
128 {
130 }
131
133}
ACPI_STATUS AcpiOsCreateLock(ACPI_SPINLOCK *OutHandle)
Definition: osl.c:463
ACPI_STATUS AcpiUtCreateRwLock(ACPI_RW_LOCK *Lock)
Definition: utlock.c:66
static ACPI_STATUS AcpiUtCreateMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:194

Referenced by AcpiInitializeSubsystem().

◆ AcpiUtMutexTerminate()

void AcpiUtMutexTerminate ( void  )

Definition at line 150 of file utmutex.c.

152{
153 UINT32 i;
154
155
156 ACPI_FUNCTION_TRACE (UtMutexTerminate);
157
158
159 /* Delete each predefined mutex object */
160
161 for (i = 0; i < ACPI_NUM_MUTEX; i++)
162 {
164 }
165
166 AcpiOsDeleteMutex (AcpiGbl_OsiMutex);
167
168 /* Delete the spinlocks */
169
170 AcpiOsDeleteLock (AcpiGbl_GpeLock);
171 AcpiOsDeleteLock (AcpiGbl_HardwareLock);
172 AcpiOsDeleteLock (AcpiGbl_ReferenceCountLock);
173
174 /* Delete the reader/writer lock */
175
176 AcpiUtDeleteRwLock (&AcpiGbl_NamespaceRwLock);
178}
void AcpiOsDeleteLock(ACPI_SPINLOCK Handle)
Definition: osl.c:485
void AcpiUtDeleteRwLock(ACPI_RW_LOCK *Lock)
Definition: utlock.c:85
static void AcpiUtDeleteMutex(ACPI_MUTEX_HANDLE MutexId)
Definition: utmutex.c:227

Referenced by AcpiTerminate().

◆ AcpiUtOsiImplementation()

ACPI_STATUS AcpiUtOsiImplementation ( ACPI_WALK_STATE WalkState)

Definition at line 472 of file utosi.c.

474{
475 ACPI_OPERAND_OBJECT *StringDesc;
476 ACPI_OPERAND_OBJECT *ReturnDesc;
477 ACPI_INTERFACE_INFO *InterfaceInfo;
478 ACPI_INTERFACE_HANDLER InterfaceHandler;
481
482
483 ACPI_FUNCTION_TRACE (UtOsiImplementation);
484
485
486 /* Validate the string input argument (from the AML caller) */
487
488 StringDesc = WalkState->Arguments[0].Object;
489 if (!StringDesc ||
490 (StringDesc->Common.Type != ACPI_TYPE_STRING))
491 {
493 }
494
495 /* Create a return object */
496
498 if (!ReturnDesc)
499 {
501 }
502
503 /* Default return value is 0, NOT SUPPORTED */
504
505 ReturnValue = 0;
506 Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
507 if (ACPI_FAILURE (Status))
508 {
509 AcpiUtRemoveReference (ReturnDesc);
511 }
512
513 /* Lookup the interface in the global _OSI list */
514
515 InterfaceInfo = AcpiUtGetInterface (StringDesc->String.Pointer);
516 if (InterfaceInfo &&
517 !(InterfaceInfo->Flags & ACPI_OSI_INVALID))
518 {
519 /*
520 * The interface is supported.
521 * Update the OsiData if necessary. We keep track of the latest
522 * version of Windows that has been requested by the BIOS.
523 */
524 if (InterfaceInfo->Value > AcpiGbl_OsiData)
525 {
526 AcpiGbl_OsiData = InterfaceInfo->Value;
527 }
528
530 }
531
532 AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
533
534 /*
535 * Invoke an optional _OSI interface handler. The host OS may wish
536 * to do some interface-specific handling. For example, warn about
537 * certain interfaces or override the true/false support value.
538 */
539 InterfaceHandler = AcpiGbl_InterfaceHandler;
540 if (InterfaceHandler)
541 {
542 if (InterfaceHandler (
543 StringDesc->String.Pointer, (UINT32) ReturnValue))
544 {
546 }
547 }
548
550 "ACPI: BIOS _OSI(\"%s\") is %ssupported\n",
551 StringDesc->String.Pointer, ReturnValue == 0 ? "not " : ""));
552
553 /* Complete the return object */
554
555 ReturnDesc->Integer.Value = ReturnValue;
556 WalkState->ReturnDesc = ReturnDesc;
558}
UINT32 void void ** ReturnValue
Definition: acevents.h:216
#define ACPI_DEBUG_PRINT_RAW(pl)
Definition: acoutput.h:476
#define ACPI_DB_INFO
Definition: acoutput.h:153
#define ACPI_UINT64_MAX
Definition: actypes.h:67
UINT32(* ACPI_INTERFACE_HANDLER)(ACPI_STRING InterfaceName, UINT32 Supported)
Definition: actypes.h:1256
union acpi_operand_object * ReturnDesc
Definition: acstruct.h:123
struct acpi_namespace_node Arguments[ACPI_METHOD_NUM_ARGS]
Definition: acstruct.h:103
ACPI_INTERFACE_INFO * AcpiUtGetInterface(ACPI_STRING InterfaceName)
Definition: utosi.c:425

Referenced by AcpiNsRootInitialize().

◆ AcpiUtPopGenericState()

ACPI_GENERIC_STATE * AcpiUtPopGenericState ( ACPI_GENERIC_STATE **  ListHead)

Definition at line 93 of file utstate.c.

95{
97
98
100
101
102 /* Remove the state object at the head of the list (stack) */
103
104 State = *ListHead;
105 if (State)
106 {
107 /* Update the list head */
108
109 *ListHead = State->Common.Next;
110 }
111
112 return (State);
113}

Referenced by AcpiDsExecEndControlOp(), AcpiDsResultStackPop(), AcpiDsScopeStackPop(), AcpiPsCleanupScope(), AcpiPsCompleteOp(), AcpiPsParseLoop(), AcpiPsPopScope(), AcpiUtUpdateObjectReference(), and AcpiUtWalkPackageTree().

◆ AcpiUtPredefinedBiosError()

void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedBiosError ( const char ModuleName,
UINT32  LineNumber,
char Pathname,
UINT16  NodeFlags,
const char Format,
  ... 
)

Definition at line 177 of file uterror.c.

184{
185 va_list ArgList;
186
187
188 /*
189 * Warning messages for this method/object will be disabled after the
190 * first time a validation fails or an object is successfully repaired.
191 */
192 if (NodeFlags & ANOBJ_EVALUATED)
193 {
194 return;
195 }
196
198
199 va_start (ArgList, Format);
200 AcpiOsVprintf (Format, ArgList);
202 va_end (ArgList);
203}
#define ANOBJ_EVALUATED
Definition: aclocal.h:220
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
void AcpiOsVprintf(const char *Format, va_list Args)
Definition: osl.c:865
#define ACPI_MSG_BIOS_ERROR
Definition: acutils.h:131

◆ AcpiUtPredefinedInfo()

void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedInfo ( const char ModuleName,
UINT32  LineNumber,
char Pathname,
UINT16  NodeFlags,
const char Format,
  ... 
)

Definition at line 128 of file uterror.c.

135{
136 va_list ArgList;
137
138
139 /*
140 * Warning messages for this method/object will be disabled after the
141 * first time a validation fails or an object is successfully repaired.
142 */
143 if (NodeFlags & ANOBJ_EVALUATED)
144 {
145 return;
146 }
147
149
150 va_start (ArgList, Format);
151 AcpiOsVprintf (Format, ArgList);
153 va_end (ArgList);
154}
#define ACPI_MSG_INFO
Definition: acutils.h:127

◆ AcpiUtPredefinedWarning()

void ACPI_INTERNAL_VAR_XFACE AcpiUtPredefinedWarning ( const char ModuleName,
UINT32  LineNumber,
char Pathname,
UINT16  NodeFlags,
const char Format,
  ... 
)

Definition at line 79 of file uterror.c.

86{
87 va_list ArgList;
88
89
90 /*
91 * Warning messages for this method/object will be disabled after the
92 * first time a validation fails or an object is successfully repaired.
93 */
94 if (NodeFlags & ANOBJ_EVALUATED)
95 {
96 return;
97 }
98
100
101 va_start (ArgList, Format);
102 AcpiOsVprintf (Format, ArgList);
104 va_end (ArgList);
105}
#define ACPI_MSG_WARNING
Definition: acutils.h:124

◆ AcpiUtPrefixedNamespaceError()

void AcpiUtPrefixedNamespaceError ( const char ModuleName,
UINT32  LineNumber,
ACPI_GENERIC_STATE PrefixScope,
const char InternalName,
ACPI_STATUS  LookupStatus 
)

Definition at line 227 of file uterror.c.

233{
234 char *FullPath;
235 const char *Message;
236
237
238 /*
239 * Main cases:
240 * 1) Object creation, object must not already exist
241 * 2) Object lookup, object must exist
242 */
243 switch (LookupStatus)
244 {
246
248 Message = "Failure creating named object";
249 break;
250
251 case AE_NOT_FOUND:
252
254 Message = "Could not resolve symbol";
255 break;
256
257 default:
258
260 Message = "Failure resolving symbol";
261 break;
262 }
263
264 /* Concatenate the prefix path and the internal path */
265
266 FullPath = AcpiNsBuildPrefixedPathname (PrefixScope, InternalPath);
267
268 AcpiOsPrintf ("%s [%s], %s", Message,
269 FullPath ? FullPath : "Could not get pathname",
270 AcpiFormatException (LookupStatus));
271
272 if (FullPath)
273 {
274 ACPI_FREE (FullPath);
275 }
276
278}
char * AcpiNsBuildPrefixedPathname(ACPI_GENERIC_STATE *PrefixScope, const char *InternalPath)
Definition: nsnames.c:423
@ InternalPath
Definition: bl.h:284

◆ AcpiUtPrintString()

void AcpiUtPrintString ( char String,
UINT16  MaxLength 
)

Definition at line 69 of file utstring.c.

72{
73 UINT32 i;
74
75
76 if (!String)
77 {
78 AcpiOsPrintf ("<\"NULL STRING PTR\">");
79 return;
80 }
81
82 AcpiOsPrintf ("\"");
83 for (i = 0; (i < MaxLength) && String[i]; i++)
84 {
85 /* Escape sequences */
86
87 switch (String[i])
88 {
89 case 0x07:
90
91 AcpiOsPrintf ("\\a"); /* BELL */
92 break;
93
94 case 0x08:
95
96 AcpiOsPrintf ("\\b"); /* BACKSPACE */
97 break;
98
99 case 0x0C:
100
101 AcpiOsPrintf ("\\f"); /* FORMFEED */
102 break;
103
104 case 0x0A:
105
106 AcpiOsPrintf ("\\n"); /* LINEFEED */
107 break;
108
109 case 0x0D:
110
111 AcpiOsPrintf ("\\r"); /* CARRIAGE RETURN*/
112 break;
113
114 case 0x09:
115
116 AcpiOsPrintf ("\\t"); /* HORIZONTAL TAB */
117 break;
118
119 case 0x0B:
120
121 AcpiOsPrintf ("\\v"); /* VERTICAL TAB */
122 break;
123
124 case '\'': /* Single Quote */
125 case '\"': /* Double Quote */
126 case '\\': /* Backslash */
127
128 AcpiOsPrintf ("\\%c", (int) String[i]);
129 break;
130
131 default:
132
133 /* Check for printable character or hex escape */
134
135 if (isprint ((int) String[i]))
136 {
137 /* This is a normal character */
138
139 AcpiOsPrintf ("%c", (int) String[i]);
140 }
141 else
142 {
143 /* All others will be Hex escapes */
144
145 AcpiOsPrintf ("\\x%2.2X", (INT32) String[i]);
146 }
147 break;
148 }
149 }
150
151 AcpiOsPrintf ("\"");
152
153 if (i == MaxLength && String[i])
154 {
155 AcpiOsPrintf ("...");
156 }
157}

◆ AcpiUtPtrExit()

void AcpiUtPtrExit ( UINT32  LineNumber,
const char FunctionName,
const char ModuleName,
UINT32  ComponentId,
UINT8 Ptr 
)

◆ AcpiUtPushGenericState()

void AcpiUtPushGenericState ( ACPI_GENERIC_STATE **  ListHead,
ACPI_GENERIC_STATE State 
)

Definition at line 65 of file utstate.c.

68{
70
71
72 /* Push the state object onto the front of the list (stack) */
73
74 State->Common.Next = *ListHead;
75 *ListHead = State;
76 return;
77}

Referenced by AcpiDsExecBeginControlOp(), AcpiDsResultStackPush(), AcpiDsScopeStackPush(), AcpiPsPushScope(), AcpiUtCreateUpdateStateAndPush(), and AcpiUtWalkPackageTree().

◆ AcpiUtReleaseMutex()

ACPI_STATUS AcpiUtReleaseMutex ( ACPI_MUTEX_HANDLE  MutexId)

Definition at line 348 of file utmutex.c.

350{
351 ACPI_FUNCTION_NAME (UtReleaseMutex);
352
353
354 ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n",
356
357 if (MutexId > ACPI_MAX_MUTEX)
358 {
359 return (AE_BAD_PARAMETER);
360 }
361
362 /*
363 * Mutex must be acquired in order to release it!
364 */
365 if (AcpiGbl_MutexInfo[MutexId].ThreadId == ACPI_MUTEX_NOT_ACQUIRED)
366 {
368 "Mutex [%s] (0x%X) is not acquired, cannot release",
369 AcpiUtGetMutexName (MutexId), MutexId));
370
371 return (AE_NOT_ACQUIRED);
372 }
373
374#ifdef ACPI_MUTEX_DEBUG
375 {
376 UINT32 i;
377 /*
378 * Mutex debug code, for internal debugging only.
379 *
380 * Deadlock prevention. Check if this thread owns any mutexes of value
381 * greater than this one. If so, the thread has violated the mutex
382 * ordering rule. This indicates a coding error somewhere in
383 * the ACPI subsystem code.
384 */
385 for (i = MutexId; i < ACPI_NUM_MUTEX; i++)
386 {
387 if (AcpiGbl_MutexInfo[i].ThreadId == AcpiOsGetThreadId ())
388 {
389 if (i == MutexId)
390 {
391 continue;
392 }
393
395 "Invalid release order: owns [%s], releasing [%s]",
397
398 return (AE_RELEASE_DEADLOCK);
399 }
400 }
401 }
402#endif
403
404 /* Mark unlocked FIRST */
405
406 AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED;
407
408 AcpiOsReleaseMutex (AcpiGbl_MutexInfo[MutexId].Mutex);
409 return (AE_OK);
410}
#define AE_RELEASE_DEADLOCK
Definition: acexcep.h:127
#define AE_NOT_ACQUIRED
Definition: acexcep.h:128

Referenced by AcpiAnyGpeStatusSet(), AcpiAttachData(), AcpiCheckAddressRange(), AcpiDebugTrace(), AcpiDetachData(), AcpiDisableAllGpes(), AcpiEnableAllRuntimeGpes(), AcpiEnableAllWakeupGpes(), AcpiEvDeleteGpeBlock(), AcpiEvDetachRegion(), AcpiEvExecuteOrphanRegMethod(), AcpiEvGpeInitialize(), AcpiEvInitializeOpRegions(), AcpiEvInstallGpeBlock(), AcpiEvInstallGpeHandler(), AcpiEvInstallRegionHandlers(), AcpiEvUpdateGpes(), AcpiExExitInterpreter(), AcpiGetData(), AcpiGetDevices(), AcpiGetName(), AcpiGetNextObject(), AcpiGetObjectInfo(), AcpiGetParent(), AcpiGetTable(), AcpiGetTableByIndex(), AcpiGetType(), AcpiInstallAddressSpaceHandler(), AcpiInstallExceptionHandler(), AcpiInstallFixedEventHandler(), AcpiInstallGlobalEventHandler(), AcpiInstallGpeBlock(), AcpiInstallMethod(), AcpiInstallNotifyHandler(), AcpiInstallSciHandler(), AcpiInstallTableHandler(), AcpiNsDeleteNamespaceByOwner(), AcpiNsDeleteNamespaceSubtree(), AcpiNsGetDeviceCallback(), AcpiNsGetNode(), AcpiNsRootInitialize(), AcpiNsTerminate(), AcpiNsWalkNamespace(), AcpiPutTable(), AcpiReallocateRootTable(), AcpiRemoveAddressSpaceHandler(), AcpiRemoveFixedEventHandler(), AcpiRemoveGpeBlock(), AcpiRemoveGpeHandler(), AcpiRemoveNotifyHandler(), AcpiRemoveSciHandler(), AcpiRemoveTableHandler(), AcpiTbAllocateOwnerId(), AcpiTbDeleteNamespaceByOwner(), AcpiTbFindTable(), AcpiTbGetOwnerId(), AcpiTbInstallStandardTable(), AcpiTbIsTableLoaded(), AcpiTbLoadNamespace(), AcpiTbReleaseOwnerId(), AcpiTbSetTableLoadedFlag(), AcpiTbTerminate(), AcpiUnloadParentTable(), AcpiUpdateAllGpes(), AcpiUtAllocateOwnerId(), AcpiUtReleaseOwnerId(), and AcpiWalkNamespace().

◆ AcpiUtReleaseOwnerId()

void AcpiUtReleaseOwnerId ( ACPI_OWNER_ID OwnerId)

Definition at line 190 of file utownerid.c.

192{
193 ACPI_OWNER_ID OwnerId = *OwnerIdPtr;
196 UINT32 Bit;
197
198
199 ACPI_FUNCTION_TRACE_U32 (UtReleaseOwnerId, OwnerId);
200
201
202 /* Always clear the input OwnerId (zero is an invalid ID) */
203
204 *OwnerIdPtr = 0;
205
206 /* Zero is not a valid OwnerID */
207
208 if (OwnerId == 0)
209 {
210 ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%3.3X", OwnerId));
212 }
213
214 /* Mutex for the global ID mask */
215
217 if (ACPI_FAILURE (Status))
218 {
220 }
221
222 /* Normalize the ID to zero */
223
224 OwnerId--;
225
226 /* Decode ID to index/offset pair */
227
229 Bit = (UINT32) 1 << ACPI_MOD_32 (OwnerId);
230
231 /* Free the owner ID only if it is valid */
232
233 if (AcpiGbl_OwnerIdMask[Index] & Bit)
234 {
235 AcpiGbl_OwnerIdMask[Index] ^= Bit;
236 }
237 else
238 {
240 "Attempted release of non-allocated OwnerId: 0x%3.3X", OwnerId + 1));
241 }
242
245}
#define ACPI_DIV_32(a)
Definition: acmacros.h:222
#define ACPI_MOD_32(a)
Definition: acmacros.h:224

Referenced by AcpiDsTerminateControlMethod(), and AcpiTbReleaseOwnerId().

◆ AcpiUtReleaseReadLock()

ACPI_STATUS AcpiUtReleaseReadLock ( ACPI_RW_LOCK Lock)

Definition at line 143 of file utlock.c.

145{
147
148
150 if (ACPI_FAILURE (Status))
151 {
152 return (Status);
153 }
154
155 /* Release the write lock only for the very last reader */
156
157 Lock->NumReaders--;
158 if (Lock->NumReaders == 0)
159 {
160 AcpiOsReleaseMutex (Lock->WriterMutex);
161 }
162
163 AcpiOsReleaseMutex (Lock->ReaderMutex);
164 return (Status);
165}

Referenced by AcpiWalkNamespace().

◆ AcpiUtReleaseWriteLock()

void AcpiUtReleaseWriteLock ( ACPI_RW_LOCK Lock)

Definition at line 197 of file utlock.c.

199{
200
201 AcpiOsReleaseMutex (Lock->WriterMutex);
202}

Referenced by AcpiTbDeleteNamespaceByOwner().

◆ AcpiUtRemoveAddressRange()

void AcpiUtRemoveAddressRange ( ACPI_ADR_SPACE_TYPE  SpaceId,
ACPI_NAMESPACE_NODE RegionNode 
)

Definition at line 139 of file utaddress.c.

142{
143 ACPI_ADDRESS_RANGE *RangeInfo;
144 ACPI_ADDRESS_RANGE *Prev;
145
146
147 ACPI_FUNCTION_TRACE (UtRemoveAddressRange);
148
149
152 {
154 }
155
156 /* Get the appropriate list head and check the list */
157
158 RangeInfo = Prev = AcpiGbl_AddressRangeList[SpaceId];
159 while (RangeInfo)
160 {
161 if (RangeInfo->RegionNode == RegionNode)
162 {
163 if (RangeInfo == Prev) /* Found at list head */
164 {
165 AcpiGbl_AddressRangeList[SpaceId] = RangeInfo->Next;
166 }
167 else
168 {
169 Prev->Next = RangeInfo->Next;
170 }
171
173 "\nRemoved [%4.4s] address range: 0x%8.8X%8.8X-0x%8.8X%8.8X\n",
174 AcpiUtGetNodeName (RangeInfo->RegionNode),
175 ACPI_FORMAT_UINT64 (RangeInfo->StartAddress),
176 ACPI_FORMAT_UINT64 (RangeInfo->EndAddress)));
177
178 ACPI_FREE (RangeInfo);
180 }
181
182 Prev = RangeInfo;
183 RangeInfo = RangeInfo->Next;
184 }
185
187}

Referenced by AcpiNsDetachObject(), and AcpiUtDeleteInternalObj().

◆ AcpiUtRemoveHexPrefix()

void AcpiUtRemoveHexPrefix ( char **  String)

Definition at line 357 of file utstrsuppt.c.

359{
360 if ((**String == ACPI_ASCII_ZERO) &&
361 (tolower ((int) *(*String + 1)) == 'x'))
362 {
363 *String += 2; /* Go past the leading 0x */
364 }
365}
int tolower(int c)
Definition: utclib.c:902

Referenced by AcpiUtDetectHexPrefix(), and AcpiUtImplicitStrtoul64().

◆ AcpiUtRemoveInterface()

ACPI_STATUS AcpiUtRemoveInterface ( ACPI_STRING  InterfaceName)

Definition at line 301 of file utosi.c.

303{
304 ACPI_INTERFACE_INFO *PreviousInterface;
305 ACPI_INTERFACE_INFO *NextInterface;
306
307
308 PreviousInterface = NextInterface = AcpiGbl_SupportedInterfaces;
309 while (NextInterface)
310 {
311 if (!strcmp (InterfaceName, NextInterface->Name))
312 {
313 /*
314 * Found: name is in either the static list
315 * or was added at runtime
316 */
317 if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
318 {
319 /* Interface was added dynamically, remove and free it */
320
321 if (PreviousInterface == NextInterface)
322 {
323 AcpiGbl_SupportedInterfaces = NextInterface->Next;
324 }
325 else
326 {
327 PreviousInterface->Next = NextInterface->Next;
328 }
329
330 ACPI_FREE (NextInterface->Name);
331 ACPI_FREE (NextInterface);
332 }
333 else
334 {
335 /*
336 * Interface is in static list. If marked invalid, then
337 * it does not actually exist. Else, mark it invalid.
338 */
339 if (NextInterface->Flags & ACPI_OSI_INVALID)
340 {
341 return (AE_NOT_EXIST);
342 }
343
344 NextInterface->Flags |= ACPI_OSI_INVALID;
345 }
346
347 return (AE_OK);
348 }
349
350 PreviousInterface = NextInterface;
351 NextInterface = NextInterface->Next;
352 }
353
354 /* Interface was not found */
355
356 return (AE_NOT_EXIST);
357}

Referenced by AcpiRemoveInterface().

◆ AcpiUtRemoveLeadingZeros()

char AcpiUtRemoveLeadingZeros ( char **  String)

Definition at line 274 of file utstrsuppt.c.

276{
277
278 while (**String == ACPI_ASCII_ZERO)
279 {
280 *String += 1;
281 }
282
283 return (**String);
284}

Referenced by AcpiUtExplicitStrtoul64(), AcpiUtImplicitStrtoul64(), and AcpiUtStrtoul64().

◆ AcpiUtRemoveReference()

void AcpiUtRemoveReference ( ACPI_OPERAND_OBJECT Object)

Definition at line 790 of file utdelete.c.

792{
793
794 ACPI_FUNCTION_NAME (UtRemoveReference);
795
796
797 /*
798 * Allow a NULL pointer to be passed in, just ignore it. This saves
799 * each caller from having to check. Also, ignore NS nodes.
800 */
801 if (!Object ||
803
804 {
805 return;
806 }
807
808 /* Ensure that we have a valid object */
809
811 {
812 return;
813 }
814
816 "%s: Obj %p Current Refs=%X [To Be Decremented]\n",
817 ACPI_GET_FUNCTION_NAME, Object, Object->Common.ReferenceCount));
818
819 /*
820 * Decrement the reference count, and only actually delete the object
821 * if the reference count becomes 0. (Must also decrement the ref count
822 * of all subobjects!)
823 */
825 return;
826}
#define ACPI_GET_FUNCTION_NAME
Definition: acgcc.h:67
#define REF_DECREMENT
Definition: acutils.h:182

Referenced by AcpiDsBuildInternalBufferObj(), AcpiDsBuildInternalObject(), AcpiDsBuildInternalPackageObj(), AcpiDsCallControlMethod(), AcpiDsClearImplicitReturn(), AcpiDsClearOperands(), AcpiDsCreateBufferField(), AcpiDsCreateNode(), AcpiDsDeleteResultIfNotUsed(), AcpiDsEvalBankFieldOperands(), AcpiDsEvalDataObjectOperands(), AcpiDsEvalRegionOperands(), AcpiDsEvalTableRegionOperands(), AcpiDsEvaluateNamePath(), AcpiDsExecEndControlOp(), AcpiDsGetFieldNames(), AcpiDsGetPredicateValue(), AcpiDsInitBufferField(), AcpiDsLoad2EndOp(), AcpiDsMethodDataDeleteValue(), AcpiDsObjStackPopAndDelete(), AcpiDsResolvePackageElement(), AcpiDsRestartControlMethod(), AcpiDsStoreObjectToLocal(), AcpiEvaluateObject(), AcpiEvDetachRegion(), AcpiEvExecuteRegMethod(), AcpiEvInstallSpaceHandler(), AcpiExCreateEvent(), AcpiExCreateMethod(), AcpiExCreateMutex(), AcpiExCreatePowerResource(), AcpiExCreateProcessor(), AcpiExCreateRegion(), AcpiExDoConcatenate(), AcpiExDoLogicalOp(), AcpiExLoadOp(), AcpiExLoadTableOp(), AcpiExOpcode_0A_0T_1R(), AcpiExOpcode_1A_0T_1R(), AcpiExOpcode_1A_1T_1R(), AcpiExOpcode_2A_0T_1R(), AcpiExOpcode_2A_1T_1R(), AcpiExOpcode_2A_2T_1R(), AcpiExOpcode_3A_1T_1R(), AcpiExOpcode_6A_0T_1R(), AcpiExPrepFieldValue(), AcpiExReadDataFromField(), AcpiExResolveMultiple(), AcpiExResolveObjectToValue(), AcpiExResolveOperands(), AcpiExStoreDirectToNode(), AcpiExStoreObjectToIndex(), AcpiExStoreObjectToObject(), AcpiGetSleepTypeData(), AcpiInstallGpeBlock(), AcpiInstallMethod(), AcpiInstallNotifyHandler(), AcpiNsDeleteNode(), AcpiNsDetachData(), AcpiNsDetachObject(), AcpiNsEvaluate(), AcpiNsExecuteTable(), AcpiNsRemoveElement(), AcpiNsRepair_CID(), AcpiNsRepair_FDE(), AcpiNsRepair_HID(), AcpiNsResolveReferences(), AcpiNsRootInitialize(), AcpiNsSearchAndEnter(), AcpiNsSimpleRepair(), AcpiPsParseAml(), AcpiRemoveAddressSpaceHandler(), AcpiRemoveNotifyHandler(), AcpiRsGetAeiMethodData(), AcpiRsGetCrsMethodData(), AcpiRsGetMethodData(), AcpiRsGetPrsMethodData(), AcpiRsGetPrtMethodData(), AcpiRsSetSrsMethodData(), AcpiUtCopyEpackageToIpackage(), AcpiUtCopyEsimpleToIsimple(), AcpiUtCopyIelementToIelement(), AcpiUtCopyIobjectToIobject(), AcpiUtCopyIpackageToIpackage(), AcpiUtCreateBufferObject(), AcpiUtCreateStringObject(), AcpiUtDeleteInternalObj(), AcpiUtDeleteInternalObjectList(), AcpiUtEvaluateNumericObject(), AcpiUtEvaluateObject(), AcpiUtExecute_CID(), AcpiUtExecute_CLS(), AcpiUtExecute_HID(), AcpiUtExecute_STA(), AcpiUtExecute_UID(), AcpiUtExecutePowerMethods(), and AcpiUtOsiImplementation().

◆ AcpiUtRemoveWhitespace()

char AcpiUtRemoveWhitespace ( char **  String)

Definition at line 303 of file utstrsuppt.c.

305{
306
307 while (isspace ((UINT8) **String))
308 {
309 *String += 1;
310 }
311
312 return (**String);
313}
#define isspace(c)
Definition: acclib.h:69

Referenced by AcpiUtExplicitStrtoul64(), AcpiUtImplicitStrtoul64(), and AcpiUtStrtoul64().

◆ AcpiUtRepairName()

void AcpiUtRepairName ( char Name)

Definition at line 183 of file utstring.c.

185{
186 UINT32 i;
187 BOOLEAN FoundBadChar = FALSE;
188 UINT32 OriginalName;
189
190
191 ACPI_FUNCTION_NAME (UtRepairName);
192
193
194 /*
195 * Special case for the root node. This can happen if we get an
196 * error during the execution of module-level code.
197 */
199 {
200 return;
201 }
202
203 ACPI_COPY_NAMESEG (&OriginalName, &Name[0]);
204
205 /* Check each character in the name */
206
207 for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
208 {
209 if (AcpiUtValidNameChar (Name[i], i))
210 {
211 continue;
212 }
213
214 /*
215 * Replace a bad character with something printable, yet technically
216 * "odd". This prevents any collisions with existing "good"
217 * names in the namespace.
218 */
219 Name[i] = '_';
220 FoundBadChar = TRUE;
221 }
222
223 if (FoundBadChar)
224 {
225 /* Report warning only if in strict mode or debug mode */
226
227 if (!AcpiGbl_EnableInterpreterSlack)
228 {
230 "Invalid character(s) in name (0x%.8X) %p, repaired: [%4.4s]",
231 OriginalName, Name, &Name[0]));
232 }
233 else
234 {
236 "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]",
237 OriginalName, Name));
238 }
239 }
240}
unsigned char BOOLEAN
#define ACPI_ROOT_PATHNAME
Definition: acnames.h:93
#define ACPI_COPY_NAMESEG(dest, src)
Definition: actypes.h:565
#define ACPI_NAMESEG_SIZE
Definition: actypes.h:415
BOOLEAN AcpiUtValidNameChar(char Character, UINT32 Position)
Definition: utascii.c:102

Referenced by AcpiNsExternalizeName(), AcpiNsSearchAndEnter(), and AcpiUtGetNodeName().

◆ AcpiUtReportError()

void AcpiUtReportError ( char ModuleName,
UINT32  LineNumber 
)

◆ AcpiUtReportInfo()

void AcpiUtReportInfo ( char ModuleName,
UINT32  LineNumber 
)

◆ AcpiUtReportWarning()

void AcpiUtReportWarning ( char ModuleName,
UINT32  LineNumber 
)

◆ AcpiUtSetIntegerWidth()

void AcpiUtSetIntegerWidth ( UINT8  Revision)

Definition at line 181 of file utmisc.c.

183{
184
185 if (Revision < 2)
186 {
187 /* 32-bit case */
188
189 AcpiGbl_IntegerBitWidth = 32;
190 AcpiGbl_IntegerNybbleWidth = 8;
191 AcpiGbl_IntegerByteWidth = 4;
192 }
193 else
194 {
195 /* 64-bit case (ACPI 2.0+) */
196
197 AcpiGbl_IntegerBitWidth = 64;
198 AcpiGbl_IntegerNybbleWidth = 16;
199 AcpiGbl_IntegerByteWidth = 8;
200 }
201}
_In_ ULONG Revision
Definition: rtlfuncs.h:1130

Referenced by AcpiTbInstallTableWithOverride().

◆ AcpiUtShortDivide()

ACPI_STATUS AcpiUtShortDivide ( UINT64  InDividend,
UINT32  Divisor,
UINT64 OutQuotient,
UINT32 OutRemainder 
)

Definition at line 337 of file utmath.c.

342{
343 UINT64_OVERLAY DividendOvl;
344 UINT64_OVERLAY Quotient;
345 UINT32 Remainder32;
346
347
348 ACPI_FUNCTION_TRACE (UtShortDivide);
349
350
351 /* Always check for a zero divisor */
352
353 if (Divisor == 0)
354 {
355 ACPI_ERROR ((AE_INFO, "Divide by zero"));
357 }
358
359 DividendOvl.Full = Dividend;
360
361 /*
362 * The quotient is 64 bits, the remainder is always 32 bits,
363 * and is generated by the second divide.
364 */
365 ACPI_DIV_64_BY_32 (0, DividendOvl.Part.Hi, Divisor,
366 Quotient.Part.Hi, Remainder32);
367
368 ACPI_DIV_64_BY_32 (Remainder32, DividendOvl.Part.Lo, Divisor,
369 Quotient.Part.Lo, Remainder32);
370
371 /* Return only what was requested */
372
373 if (OutQuotient)
374 {
375 *OutQuotient = Quotient.Full;
376 }
377 if (OutRemainder)
378 {
379 *OutRemainder = Remainder32;
380 }
381
383}

Referenced by AcpiExConvertToAscii(), AcpiExDigitsNeeded(), AcpiExIntegerToString(), AcpiExOpcode_1A_1T_1R(), AcpiExSystemMemorySpaceHandler(), AcpiGetTimerDuration(), and AcpiUtStrtoulMultiply64().

◆ AcpiUtShortMultiply()

ACPI_STATUS AcpiUtShortMultiply ( UINT64  InMultiplicand,
UINT32  Multiplier,
UINT64 Outproduct 
)

Definition at line 88 of file utmath.c.

92{
93 UINT64_OVERLAY MultiplicandOvl;
94 UINT64_OVERLAY Product;
95 UINT32 Carry32;
96
97
98 ACPI_FUNCTION_TRACE (UtShortMultiply);
99
100
101 MultiplicandOvl.Full = Multiplicand;
102
103 /*
104 * The Product is 64 bits, the carry is always 32 bits,
105 * and is generated by the second multiply.
106 */
107 ACPI_MUL_64_BY_32 (0, MultiplicandOvl.Part.Hi, Multiplier,
108 Product.Part.Hi, Carry32);
109
110 ACPI_MUL_64_BY_32 (0, MultiplicandOvl.Part.Lo, Multiplier,
111 Product.Part.Lo, Carry32);
112
113 Product.Part.Hi += Carry32;
114
115 /* Return only what was requested */
116
117 if (OutProduct)
118 {
119 *OutProduct = Product.Full;
120 }
121
123}

Referenced by AcpiUtScanNumber().

◆ AcpiUtShortShiftLeft()

ACPI_STATUS AcpiUtShortShiftLeft ( UINT64  Operand,
UINT32  Count,
UINT64 OutResult 
)

Definition at line 139 of file utmath.c.

143{
144 UINT64_OVERLAY OperandOvl;
145
146
147 ACPI_FUNCTION_TRACE (UtShortShiftLeft);
148
149
150 OperandOvl.Full = Operand;
151
152 if ((Count & 63) >= 32)
153 {
154 OperandOvl.Part.Hi = OperandOvl.Part.Lo;
155 OperandOvl.Part.Lo = 0;
156 Count = (Count & 63) - 32;
157 }
158 ACPI_SHIFT_LEFT_64_BY_32 (OperandOvl.Part.Hi,
159 OperandOvl.Part.Lo, Count);
160
161 /* Return only what was requested */
162
163 if (OutResult)
164 {
165 *OutResult = OperandOvl.Full;
166 }
167
169}

◆ AcpiUtShortShiftRight()

ACPI_STATUS AcpiUtShortShiftRight ( UINT64  Operand,
UINT32  Count,
UINT64 OutResult 
)

Definition at line 184 of file utmath.c.

188{
189 UINT64_OVERLAY OperandOvl;
190
191
192 ACPI_FUNCTION_TRACE (UtShortShiftRight);
193
194
195 OperandOvl.Full = Operand;
196
197 if ((Count & 63) >= 32)
198 {
199 OperandOvl.Part.Lo = OperandOvl.Part.Hi;
200 OperandOvl.Part.Hi = 0;
201 Count = (Count & 63) - 32;
202 }
203 ACPI_SHIFT_RIGHT_64_BY_32 (OperandOvl.Part.Hi,
204 OperandOvl.Part.Lo, Count);
205
206 /* Return only what was requested */
207
208 if (OutResult)
209 {
210 *OutResult = OperandOvl.Full;
211 }
212
214}

Referenced by AcpiUtHexToAsciiChar().

◆ AcpiUtStatusExit()

void AcpiUtStatusExit ( UINT32  LineNumber,
const char FunctionName,
const char ModuleName,
UINT32  ComponentId,
ACPI_STATUS  Status 
)

◆ AcpiUtStrExit()

void AcpiUtStrExit ( UINT32  LineNumber,
const char FunctionName,
const char ModuleName,
UINT32  ComponentId,
const char String 
)

◆ AcpiUtStricmp()

int AcpiUtStricmp ( char String1,
char String2 
)

Definition at line 144 of file utnonansi.c.

147{
148 int c1;
149 int c2;
150
151
152 do
153 {
154 c1 = tolower ((int) *String1);
155 c2 = tolower ((int) *String2);
156
157 String1++;
158 String2++;
159 }
160 while ((c1 == c2) && (c1));
161
162 return (c1 - c2);
163}
_In_ const STRING * String2
Definition: rtlfuncs.h:2357

◆ AcpiUtStrlwr()

void AcpiUtStrlwr ( char SrcString)

Definition at line 69 of file utnonansi.c.

71{
72 char *String;
73
74
76
77
78 if (!SrcString)
79 {
80 return;
81 }
82
83 /* Walk entire string, lowercasing the letters */
84
85 for (String = SrcString; *String; String++)
86 {
87 *String = (char) tolower ((int) *String);
88 }
89}

◆ AcpiUtStrtoul64()

ACPI_STATUS AcpiUtStrtoul64 ( char String,
UINT64 RetInteger 
)

Definition at line 121 of file utstrtoul64.c.

124{
126 UINT8 OriginalBitWidth;
127 UINT32 Base = 10; /* Default is decimal */
128
129
130 ACPI_FUNCTION_TRACE_STR (UtStrtoul64, String);
131
132
133 *ReturnValue = 0;
134
135 /* A NULL return string returns a value of zero */
136
137 if (*String == 0)
138 {
140 }
141
143 {
145 }
146
147 /*
148 * 1) Check for a hex constant. A "0x" prefix indicates base 16.
149 */
151 {
152 Base = 16;
153 }
154
155 /*
156 * 2) Check for an octal constant, defined to be a leading zero
157 * followed by sequence of octal digits (0-7)
158 */
160 {
161 Base = 8;
162 }
163
165 {
166 return_ACPI_STATUS (AE_OK); /* Return value 0 */
167 }
168
169 /*
170 * Force a full 64-bit conversion. The caller (usually iASL) must
171 * check for a 32-bit overflow later as necessary (If current mode
172 * is 32-bit, meaning a 32-bit DSDT).
173 */
174 OriginalBitWidth = AcpiGbl_IntegerBitWidth;
175 AcpiGbl_IntegerBitWidth = 64;
176
177 /*
178 * Perform the base 8, 10, or 16 conversion. A 64-bit numeric overflow
179 * will return an exception (to allow iASL to flag the statement).
180 */
181 switch (Base)
182 {
183 case 8:
185 break;
186
187 case 10:
189 break;
190
191 case 16:
192 default:
194 break;
195 }
196
197 /* Only possible exception from above is a 64-bit overflow */
198
199 AcpiGbl_IntegerBitWidth = OriginalBitWidth;
201}
BOOLEAN AcpiUtDetectOctalPrefix(char **String)
Definition: utstrsuppt.c:382
ACPI_STATUS AcpiUtConvertOctalString(char *String, UINT64 *ReturnValue)
Definition: utstrsuppt.c:90

Referenced by AcpiNsConvertToInteger().

◆ AcpiUtStrupr()

void AcpiUtStrupr ( char SrcString)

Definition at line 105 of file utnonansi.c.

107{
108 char *String;
109
110
112
113
114 if (!SrcString)
115 {
116 return;
117 }
118
119 /* Walk entire string, uppercasing the letters */
120
121 for (String = SrcString; *String; String++)
122 {
123 *String = (char) toupper ((int) *String);
124 }
125}
int toupper(int c)
Definition: utclib.c:881

◆ AcpiUtSubsystemShutdown()

void AcpiUtSubsystemShutdown ( void  )

Definition at line 304 of file utinit.c.

306{
307 ACPI_FUNCTION_TRACE (UtSubsystemShutdown);
308
309
310 /* Just exit if subsystem is already shutdown */
311
312 if (AcpiGbl_Shutdown)
313 {
314 ACPI_ERROR ((AE_INFO, "ACPI Subsystem is already terminated"));
316 }
317
318 /* Subsystem appears active, go ahead and shut it down */
319
320 AcpiGbl_Shutdown = TRUE;
321 AcpiGbl_StartupFlags = 0;
322 ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
323
324#ifndef ACPI_ASL_COMPILER
325
326 /* Close the AcpiEvent Handling */
327
329
330 /* Delete any dynamic _OSI interfaces */
331
333#endif
334
335 /* Close the Namespace */
336
338
339 /* Delete the ACPI tables */
340
342
343 /* Close the globals */
344
346
347 /* Purge the local caches */
348
351}
void AcpiNsTerminate(void)
Definition: nsutils.c:693
void AcpiTbTerminate(void)
Definition: tbdata.c:811
ACPI_STATUS AcpiUtDeleteCaches(void)
Definition: utalloc.c:218
ACPI_STATUS AcpiUtInterfaceTerminate(void)
Definition: utosi.c:194
void AcpiEvTerminate(void)
Definition: evmisc.c:263
static void AcpiUtTerminate(void)
Definition: utinit.c:279

Referenced by AcpiTerminate().

◆ AcpiUtTrace()

void AcpiUtTrace ( UINT32  LineNumber,
const char FunctionName,
const char ModuleName,
UINT32  ComponentId 
)

◆ AcpiUtTracePtr()

void AcpiUtTracePtr ( UINT32  LineNumber,
const char FunctionName,
const char ModuleName,
UINT32  ComponentId,
const void Pointer 
)

◆ AcpiUtTraceStr()

void AcpiUtTraceStr ( UINT32  LineNumber,
const char FunctionName,
const char ModuleName,
UINT32  ComponentId,
const char String 
)

◆ AcpiUtTraceU32()

void AcpiUtTraceU32 ( UINT32  LineNumber,
const char FunctionName,
const char ModuleName,
UINT32  ComponentId,
UINT32  Integer 
)

◆ AcpiUtTrackStackPtr()

void AcpiUtTrackStackPtr ( void  )

◆ AcpiUtUpdateInterfaces()

ACPI_STATUS AcpiUtUpdateInterfaces ( UINT8  Action)

Definition at line 376 of file utosi.c.

378{
379 ACPI_INTERFACE_INFO *NextInterface;
380
381
382 NextInterface = AcpiGbl_SupportedInterfaces;
383 while (NextInterface)
384 {
385 if (((NextInterface->Flags & ACPI_OSI_FEATURE) &&
387 (!(NextInterface->Flags & ACPI_OSI_FEATURE) &&
389 {
391 {
392 /* Mark the interfaces as invalid */
393
394 NextInterface->Flags |= ACPI_OSI_INVALID;
395 }
396 else
397 {
398 /* Mark the interfaces as valid */
399
400 NextInterface->Flags &= ~ACPI_OSI_INVALID;
401 }
402 }
403
404 NextInterface = NextInterface->Next;
405 }
406
407 return (AE_OK);
408}
#define ACPI_OSI_FEATURE
Definition: aclocal.h:1272
#define ACPI_VENDOR_STRINGS
Definition: actypes.h:1423
#define ACPI_FEATURE_STRINGS
Definition: actypes.h:1424
#define ACPI_DISABLE_INTERFACES
Definition: actypes.h:1426

Referenced by AcpiUpdateInterfaces().

◆ AcpiUtUpdateObjectReference()

ACPI_STATUS AcpiUtUpdateObjectReference ( ACPI_OPERAND_OBJECT Object,
UINT16  Action 
)

Definition at line 548 of file utdelete.c.

551{
553 ACPI_GENERIC_STATE *StateList = NULL;
554 ACPI_OPERAND_OBJECT *NextObject = NULL;
555 ACPI_OPERAND_OBJECT *PrevObject;
557 UINT32 i;
558
559
560 ACPI_FUNCTION_NAME (UtUpdateObjectReference);
561
562
563 while (Object)
564 {
565 /* Make sure that this isn't a namespace handle */
566
568 {
570 "Object %p is NS handle\n", Object));
571 return (AE_OK);
572 }
573
574 /*
575 * All sub-objects must have their reference count updated
576 * also. Different object types have different subobjects.
577 */
578 switch (Object->Common.Type)
579 {
580 case ACPI_TYPE_DEVICE:
582 case ACPI_TYPE_POWER:
584 /*
585 * Update the notify objects for these types (if present)
586 * Two lists, system and device notify handlers.
587 */
588 for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++)
589 {
590 PrevObject = Object->CommonNotify.NotifyList[i];
591 while (PrevObject)
592 {
593 NextObject = PrevObject->Notify.Next[i];
594 AcpiUtUpdateRefCount (PrevObject, Action);
595 PrevObject = NextObject;
596 }
597 }
598 break;
599
601 /*
602 * We must update all the sub-objects of the package,
603 * each of whom may have their own sub-objects.
604 */
605 for (i = 0; i < Object->Package.Count; i++)
606 {
607 /*
608 * Null package elements are legal and can be simply
609 * ignored.
610 */
611 NextObject = Object->Package.Elements[i];
612 if (!NextObject)
613 {
614 continue;
615 }
616
617 switch (NextObject->Common.Type)
618 {
620 case ACPI_TYPE_STRING:
621 case ACPI_TYPE_BUFFER:
622 /*
623 * For these very simple sub-objects, we can just
624 * update the reference count here and continue.
625 * Greatly increases performance of this operation.
626 */
627 AcpiUtUpdateRefCount (NextObject, Action);
628 break;
629
630 default:
631 /*
632 * For complex sub-objects, push them onto the stack
633 * for later processing (this eliminates recursion.)
634 */
636 NextObject, Action, &StateList);
637 if (ACPI_FAILURE (Status))
638 {
639 goto ErrorExit;
640 }
641 break;
642 }
643 }
644
645 NextObject = NULL;
646 break;
647
649
650 NextObject = Object->BufferField.BufferObj;
651 break;
652
654
655 NextObject = Object->BankField.BankObj;
657 Object->BankField.RegionObj, Action, &StateList);
658 if (ACPI_FAILURE (Status))
659 {
660 goto ErrorExit;
661 }
662 break;
663
665
666 NextObject = Object->IndexField.IndexObj;
668 Object->IndexField.DataObj, Action, &StateList);
669 if (ACPI_FAILURE (Status))
670 {
671 goto ErrorExit;
672 }
673 break;
674
676 /*
677 * The target of an Index (a package, string, or buffer) or a named
678 * reference must track changes to the ref count of the index or
679 * target object.
680 */
681 if ((Object->Reference.Class == ACPI_REFCLASS_INDEX) ||
682 (Object->Reference.Class== ACPI_REFCLASS_NAME))
683 {
684 NextObject = Object->Reference.Object;
685 }
686 break;
687
689 case ACPI_TYPE_REGION:
690 default:
691
692 break; /* No subobjects for all other types */
693 }
694
695 /*
696 * Now we can update the count in the main object. This can only
697 * happen after we update the sub-objects in case this causes the
698 * main object to be deleted.
699 */
701 Object = NULL;
702
703 /* Move on to the next object to be updated */
704
705 if (NextObject)
706 {
707 Object = NextObject;
708 NextObject = NULL;
709 }
710 else if (StateList)
711 {
712 State = AcpiUtPopGenericState (&StateList);
713 Object = State->Update.Object;
715 }
716 }
717
718 return (AE_OK);
719
720
722
724 "Could not update object reference count"));
725
726 /* Free any stacked Update State objects */
727
728 while (StateList)
729 {
730 State = AcpiUtPopGenericState (&StateList);
732 }
733
734 return (Status);
735}
@ ACPI_REFCLASS_NAME
Definition: acobject.h:464
@ ACPI_REFCLASS_INDEX
Definition: acobject.h:462
#define ACPI_TYPE_PROCESSOR
Definition: actypes.h:699
#define ACPI_TYPE_LOCAL_REGION_FIELD
Definition: actypes.h:716
#define ACPI_TYPE_POWER
Definition: actypes.h:698
#define ACPI_NUM_NOTIFY_TYPES
Definition: actypes.h:848
#define ACPI_TYPE_LOCAL_INDEX_FIELD
Definition: actypes.h:718
#define ACPI_TYPE_THERMAL
Definition: actypes.h:700
ACPI_GENERIC_STATE * AcpiUtPopGenericState(ACPI_GENERIC_STATE **ListHead)
Definition: utstate.c:93
ACPI_STATUS AcpiUtCreateUpdateStateAndPush(ACPI_OPERAND_OBJECT *Object, UINT16 Action, ACPI_GENERIC_STATE **StateList)
Definition: utmisc.c:219
void AcpiUtDeleteGenericState(ACPI_GENERIC_STATE *State)
Definition: utstate.c:340
union acpi_operand_object * BankObj
Definition: acobject.h:359
union acpi_operand_object * BufferObj
Definition: acobject.h:386
ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO union acpi_operand_object * IndexObj
Definition: acobject.h:373
union acpi_operand_object * Next[2]
Definition: acobject.h:404
static VOID ErrorExit(LPTSTR lpszMessage)
Definition: telnetd.c:647
ACPI_OBJECT_NOTIFY_HANDLER Notify
Definition: acobject.h:538
ACPI_OBJECT_BANK_FIELD BankField
Definition: acobject.h:536
ACPI_OBJECT_NOTIFY_COMMON CommonNotify
Definition: acobject.h:528
ACPI_OBJECT_BUFFER_FIELD BufferField
Definition: acobject.h:535
ACPI_OBJECT_REFERENCE Reference
Definition: acobject.h:540
ACPI_OBJECT_INDEX_FIELD IndexField
Definition: acobject.h:537
static void AcpiUtUpdateRefCount(ACPI_OPERAND_OBJECT *Object, UINT32 Action)
Definition: utdelete.c:421

Referenced by AcpiPsUpdateParameterList(), AcpiUtAddReference(), and AcpiUtRemoveReference().

◆ AcpiUtValidateBuffer()

ACPI_STATUS AcpiUtValidateBuffer ( ACPI_BUFFER Buffer)

Definition at line 290 of file utalloc.c.

292{
293
294 /* Obviously, the structure pointer must be valid */
295
296 if (!Buffer)
297 {
298 return (AE_BAD_PARAMETER);
299 }
300
301 /* Special semantics for the length */
302
303 if ((Buffer->Length == ACPI_NO_BUFFER) ||
304 (Buffer->Length == ACPI_ALLOCATE_BUFFER) ||
306 {
307 return (AE_OK);
308 }
309
310 /* Length is valid, the buffer pointer must be also */
311
312 if (!Buffer->Pointer)
313 {
314 return (AE_BAD_PARAMETER);
315 }
316
317 return (AE_OK);
318}

Referenced by AcpiGetName(), AcpiGetSystemInfo(), and AcpiRsValidateParameters().

◆ AcpiUtValidateException()

const ACPI_EXCEPTION_INFO * AcpiUtValidateException ( ACPI_STATUS  Status)

Definition at line 111 of file utexcep.c.

113{
115 const ACPI_EXCEPTION_INFO *Exception = NULL;
116
117
119
120
121 /*
122 * Status is composed of two parts, a "type" and an actual code
123 */
124 SubStatus = (Status & ~AE_CODE_MASK);
125
126 switch (Status & AE_CODE_MASK)
127 {
129
131 {
132 Exception = &AcpiGbl_ExceptionNames_Env [SubStatus];
133 }
134 break;
135
137
139 {
140 Exception = &AcpiGbl_ExceptionNames_Pgm [SubStatus];
141 }
142 break;
143
145
147 {
148 Exception = &AcpiGbl_ExceptionNames_Tbl [SubStatus];
149 }
150 break;
151
152 case AE_CODE_AML:
153
155 {
156 Exception = &AcpiGbl_ExceptionNames_Aml [SubStatus];
157 }
158 break;
159
160 case AE_CODE_CONTROL:
161
163 {
164 Exception = &AcpiGbl_ExceptionNames_Ctrl [SubStatus];
165 }
166 break;
167
168 default:
169
170 break;
171 }
172
173 if (!Exception || !Exception->Name)
174 {
175 return (NULL);
176 }
177
178 return (Exception);
179}
#define AE_CODE_ENV_MAX
Definition: acexcep.h:145
#define AE_CODE_TBL_MAX
Definition: acexcep.h:173
#define AE_CODE_AML_MAX
Definition: acexcep.h:218
#define AE_CODE_ACPI_TABLES
Definition: acexcep.h:55
#define AE_CODE_PROGRAMMER
Definition: acexcep.h:54
#define AE_CODE_AML
Definition: acexcep.h:56
#define AE_CODE_CONTROL
Definition: acexcep.h:57
#define AE_CODE_CTRL_MAX
Definition: acexcep.h:237
#define AE_CODE_ENVIRONMENTAL
Definition: acexcep.h:53
#define AE_CODE_MASK
Definition: acexcep.h:60
#define AE_CODE_PGM_MAX
Definition: acexcep.h:161
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID _Out_ PHANDLE _Out_ PQUOTA_LIMITS _Out_ PNTSTATUS SubStatus

Referenced by AcpiFormatException().

◆ AcpiUtValidateResource()

ACPI_STATUS AcpiUtValidateResource ( ACPI_WALK_STATE WalkState,
void Aml,
UINT8 ReturnIndex 
)

Definition at line 314 of file utresrc.c.

318{
319 AML_RESOURCE *AmlResource;
320 UINT8 ResourceType;
321 UINT8 ResourceIndex;
322 ACPI_RS_LENGTH ResourceLength;
323 ACPI_RS_LENGTH MinimumResourceLength;
324
325
327
328
329 /*
330 * 1) Validate the ResourceType field (Byte 0)
331 */
332 ResourceType = ACPI_GET8 (Aml);
333
334 /*
335 * Byte 0 contains the descriptor name (Resource Type)
336 * Examine the large/small bit in the resource header
337 */
338 if (ResourceType & ACPI_RESOURCE_NAME_LARGE)
339 {
340 /* Verify the large resource type (name) against the max */
341
342 if (ResourceType > ACPI_RESOURCE_NAME_LARGE_MAX)
343 {
344 goto InvalidResource;
345 }
346
347 /*
348 * Large Resource Type -- bits 6:0 contain the name
349 * Translate range 0x80-0x8B to index range 0x10-0x1B
350 */
351 ResourceIndex = (UINT8) (ResourceType - 0x70);
352 }
353 else
354 {
355 /*
356 * Small Resource Type -- bits 6:3 contain the name
357 * Shift range to index range 0x00-0x0F
358 */
359 ResourceIndex = (UINT8)
360 ((ResourceType & ACPI_RESOURCE_NAME_SMALL_MASK) >> 3);
361 }
362
363 /*
364 * Check validity of the resource type, via AcpiGbl_ResourceTypes.
365 * Zero indicates an invalid resource.
366 */
367 if (!AcpiGbl_ResourceTypes[ResourceIndex])
368 {
369 goto InvalidResource;
370 }
371
372 /*
373 * Validate the ResourceLength field. This ensures that the length
374 * is at least reasonable, and guarantees that it is non-zero.
375 */
376 ResourceLength = AcpiUtGetResourceLength (Aml);
377 MinimumResourceLength = AcpiGbl_ResourceAmlSizes[ResourceIndex];
378
379 /* Validate based upon the type of resource - fixed length or variable */
380
381 switch (AcpiGbl_ResourceTypes[ResourceIndex])
382 {
384
385 /* Fixed length resource, length must match exactly */
386
387 if (ResourceLength != MinimumResourceLength)
388 {
389 goto BadResourceLength;
390 }
391 break;
392
394
395 /* Variable length resource, length must be at least the minimum */
396
397 if (ResourceLength < MinimumResourceLength)
398 {
399 goto BadResourceLength;
400 }
401 break;
402
404
405 /* Small variable length resource, length can be (Min) or (Min-1) */
406
407 if ((ResourceLength > MinimumResourceLength) ||
408 (ResourceLength < (MinimumResourceLength - 1)))
409 {
410 goto BadResourceLength;
411 }
412 break;
413
414 default:
415
416 /* Shouldn't happen (because of validation earlier), but be sure */
417
418 goto InvalidResource;
419 }
420
421 AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml);
422 if (ResourceType == ACPI_RESOURCE_NAME_SERIAL_BUS)
423 {
424 /* Validate the BusType field */
425
426 if ((AmlResource->CommonSerialBus.Type == 0) ||
428 {
429 if (WalkState)
430 {
432 "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
433 AmlResource->CommonSerialBus.Type));
434 }
436 }
437 }
438
439 /* Optionally return the resource table index */
440
441 if (ReturnIndex)
442 {
443 *ReturnIndex = ResourceIndex;
444 }
445
446 return (AE_OK);
447
448
449InvalidResource:
450
451 if (WalkState)
452 {
454 "Invalid/unsupported resource descriptor: Type 0x%2.2X",
455 ResourceType));
456 }
458
459BadResourceLength:
460
461 if (WalkState)
462 {
464 "Invalid resource descriptor length: Type "
465 "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
466 ResourceType, ResourceLength, MinimumResourceLength));
467 }
469}
#define AE_AML_INVALID_RESOURCE_TYPE
Definition: acexcep.h:202
#define AE_AML_BAD_RESOURCE_LENGTH
Definition: acexcep.h:210
#define ACPI_RESOURCE_NAME_LARGE_MAX
Definition: aclocal.h:1347
#define ACPI_RESOURCE_NAME_SERIAL_BUS
Definition: aclocal.h:1342
#define ACPI_SMALL_VARIABLE_LENGTH
Definition: acutils.h:153
#define ACPI_FIXED_LENGTH
Definition: acutils.h:151
#define ACPI_VARIABLE_LENGTH
Definition: acutils.h:152
#define AML_RESOURCE_MAX_SERIALBUSTYPE
Definition: amlresrc.h:466
AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus
Definition: amlresrc.h:708
const UINT8 AcpiGbl_ResourceAmlSizes[]
Definition: utresrc.c:57
static const UINT8 AcpiGbl_ResourceTypes[]
Definition: utresrc.c:117

Referenced by AcpiRsConvertResourcesToAml(), AcpiRsGetListLength(), and AcpiUtWalkAmlResources().

◆ AcpiUtValidInternalObject()

BOOLEAN AcpiUtValidInternalObject ( void Object)

Definition at line 376 of file utobject.c.

378{
379
380 ACPI_FUNCTION_NAME (UtValidInternalObject);
381
382
383 /* Check for a null pointer */
384
385 if (!Object)
386 {
387 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "**** Null Object Ptr\n"));
388 return (FALSE);
389 }
390
391 /* Check the descriptor type field */
392
394 {
396
397 /* The object appears to be a valid ACPI_OPERAND_OBJECT */
398
399 return (TRUE);
400
401 default:
402
404 "%p is not an ACPI operand obj [%s]\n",
406 break;
407 }
408
409 return (FALSE);
410}

Referenced by AcpiExDoDebugObject(), AcpiUtAddReference(), and AcpiUtRemoveReference().

◆ AcpiUtValidNameChar()

BOOLEAN AcpiUtValidNameChar ( char  Character,
UINT32  Position 
)

Definition at line 102 of file utascii.c.

105{
106
107 if (!((Character >= 'A' && Character <= 'Z') ||
108 (Character >= '0' && Character <= '9') ||
109 (Character == '_')))
110 {
111 /* Allow a '!' in the last position */
112
113 if (Character == '!' && Position == 3)
114 {
115 return (TRUE);
116 }
117
118 return (FALSE);
119 }
120
121 return (TRUE);
122}

Referenced by AcpiExNameSegment(), AcpiUtRepairName(), and AcpiUtValidNameseg().

◆ AcpiUtValidNameseg()

BOOLEAN AcpiUtValidNameseg ( char Signature)

Definition at line 63 of file utascii.c.

65{
66 UINT32 i;
67
68
69 /* Validate each character in the signature */
70
71 for (i = 0; i < ACPI_NAMESEG_SIZE; i++)
72 {
73 if (!AcpiUtValidNameChar (Name[i], i))
74 {
75 return (FALSE);
76 }
77 }
78
79 return (TRUE);
80}
BOOLEAN AcpiUtValidNameChar(char Character, UINT32 Position)
Definition: utascii.c:102

Referenced by AcpiTbFindTable(), and AcpiTbVerifyTempTable().

◆ AcpiUtValidObjectType()

BOOLEAN AcpiUtValidObjectType ( ACPI_OBJECT_TYPE  Type)

Definition at line 681 of file utdecode.c.

683{
684
686 {
687 /* Note: Assumes all TYPEs are contiguous (external/local) */
688
689 return (FALSE);
690 }
691
692 return (TRUE);
693}
#define ACPI_TYPE_LOCAL_MAX
Definition: actypes.h:738

Referenced by AcpiDsScopeStackPush(), AcpiExResolveOperands(), and AcpiNsLocal().

◆ AcpiUtValueExit()

void AcpiUtValueExit ( UINT32  LineNumber,
const char FunctionName,
const char ModuleName,
UINT32  ComponentId,
UINT64  Value 
)

◆ AcpiUtVerifyCdatChecksum()

ACPI_STATUS AcpiUtVerifyCdatChecksum ( ACPI_TABLE_CDAT CdatTable,
UINT32  Length 
)

Definition at line 130 of file utcksum.c.

133{
134 UINT8 Checksum;
135
136
137 /* Compute the checksum on the table */
138
139 Checksum = AcpiUtGenerateChecksum (ACPI_CAST_PTR (UINT8, CdatTable),
140 CdatTable->Length, CdatTable->Checksum);
141
142 /* Computed checksum matches table? */
143
144 if (Checksum != CdatTable->Checksum)
145 {
147 "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
148 "should be 0x%2.2X",
149 AcpiGbl_CDAT, CdatTable->Checksum, Checksum));
150
151#if (ACPI_CHECKSUM_ABORT)
152 return (AE_BAD_CHECKSUM);
153#endif
154 }
155
156 CdatTable->Checksum = Checksum;
157 return (AE_OK);
158}
#define AE_BAD_CHECKSUM
Definition: acexcep.h:169
#define ACPI_BIOS_WARNING(plist)
Definition: acoutput.h:241
UINT8 Checksum
Definition: actbl1.h:405
UINT32 Length
Definition: actbl1.h:403
UINT8 AcpiUtGenerateChecksum(void *Table, UINT32 Length, UINT8 OriginalChecksum)
Definition: utcksum.c:176

◆ AcpiUtVerifyChecksum()

ACPI_STATUS AcpiUtVerifyChecksum ( ACPI_TABLE_HEADER Table,
UINT32  Length 
)

Definition at line 74 of file utcksum.c.

77{
78 UINT8 Checksum;
79
80
81 /*
82 * FACS/S3PT:
83 * They are the odd tables, have no standard ACPI header and no checksum
84 */
85 if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_S3PT) ||
87 {
88 return (AE_OK);
89 }
90
91 /* Compute the checksum on the table */
92
93 Length = Table->Length;
94 Checksum = AcpiUtGenerateChecksum (ACPI_CAST_PTR (UINT8, Table), Length, Table->Checksum);
95
96 /* Computed checksum matches table? */
97
98 if (Checksum != Table->Checksum)
99 {
101 "Incorrect checksum in table [%4.4s] - 0x%2.2X, "
102 "should be 0x%2.2X",
103 Table->Signature, Table->Checksum,
104 Table->Checksum - Checksum));
105
106#if (ACPI_CHECKSUM_ABORT)
107 return (AE_BAD_CHECKSUM);
108#endif
109 }
110
111 return (AE_OK);
112}
#define ACPI_SIG_S3PT
Definition: actbl1.h:86
#define ACPI_SIG_FACS
Definition: actbl.h:69

Referenced by AcpiTbParseFadt(), AcpiTbParseRootTable(), and AcpiTbVerifyTempTable().

◆ AcpiUtWalkAmlResources()

ACPI_STATUS AcpiUtWalkAmlResources ( ACPI_WALK_STATE WalkState,
UINT8 Aml,
ACPI_SIZE  AmlLength,
ACPI_WALK_AML_CALLBACK  UserFunction,
void **  Context 
)

Definition at line 181 of file utresrc.c.

187{
189 UINT8 *EndAml;
190 UINT8 ResourceIndex;
192 UINT32 Offset = 0;
193 UINT8 EndTag[2] = {0x79, 0x00};
194
195
196 ACPI_FUNCTION_TRACE (UtWalkAmlResources);
197
198
199 /* The absolute minimum resource template is one EndTag descriptor */
200
201 if (AmlLength < sizeof (AML_RESOURCE_END_TAG))
202 {
204 }
205
206 /* Point to the end of the resource template buffer */
207
208 EndAml = Aml + AmlLength;
209
210 /* Walk the byte list, abort on any invalid descriptor type or length */
211
212 while (Aml < EndAml)
213 {
214 /* Validate the Resource Type and Resource Length */
215
216 Status = AcpiUtValidateResource (WalkState, Aml, &ResourceIndex);
217 if (ACPI_FAILURE (Status))
218 {
219 /*
220 * Exit on failure. Cannot continue because the descriptor
221 * length may be bogus also.
222 */
224 }
225
226 /* Get the length of this descriptor */
227
229
230 /* Invoke the user function */
231
232 if (UserFunction)
233 {
235 Aml, Length, Offset, ResourceIndex, Context);
236 if (ACPI_FAILURE (Status))
237 {
239 }
240 }
241
242 /* An EndTag descriptor terminates this resource template */
243
245 {
246 /*
247 * There must be at least one more byte in the buffer for
248 * the 2nd byte of the EndTag
249 */
250 if ((Aml + 1) >= EndAml)
251 {
253 }
254
255 /*
256 * Don't attempt to perform any validation on the 2nd byte.
257 * Although all known ASL compilers insert a zero for the 2nd
258 * byte, it can also be a checksum (as per the ACPI spec),
259 * and this is occasionally seen in the field. July 2017.
260 */
261
262 /* Return the pointer to the EndTag if requested */
263
264 if (!UserFunction)
265 {
266 *Context = Aml;
267 }
268
269 /* Normal exit */
270
272 }
273
274 Aml += Length;
275 Offset += Length;
276 }
277
278 /* Did not find an EndTag descriptor */
279
280 if (UserFunction)
281 {
282 /* Insert an EndTag anyway. AcpiRsGetListLength always leaves room */
283
284 (void) AcpiUtValidateResource (WalkState, EndTag, &ResourceIndex);
285 Status = UserFunction (EndTag, 2, Offset, ResourceIndex, Context);
286 if (ACPI_FAILURE (Status))
287 {
289 }
290 }
291
293}
#define AE_AML_NO_RESOURCE_END_TAG
Definition: acexcep.h:207
#define ACPI_RESOURCE_NAME_END_TAG
Definition: aclocal.h:1323
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK UserFunction
Definition: acpixf.h:1078
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
UINT32 AcpiUtGetDescriptorLength(void *Aml)
Definition: utresrc.c:606
ACPI_STATUS AcpiUtValidateResource(ACPI_WALK_STATE *WalkState, void *Aml, UINT8 *ReturnIndex)
Definition: utresrc.c:314
UINT8 AcpiUtGetResourceType(void *Aml)
Definition: utresrc.c:487

Referenced by AcpiBufferToResource(), AcpiRsCreateResourceList(), and AcpiUtGetResourceEndTag().

◆ AcpiUtWalkPackageTree()

ACPI_STATUS AcpiUtWalkPackageTree ( ACPI_OPERAND_OBJECT SourceObject,
void TargetObject,
ACPI_PKG_CALLBACK  WalkCallback,
void Context 
)

Definition at line 264 of file utmisc.c.

269{
271 ACPI_GENERIC_STATE *StateList = NULL;
273 ACPI_OPERAND_OBJECT *ThisSourceObj;
274 UINT32 ThisIndex;
275
276
277 ACPI_FUNCTION_TRACE (UtWalkPackageTree);
278
279
280 State = AcpiUtCreatePkgState (SourceObject, TargetObject, 0);
281 if (!State)
282 {
284 }
285
286 while (State)
287 {
288 /* Get one element of the package */
289
290 ThisIndex = State->Pkg.Index;
291 ThisSourceObj =
292 State->Pkg.SourceObject->Package.Elements[ThisIndex];
293 State->Pkg.ThisTargetObj =
294 &State->Pkg.SourceObject->Package.Elements[ThisIndex];
295
296 /*
297 * Check for:
298 * 1) An uninitialized package element. It is completely
299 * legal to declare a package and leave it uninitialized
300 * 2) Not an internal object - can be a namespace node instead
301 * 3) Any type other than a package. Packages are handled in else
302 * case below.
303 */
304 if ((!ThisSourceObj) ||
305 (ACPI_GET_DESCRIPTOR_TYPE (ThisSourceObj) !=
307 (ThisSourceObj->Common.Type != ACPI_TYPE_PACKAGE))
308 {
309 Status = WalkCallback (ACPI_COPY_TYPE_SIMPLE, ThisSourceObj,
310 State, Context);
311 if (ACPI_FAILURE (Status))
312 {
314 }
315
316 State->Pkg.Index++;
317 while (State->Pkg.Index >=
318 State->Pkg.SourceObject->Package.Count)
319 {
320 /*
321 * We've handled all of the objects at this level, This means
322 * that we have just completed a package. That package may
323 * have contained one or more packages itself.
324 *
325 * Delete this state and pop the previous state (package).
326 */
328 State = AcpiUtPopGenericState (&StateList);
329
330 /* Finished when there are no more states */
331
332 if (!State)
333 {
334 /*
335 * We have handled all of the objects in the top level
336 * package just add the length of the package objects
337 * and exit
338 */
340 }
341
342 /*
343 * Go back up a level and move the index past the just
344 * completed package object.
345 */
346 State->Pkg.Index++;
347 }
348 }
349 else
350 {
351 /* This is a subobject of type package */
352
353 Status = WalkCallback (
354 ACPI_COPY_TYPE_PACKAGE, ThisSourceObj, State, Context);
355 if (ACPI_FAILURE (Status))
356 {
358 }
359
360 /*
361 * Push the current state and create a new one
362 * The callback above returned a new target package object.
363 */
364 AcpiUtPushGenericState (&StateList, State);
366 ThisSourceObj, State->Pkg.ThisTargetObj, 0);
367 if (!State)
368 {
369 /* Free any stacked Update State objects */
370
371 while (StateList)
372 {
373 State = AcpiUtPopGenericState (&StateList);
375 }
377 }
378 }
379 }
380
381 /* We should never get here */
382
384 "State list did not terminate correctly"));
385
387}
#define AE_AML_INTERNAL
Definition: acexcep.h:194
#define ACPI_COPY_TYPE_PACKAGE
Definition: aclocal.h:282
#define ACPI_COPY_TYPE_SIMPLE
Definition: aclocal.h:281
ACPI_GENERIC_STATE * AcpiUtCreatePkgState(void *InternalObject, void *ExternalObject, UINT32 Index)
Definition: utstate.c:255

Referenced by AcpiNsInitOnePackage(), AcpiUtCopyIpackageToEpackage(), AcpiUtCopyIpackageToIpackage(), and AcpiUtGetPackageObjectSize().

Variable Documentation

◆ AcpiGbl_ResourceAmlSerialBusSizes

const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[]
extern

Definition at line 101 of file utresrc.c.

Referenced by AcpiRsGetListLength().

◆ AcpiGbl_ResourceAmlSizes

const UINT8 AcpiGbl_ResourceAmlSizes[]
extern

Definition at line 57 of file utresrc.c.

Referenced by AcpiRsGetListLength(), and AcpiUtValidateResource().