diff options
Diffstat (limited to 'sys/contrib/dev/acpica/include/acutils.h')
-rw-r--r-- | sys/contrib/dev/acpica/include/acutils.h | 268 |
1 files changed, 95 insertions, 173 deletions
diff --git a/sys/contrib/dev/acpica/include/acutils.h b/sys/contrib/dev/acpica/include/acutils.h index fe6c057..b92a39b 100644 --- a/sys/contrib/dev/acpica/include/acutils.h +++ b/sys/contrib/dev/acpica/include/acutils.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -115,13 +115,25 @@ extern const char *AcpiGbl_PtDecode[]; /* * Common error message prefixes */ +#ifndef ACPI_MSG_ERROR #define ACPI_MSG_ERROR "ACPI Error: " +#endif +#ifndef ACPI_MSG_EXCEPTION #define ACPI_MSG_EXCEPTION "ACPI Exception: " +#endif +#ifndef ACPI_MSG_WARNING #define ACPI_MSG_WARNING "ACPI Warning: " +#endif +#ifndef ACPI_MSG_INFO #define ACPI_MSG_INFO "ACPI: " +#endif +#ifndef ACPI_MSG_BIOS_ERROR #define ACPI_MSG_BIOS_ERROR "ACPI BIOS Error (bug): " +#endif +#ifndef ACPI_MSG_BIOS_WARNING #define ACPI_MSG_BIOS_WARNING "ACPI BIOS Warning (bug): " +#endif /* * Common message suffix @@ -173,6 +185,55 @@ typedef struct acpi_pkg_info #define DB_DWORD_DISPLAY 4 #define DB_QWORD_DISPLAY 8 + +/* + * utascii - ASCII utilities + */ +BOOLEAN +AcpiUtValidNameseg ( + char *Signature); + +BOOLEAN +AcpiUtValidNameChar ( + char Character, + UINT32 Position); + +void +AcpiUtCheckAndRepairAscii ( + UINT8 *Name, + char *RepairedName, + UINT32 Count); + + +/* + * utnonansi - Non-ANSI C library functions + */ +void +AcpiUtStrupr ( + char *SrcString); + +void +AcpiUtStrlwr ( + char *SrcString); + +int +AcpiUtStricmp ( + char *String1, + char *String2); + +ACPI_STATUS +AcpiUtStrtoul64 ( + char *String, + UINT32 Base, + UINT32 MaxIntegerByteWidth, + UINT64 *RetInteger); + +/* Values for MaxIntegerByteWidth above */ + +#define ACPI_MAX32_BYTE_WIDTH 4 +#define ACPI_MAX64_BYTE_WIDTH 8 + + /* * utglobal - Global data structures and procedures */ @@ -182,7 +243,7 @@ AcpiUtInitGlobals ( #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) -char * +const char * AcpiUtGetMutexName ( UINT32 MutexId); @@ -192,15 +253,15 @@ AcpiUtGetNotifyName ( ACPI_OBJECT_TYPE Type); #endif -char * +const char * AcpiUtGetTypeName ( ACPI_OBJECT_TYPE Type); -char * +const char * AcpiUtGetNodeName ( void *Object); -char * +const char * AcpiUtGetDescriptorName ( void *Object); @@ -208,15 +269,15 @@ const char * AcpiUtGetReferenceName ( ACPI_OPERAND_OBJECT *Object); -char * +const char * AcpiUtGetObjectTypeName ( ACPI_OPERAND_OBJECT *ObjDesc); -char * +const char * AcpiUtGetRegionName ( UINT8 SpaceId); -char * +const char * AcpiUtGetEventName ( UINT32 EventId); @@ -247,116 +308,6 @@ AcpiUtSubsystemShutdown ( /* - * utclib - Local implementations of C library functions - */ -#ifndef ACPI_USE_SYSTEM_CLIBRARY - -ACPI_SIZE -AcpiUtStrlen ( - const char *String); - -char * -AcpiUtStrchr ( - const char *String, - int ch); - -char * -AcpiUtStrcpy ( - char *DstString, - const char *SrcString); - -char * -AcpiUtStrncpy ( - char *DstString, - const char *SrcString, - ACPI_SIZE Count); - -int -AcpiUtMemcmp ( - const char *Buffer1, - const char *Buffer2, - ACPI_SIZE Count); - -int -AcpiUtStrncmp ( - const char *String1, - const char *String2, - ACPI_SIZE Count); - -int -AcpiUtStrcmp ( - const char *String1, - const char *String2); - -char * -AcpiUtStrcat ( - char *DstString, - const char *SrcString); - -char * -AcpiUtStrncat ( - char *DstString, - const char *SrcString, - ACPI_SIZE Count); - -UINT32 -AcpiUtStrtoul ( - const char *String, - char **Terminator, - UINT32 Base); - -char * -AcpiUtStrstr ( - char *String1, - char *String2); - -void * -AcpiUtMemcpy ( - void *Dest, - const void *Src, - ACPI_SIZE Count); - -void * -AcpiUtMemset ( - void *Dest, - UINT8 Value, - ACPI_SIZE Count); - -int -AcpiUtToUpper ( - int c); - -int -AcpiUtToLower ( - int c); - -extern const UINT8 _acpi_ctype[]; - -#define _ACPI_XA 0x00 /* extra alphabetic - not supported */ -#define _ACPI_XS 0x40 /* extra space */ -#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ -#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ -#define _ACPI_DI 0x04 /* '0'-'9' */ -#define _ACPI_LO 0x02 /* 'a'-'z' */ -#define _ACPI_PU 0x10 /* punctuation */ -#define _ACPI_SP 0x08 /* space, tab, CR, LF, VT, FF */ -#define _ACPI_UP 0x01 /* 'A'-'Z' */ -#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ - -#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) -#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) -#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) -#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) -#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) -#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU)) -#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) - -#endif /* !ACPI_USE_SYSTEM_CLIBRARY */ - -#define ACPI_IS_ASCII(c) ((c) < 0x80) - - -/* * utcopy - Object construction and conversion interfaces */ ACPI_STATUS @@ -427,7 +378,7 @@ AcpiUtTracePtr ( const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - void *Pointer); + const void *Pointer); void AcpiUtTraceU32 ( @@ -443,7 +394,7 @@ AcpiUtTraceStr ( const char *FunctionName, const char *ModuleName, UINT32 ComponentId, - char *String); + const char *String); void AcpiUtExit ( @@ -477,6 +428,14 @@ AcpiUtPtrExit ( UINT8 *Ptr); void +AcpiUtStrExit ( + UINT32 LineNumber, + const char *FunctionName, + const char *ModuleName, + UINT32 ComponentId, + const char *String); + +void AcpiUtDebugDumpBuffer ( UINT8 *Buffer, UINT32 Count, @@ -515,6 +474,7 @@ AcpiUtReportWarning ( char *ModuleName, UINT32 LineNumber); + /* * utdelete - Object deletion and reference counts */ @@ -545,13 +505,13 @@ AcpiUtDeleteInternalObjectList ( ACPI_STATUS AcpiUtEvaluateObject ( ACPI_NAMESPACE_NODE *PrefixNode, - char *Path, + const char *Path, UINT32 ExpectedReturnBtypes, ACPI_OPERAND_OBJECT **ReturnDesc); ACPI_STATUS AcpiUtEvaluateNumericObject ( - char *ObjectName, + const char *ObjectName, ACPI_NAMESPACE_NODE *DeviceNode, UINT64 *Value); @@ -569,17 +529,6 @@ AcpiUtExecutePowerMethods ( /* - * utfileio - file operations - */ -#ifdef ACPI_APPLICATION -ACPI_STATUS -AcpiUtReadTableFromFile ( - char *Filename, - ACPI_TABLE_HEADER **Table); -#endif - - -/* * utids - device ID support */ ACPI_STATUS @@ -593,14 +542,14 @@ AcpiUtExecute_UID ( ACPI_PNP_DEVICE_ID **ReturnId); ACPI_STATUS -AcpiUtExecute_SUB ( +AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_PNP_DEVICE_ID **ReturnId); + ACPI_PNP_DEVICE_ID_LIST **ReturnCidList); ACPI_STATUS -AcpiUtExecute_CID ( +AcpiUtExecute_CLS ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_PNP_DEVICE_ID_LIST **ReturnCidList); + ACPI_PNP_DEVICE_ID **ReturnId); /* @@ -822,7 +771,7 @@ BOOLEAN AcpiUtIsPciRootBridge ( char *Id); -#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP) +#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP) BOOLEAN AcpiUtIsAmlTable ( ACPI_TABLE_HEADER *Table); @@ -835,11 +784,11 @@ AcpiUtWalkPackageTree ( ACPI_PKG_CALLBACK WalkCallback, void *Context); - /* Values for Base above (16=Hex, 10=Decimal) */ #define ACPI_ANY_BASE 0 + UINT32 AcpiUtDwordByteSwap ( UINT32 Value); @@ -853,7 +802,7 @@ void AcpiUtDisplayInitPathname ( UINT8 Type, ACPI_NAMESPACE_NODE *ObjHandle, - char *Path); + const char *Path); #endif @@ -912,27 +861,6 @@ AcpiUtGetResourceEndTag ( * utstring - String and character utilities */ void -AcpiUtStrupr ( - char *SrcString); - -#ifdef ACPI_ASL_COMPILER -void -AcpiUtStrlwr ( - char *SrcString); - -int -AcpiUtStricmp ( - char *String1, - char *String2); -#endif - -ACPI_STATUS -AcpiUtStrtoul64 ( - char *String, - UINT32 Base, - UINT64 *RetInteger); - -void AcpiUtPrintString ( char *String, UINT16 MaxLength); @@ -943,15 +871,6 @@ UtConvertBackslashes ( char *Pathname); #endif -BOOLEAN -AcpiUtValidAcpiName ( - char *Name); - -BOOLEAN -AcpiUtValidAcpiChar ( - char Character, - UINT32 Position); - void AcpiUtRepairName ( char *Name); @@ -969,7 +888,6 @@ AcpiUtSafeStrcat ( ACPI_SIZE DestSize, char *Source); -#ifndef _KERNEL BOOLEAN AcpiUtSafeStrncat ( char *Dest, @@ -977,7 +895,6 @@ AcpiUtSafeStrncat ( char *Source, ACPI_SIZE MaxTransferLength); #endif -#endif /* @@ -1053,12 +970,13 @@ AcpiUtDumpAllocations ( ACPI_STATUS AcpiUtCreateList ( - char *ListName, + const char *ListName, UINT16 ObjectSize, ACPI_MEMORY_LIST **ReturnCache); #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ + /* * utaddress - address range check */ @@ -1085,6 +1003,7 @@ void AcpiUtDeleteAddressLists ( void); + /* * utxferror - various error/warning output functions */ @@ -1131,6 +1050,7 @@ AcpiUtMethodError ( const char *Path, ACPI_STATUS LookupStatus); + /* * Utility functions for ACPI names and IDs */ @@ -1146,6 +1066,7 @@ const char * AcpiAhMatchUuid ( UINT8 *Data); + /* * utprint - printf/vprintf output functions */ @@ -1187,6 +1108,7 @@ AcpiUtFilePrintf ( ...); #endif + /* * utuuid -- UUID support functions */ |