diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-06-16 19:48:16 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-06-16 19:48:16 +0000 |
commit | 8811b910b092027f905013bced1da3e87c6b07b9 (patch) | |
tree | b0c56a23f2d8877b9431deb3cab73df3c1913fb7 /source/components/utilities | |
parent | 0c85196b0c51b4e5eba8fcace026f947f9112c9e (diff) |
Notes
Diffstat (limited to 'source/components/utilities')
-rw-r--r-- | source/components/utilities/utalloc.c | 6 | ||||
-rw-r--r-- | source/components/utilities/utbuffer.c | 4 | ||||
-rw-r--r-- | source/components/utilities/utcache.c | 6 | ||||
-rw-r--r-- | source/components/utilities/utclib.c | 144 | ||||
-rw-r--r-- | source/components/utilities/utcopy.c | 16 | ||||
-rw-r--r-- | source/components/utilities/utids.c | 104 | ||||
-rw-r--r-- | source/components/utilities/utmisc.c | 7 | ||||
-rw-r--r-- | source/components/utilities/utosi.c | 8 | ||||
-rw-r--r-- | source/components/utilities/utpredef.c | 4 | ||||
-rw-r--r-- | source/components/utilities/utprint.c | 6 | ||||
-rw-r--r-- | source/components/utilities/utstring.c | 32 | ||||
-rw-r--r-- | source/components/utilities/uttrack.c | 8 | ||||
-rw-r--r-- | source/components/utilities/utxface.c | 6 |
13 files changed, 244 insertions, 107 deletions
diff --git a/source/components/utilities/utalloc.c b/source/components/utilities/utalloc.c index bb4194df0d89..d0b5c920634c 100644 --- a/source/components/utilities/utalloc.c +++ b/source/components/utilities/utalloc.c @@ -79,7 +79,7 @@ AcpiOsAllocateZeroed ( { /* Clear the memory block */ - ACPI_MEMSET (Allocation, 0, Size); + memset (Allocation, 0, Size); } return (Allocation); @@ -189,7 +189,7 @@ AcpiUtDeleteCaches ( if (AcpiGbl_DisplayFinalMemStats) { - ACPI_STRCPY (Buffer, "MEMORY"); + strcpy (Buffer, "MEMORY"); (void) AcpiDbDisplayStatistics (Buffer); } #endif @@ -359,6 +359,6 @@ AcpiUtInitializeBuffer ( /* Have a valid buffer, clear it */ - ACPI_MEMSET (Buffer->Pointer, 0, RequiredLength); + memset (Buffer->Pointer, 0, RequiredLength); return (AE_OK); } diff --git a/source/components/utilities/utbuffer.c b/source/components/utilities/utbuffer.c index cf99b769922e..16a593f111bc 100644 --- a/source/components/utilities/utbuffer.c +++ b/source/components/utilities/utbuffer.c @@ -168,7 +168,7 @@ AcpiUtDumpBuffer ( } BufChar = Buffer[(ACPI_SIZE) i + j]; - if (ACPI_IS_PRINT (BufChar)) + if (isprint (BufChar)) { AcpiOsPrintf ("%c", BufChar); } @@ -341,7 +341,7 @@ AcpiUtDumpBufferToFile ( } BufChar = Buffer[(ACPI_SIZE) i + j]; - if (ACPI_IS_PRINT (BufChar)) + if (isprint (BufChar)) { AcpiUtFilePrintf (File, "%c", BufChar); } diff --git a/source/components/utilities/utcache.c b/source/components/utilities/utcache.c index c2211cc2adb9..7a0f210dff6a 100644 --- a/source/components/utilities/utcache.c +++ b/source/components/utilities/utcache.c @@ -92,7 +92,7 @@ AcpiOsCreateCache ( /* Populate the cache object and return it */ - ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); + memset (Cache, 0, sizeof (ACPI_MEMORY_LIST)); Cache->ListName = CacheName; Cache->ObjectSize = ObjectSize; Cache->MaxDepth = MaxDepth; @@ -242,7 +242,7 @@ AcpiOsReleaseObject ( /* Mark the object as cached */ - ACPI_MEMSET (Object, 0xCA, Cache->ObjectSize); + memset (Object, 0xCA, Cache->ObjectSize); ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_CACHED); /* Put the object at the head of the cache list */ @@ -318,7 +318,7 @@ AcpiOsAcquireObject ( /* Clear (zero) the previously used Object */ - ACPI_MEMSET (Object, 0, Cache->ObjectSize); + memset (Object, 0, Cache->ObjectSize); } else { diff --git a/source/components/utilities/utclib.c b/source/components/utilities/utclib.c index e68634b18bbb..6e3e9b4eb5b2 100644 --- a/source/components/utilities/utclib.c +++ b/source/components/utilities/utclib.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: cmclib - Local implementation of C library functions + * Module Name: utclib - ACPICA implementations of C library functions * *****************************************************************************/ @@ -41,20 +41,59 @@ * POSSIBILITY OF SUCH DAMAGES. */ +#define ACPI_CLIBRARY #include "acpi.h" #include "accommon.h" /* - * These implementations of standard C Library routines can optionally be - * used if a C library is not available. In general, they are less efficient - * than an inline or assembly implementation + * This module contains implementations of the standard C library functions + * that are required by the ACPICA code at both application level and kernel + * level. + * + * The module is an optional feature that can be used if a local/system + * C library is not available. Some operating system kernels may not have + * an internal C library. + * + * In general, these functions are less efficient than an inline or assembly + * code implementation. + * + * These C functions and the associated prototypes are enabled by default + * unless the ACPI_USE_SYSTEM_CLIBRARY symbol is defined. This is usually + * automatically defined for the ACPICA applications such as iASL and + * AcpiExec, so that these user-level applications use the local C library + * instead of the functions in this module. */ + +/******************************************************************************* + * + * Functions implemented in this module: + * + * FUNCTION: memcmp + * FUNCTION: memcpy + * FUNCTION: memset + * FUNCTION: strlen + * FUNCTION: strcpy + * FUNCTION: strncpy + * FUNCTION: strcmp + * FUNCTION: strchr + * FUNCTION: strncmp + * FUNCTION: strcat + * FUNCTION: strncat + * FUNCTION: strstr + * FUNCTION: strtoul + * FUNCTION: toupper + * FUNCTION: tolower + * FUNCTION: is* functions + * + ******************************************************************************/ + + #define _COMPONENT ACPI_UTILITIES - ACPI_MODULE_NAME ("cmclib") + ACPI_MODULE_NAME ("utclib") -#ifndef ACPI_USE_SYSTEM_CLIBRARY +#ifndef ACPI_USE_SYSTEM_CLIBRARY /* Entire module */ #define NEGATIVE 1 #define POSITIVE 0 @@ -62,7 +101,7 @@ /******************************************************************************* * - * FUNCTION: AcpiUtMemcmp (memcmp) + * FUNCTION: memcmp * * PARAMETERS: Buffer1 - First Buffer * Buffer2 - Second Buffer @@ -75,11 +114,14 @@ ******************************************************************************/ int -AcpiUtMemcmp ( - const char *Buffer1, - const char *Buffer2, +memcmp ( + void *VBuffer1, + void *VBuffer2, ACPI_SIZE Count) { + char *Buffer1 = (char *) VBuffer1; + char *Buffer2 = (char *) VBuffer2; + for ( ; Count-- && (*Buffer1 == *Buffer2); Buffer1++, Buffer2++) { @@ -92,7 +134,7 @@ AcpiUtMemcmp ( /******************************************************************************* * - * FUNCTION: AcpiUtMemcpy (memcpy) + * FUNCTION: memcpy * * PARAMETERS: Dest - Target of the copy * Src - Source buffer to copy @@ -105,7 +147,7 @@ AcpiUtMemcmp ( ******************************************************************************/ void * -AcpiUtMemcpy ( +memcpy ( void *Dest, const void *Src, ACPI_SIZE Count) @@ -128,7 +170,7 @@ AcpiUtMemcpy ( /******************************************************************************* * - * FUNCTION: AcpiUtMemset (memset) + * FUNCTION: memset * * PARAMETERS: Dest - Buffer to set * Value - Value to set each byte of memory @@ -141,9 +183,9 @@ AcpiUtMemcpy ( ******************************************************************************/ void * -AcpiUtMemset ( +memset ( void *Dest, - UINT8 Value, + int Value, ACPI_SIZE Count) { char *New = (char *) Dest; @@ -162,7 +204,7 @@ AcpiUtMemset ( /******************************************************************************* * - * FUNCTION: AcpiUtStrlen (strlen) + * FUNCTION: strlen * * PARAMETERS: String - Null terminated string * @@ -174,7 +216,7 @@ AcpiUtMemset ( ACPI_SIZE -AcpiUtStrlen ( +strlen ( const char *String) { UINT32 Length = 0; @@ -194,7 +236,7 @@ AcpiUtStrlen ( /******************************************************************************* * - * FUNCTION: AcpiUtStrcpy (strcpy) + * FUNCTION: strcpy * * PARAMETERS: DstString - Target of the copy * SrcString - The source string to copy @@ -206,7 +248,7 @@ AcpiUtStrlen ( ******************************************************************************/ char * -AcpiUtStrcpy ( +strcpy ( char *DstString, const char *SrcString) { @@ -232,7 +274,7 @@ AcpiUtStrcpy ( /******************************************************************************* * - * FUNCTION: AcpiUtStrncpy (strncpy) + * FUNCTION: strncpy * * PARAMETERS: DstString - Target of the copy * SrcString - The source string to copy @@ -245,7 +287,7 @@ AcpiUtStrcpy ( ******************************************************************************/ char * -AcpiUtStrncpy ( +strncpy ( char *DstString, const char *SrcString, ACPI_SIZE Count) @@ -275,7 +317,7 @@ AcpiUtStrncpy ( /******************************************************************************* * - * FUNCTION: AcpiUtStrcmp (strcmp) + * FUNCTION: strcmp * * PARAMETERS: String1 - First string * String2 - Second string @@ -287,7 +329,7 @@ AcpiUtStrncpy ( ******************************************************************************/ int -AcpiUtStrcmp ( +strcmp ( const char *String1, const char *String2) { @@ -307,7 +349,7 @@ AcpiUtStrcmp ( /******************************************************************************* * - * FUNCTION: AcpiUtStrchr (strchr) + * FUNCTION: strchr * * PARAMETERS: String - Search string * ch - character to search for @@ -319,7 +361,7 @@ AcpiUtStrcmp ( ******************************************************************************/ char * -AcpiUtStrchr ( +strchr ( const char *String, int ch) { @@ -339,7 +381,7 @@ AcpiUtStrchr ( /******************************************************************************* * - * FUNCTION: AcpiUtStrncmp (strncmp) + * FUNCTION: strncmp * * PARAMETERS: String1 - First string * String2 - Second string @@ -352,7 +394,7 @@ AcpiUtStrchr ( ******************************************************************************/ int -AcpiUtStrncmp ( +strncmp ( const char *String1, const char *String2, ACPI_SIZE Count) @@ -374,7 +416,7 @@ AcpiUtStrncmp ( /******************************************************************************* * - * FUNCTION: AcpiUtStrcat (Strcat) + * FUNCTION: strcat * * PARAMETERS: DstString - Target of the copy * SrcString - The source string to copy @@ -386,7 +428,7 @@ AcpiUtStrncmp ( ******************************************************************************/ char * -AcpiUtStrcat ( +strcat ( char *DstString, const char *SrcString) { @@ -409,7 +451,7 @@ AcpiUtStrcat ( /******************************************************************************* * - * FUNCTION: AcpiUtStrncat (strncat) + * FUNCTION: strncat * * PARAMETERS: DstString - Target of the copy * SrcString - The source string to copy @@ -423,7 +465,7 @@ AcpiUtStrcat ( ******************************************************************************/ char * -AcpiUtStrncat ( +strncat ( char *DstString, const char *SrcString, ACPI_SIZE Count) @@ -457,7 +499,7 @@ AcpiUtStrncat ( /******************************************************************************* * - * FUNCTION: AcpiUtStrstr (strstr) + * FUNCTION: strstr * * PARAMETERS: String1 - Target string * String2 - Substring to search for @@ -471,22 +513,22 @@ AcpiUtStrncat ( ******************************************************************************/ char * -AcpiUtStrstr ( +strstr ( char *String1, char *String2) { UINT32 Length; - Length = AcpiUtStrlen (String2); + Length = strlen (String2); if (!Length) { return (String1); } - while (AcpiUtStrlen (String1) >= Length) + while (strlen (String1) >= Length) { - if (AcpiUtMemcmp (String1, String2, Length) == 0) + if (memcmp (String1, String2, Length) == 0) { return (String1); } @@ -499,7 +541,7 @@ AcpiUtStrstr ( /******************************************************************************* * - * FUNCTION: AcpiUtStrtoul (strtoul) + * FUNCTION: strtoul * * PARAMETERS: String - Null terminated string * Terminater - Where a pointer to the terminating byte is @@ -509,12 +551,12 @@ AcpiUtStrstr ( * RETURN: Converted value * * DESCRIPTION: Convert a string into a 32-bit unsigned value. - * Note: use AcpiUtStrtoul64 for 64-bit integers. + * Note: use strtoul64 for 64-bit integers. * ******************************************************************************/ UINT32 -AcpiUtStrtoul ( +strtoul ( const char *String, char **Terminator, UINT32 Base) @@ -533,7 +575,7 @@ AcpiUtStrtoul ( * skip over any white space in the buffer: */ StringStart = String; - while (ACPI_IS_SPACE (*String) || *String == '\t') + while (isspace (*String) || *String == '\t') { ++String; } @@ -565,7 +607,7 @@ AcpiUtStrtoul ( { if (*String == '0') { - if (AcpiUtToLower (*(++String)) == 'x') + if (tolower (*(++String)) == 'x') { Base = 16; ++String; @@ -600,7 +642,7 @@ AcpiUtStrtoul ( if (Base == 16 && *String == '0' && - AcpiUtToLower (*(++String)) == 'x') + tolower (*(++String)) == 'x') { String++; } @@ -610,14 +652,14 @@ AcpiUtStrtoul ( */ while (*String) { - if (ACPI_IS_DIGIT (*String)) + if (isdigit (*String)) { index = (UINT32) ((UINT8) *String - '0'); } else { - index = (UINT32) AcpiUtToUpper (*String); - if (ACPI_IS_UPPER (index)) + index = (UINT32) toupper (*String); + if (isupper (index)) { index = index - 'A' + 10; } @@ -688,7 +730,7 @@ done: /******************************************************************************* * - * FUNCTION: AcpiUtToUpper (TOUPPER) + * FUNCTION: toupper * * PARAMETERS: c - Character to convert * @@ -699,17 +741,17 @@ done: ******************************************************************************/ int -AcpiUtToUpper ( +toupper ( int c) { - return (ACPI_IS_LOWER(c) ? ((c)-0x20) : (c)); + return (islower(c) ? ((c)-0x20) : (c)); } /******************************************************************************* * - * FUNCTION: AcpiUtToLower (TOLOWER) + * FUNCTION: tolower * * PARAMETERS: c - Character to convert * @@ -720,11 +762,11 @@ AcpiUtToUpper ( ******************************************************************************/ int -AcpiUtToLower ( +tolower ( int c) { - return (ACPI_IS_UPPER(c) ? ((c)+0x20) : (c)); + return (isupper(c) ? ((c)+0x20) : (c)); } diff --git a/source/components/utilities/utcopy.c b/source/components/utilities/utcopy.c index 932faa3638c1..dc5ecda7731c 100644 --- a/source/components/utilities/utcopy.c +++ b/source/components/utilities/utcopy.c @@ -146,7 +146,7 @@ AcpiUtCopyIsimpleToEsimple ( /* Always clear the external object */ - ACPI_MEMSET (ExternalObject, 0, sizeof (ACPI_OBJECT)); + memset (ExternalObject, 0, sizeof (ACPI_OBJECT)); /* * In general, the external object will be the same type as @@ -165,7 +165,7 @@ AcpiUtCopyIsimpleToEsimple ( *BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD ( (ACPI_SIZE) InternalObject->String.Length + 1); - ACPI_MEMCPY ((void *) DataSpace, + memcpy ((void *) DataSpace, (void *) InternalObject->String.Pointer, (ACPI_SIZE) InternalObject->String.Length + 1); break; @@ -177,7 +177,7 @@ AcpiUtCopyIsimpleToEsimple ( *BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD ( InternalObject->String.Length); - ACPI_MEMCPY ((void *) DataSpace, + memcpy ((void *) DataSpace, (void *) InternalObject->Buffer.Pointer, InternalObject->Buffer.Length); break; @@ -528,7 +528,7 @@ AcpiUtCopyEsimpleToIsimple ( goto ErrorExit; } - ACPI_MEMCPY (InternalObject->String.Pointer, + memcpy (InternalObject->String.Pointer, ExternalObject->String.Pointer, ExternalObject->String.Length); @@ -544,7 +544,7 @@ AcpiUtCopyEsimpleToIsimple ( goto ErrorExit; } - ACPI_MEMCPY (InternalObject->Buffer.Pointer, + memcpy (InternalObject->Buffer.Pointer, ExternalObject->Buffer.Pointer, ExternalObject->Buffer.Length); @@ -732,7 +732,7 @@ AcpiUtCopySimpleObject ( CopySize = sizeof (ACPI_NAMESPACE_NODE); } - ACPI_MEMCPY (ACPI_CAST_PTR (char, DestDesc), + memcpy (ACPI_CAST_PTR (char, DestDesc), ACPI_CAST_PTR (char, SourceDesc), CopySize); /* Restore the saved fields */ @@ -766,7 +766,7 @@ AcpiUtCopySimpleObject ( /* Copy the actual buffer data */ - ACPI_MEMCPY (DestDesc->Buffer.Pointer, + memcpy (DestDesc->Buffer.Pointer, SourceDesc->Buffer.Pointer, SourceDesc->Buffer.Length); } break; @@ -788,7 +788,7 @@ AcpiUtCopySimpleObject ( /* Copy the actual string data */ - ACPI_MEMCPY (DestDesc->String.Pointer, SourceDesc->String.Pointer, + memcpy (DestDesc->String.Pointer, SourceDesc->String.Pointer, (ACPI_SIZE) SourceDesc->String.Length + 1); } break; diff --git a/source/components/utilities/utids.c b/source/components/utilities/utids.c index 2affb2137bc6..1b7f1f5dad8a 100644 --- a/source/components/utilities/utids.c +++ b/source/components/utilities/utids.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: utids - support for device IDs - HID, UID, CID + * Module Name: utids - support for device IDs - HID, UID, CID, SUB, CLS * *****************************************************************************/ @@ -121,7 +121,7 @@ AcpiUtExecute_HID ( } else { - ACPI_STRCPY (Hid->String, ObjDesc->String.Pointer); + strcpy (Hid->String, ObjDesc->String.Pointer); } Hid->Length = Length; @@ -194,7 +194,7 @@ AcpiUtExecute_SUB ( /* Simply copy existing string */ - ACPI_STRCPY (Sub->String, ObjDesc->String.Pointer); + strcpy (Sub->String, ObjDesc->String.Pointer); Sub->Length = Length; *ReturnId = Sub; @@ -279,7 +279,7 @@ AcpiUtExecute_UID ( } else { - ACPI_STRCPY (Uid->String, ObjDesc->String.Pointer); + strcpy (Uid->String, ObjDesc->String.Pointer); } Uid->Length = Length; @@ -426,7 +426,7 @@ AcpiUtExecute_CID ( { /* Copy the String CID from the returned object */ - ACPI_STRCPY (NextIdString, CidObjects[i]->String.Pointer); + strcpy (NextIdString, CidObjects[i]->String.Pointer); Length = CidObjects[i]->String.Length + 1; } @@ -449,3 +449,97 @@ Cleanup: AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } + + +/******************************************************************************* + * + * FUNCTION: AcpiUtExecute_CLS + * + * PARAMETERS: DeviceNode - Node for the device + * ReturnId - Where the _CLS is returned + * + * RETURN: Status + * + * DESCRIPTION: Executes the _CLS control method that returns PCI-defined + * class code of the device. The _CLS value is always a package + * containing PCI class information as a list of integers. + * The returned string has format "BBSSPP", where: + * BB = Base-class code + * SS = Sub-class code + * PP = Programming Interface code + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtExecute_CLS ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_PNP_DEVICE_ID **ReturnId) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT **ClsObjects; + UINT32 Count; + ACPI_PNP_DEVICE_ID *Cls; + UINT32 Length; + ACPI_STATUS Status; + UINT8 ClassCode[3] = {0, 0, 0}; + + + ACPI_FUNCTION_TRACE (UtExecute_CLS); + + + Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CLS, + ACPI_BTYPE_PACKAGE, &ObjDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Get the size of the String to be returned, includes null terminator */ + + Length = ACPI_PCICLS_STRING_SIZE; + ClsObjects = ObjDesc->Package.Elements; + Count = ObjDesc->Package.Count; + + if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE) + { + if (Count > 0 && ClsObjects[0]->Common.Type == ACPI_TYPE_INTEGER) + { + ClassCode[0] = (UINT8) ClsObjects[0]->Integer.Value; + } + if (Count > 1 && ClsObjects[1]->Common.Type == ACPI_TYPE_INTEGER) + { + ClassCode[1] = (UINT8) ClsObjects[1]->Integer.Value; + } + if (Count > 2 && ClsObjects[2]->Common.Type == ACPI_TYPE_INTEGER) + { + ClassCode[2] = (UINT8) ClsObjects[2]->Integer.Value; + } + } + + /* Allocate a buffer for the CLS */ + + Cls = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); + if (!Cls) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* Area for the string starts after PNP_DEVICE_ID struct */ + + Cls->String = ACPI_ADD_PTR (char, Cls, sizeof (ACPI_PNP_DEVICE_ID)); + + /* Simply copy existing string */ + + AcpiExPciClsToString (Cls->String, ClassCode); + Cls->Length = Length; + *ReturnId = Cls; + + +Cleanup: + + /* On exit, we must delete the return object */ + + AcpiUtRemoveReference (ObjDesc); + return_ACPI_STATUS (Status); +} diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c index d482ad58782a..8ac133a2c21a 100644 --- a/source/components/utilities/utmisc.c +++ b/source/components/utilities/utmisc.c @@ -71,10 +71,10 @@ AcpiUtIsPciRootBridge ( * Check if this is a PCI root bridge. * ACPI 3.0+: check for a PCI Express root also. */ - if (!(ACPI_STRCMP (Id, + if (!(strcmp (Id, PCI_ROOT_HID_STRING)) || - !(ACPI_STRCMP (Id, + !(strcmp (Id, PCI_EXPRESS_ROOT_HID_STRING))) { return (TRUE); @@ -108,7 +108,8 @@ AcpiUtIsAmlTable ( if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT) || ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_PSDT) || - ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT)) + ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT) || + ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_OSDT)) { return (TRUE); } diff --git a/source/components/utilities/utosi.c b/source/components/utilities/utosi.c index f2c1adf70c34..30cba5422389 100644 --- a/source/components/utilities/utosi.c +++ b/source/components/utilities/utosi.c @@ -256,7 +256,7 @@ AcpiUtInstallInterface ( return (AE_NO_MEMORY); } - InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (InterfaceName) + 1); + InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (strlen (InterfaceName) + 1); if (!InterfaceInfo->Name) { ACPI_FREE (InterfaceInfo); @@ -265,7 +265,7 @@ AcpiUtInstallInterface ( /* Initialize new info and insert at the head of the global list */ - ACPI_STRCPY (InterfaceInfo->Name, InterfaceName); + strcpy (InterfaceInfo->Name, InterfaceName); InterfaceInfo->Flags = ACPI_OSI_DYNAMIC; InterfaceInfo->Next = AcpiGbl_SupportedInterfaces; @@ -298,7 +298,7 @@ AcpiUtRemoveInterface ( PreviousInterface = NextInterface = AcpiGbl_SupportedInterfaces; while (NextInterface) { - if (!ACPI_STRCMP (InterfaceName, NextInterface->Name)) + if (!strcmp (InterfaceName, NextInterface->Name)) { /* Found: name is in either the static list or was added at runtime */ @@ -419,7 +419,7 @@ AcpiUtGetInterface ( NextInterface = AcpiGbl_SupportedInterfaces; while (NextInterface) { - if (!ACPI_STRCMP (InterfaceName, NextInterface->Name)) + if (!strcmp (InterfaceName, NextInterface->Name)) { return (NextInterface); } diff --git a/source/components/utilities/utpredef.c b/source/components/utilities/utpredef.c index 205fa45e6f77..1b7ef34181cb 100644 --- a/source/components/utilities/utpredef.c +++ b/source/components/utilities/utpredef.c @@ -166,7 +166,7 @@ AcpiUtGetExpectedReturnTypes ( if (!ExpectedBtypes) { - ACPI_STRCPY (Buffer, "NONE"); + strcpy (Buffer, "NONE"); return; } @@ -180,7 +180,7 @@ AcpiUtGetExpectedReturnTypes ( if (ExpectedBtypes & ThisRtype) { - ACPI_STRCAT (Buffer, &UtRtypeNames[i][j]); + strcat (Buffer, &UtRtypeNames[i][j]); j = 0; /* Use name separator from now on */ } diff --git a/source/components/utilities/utprint.c b/source/components/utilities/utprint.c index ffb5e6ad24d1..832d04fd35c2 100644 --- a/source/components/utilities/utprint.c +++ b/source/components/utilities/utprint.c @@ -227,7 +227,7 @@ AcpiUtScanNumber ( UINT64 Number = 0; - while (ACPI_IS_DIGIT (*String)) + while (isdigit (*String)) { Number *= 10; Number += *(String++) - '0'; @@ -505,7 +505,7 @@ AcpiUtVsnprintf ( /* Process width */ Width = -1; - if (ACPI_IS_DIGIT (*Format)) + if (isdigit (*Format)) { Format = AcpiUtScanNumber (Format, &Number); Width = (INT32) Number; @@ -527,7 +527,7 @@ AcpiUtVsnprintf ( if (*Format == '.') { ++Format; - if (ACPI_IS_DIGIT(*Format)) + if (isdigit(*Format)) { Format = AcpiUtScanNumber (Format, &Number); Precision = (INT32) Number; diff --git a/source/components/utilities/utstring.c b/source/components/utilities/utstring.c index 035d5ba8d3b2..737903d334df 100644 --- a/source/components/utilities/utstring.c +++ b/source/components/utilities/utstring.c @@ -89,7 +89,7 @@ AcpiUtStrlwr ( for (String = SrcString; *String; String++) { - *String = (char) ACPI_TOLOWER (*String); + *String = (char) tolower (*String); } return; @@ -168,7 +168,7 @@ AcpiUtStrupr ( for (String = SrcString; *String; String++) { - *String = (char) ACPI_TOUPPER (*String); + *String = (char) toupper (*String); } return; @@ -234,7 +234,7 @@ AcpiUtStrtoul64 ( /* Skip over any white space in the buffer */ - while ((*String) && (ACPI_IS_SPACE (*String) || *String == '\t')) + while ((*String) && (isspace (*String) || *String == '\t')) { String++; } @@ -245,7 +245,7 @@ AcpiUtStrtoul64 ( * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. * We need to determine if it is decimal or hexadecimal. */ - if ((*String == '0') && (ACPI_TOLOWER (*(String + 1)) == 'x')) + if ((*String == '0') && (tolower (*(String + 1)) == 'x')) { SignOf0x = 1; Base = 16; @@ -261,7 +261,7 @@ AcpiUtStrtoul64 ( /* Any string left? Check that '0x' is not followed by white space. */ - if (!(*String) || ACPI_IS_SPACE (*String) || *String == '\t') + if (!(*String) || isspace (*String) || *String == '\t') { if (ToIntegerOp) { @@ -283,7 +283,7 @@ AcpiUtStrtoul64 ( while (*String) { - if (ACPI_IS_DIGIT (*String)) + if (isdigit (*String)) { /* Convert ASCII 0-9 to Decimal value */ @@ -297,8 +297,8 @@ AcpiUtStrtoul64 ( } else { - ThisDigit = (UINT8) ACPI_TOUPPER (*String); - if (ACPI_IS_XDIGIT ((char) ThisDigit)) + ThisDigit = (UINT8) toupper (*String); + if (isxdigit ((char) ThisDigit)) { /* Convert ASCII Hex char to value */ @@ -469,7 +469,7 @@ AcpiUtPrintString ( /* Check for printable character or hex escape */ - if (ACPI_IS_PRINT (String[i])) + if (isprint (String[i])) { /* This is a normal character */ @@ -711,12 +711,12 @@ AcpiUtSafeStrcpy ( char *Source) { - if (ACPI_STRLEN (Source) >= DestSize) + if (strlen (Source) >= DestSize) { return (TRUE); } - ACPI_STRCPY (Dest, Source); + strcpy (Dest, Source); return (FALSE); } @@ -727,12 +727,12 @@ AcpiUtSafeStrcat ( char *Source) { - if ((ACPI_STRLEN (Dest) + ACPI_STRLEN (Source)) >= DestSize) + if ((strlen (Dest) + strlen (Source)) >= DestSize) { return (TRUE); } - ACPI_STRCAT (Dest, Source); + strcat (Dest, Source); return (FALSE); } @@ -746,14 +746,14 @@ AcpiUtSafeStrncat ( ACPI_SIZE ActualTransferLength; - ActualTransferLength = ACPI_MIN (MaxTransferLength, ACPI_STRLEN (Source)); + ActualTransferLength = ACPI_MIN (MaxTransferLength, strlen (Source)); - if ((ACPI_STRLEN (Dest) + ActualTransferLength) >= DestSize) + if ((strlen (Dest) + ActualTransferLength) >= DestSize) { return (TRUE); } - ACPI_STRNCAT (Dest, Source, MaxTransferLength); + strncat (Dest, Source, MaxTransferLength); return (FALSE); } #endif diff --git a/source/components/utilities/uttrack.c b/source/components/utilities/uttrack.c index 44ef0ed7eae4..7a594be88fc2 100644 --- a/source/components/utilities/uttrack.c +++ b/source/components/utilities/uttrack.c @@ -113,7 +113,7 @@ AcpiUtCreateList ( return (AE_NO_MEMORY); } - ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); + memset (Cache, 0, sizeof (ACPI_MEMORY_LIST)); Cache->ListName = ListName; Cache->ObjectSize = ObjectSize; @@ -445,7 +445,7 @@ AcpiUtTrackAllocation ( Allocation->Component = Component; Allocation->Line = Line; - ACPI_STRNCPY (Allocation->Module, Module, ACPI_MAX_MODULE_NAME); + strncpy (Allocation->Module, Module, ACPI_MAX_MODULE_NAME); Allocation->Module[ACPI_MAX_MODULE_NAME-1] = 0; if (!Element) @@ -556,7 +556,7 @@ AcpiUtRemoveAllocation ( /* Mark the segment as deleted */ - ACPI_MEMSET (&Allocation->UserSpace, 0xEA, Allocation->Size); + memset (&Allocation->UserSpace, 0xEA, Allocation->Size); Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY); return (Status); @@ -667,7 +667,7 @@ AcpiUtDumpAllocations ( while (Element) { if ((Element->Component & Component) && - ((Module == NULL) || (0 == ACPI_STRCMP (Module, Element->Module)))) + ((Module == NULL) || (0 == strcmp (Module, Element->Module)))) { Descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &Element->UserSpace); diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c index 4266dcebc1d7..2c6ff38c8d9a 100644 --- a/source/components/utilities/utxface.c +++ b/source/components/utilities/utxface.c @@ -263,7 +263,7 @@ AcpiGetStatistics ( Stats->SciCount = AcpiSciCount; Stats->GpeCount = AcpiGpeCount; - ACPI_MEMCPY (Stats->FixedEventCount, AcpiFixedEventCount, + memcpy (Stats->FixedEventCount, AcpiFixedEventCount, sizeof (AcpiFixedEventCount)); @@ -367,7 +367,7 @@ AcpiInstallInterface ( /* Parameter validation */ - if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) + if (!InterfaceName || (strlen (InterfaceName) == 0)) { return (AE_BAD_PARAMETER); } @@ -432,7 +432,7 @@ AcpiRemoveInterface ( /* Parameter validation */ - if (!InterfaceName || (ACPI_STRLEN (InterfaceName) == 0)) + if (!InterfaceName || (strlen (InterfaceName) == 0)) { return (AE_BAD_PARAMETER); } |