summaryrefslogtreecommitdiff
path: root/source/components/utilities
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2015-11-25 21:04:42 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2015-11-25 21:04:42 +0000
commitb9098066cd6284319bca922f13e59517f774a103 (patch)
treef01fd6c9053cb01ed84c00cb42ee789adafceaf5 /source/components/utilities
parent1e24cf365bc9c8df179b145c90d52852724e54ee (diff)
Notes
Diffstat (limited to 'source/components/utilities')
-rw-r--r--source/components/utilities/utaddress.c2
-rw-r--r--source/components/utilities/utalloc.c15
-rw-r--r--source/components/utilities/utcache.c4
-rw-r--r--source/components/utilities/utcopy.c120
-rw-r--r--source/components/utilities/utdecode.c31
-rw-r--r--source/components/utilities/utdelete.c11
-rw-r--r--source/components/utilities/uterror.c8
-rw-r--r--source/components/utilities/uteval.c8
-rw-r--r--source/components/utilities/utfileio.c366
-rw-r--r--source/components/utilities/uthex.c2
-rw-r--r--source/components/utilities/utids.c93
-rw-r--r--source/components/utilities/utinit.c16
-rw-r--r--source/components/utilities/utmath.c33
-rw-r--r--source/components/utilities/utmisc.c30
-rw-r--r--source/components/utilities/utmutex.c7
-rw-r--r--source/components/utilities/utnonansi.c4
-rw-r--r--source/components/utilities/utobject.c30
-rw-r--r--source/components/utilities/utosi.c14
-rw-r--r--source/components/utilities/utownerid.c11
-rw-r--r--source/components/utilities/utpredef.c6
-rw-r--r--source/components/utilities/utprint.c16
-rw-r--r--source/components/utilities/utresrc.c17
-rw-r--r--source/components/utilities/utstate.c3
-rw-r--r--source/components/utilities/utstring.c1
-rw-r--r--source/components/utilities/uttrack.c81
-rw-r--r--source/components/utilities/utuuid.c8
-rw-r--r--source/components/utilities/utxface.c21
-rw-r--r--source/components/utilities/utxferror.c4
-rw-r--r--source/components/utilities/utxfmutex.c4
29 files changed, 282 insertions, 684 deletions
diff --git a/source/components/utilities/utaddress.c b/source/components/utilities/utaddress.c
index 2ebdea47e830..3106c4d4e272 100644
--- a/source/components/utilities/utaddress.c
+++ b/source/components/utilities/utaddress.c
@@ -263,7 +263,7 @@ AcpiUtCheckAddressRange (
OverlapCount++;
if (Warn) /* Optional warning message */
{
- Pathname = AcpiNsGetExternalPathname (RangeInfo->RegionNode);
+ Pathname = AcpiNsGetNormalizedPathname (RangeInfo->RegionNode, TRUE);
ACPI_WARNING ((AE_INFO,
"%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)",
diff --git a/source/components/utilities/utalloc.c b/source/components/utilities/utalloc.c
index d0b5c920634c..9fed8b84550f 100644
--- a/source/components/utilities/utalloc.c
+++ b/source/components/utilities/utalloc.c
@@ -110,35 +110,35 @@ AcpiUtCreateCaches (
/* Object Caches, for frequently used objects */
Status = AcpiOsCreateCache ("Acpi-Namespace", sizeof (ACPI_NAMESPACE_NODE),
- ACPI_MAX_NAMESPACE_CACHE_DEPTH, &AcpiGbl_NamespaceCache);
+ ACPI_MAX_NAMESPACE_CACHE_DEPTH, &AcpiGbl_NamespaceCache);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiOsCreateCache ("Acpi-State", sizeof (ACPI_GENERIC_STATE),
- ACPI_MAX_STATE_CACHE_DEPTH, &AcpiGbl_StateCache);
+ ACPI_MAX_STATE_CACHE_DEPTH, &AcpiGbl_StateCache);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiOsCreateCache ("Acpi-Parse", sizeof (ACPI_PARSE_OBJ_COMMON),
- ACPI_MAX_PARSE_CACHE_DEPTH, &AcpiGbl_PsNodeCache);
+ ACPI_MAX_PARSE_CACHE_DEPTH, &AcpiGbl_PsNodeCache);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiOsCreateCache ("Acpi-ParseExt", sizeof (ACPI_PARSE_OBJ_NAMED),
- ACPI_MAX_EXTPARSE_CACHE_DEPTH, &AcpiGbl_PsNodeExtCache);
+ ACPI_MAX_EXTPARSE_CACHE_DEPTH, &AcpiGbl_PsNodeExtCache);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiOsCreateCache ("Acpi-Operand", sizeof (ACPI_OPERAND_OBJECT),
- ACPI_MAX_OBJECT_CACHE_DEPTH, &AcpiGbl_OperandCache);
+ ACPI_MAX_OBJECT_CACHE_DEPTH, &AcpiGbl_OperandCache);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -150,14 +150,14 @@ AcpiUtCreateCaches (
/* Memory allocation lists */
Status = AcpiUtCreateList ("Acpi-Global", 0,
- &AcpiGbl_GlobalList);
+ &AcpiGbl_GlobalList);
if (ACPI_FAILURE (Status))
{
return (Status);
}
Status = AcpiUtCreateList ("Acpi-Namespace", sizeof (ACPI_NAMESPACE_NODE),
- &AcpiGbl_NsNodeList);
+ &AcpiGbl_NsNodeList);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -187,6 +187,7 @@ AcpiUtDeleteCaches (
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
char Buffer[7];
+
if (AcpiGbl_DisplayFinalMemStats)
{
strcpy (Buffer, "MEMORY");
diff --git a/source/components/utilities/utcache.c b/source/components/utilities/utcache.c
index 7a0f210dff6a..01c04fab9335 100644
--- a/source/components/utilities/utcache.c
+++ b/source/components/utilities/utcache.c
@@ -93,9 +93,9 @@ AcpiOsCreateCache (
/* Populate the cache object and return it */
memset (Cache, 0, sizeof (ACPI_MEMORY_LIST));
- Cache->ListName = CacheName;
+ Cache->ListName = CacheName;
Cache->ObjectSize = ObjectSize;
- Cache->MaxDepth = MaxDepth;
+ Cache->MaxDepth = MaxDepth;
*ReturnCache = Cache;
return (AE_OK);
diff --git a/source/components/utilities/utcopy.c b/source/components/utilities/utcopy.c
index dc5ecda7731c..bab6b9f27013 100644
--- a/source/components/utilities/utcopy.c
+++ b/source/components/utilities/utcopy.c
@@ -163,7 +163,7 @@ AcpiUtCopyIsimpleToEsimple (
ExternalObject->String.Pointer = (char *) DataSpace;
ExternalObject->String.Length = InternalObject->String.Length;
*BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD (
- (ACPI_SIZE) InternalObject->String.Length + 1);
+ (ACPI_SIZE) InternalObject->String.Length + 1);
memcpy ((void *) DataSpace,
(void *) InternalObject->String.Pointer,
@@ -175,7 +175,7 @@ AcpiUtCopyIsimpleToEsimple (
ExternalObject->Buffer.Pointer = DataSpace;
ExternalObject->Buffer.Length = InternalObject->Buffer.Length;
*BufferSpaceUsed = ACPI_ROUND_UP_TO_NATIVE_WORD (
- InternalObject->String.Length);
+ InternalObject->String.Length);
memcpy ((void *) DataSpace,
(void *) InternalObject->Buffer.Pointer,
@@ -275,9 +275,9 @@ AcpiUtCopyIelementToEelement (
ACPI_FUNCTION_ENTRY ();
- ThisIndex = State->Pkg.Index;
- TargetObject = (ACPI_OBJECT *)
- &((ACPI_OBJECT *)(State->Pkg.DestObject))->Package.Elements[ThisIndex];
+ ThisIndex = State->Pkg.Index;
+ TargetObject = (ACPI_OBJECT *) &((ACPI_OBJECT *)
+ (State->Pkg.DestObject))->Package.Elements[ThisIndex];
switch (ObjectType)
{
@@ -286,7 +286,7 @@ AcpiUtCopyIelementToEelement (
* This is a simple or null object
*/
Status = AcpiUtCopyIsimpleToEsimple (SourceObject,
- TargetObject, Info->FreeSpace, &ObjectSpace);
+ TargetObject, Info->FreeSpace, &ObjectSpace);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -297,9 +297,9 @@ AcpiUtCopyIelementToEelement (
/*
* Build the package object
*/
- TargetObject->Type = ACPI_TYPE_PACKAGE;
- TargetObject->Package.Count = SourceObject->Package.Count;
- TargetObject->Package.Elements =
+ TargetObject->Type = ACPI_TYPE_PACKAGE;
+ TargetObject->Package.Count = SourceObject->Package.Count;
+ TargetObject->Package.Elements =
ACPI_CAST_PTR (ACPI_OBJECT, Info->FreeSpace);
/*
@@ -312,8 +312,8 @@ AcpiUtCopyIelementToEelement (
* update the buffer length counter
*/
ObjectSpace = ACPI_ROUND_UP_TO_NATIVE_WORD (
- (ACPI_SIZE) TargetObject->Package.Count *
- sizeof (ACPI_OBJECT));
+ (ACPI_SIZE) TargetObject->Package.Count *
+ sizeof (ACPI_OBJECT));
break;
default:
@@ -321,8 +321,8 @@ AcpiUtCopyIelementToEelement (
return (AE_BAD_PARAMETER);
}
- Info->FreeSpace += ObjectSpace;
- Info->Length += ObjectSpace;
+ Info->FreeSpace += ObjectSpace;
+ Info->Length += ObjectSpace;
return (Status);
}
@@ -368,28 +368,28 @@ AcpiUtCopyIpackageToEpackage (
/*
* Free space begins right after the first package
*/
- Info.Length = ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
- Info.FreeSpace = Buffer + ACPI_ROUND_UP_TO_NATIVE_WORD (
- sizeof (ACPI_OBJECT));
+ Info.Length = ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
+ Info.FreeSpace = Buffer +
+ ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
Info.ObjectSpace = 0;
Info.NumPackages = 1;
- ExternalObject->Type = InternalObject->Common.Type;
- ExternalObject->Package.Count = InternalObject->Package.Count;
- ExternalObject->Package.Elements = ACPI_CAST_PTR (ACPI_OBJECT,
- Info.FreeSpace);
+ ExternalObject->Type = InternalObject->Common.Type;
+ ExternalObject->Package.Count = InternalObject->Package.Count;
+ ExternalObject->Package.Elements =
+ ACPI_CAST_PTR (ACPI_OBJECT, Info.FreeSpace);
/*
* Leave room for an array of ACPI_OBJECTS in the buffer
* and move the free space past it
*/
- Info.Length += (ACPI_SIZE) ExternalObject->Package.Count *
- ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
+ Info.Length += (ACPI_SIZE) ExternalObject->Package.Count *
+ ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
Info.FreeSpace += ExternalObject->Package.Count *
- ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
+ ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT));
Status = AcpiUtWalkPackageTree (InternalObject, ExternalObject,
- AcpiUtCopyIelementToEelement, &Info);
+ AcpiUtCopyIelementToEelement, &Info);
*SpaceUsed = Info.Length;
return_ACPI_STATUS (Status);
@@ -428,7 +428,7 @@ AcpiUtCopyIobjectToEobject (
* nested packages)
*/
Status = AcpiUtCopyIpackageToEpackage (InternalObject,
- RetBuffer->Pointer, &RetBuffer->Length);
+ RetBuffer->Pointer, &RetBuffer->Length);
}
else
{
@@ -436,10 +436,10 @@ AcpiUtCopyIobjectToEobject (
* Build a simple object (no nested objects)
*/
Status = AcpiUtCopyIsimpleToEsimple (InternalObject,
- ACPI_CAST_PTR (ACPI_OBJECT, RetBuffer->Pointer),
- ACPI_ADD_PTR (UINT8, RetBuffer->Pointer,
- ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT))),
- &RetBuffer->Length);
+ ACPI_CAST_PTR (ACPI_OBJECT, RetBuffer->Pointer),
+ ACPI_ADD_PTR (UINT8, RetBuffer->Pointer,
+ ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT))),
+ &RetBuffer->Length);
/*
* build simple does not include the object size in the length
* so we add it in here
@@ -489,7 +489,7 @@ AcpiUtCopyEsimpleToIsimple (
case ACPI_TYPE_LOCAL_REFERENCE:
InternalObject = AcpiUtCreateInternalObject (
- (UINT8) ExternalObject->Type);
+ (UINT8) ExternalObject->Type);
if (!InternalObject)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -529,10 +529,10 @@ AcpiUtCopyEsimpleToIsimple (
}
memcpy (InternalObject->String.Pointer,
- ExternalObject->String.Pointer,
- ExternalObject->String.Length);
+ ExternalObject->String.Pointer,
+ ExternalObject->String.Length);
- InternalObject->String.Length = ExternalObject->String.Length;
+ InternalObject->String.Length = ExternalObject->String.Length;
break;
case ACPI_TYPE_BUFFER:
@@ -545,10 +545,10 @@ AcpiUtCopyEsimpleToIsimple (
}
memcpy (InternalObject->Buffer.Pointer,
- ExternalObject->Buffer.Pointer,
- ExternalObject->Buffer.Length);
+ ExternalObject->Buffer.Pointer,
+ ExternalObject->Buffer.Length);
- InternalObject->Buffer.Length = ExternalObject->Buffer.Length;
+ InternalObject->Buffer.Length = ExternalObject->Buffer.Length;
/* Mark buffer data valid */
@@ -557,7 +557,7 @@ AcpiUtCopyEsimpleToIsimple (
case ACPI_TYPE_INTEGER:
- InternalObject->Integer.Value = ExternalObject->Integer.Value;
+ InternalObject->Integer.Value = ExternalObject->Integer.Value;
break;
case ACPI_TYPE_LOCAL_REFERENCE:
@@ -615,7 +615,8 @@ AcpiUtCopyEpackageToIpackage (
/* Create the package object */
- PackageObject = AcpiUtCreatePackageObject (ExternalObject->Package.Count);
+ PackageObject = AcpiUtCreatePackageObject (
+ ExternalObject->Package.Count);
if (!PackageObject)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@@ -624,14 +625,14 @@ AcpiUtCopyEpackageToIpackage (
PackageElements = PackageObject->Package.Elements;
/*
- * Recursive implementation. Probably ok, since nested external packages
- * as parameters should be very rare.
+ * Recursive implementation. Probably ok, since nested external
+ * packages as parameters should be very rare.
*/
for (i = 0; i < ExternalObject->Package.Count; i++)
{
Status = AcpiUtCopyEobjectToIobject (
- &ExternalObject->Package.Elements[i],
- &PackageElements[i]);
+ &ExternalObject->Package.Elements[i],
+ &PackageElements[i]);
if (ACPI_FAILURE (Status))
{
/* Truncate package and delete it */
@@ -678,14 +679,16 @@ AcpiUtCopyEobjectToIobject (
if (ExternalObject->Type == ACPI_TYPE_PACKAGE)
{
- Status = AcpiUtCopyEpackageToIpackage (ExternalObject, InternalObject);
+ Status = AcpiUtCopyEpackageToIpackage (
+ ExternalObject, InternalObject);
}
else
{
/*
* Build a simple object (no nested objects)
*/
- Status = AcpiUtCopyEsimpleToIsimple (ExternalObject, InternalObject);
+ Status = AcpiUtCopyEsimpleToIsimple (ExternalObject,
+ InternalObject);
}
return_ACPI_STATUS (Status);
@@ -836,7 +839,7 @@ AcpiUtCopySimpleObject (
case ACPI_TYPE_EVENT:
Status = AcpiOsCreateSemaphore (ACPI_NO_UNIT_LIMIT, 0,
- &DestDesc->Event.OsSemaphore);
+ &DestDesc->Event.OsSemaphore);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -882,9 +885,9 @@ AcpiUtCopyIelementToIelement (
ACPI_FUNCTION_ENTRY ();
- ThisIndex = State->Pkg.Index;
+ ThisIndex = State->Pkg.Index;
ThisTargetPtr = (ACPI_OPERAND_OBJECT **)
- &State->Pkg.DestObject->Package.Elements[ThisIndex];
+ &State->Pkg.DestObject->Package.Elements[ThisIndex];
switch (ObjectType)
{
@@ -898,7 +901,7 @@ AcpiUtCopyIelementToIelement (
* This is a simple object, just copy it
*/
TargetObject = AcpiUtCreateInternalObject (
- SourceObject->Common.Type);
+ SourceObject->Common.Type);
if (!TargetObject)
{
return (AE_NO_MEMORY);
@@ -925,7 +928,8 @@ AcpiUtCopyIelementToIelement (
* This object is a package - go down another nesting level
* Create and build the package object
*/
- TargetObject = AcpiUtCreatePackageObject (SourceObject->Package.Count);
+ TargetObject = AcpiUtCreatePackageObject (
+ SourceObject->Package.Count);
if (!TargetObject)
{
return (AE_NO_MEMORY);
@@ -982,16 +986,16 @@ AcpiUtCopyIpackageToIpackage (
ACPI_FUNCTION_TRACE (UtCopyIpackageToIpackage);
- DestObj->Common.Type = SourceObj->Common.Type;
- DestObj->Common.Flags = SourceObj->Common.Flags;
- DestObj->Package.Count = SourceObj->Package.Count;
+ DestObj->Common.Type = SourceObj->Common.Type;
+ DestObj->Common.Flags = SourceObj->Common.Flags;
+ DestObj->Package.Count = SourceObj->Package.Count;
/*
* Create the object array and walk the source package tree
*/
DestObj->Package.Elements = ACPI_ALLOCATE_ZEROED (
- ((ACPI_SIZE) SourceObj->Package.Count + 1) *
- sizeof (void *));
+ ((ACPI_SIZE) SourceObj->Package.Count + 1) *
+ sizeof (void *));
if (!DestObj->Package.Elements)
{
ACPI_ERROR ((AE_INFO, "Package allocation failure"));
@@ -1003,7 +1007,7 @@ AcpiUtCopyIpackageToIpackage (
* This handles nested packages of arbitrary depth.
*/
Status = AcpiUtWalkPackageTree (SourceObj, DestObj,
- AcpiUtCopyIelementToIelement, WalkState);
+ AcpiUtCopyIelementToIelement, WalkState);
if (ACPI_FAILURE (Status))
{
/* On failure, delete the destination package object */
@@ -1053,8 +1057,8 @@ AcpiUtCopyIobjectToIobject (
if (SourceDesc->Common.Type == ACPI_TYPE_PACKAGE)
{
- Status = AcpiUtCopyIpackageToIpackage (SourceDesc, *DestDesc,
- WalkState);
+ Status = AcpiUtCopyIpackageToIpackage (
+ SourceDesc, *DestDesc, WalkState);
}
else
{
@@ -1065,7 +1069,7 @@ AcpiUtCopyIobjectToIobject (
if (ACPI_FAILURE (Status))
{
- AcpiUtRemoveReference(*DestDesc);
+ AcpiUtRemoveReference (*DestDesc);
}
return_ACPI_STATUS (Status);
diff --git a/source/components/utilities/utdecode.c b/source/components/utilities/utdecode.c
index fc21e205845b..e8f380f0c51f 100644
--- a/source/components/utilities/utdecode.c
+++ b/source/components/utilities/utdecode.c
@@ -119,7 +119,7 @@ const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] =
};
-char *
+const char *
AcpiUtGetRegionName (
UINT8 SpaceId)
{
@@ -141,7 +141,7 @@ AcpiUtGetRegionName (
return ("InvalidSpaceId");
}
- return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId]));
+ return (AcpiGbl_RegionTypes[SpaceId]);
}
@@ -169,7 +169,7 @@ static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] =
};
-char *
+const char *
AcpiUtGetEventName (
UINT32 EventId)
{
@@ -179,7 +179,7 @@ AcpiUtGetEventName (
return ("InvalidEventID");
}
- return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId]));
+ return (AcpiGbl_EventTypes[EventId]);
}
@@ -201,7 +201,8 @@ AcpiUtGetEventName (
*
* The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching;
* when stored in a table it really means that we have thus far seen no
- * evidence to indicate what type is actually going to be stored for this entry.
+ * evidence to indicate what type is actually going to be stored for this
+ & entry.
*/
static const char AcpiGbl_BadType[] = "UNDEFINED";
@@ -243,21 +244,21 @@ static const char *AcpiGbl_NsTypeNames[] =
};
-char *
+const char *
AcpiUtGetTypeName (
ACPI_OBJECT_TYPE Type)
{
if (Type > ACPI_TYPE_INVALID)
{
- return (ACPI_CAST_PTR (char, AcpiGbl_BadType));
+ return (AcpiGbl_BadType);
}
- return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type]));
+ return (AcpiGbl_NsTypeNames[Type]);
}
-char *
+const char *
AcpiUtGetObjectTypeName (
ACPI_OPERAND_OBJECT *ObjDesc)
{
@@ -299,7 +300,7 @@ AcpiUtGetObjectTypeName (
*
******************************************************************************/
-char *
+const char *
AcpiUtGetNodeName (
void *Object)
{
@@ -375,7 +376,7 @@ static const char *AcpiGbl_DescTypeNames[] =
};
-char *
+const char *
AcpiUtGetDescriptorName (
void *Object)
{
@@ -390,9 +391,7 @@ AcpiUtGetDescriptorName (
return ("Not a Descriptor");
}
- return (ACPI_CAST_PTR (char,
- AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]));
-
+ return (AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]);
}
@@ -469,7 +468,7 @@ AcpiUtGetReferenceName (
/* Names for internal mutex objects, used for debug output */
-static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
+static const char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
{
"ACPI_MTX_Interpreter",
"ACPI_MTX_Namespace",
@@ -479,7 +478,7 @@ static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
"ACPI_MTX_Memory",
};
-char *
+const char *
AcpiUtGetMutexName (
UINT32 MutexId)
{
diff --git a/source/components/utilities/utdelete.c b/source/components/utilities/utdelete.c
index 17ccacb6e2a2..95521f060d3e 100644
--- a/source/components/utilities/utdelete.c
+++ b/source/components/utilities/utdelete.c
@@ -220,6 +220,7 @@ AcpiUtDeleteInternalObj (
AcpiUtDeleteObjectDesc (Object->Method.Mutex);
Object->Method.Mutex = NULL;
}
+
if (Object->Method.Node)
{
Object->Method.Node = NULL;
@@ -553,8 +554,8 @@ AcpiUtUpdateObjectReference (
}
/*
- * All sub-objects must have their reference count incremented also.
- * Different object types have different subobjects.
+ * All sub-objects must have their reference count incremented
+ * also. Different object types have different subobjects.
*/
switch (Object->Common.Type)
{
@@ -614,7 +615,7 @@ AcpiUtUpdateObjectReference (
* for later processing (this eliminates recursion.)
*/
Status = AcpiUtCreateUpdateStateAndPush (
- NextObject, Action, &StateList);
+ NextObject, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
@@ -639,7 +640,7 @@ AcpiUtUpdateObjectReference (
NextObject = Object->BankField.BankObj;
Status = AcpiUtCreateUpdateStateAndPush (
- Object->BankField.RegionObj, Action, &StateList);
+ Object->BankField.RegionObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
@@ -650,7 +651,7 @@ AcpiUtUpdateObjectReference (
NextObject = Object->IndexField.IndexObj;
Status = AcpiUtCreateUpdateStateAndPush (
- Object->IndexField.DataObj, Action, &StateList);
+ Object->IndexField.DataObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
diff --git a/source/components/utilities/uterror.c b/source/components/utilities/uterror.c
index b5f532f2fbd7..756a259f9424 100644
--- a/source/components/utilities/uterror.c
+++ b/source/components/utilities/uterror.c
@@ -244,8 +244,8 @@ AcpiUtNamespaceError (
{
/* Convert path to external format */
- Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
- InternalName, NULL, &Name);
+ Status = AcpiNsExternalizeName (
+ ACPI_UINT32_MAX, InternalName, NULL, &Name);
/* Print target name */
@@ -307,8 +307,8 @@ AcpiUtMethodError (
if (Path)
{
- Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH,
- &Node);
+ Status = AcpiNsGetNode (PrefixNode, Path,
+ ACPI_NS_NO_UPSEARCH, &Node);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("[Could not get node by pathname]");
diff --git a/source/components/utilities/uteval.c b/source/components/utilities/uteval.c
index 542c691276c1..24afcad2a3cb 100644
--- a/source/components/utilities/uteval.c
+++ b/source/components/utilities/uteval.c
@@ -231,7 +231,7 @@ AcpiUtEvaluateNumericObject (
Status = AcpiUtEvaluateObject (DeviceNode, ObjectName,
- ACPI_BTYPE_INTEGER, &ObjDesc);
+ ACPI_BTYPE_INTEGER, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -278,7 +278,7 @@ AcpiUtExecute_STA (
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__STA,
- ACPI_BTYPE_INTEGER, &ObjDesc);
+ ACPI_BTYPE_INTEGER, &ObjDesc);
if (ACPI_FAILURE (Status))
{
if (AE_NOT_FOUND == Status)
@@ -351,8 +351,8 @@ AcpiUtExecutePowerMethods (
* return type is an Integer.
*/
Status = AcpiUtEvaluateObject (DeviceNode,
- ACPI_CAST_PTR (char, MethodNames[i]),
- ACPI_BTYPE_INTEGER, &ObjDesc);
+ ACPI_CAST_PTR (char, MethodNames[i]),
+ ACPI_BTYPE_INTEGER, &ObjDesc);
if (ACPI_SUCCESS (Status))
{
OutValues[i] = (UINT8) ObjDesc->Integer.Value;
diff --git a/source/components/utilities/utfileio.c b/source/components/utilities/utfileio.c
deleted file mode 100644
index 8c503543507e..000000000000
--- a/source/components/utilities/utfileio.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*******************************************************************************
- *
- * Module Name: utfileio - simple file I/O routines
- *
- ******************************************************************************/
-
-/*
- * Copyright (C) 2000 - 2015, Intel Corp.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions, and the following disclaimer,
- * without modification.
- * 2. Redistributions in binary form must reproduce at minimum a disclaimer
- * substantially similar to the "NO WARRANTY" disclaimer below
- * ("Disclaimer") and any redistribution must be conditioned upon
- * including a substantially similar Disclaimer requirement for further
- * binary redistribution.
- * 3. Neither the names of the above-listed copyright holders nor the names
- * of any contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- *
- * NO WARRANTY
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGES.
- */
-
-#include "acpi.h"
-#include "accommon.h"
-#include "actables.h"
-#include "acapps.h"
-#include "errno.h"
-
-#ifdef ACPI_ASL_COMPILER
-#include "aslcompiler.h"
-#endif
-
-
-#define _COMPONENT ACPI_CA_DEBUGGER
- ACPI_MODULE_NAME ("utfileio")
-
-
-#ifdef ACPI_APPLICATION
-
-/* Local prototypes */
-
-static ACPI_STATUS
-AcpiUtCheckTextModeCorruption (
- UINT8 *Table,
- UINT32 TableLength,
- UINT32 FileLength);
-
-static ACPI_STATUS
-AcpiUtReadTable (
- FILE *fp,
- ACPI_TABLE_HEADER **Table,
- UINT32 *TableLength);
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtCheckTextModeCorruption
- *
- * PARAMETERS: Table - Table buffer
- * TableLength - Length of table from the table header
- * FileLength - Length of the file that contains the table
- *
- * RETURN: Status
- *
- * DESCRIPTION: Check table for text mode file corruption where all linefeed
- * characters (LF) have been replaced by carriage return linefeed
- * pairs (CR/LF).
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiUtCheckTextModeCorruption (
- UINT8 *Table,
- UINT32 TableLength,
- UINT32 FileLength)
-{
- UINT32 i;
- UINT32 Pairs = 0;
-
-
- if (TableLength != FileLength)
- {
- ACPI_WARNING ((AE_INFO,
- "File length (0x%X) is not the same as the table length (0x%X)",
- FileLength, TableLength));
- }
-
- /* Scan entire table to determine if each LF has been prefixed with a CR */
-
- for (i = 1; i < FileLength; i++)
- {
- if (Table[i] == 0x0A)
- {
- if (Table[i - 1] != 0x0D)
- {
- /* The LF does not have a preceding CR, table not corrupted */
-
- return (AE_OK);
- }
- else
- {
- /* Found a CR/LF pair */
-
- Pairs++;
- }
- i++;
- }
- }
-
- if (!Pairs)
- {
- return (AE_OK);
- }
-
- /*
- * Entire table scanned, each CR is part of a CR/LF pair --
- * meaning that the table was treated as a text file somewhere.
- *
- * NOTE: We can't "fix" the table, because any existing CR/LF pairs in the
- * original table are left untouched by the text conversion process --
- * meaning that we cannot simply replace CR/LF pairs with LFs.
- */
- AcpiOsPrintf ("Table has been corrupted by text mode conversion\n");
- AcpiOsPrintf ("All LFs (%u) were changed to CR/LF pairs\n", Pairs);
- AcpiOsPrintf ("Table cannot be repaired!\n");
- return (AE_BAD_VALUE);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtReadTable
- *
- * PARAMETERS: fp - File that contains table
- * Table - Return value, buffer with table
- * TableLength - Return value, length of table
- *
- * RETURN: Status
- *
- * DESCRIPTION: Load the DSDT from the file pointer
- *
- ******************************************************************************/
-
-static ACPI_STATUS
-AcpiUtReadTable (
- FILE *fp,
- ACPI_TABLE_HEADER **Table,
- UINT32 *TableLength)
-{
- ACPI_TABLE_HEADER TableHeader;
- UINT32 Actual;
- ACPI_STATUS Status;
- UINT32 FileSize;
- BOOLEAN StandardHeader = TRUE;
- INT32 Count;
-
- /* Get the file size */
-
- FileSize = CmGetFileSize (fp);
- if (FileSize == ACPI_UINT32_MAX)
- {
- return (AE_ERROR);
- }
-
- if (FileSize < 4)
- {
- return (AE_BAD_HEADER);
- }
-
- /* Read the signature */
-
- fseek (fp, 0, SEEK_SET);
-
- Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), fp);
- if (Count != sizeof (ACPI_TABLE_HEADER))
- {
- AcpiOsPrintf ("Could not read the table header\n");
- return (AE_BAD_HEADER);
- }
-
- /* The RSDP table does not have standard ACPI header */
-
- if (ACPI_VALIDATE_RSDP_SIG (TableHeader.Signature))
- {
- *TableLength = FileSize;
- StandardHeader = FALSE;
- }
- else
- {
-
-#if 0
- /* Validate the table header/length */
-
- Status = AcpiTbValidateTableHeader (&TableHeader);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Table header is invalid!\n");
- return (Status);
- }
-#endif
-
- /* File size must be at least as long as the Header-specified length */
-
- if (TableHeader.Length > FileSize)
- {
- AcpiOsPrintf (
- "TableHeader length [0x%X] greater than the input file size [0x%X]\n",
- TableHeader.Length, FileSize);
-
-#ifdef ACPI_ASL_COMPILER
- AcpiOsPrintf ("File is corrupt or is ASCII text -- "
- "it must be a binary file\n");
-#endif
- return (AE_BAD_HEADER);
- }
-
-#ifdef ACPI_OBSOLETE_CODE
- /* We only support a limited number of table types */
-
- if (!ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_DSDT) &&
- !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_PSDT) &&
- !ACPI_COMPARE_NAME ((char *) TableHeader.Signature, ACPI_SIG_SSDT))
- {
- AcpiOsPrintf ("Table signature [%4.4s] is invalid or not supported\n",
- (char *) TableHeader.Signature);
- ACPI_DUMP_BUFFER (&TableHeader, sizeof (ACPI_TABLE_HEADER));
- return (AE_ERROR);
- }
-#endif
-
- *TableLength = TableHeader.Length;
- }
-
- /* Allocate a buffer for the table */
-
- *Table = AcpiOsAllocate ((size_t) FileSize);
- if (!*Table)
- {
- AcpiOsPrintf (
- "Could not allocate memory for ACPI table %4.4s (size=0x%X)\n",
- TableHeader.Signature, *TableLength);
- return (AE_NO_MEMORY);
- }
-
- /* Get the rest of the table */
-
- fseek (fp, 0, SEEK_SET);
- Actual = fread (*Table, 1, (size_t) FileSize, fp);
- if (Actual == FileSize)
- {
- if (StandardHeader)
- {
- /* Now validate the checksum */
-
- Status = AcpiTbVerifyChecksum ((void *) *Table,
- ACPI_CAST_PTR (ACPI_TABLE_HEADER, *Table)->Length);
-
- if (Status == AE_BAD_CHECKSUM)
- {
- Status = AcpiUtCheckTextModeCorruption ((UINT8 *) *Table,
- FileSize, (*Table)->Length);
- return (Status);
- }
- }
- return (AE_OK);
- }
-
- if (Actual > 0)
- {
- AcpiOsPrintf ("Warning - reading table, asked for %X got %X\n",
- FileSize, Actual);
- return (AE_OK);
- }
-
- AcpiOsPrintf ("Error - could not read the table file\n");
- AcpiOsFree (*Table);
- *Table = NULL;
- *TableLength = 0;
- return (AE_ERROR);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiUtReadTableFromFile
- *
- * PARAMETERS: Filename - File where table is located
- * Table - Where a pointer to the table is returned
- *
- * RETURN: Status
- *
- * DESCRIPTION: Get an ACPI table from a file
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiUtReadTableFromFile (
- char *Filename,
- ACPI_TABLE_HEADER **Table)
-{
- FILE *File;
- UINT32 FileSize;
- UINT32 TableLength;
- ACPI_STATUS Status = AE_ERROR;
-
-
- /* Open the file, get current size */
-
- File = fopen (Filename, "rb");
- if (!File)
- {
- perror ("Could not open input file");
-
- if (errno == ENOENT)
- {
- return (AE_NOT_EXIST);
- }
-
- return (Status);
- }
-
- FileSize = CmGetFileSize (File);
- if (FileSize == ACPI_UINT32_MAX)
- {
- goto Exit;
- }
-
- /* Get the entire file */
-
- fprintf (stderr,
- "Reading ACPI table from file %12s - Length %.8u (0x%06X)\n",
- Filename, FileSize, FileSize);
-
- Status = AcpiUtReadTable (File, Table, &TableLength);
- if (ACPI_FAILURE (Status))
- {
- AcpiOsPrintf ("Could not get table from the file\n");
- }
-
-Exit:
- fclose(File);
- return (Status);
-}
-
-#endif
diff --git a/source/components/utilities/uthex.c b/source/components/utilities/uthex.c
index abbf5f4874f1..7ec8fe059e39 100644
--- a/source/components/utilities/uthex.c
+++ b/source/components/utilities/uthex.c
@@ -50,7 +50,7 @@
/* Hex to ASCII conversion table */
-static char AcpiGbl_HexToAscii[] =
+static const char AcpiGbl_HexToAscii[] =
{
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
};
diff --git a/source/components/utilities/utids.c b/source/components/utilities/utids.c
index 1b7f1f5dad8a..528d78c64936 100644
--- a/source/components/utilities/utids.c
+++ b/source/components/utilities/utids.c
@@ -83,7 +83,7 @@ AcpiUtExecute_HID (
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__HID,
- ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
+ ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -102,7 +102,8 @@ AcpiUtExecute_HID (
/* Allocate a buffer for the HID */
- Hid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
+ Hid = ACPI_ALLOCATE_ZEROED (
+ sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
if (!Hid)
{
Status = AE_NO_MEMORY;
@@ -139,77 +140,6 @@ Cleanup:
/*******************************************************************************
*
- * FUNCTION: AcpiUtExecute_SUB
- *
- * PARAMETERS: DeviceNode - Node for the device
- * ReturnId - Where the _SUB is returned
- *
- * RETURN: Status
- *
- * DESCRIPTION: Executes the _SUB control method that returns the subsystem
- * ID of the device. The _SUB value is always a string containing
- * either a valid PNP or ACPI ID.
- *
- * NOTE: Internal function, no parameter validation
- *
- ******************************************************************************/
-
-ACPI_STATUS
-AcpiUtExecute_SUB (
- ACPI_NAMESPACE_NODE *DeviceNode,
- ACPI_PNP_DEVICE_ID **ReturnId)
-{
- ACPI_OPERAND_OBJECT *ObjDesc;
- ACPI_PNP_DEVICE_ID *Sub;
- UINT32 Length;
- ACPI_STATUS Status;
-
-
- ACPI_FUNCTION_TRACE (UtExecute_SUB);
-
-
- Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__SUB,
- ACPI_BTYPE_STRING, &ObjDesc);
- if (ACPI_FAILURE (Status))
- {
- return_ACPI_STATUS (Status);
- }
-
- /* Get the size of the String to be returned, includes null terminator */
-
- Length = ObjDesc->String.Length + 1;
-
- /* Allocate a buffer for the SUB */
-
- Sub = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
- if (!Sub)
- {
- Status = AE_NO_MEMORY;
- goto Cleanup;
- }
-
- /* Area for the string starts after PNP_DEVICE_ID struct */
-
- Sub->String = ACPI_ADD_PTR (char, Sub, sizeof (ACPI_PNP_DEVICE_ID));
-
- /* Simply copy existing string */
-
- strcpy (Sub->String, ObjDesc->String.Pointer);
- Sub->Length = Length;
- *ReturnId = Sub;
-
-
-Cleanup:
-
- /* On exit, we must delete the return object */
-
- AcpiUtRemoveReference (ObjDesc);
- return_ACPI_STATUS (Status);
-}
-
-
-/*******************************************************************************
- *
* FUNCTION: AcpiUtExecute_UID
*
* PARAMETERS: DeviceNode - Node for the device
@@ -241,7 +171,7 @@ AcpiUtExecute_UID (
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__UID,
- ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
+ ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -260,7 +190,8 @@ AcpiUtExecute_UID (
/* Allocate a buffer for the UID */
- Uid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
+ Uid = ACPI_ALLOCATE_ZEROED (
+ sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
if (!Uid)
{
Status = AE_NO_MEMORY;
@@ -341,8 +272,8 @@ AcpiUtExecute_CID (
/* Evaluate the _CID method for this device */
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CID,
- ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE,
- &ObjDesc);
+ ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_PACKAGE,
+ &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -419,7 +350,8 @@ AcpiUtExecute_CID (
{
/* Convert the Integer (EISAID) CID to a string */
- AcpiExEisaIdToString (NextIdString, CidObjects[i]->Integer.Value);
+ AcpiExEisaIdToString (
+ NextIdString, CidObjects[i]->Integer.Value);
Length = ACPI_EISAID_STRING_SIZE;
}
else /* ACPI_TYPE_STRING */
@@ -488,7 +420,7 @@ AcpiUtExecute_CLS (
Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__CLS,
- ACPI_BTYPE_PACKAGE, &ObjDesc);
+ ACPI_BTYPE_PACKAGE, &ObjDesc);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -518,7 +450,8 @@ AcpiUtExecute_CLS (
/* Allocate a buffer for the CLS */
- Cls = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
+ Cls = ACPI_ALLOCATE_ZEROED (
+ sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length);
if (!Cls)
{
Status = AE_NO_MEMORY;
diff --git a/source/components/utilities/utinit.c b/source/components/utilities/utinit.c
index 8f8eaaad92b9..9689abb43516 100644
--- a/source/components/utilities/utinit.c
+++ b/source/components/utilities/utinit.c
@@ -262,8 +262,6 @@ AcpiUtInitGlobals (
AcpiGbl_DisableMemTracking = FALSE;
#endif
- ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = FALSE);
-
return_ACPI_STATUS (AE_OK);
}
@@ -312,6 +310,20 @@ AcpiUtSubsystemShutdown (
ACPI_FUNCTION_TRACE (UtSubsystemShutdown);
+ /* Just exit if subsystem is already shutdown */
+
+ if (AcpiGbl_Shutdown)
+ {
+ ACPI_ERROR ((AE_INFO, "ACPI Subsystem is already terminated"));
+ return_VOID;
+ }
+
+ /* Subsystem appears active, go ahead and shut it down */
+
+ AcpiGbl_Shutdown = TRUE;
+ AcpiGbl_StartupFlags = 0;
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
+
#ifndef ACPI_ASL_COMPILER
/* Close the AcpiEvent Handling */
diff --git a/source/components/utilities/utmath.c b/source/components/utilities/utmath.c
index 0f920751c17c..9d44ad5533d5 100644
--- a/source/components/utilities/utmath.c
+++ b/source/components/utilities/utmath.c
@@ -122,9 +122,10 @@ AcpiUtShortDivide (
* and is generated by the second divide.
*/
ACPI_DIV_64_BY_32 (0, DividendOvl.Part.Hi, Divisor,
- Quotient.Part.Hi, Remainder32);
+ Quotient.Part.Hi, Remainder32);
+
ACPI_DIV_64_BY_32 (Remainder32, DividendOvl.Part.Lo, Divisor,
- Quotient.Part.Lo, Remainder32);
+ Quotient.Part.Lo, Remainder32);
/* Return only what was requested */
@@ -200,9 +201,10 @@ AcpiUtDivide (
* and is generated by the second divide.
*/
ACPI_DIV_64_BY_32 (0, Dividend.Part.Hi, Divisor.Part.Lo,
- Quotient.Part.Hi, Partial1);
+ Quotient.Part.Hi, Partial1);
+
ACPI_DIV_64_BY_32 (Partial1, Dividend.Part.Lo, Divisor.Part.Lo,
- Quotient.Part.Lo, Remainder.Part.Lo);
+ Quotient.Part.Lo, Remainder.Part.Lo);
}
else
@@ -219,25 +221,24 @@ AcpiUtDivide (
do
{
- ACPI_SHIFT_RIGHT_64 (NormalizedDivisor.Part.Hi,
- NormalizedDivisor.Part.Lo);
- ACPI_SHIFT_RIGHT_64 (NormalizedDividend.Part.Hi,
- NormalizedDividend.Part.Lo);
+ ACPI_SHIFT_RIGHT_64 (
+ NormalizedDivisor.Part.Hi, NormalizedDivisor.Part.Lo);
+ ACPI_SHIFT_RIGHT_64 (
+ NormalizedDividend.Part.Hi, NormalizedDividend.Part.Lo);
} while (NormalizedDivisor.Part.Hi != 0);
/* Partial divide */
- ACPI_DIV_64_BY_32 (NormalizedDividend.Part.Hi,
- NormalizedDividend.Part.Lo,
- NormalizedDivisor.Part.Lo,
- Quotient.Part.Lo, Partial1);
+ ACPI_DIV_64_BY_32 (
+ NormalizedDividend.Part.Hi, NormalizedDividend.Part.Lo,
+ NormalizedDivisor.Part.Lo, Quotient.Part.Lo, Partial1);
/*
- * The quotient is always 32 bits, and simply requires adjustment.
- * The 64-bit remainder must be generated.
+ * The quotient is always 32 bits, and simply requires
+ * adjustment. The 64-bit remainder must be generated.
*/
- Partial1 = Quotient.Part.Lo * Divisor.Part.Hi;
+ Partial1 = Quotient.Part.Lo * Divisor.Part.Hi;
Partial2.Full = (UINT64) Quotient.Part.Lo * Divisor.Part.Lo;
Partial3.Full = (UINT64) Partial2.Part.Hi + Partial1;
@@ -263,7 +264,7 @@ AcpiUtDivide (
}
}
- Remainder.Full = Remainder.Full - Dividend.Full;
+ Remainder.Full = Remainder.Full - Dividend.Full;
Remainder.Part.Hi = (UINT32) -((INT32) Remainder.Part.Hi);
Remainder.Part.Lo = (UINT32) -((INT32) Remainder.Part.Lo);
diff --git a/source/components/utilities/utmisc.c b/source/components/utilities/utmisc.c
index 3ab7f16ade78..b56a50cfe59a 100644
--- a/source/components/utilities/utmisc.c
+++ b/source/components/utilities/utmisc.c
@@ -72,10 +72,10 @@ AcpiUtIsPciRootBridge (
* ACPI 3.0+: check for a PCI Express root also.
*/
if (!(strcmp (Id,
- PCI_ROOT_HID_STRING)) ||
+ PCI_ROOT_HID_STRING)) ||
!(strcmp (Id,
- PCI_EXPRESS_ROOT_HID_STRING)))
+ PCI_EXPRESS_ROOT_HID_STRING)))
{
return (TRUE);
}
@@ -185,17 +185,17 @@ AcpiUtSetIntegerWidth (
{
/* 32-bit case */
- AcpiGbl_IntegerBitWidth = 32;
+ AcpiGbl_IntegerBitWidth = 32;
AcpiGbl_IntegerNybbleWidth = 8;
- AcpiGbl_IntegerByteWidth = 4;
+ AcpiGbl_IntegerByteWidth = 4;
}
else
{
/* 64-bit case (ACPI 2.0+) */
- AcpiGbl_IntegerBitWidth = 64;
+ AcpiGbl_IntegerBitWidth = 64;
AcpiGbl_IntegerNybbleWidth = 16;
- AcpiGbl_IntegerByteWidth = 8;
+ AcpiGbl_IntegerByteWidth = 8;
}
}
@@ -286,9 +286,9 @@ AcpiUtWalkPackageTree (
{
/* Get one element of the package */
- ThisIndex = State->Pkg.Index;
+ ThisIndex = State->Pkg.Index;
ThisSourceObj = (ACPI_OPERAND_OBJECT *)
- State->Pkg.SourceObject->Package.Elements[ThisIndex];
+ State->Pkg.SourceObject->Package.Elements[ThisIndex];
/*
* Check for:
@@ -299,7 +299,8 @@ AcpiUtWalkPackageTree (
* case below.
*/
if ((!ThisSourceObj) ||
- (ACPI_GET_DESCRIPTOR_TYPE (ThisSourceObj) != ACPI_DESC_TYPE_OPERAND) ||
+ (ACPI_GET_DESCRIPTOR_TYPE (ThisSourceObj) !=
+ ACPI_DESC_TYPE_OPERAND) ||
(ThisSourceObj->Common.Type != ACPI_TYPE_PACKAGE))
{
Status = WalkCallback (ACPI_COPY_TYPE_SIMPLE, ThisSourceObj,
@@ -310,7 +311,8 @@ AcpiUtWalkPackageTree (
}
State->Pkg.Index++;
- while (State->Pkg.Index >= State->Pkg.SourceObject->Package.Count)
+ while (State->Pkg.Index >=
+ State->Pkg.SourceObject->Package.Count)
{
/*
* We've handled all of the objects at this level, This means
@@ -345,8 +347,8 @@ AcpiUtWalkPackageTree (
{
/* This is a subobject of type package */
- Status = WalkCallback (ACPI_COPY_TYPE_PACKAGE, ThisSourceObj,
- State, Context);
+ Status = WalkCallback (
+ ACPI_COPY_TYPE_PACKAGE, ThisSourceObj, State, Context);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -357,8 +359,8 @@ AcpiUtWalkPackageTree (
* The callback above returned a new target package object.
*/
AcpiUtPushGenericState (&StateList, State);
- State = AcpiUtCreatePkgState (ThisSourceObj,
- State->Pkg.ThisTargetObj, 0);
+ State = AcpiUtCreatePkgState (
+ ThisSourceObj, State->Pkg.ThisTargetObj, 0);
if (!State)
{
/* Free any stacked Update State objects */
diff --git a/source/components/utilities/utmutex.c b/source/components/utilities/utmutex.c
index 60b94c11e52b..9cbc599c417f 100644
--- a/source/components/utilities/utmutex.c
+++ b/source/components/utilities/utmutex.c
@@ -329,11 +329,12 @@ AcpiUtAcquireMutex (
"Thread %u attempting to acquire Mutex [%s]\n",
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
- Status = AcpiOsAcquireMutex (AcpiGbl_MutexInfo[MutexId].Mutex,
- ACPI_WAIT_FOREVER);
+ Status = AcpiOsAcquireMutex (
+ AcpiGbl_MutexInfo[MutexId].Mutex, ACPI_WAIT_FOREVER);
if (ACPI_SUCCESS (Status))
{
- ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u acquired Mutex [%s]\n",
+ ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX,
+ "Thread %u acquired Mutex [%s]\n",
(UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId)));
AcpiGbl_MutexInfo[MutexId].UseCount++;
diff --git a/source/components/utilities/utnonansi.c b/source/components/utilities/utnonansi.c
index 3c64eaa1f5f1..257450e41be6 100644
--- a/source/components/utilities/utnonansi.c
+++ b/source/components/utilities/utnonansi.c
@@ -332,8 +332,8 @@ AcpiUtStrtoul64 (
/* Divide the digit into the correct position */
- (void) AcpiUtShortDivide ((Dividend - (UINT64) ThisDigit),
- Base, &Quotient, NULL);
+ (void) AcpiUtShortDivide (
+ (Dividend - (UINT64) ThisDigit), Base, &Quotient, NULL);
if (ReturnValue > Quotient)
{
diff --git a/source/components/utilities/utobject.c b/source/components/utilities/utobject.c
index 62758c4f7aeb..e8e157640ce6 100644
--- a/source/components/utilities/utobject.c
+++ b/source/components/utilities/utobject.c
@@ -107,7 +107,8 @@ AcpiUtCreateInternalObjectDbg (
/* Allocate the raw object descriptor */
- Object = AcpiUtAllocateObjectDescDbg (ModuleName, LineNumber, ComponentId);
+ Object = AcpiUtAllocateObjectDescDbg (
+ ModuleName, LineNumber, ComponentId);
if (!Object)
{
return_PTR (NULL);
@@ -121,8 +122,8 @@ AcpiUtCreateInternalObjectDbg (
/* These types require a secondary object */
- SecondObject = AcpiUtAllocateObjectDescDbg (ModuleName,
- LineNumber, ComponentId);
+ SecondObject = AcpiUtAllocateObjectDescDbg (
+ ModuleName, LineNumber, ComponentId);
if (!SecondObject)
{
AcpiUtDeleteObjectDesc (Object);
@@ -193,7 +194,7 @@ AcpiUtCreatePackageObject (
* terminated.
*/
PackageElements = ACPI_ALLOCATE_ZEROED (
- ((ACPI_SIZE) Count + 1) * sizeof (void *));
+ ((ACPI_SIZE) Count + 1) * sizeof (void *));
if (!PackageElements)
{
ACPI_FREE (PackageDesc);
@@ -283,6 +284,7 @@ AcpiUtCreateBufferObject (
{
ACPI_ERROR ((AE_INFO, "Could not allocate size %u",
(UINT32) BufferSize));
+
AcpiUtRemoveReference (BufferDesc);
return_PTR (NULL);
}
@@ -342,6 +344,7 @@ AcpiUtCreateStringObject (
{
ACPI_ERROR ((AE_INFO, "Could not allocate size %u",
(UINT32) StringSize));
+
AcpiUtRemoveReference (StringDesc);
return_PTR (NULL);
}
@@ -398,8 +401,8 @@ AcpiUtValidInternalObject (
default:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
- "%p is not an ACPI operand obj [%s]\n",
- Object, AcpiUtGetDescriptorName (Object)));
+ "%p is not an ACPI operand obj [%s]\n",
+ Object, AcpiUtGetDescriptorName (Object)));
break;
}
@@ -448,7 +451,7 @@ AcpiUtAllocateObjectDescDbg (
ACPI_SET_DESCRIPTOR_TYPE (Object, ACPI_DESC_TYPE_OPERAND);
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p Size %X\n",
- Object, (UINT32) sizeof (ACPI_OPERAND_OBJECT)));
+ Object, (UINT32) sizeof (ACPI_OPERAND_OBJECT)));
return_PTR (Object);
}
@@ -711,12 +714,12 @@ AcpiUtGetPackageObjectSize (
ACPI_FUNCTION_TRACE_PTR (UtGetPackageObjectSize, InternalObject);
- Info.Length = 0;
+ Info.Length = 0;
Info.ObjectSpace = 0;
Info.NumPackages = 1;
- Status = AcpiUtWalkPackageTree (InternalObject, NULL,
- AcpiUtGetElementLength, &Info);
+ Status = AcpiUtWalkPackageTree (
+ InternalObject, NULL, AcpiUtGetElementLength, &Info);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -727,8 +730,8 @@ AcpiUtGetPackageObjectSize (
* just add the length of the package objects themselves.
* Round up to the next machine word.
*/
- Info.Length += ACPI_ROUND_UP_TO_NATIVE_WORD (sizeof (ACPI_OBJECT)) *
- (ACPI_SIZE) Info.NumPackages;
+ Info.Length += ACPI_ROUND_UP_TO_NATIVE_WORD (
+ sizeof (ACPI_OBJECT)) * (ACPI_SIZE) Info.NumPackages;
/* Return the total package length */
@@ -762,7 +765,8 @@ AcpiUtGetObjectSize (
ACPI_FUNCTION_ENTRY ();
- if ((ACPI_GET_DESCRIPTOR_TYPE (InternalObject) == ACPI_DESC_TYPE_OPERAND) &&
+ if ((ACPI_GET_DESCRIPTOR_TYPE (InternalObject) ==
+ ACPI_DESC_TYPE_OPERAND) &&
(InternalObject->Common.Type == ACPI_TYPE_PACKAGE))
{
Status = AcpiUtGetPackageObjectSize (InternalObject, ObjLength);
diff --git a/source/components/utilities/utosi.c b/source/components/utilities/utosi.c
index 30cba5422389..64a08493b484 100644
--- a/source/components/utilities/utosi.c
+++ b/source/components/utilities/utosi.c
@@ -156,7 +156,9 @@ AcpiUtInitializeInterfaces (
/* Link the static list of supported interfaces */
- for (i = 0; i < (ACPI_ARRAY_LENGTH (AcpiDefaultSupportedInterfaces) - 1); i++)
+ for (i = 0;
+ i < (ACPI_ARRAY_LENGTH (AcpiDefaultSupportedInterfaces) - 1);
+ i++)
{
AcpiDefaultSupportedInterfaces[i].Next =
&AcpiDefaultSupportedInterfaces[(ACPI_SIZE) i + 1];
@@ -300,8 +302,10 @@ AcpiUtRemoveInterface (
{
if (!strcmp (InterfaceName, NextInterface->Name))
{
- /* Found: name is in either the static list or was added at runtime */
-
+ /*
+ * Found: name is in either the static list
+ * or was added at runtime
+ */
if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
{
/* Interface was added dynamically, remove and free it */
@@ -321,8 +325,8 @@ AcpiUtRemoveInterface (
else
{
/*
- * Interface is in static list. If marked invalid, then it
- * does not actually exist. Else, mark it invalid.
+ * Interface is in static list. If marked invalid, then
+ * it does not actually exist. Else, mark it invalid.
*/
if (NextInterface->Flags & ACPI_OSI_INVALID)
{
diff --git a/source/components/utilities/utownerid.c b/source/components/utilities/utownerid.c
index a130fb704ed5..dc3922a1c1ba 100644
--- a/source/components/utilities/utownerid.c
+++ b/source/components/utilities/utownerid.c
@@ -81,7 +81,8 @@ AcpiUtAllocateOwnerId (
if (*OwnerId)
{
- ACPI_ERROR ((AE_INFO, "Owner ID [0x%2.2X] already exists", *OwnerId));
+ ACPI_ERROR ((AE_INFO,
+ "Owner ID [0x%2.2X] already exists", *OwnerId));
return_ACPI_STATUS (AE_ALREADY_EXISTS);
}
@@ -95,8 +96,8 @@ AcpiUtAllocateOwnerId (
/*
* Find a free owner ID, cycle through all possible IDs on repeated
- * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index may have
- * to be scanned twice.
+ * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index
+ * may have to be scanned twice.
*/
for (i = 0, j = AcpiGbl_LastOwnerIdIndex;
i < (ACPI_NUM_OWNERID_MASKS + 1);
@@ -152,8 +153,8 @@ AcpiUtAllocateOwnerId (
* they are released when a table is unloaded or a method completes
* execution.
*
- * If this error happens, there may be very deep nesting of invoked control
- * methods, or there may be a bug where the IDs are not released.
+ * If this error happens, there may be very deep nesting of invoked
+ * control methods, or there may be a bug where the IDs are not released.
*/
Status = AE_OWNER_ID_LIMIT;
ACPI_ERROR ((AE_INFO,
diff --git a/source/components/utilities/utpredef.c b/source/components/utilities/utpredef.c
index 1b7ef34181cb..f5d835327329 100644
--- a/source/components/utilities/utpredef.c
+++ b/source/components/utilities/utpredef.c
@@ -254,8 +254,10 @@ AcpiUtMatchResourceName (
const ACPI_PREDEFINED_INFO *ThisName;
- /* Quick check for a predefined name, first character must be underscore */
-
+ /*
+ * Quick check for a predefined name, first character must
+ * be underscore
+ */
if (Name[0] != '_')
{
return (NULL);
diff --git a/source/components/utilities/utprint.c b/source/components/utilities/utprint.c
index 6d7b87cd3e8a..1b0e12b32f13 100644
--- a/source/components/utilities/utprint.c
+++ b/source/components/utilities/utprint.c
@@ -390,8 +390,8 @@ AcpiUtFormatNumber (
String = AcpiUtBoundStringOutput (String, End, '0');
if (Base == 16)
{
- String = AcpiUtBoundStringOutput (String, End,
- Upper ? 'X' : 'x');
+ String = AcpiUtBoundStringOutput (
+ String, End, Upper ? 'X' : 'x');
}
}
if (!(Type & ACPI_FORMAT_LEFT))
@@ -500,6 +500,7 @@ AcpiUtVsnprintf (
{
break;
}
+
} while (1);
/* Process width */
@@ -537,6 +538,7 @@ AcpiUtVsnprintf (
++Format;
Precision = va_arg (Args, int);
}
+
if (Precision < 0)
{
Precision = 0;
@@ -599,11 +601,13 @@ AcpiUtVsnprintf (
Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
}
}
+
for (i = 0; i < Length; ++i)
{
Pos = AcpiUtBoundStringOutput (Pos, End, *s);
++s;
}
+
while (Length < Width--)
{
Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
@@ -642,8 +646,8 @@ AcpiUtVsnprintf (
}
p = va_arg (Args, void *);
- Pos = AcpiUtFormatNumber (Pos, End,
- ACPI_TO_INTEGER (p), 16, Width, Precision, Type);
+ Pos = AcpiUtFormatNumber (
+ Pos, End, ACPI_TO_INTEGER (p), 16, Width, Precision, Type);
continue;
default:
@@ -694,7 +698,7 @@ AcpiUtVsnprintf (
}
Pos = AcpiUtFormatNumber (Pos, End, Number, Base,
- Width, Precision, Type);
+ Width, Precision, Type);
}
if (Size > 0)
@@ -773,7 +777,7 @@ AcpiUtFileVprintf (
Flags = AcpiOsAcquireLock (AcpiGbl_PrintLock);
Length = AcpiUtVsnprintf (AcpiGbl_PrintBuffer,
- sizeof (AcpiGbl_PrintBuffer), Format, Args);
+ sizeof (AcpiGbl_PrintBuffer), Format, Args);
(void) AcpiOsWriteFile (File, AcpiGbl_PrintBuffer, Length, 1);
AcpiOsReleaseLock (AcpiGbl_PrintLock, Flags);
diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c
index df3c73ee4eb4..41db3968c1a0 100644
--- a/source/components/utilities/utresrc.c
+++ b/source/components/utilities/utresrc.c
@@ -489,8 +489,8 @@ AcpiUtWalkAmlResources (
if (ACPI_FAILURE (Status))
{
/*
- * Exit on failure. Cannot continue because the descriptor length
- * may be bogus also.
+ * Exit on failure. Cannot continue because the descriptor
+ * length may be bogus also.
*/
return_ACPI_STATUS (Status);
}
@@ -503,7 +503,8 @@ AcpiUtWalkAmlResources (
if (UserFunction)
{
- Status = UserFunction (Aml, Length, Offset, ResourceIndex, Context);
+ Status = UserFunction (
+ Aml, Length, Offset, ResourceIndex, Context);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -625,8 +626,8 @@ AcpiUtValidateResource (
}
/*
- * Check validity of the resource type, via AcpiGbl_ResourceTypes. Zero
- * indicates an invalid resource.
+ * Check validity of the resource type, via AcpiGbl_ResourceTypes.
+ * Zero indicates an invalid resource.
*/
if (!AcpiGbl_ResourceTypes[ResourceIndex])
{
@@ -813,7 +814,7 @@ AcpiUtGetResourceLength (
/* Small Resource type -- bits 2:0 of byte 0 contain the length */
ResourceLength = (UINT16) (ACPI_GET8 (Aml) &
- ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
+ ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK);
}
return (ResourceLength);
@@ -878,7 +879,7 @@ AcpiUtGetDescriptorLength (
* the header length (depends on if this is a small or large resource)
*/
return (AcpiUtGetResourceLength (Aml) +
- AcpiUtGetResourceHeaderLength (Aml));
+ AcpiUtGetResourceHeaderLength (Aml));
}
@@ -918,7 +919,7 @@ AcpiUtGetResourceEndTag (
/* Validate the template and get a pointer to the EndTag */
Status = AcpiUtWalkAmlResources (NULL, ObjDesc->Buffer.Pointer,
- ObjDesc->Buffer.Length, NULL, (void **) EndTag);
+ ObjDesc->Buffer.Length, NULL, (void **) EndTag);
return_ACPI_STATUS (Status);
}
diff --git a/source/components/utilities/utstate.c b/source/components/utilities/utstate.c
index 49fc8e9b8df1..ad07a4a74ac8 100644
--- a/source/components/utilities/utstate.c
+++ b/source/components/utilities/utstate.c
@@ -278,6 +278,7 @@ AcpiUtCreatePkgState (
State->Pkg.DestObject = ExternalObject;
State->Pkg.Index= Index;
State->Pkg.NumPackages = 1;
+
return (State);
}
@@ -317,6 +318,7 @@ AcpiUtCreateControlState (
State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_CONTROL;
State->Common.State = ACPI_CONTROL_CONDITIONAL_EXECUTING;
+
return (State);
}
@@ -347,5 +349,6 @@ AcpiUtDeleteGenericState (
{
(void) AcpiOsReleaseObject (AcpiGbl_StateCache, State);
}
+
return;
}
diff --git a/source/components/utilities/utstring.c b/source/components/utilities/utstring.c
index af7b4af761da..c8b41f10ad78 100644
--- a/source/components/utilities/utstring.c
+++ b/source/components/utilities/utstring.c
@@ -147,6 +147,7 @@ AcpiUtPrintString (
break;
}
}
+
AcpiOsPrintf ("\"");
if (i == MaxLength && String[i])
diff --git a/source/components/utilities/uttrack.c b/source/components/utilities/uttrack.c
index 7a594be88fc2..234fe50f63c5 100644
--- a/source/components/utilities/uttrack.c
+++ b/source/components/utilities/uttrack.c
@@ -115,7 +115,7 @@ AcpiUtCreateList (
memset (Cache, 0, sizeof (ACPI_MEMORY_LIST));
- Cache->ListName = ListName;
+ Cache->ListName = ListName;
Cache->ObjectSize = ObjectSize;
*ReturnCache = Cache;
@@ -169,8 +169,8 @@ AcpiUtAllocateAndTrack (
return (NULL);
}
- Status = AcpiUtTrackAllocation (Allocation, Size,
- ACPI_MEM_MALLOC, Component, Module, Line);
+ Status = AcpiUtTrackAllocation (
+ Allocation, Size, ACPI_MEM_MALLOC, Component, Module, Line);
if (ACPI_FAILURE (Status))
{
AcpiOsFree (Allocation);
@@ -180,9 +180,12 @@ AcpiUtAllocateAndTrack (
AcpiGbl_GlobalList->TotalAllocated++;
AcpiGbl_GlobalList->TotalSize += (UINT32) Size;
AcpiGbl_GlobalList->CurrentTotalSize += (UINT32) Size;
- if (AcpiGbl_GlobalList->CurrentTotalSize > AcpiGbl_GlobalList->MaxOccupied)
+
+ if (AcpiGbl_GlobalList->CurrentTotalSize >
+ AcpiGbl_GlobalList->MaxOccupied)
{
- AcpiGbl_GlobalList->MaxOccupied = AcpiGbl_GlobalList->CurrentTotalSize;
+ AcpiGbl_GlobalList->MaxOccupied =
+ AcpiGbl_GlobalList->CurrentTotalSize;
}
return ((void *) &Allocation->UserSpace);
@@ -224,7 +227,8 @@ AcpiUtAllocateZeroedAndTrack (
Size = 1;
}
- Allocation = AcpiOsAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER));
+ Allocation = AcpiOsAllocateZeroed (
+ Size + sizeof (ACPI_DEBUG_MEM_HEADER));
if (!Allocation)
{
/* Report allocation error */
@@ -235,7 +239,7 @@ AcpiUtAllocateZeroedAndTrack (
}
Status = AcpiUtTrackAllocation (Allocation, Size,
- ACPI_MEM_CALLOC, Component, Module, Line);
+ ACPI_MEM_CALLOC, Component, Module, Line);
if (ACPI_FAILURE (Status))
{
AcpiOsFree (Allocation);
@@ -245,9 +249,12 @@ AcpiUtAllocateZeroedAndTrack (
AcpiGbl_GlobalList->TotalAllocated++;
AcpiGbl_GlobalList->TotalSize += (UINT32) Size;
AcpiGbl_GlobalList->CurrentTotalSize += (UINT32) Size;
- if (AcpiGbl_GlobalList->CurrentTotalSize > AcpiGbl_GlobalList->MaxOccupied)
+
+ if (AcpiGbl_GlobalList->CurrentTotalSize >
+ AcpiGbl_GlobalList->MaxOccupied)
{
- AcpiGbl_GlobalList->MaxOccupied = AcpiGbl_GlobalList->CurrentTotalSize;
+ AcpiGbl_GlobalList->MaxOccupied =
+ AcpiGbl_GlobalList->CurrentTotalSize;
}
return ((void *) &Allocation->UserSpace);
@@ -292,13 +299,12 @@ AcpiUtFreeAndTrack (
}
DebugBlock = ACPI_CAST_PTR (ACPI_DEBUG_MEM_BLOCK,
- (((char *) Allocation) - sizeof (ACPI_DEBUG_MEM_HEADER)));
+ (((char *) Allocation) - sizeof (ACPI_DEBUG_MEM_HEADER)));
AcpiGbl_GlobalList->TotalFreed++;
AcpiGbl_GlobalList->CurrentTotalSize -= DebugBlock->Size;
- Status = AcpiUtRemoveAllocation (DebugBlock,
- Component, Module, Line);
+ Status = AcpiUtRemoveAllocation (DebugBlock, Component, Module, Line);
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status, "Could not free memory"));
@@ -440,10 +446,10 @@ AcpiUtTrackAllocation (
/* Fill in the instance data */
- Allocation->Size = (UINT32) Size;
+ Allocation->Size = (UINT32) Size;
Allocation->AllocType = AllocType;
Allocation->Component = Component;
- Allocation->Line = Line;
+ Allocation->Line = Line;
strncpy (Allocation->Module, Module, ACPI_MAX_MODULE_NAME);
Allocation->Module[ACPI_MAX_MODULE_NAME-1] = 0;
@@ -454,7 +460,8 @@ AcpiUtTrackAllocation (
if (MemList->ListHead)
{
- ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Allocation;
+ ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous =
+ Allocation;
}
Allocation->Next = MemList->ListHead;
@@ -587,37 +594,37 @@ AcpiUtDumpAllocationInfo (
/*
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Current allocations",
- MemList->CurrentCount,
- ROUND_UP_TO_1K (MemList->CurrentSize)));
+ ("%30s: %4d (%3d Kb)\n", "Current allocations",
+ MemList->CurrentCount,
+ ROUND_UP_TO_1K (MemList->CurrentSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
- MemList->MaxConcurrentCount,
- ROUND_UP_TO_1K (MemList->MaxConcurrentSize)));
+ ("%30s: %4d (%3d Kb)\n", "Max concurrent allocations",
+ MemList->MaxConcurrentCount,
+ ROUND_UP_TO_1K (MemList->MaxConcurrentSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
- RunningObjectCount,
- ROUND_UP_TO_1K (RunningObjectSize)));
+ ("%30s: %4d (%3d Kb)\n", "Total (all) internal objects",
+ RunningObjectCount,
+ ROUND_UP_TO_1K (RunningObjectSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
- RunningAllocCount,
- ROUND_UP_TO_1K (RunningAllocSize)));
+ ("%30s: %4d (%3d Kb)\n", "Total (all) allocations",
+ RunningAllocCount,
+ ROUND_UP_TO_1K (RunningAllocSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Current Nodes",
- AcpiGbl_CurrentNodeCount,
- ROUND_UP_TO_1K (AcpiGbl_CurrentNodeSize)));
+ ("%30s: %4d (%3d Kb)\n", "Current Nodes",
+ AcpiGbl_CurrentNodeCount,
+ ROUND_UP_TO_1K (AcpiGbl_CurrentNodeSize)));
ACPI_DEBUG_PRINT (TRACE_ALLOCATIONS | TRACE_TABLES,
- ("%30s: %4d (%3d Kb)\n", "Max Nodes",
- AcpiGbl_MaxConcurrentNodeCount,
- ROUND_UP_TO_1K ((AcpiGbl_MaxConcurrentNodeCount *
- sizeof (ACPI_NAMESPACE_NODE)))));
+ ("%30s: %4d (%3d Kb)\n", "Max Nodes",
+ AcpiGbl_MaxConcurrentNodeCount,
+ ROUND_UP_TO_1K ((AcpiGbl_MaxConcurrentNodeCount *
+ sizeof (ACPI_NAMESPACE_NODE)))));
*/
return_VOID;
}
@@ -669,7 +676,8 @@ AcpiUtDumpAllocations (
if ((Element->Component & Component) &&
((Module == NULL) || (0 == strcmp (Module, Element->Module))))
{
- Descriptor = ACPI_CAST_PTR (ACPI_DESCRIPTOR, &Element->UserSpace);
+ Descriptor = ACPI_CAST_PTR (
+ ACPI_DESCRIPTOR, &Element->UserSpace);
if (Element->Size < sizeof (ACPI_COMMON_DESCRIPTOR))
{
@@ -682,7 +690,8 @@ AcpiUtDumpAllocations (
{
/* Ignore allocated objects that are in a cache */
- if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) != ACPI_DESC_TYPE_CACHED)
+ if (ACPI_GET_DESCRIPTOR_TYPE (Descriptor) !=
+ ACPI_DESC_TYPE_CACHED)
{
AcpiOsPrintf ("%p Length 0x%04X %9.9s-%u [%s] ",
Descriptor, Element->Size, Element->Module,
diff --git a/source/components/utilities/utuuid.c b/source/components/utilities/utuuid.c
index 7ad4b27ef756..0cb7e71925f0 100644
--- a/source/components/utilities/utuuid.c
+++ b/source/components/utilities/utuuid.c
@@ -93,11 +93,11 @@ AcpiUtConvertStringToUuid (
for (i = 0; i < UUID_BUFFER_LENGTH; i++)
{
- UuidBuffer[i] =
- (AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i]]) << 4);
+ UuidBuffer[i] = (AcpiUtAsciiCharToHex (
+ InString[AcpiGbl_MapToUuidOffset[i]]) << 4);
- UuidBuffer[i] |=
- AcpiUtAsciiCharToHex (InString[AcpiGbl_MapToUuidOffset[i] + 1]);
+ UuidBuffer[i] |= AcpiUtAsciiCharToHex (
+ InString[AcpiGbl_MapToUuidOffset[i] + 1]);
}
}
#endif
diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c
index d41c93a18f86..57c2f458bcc8 100644
--- a/source/components/utilities/utxface.c
+++ b/source/components/utilities/utxface.c
@@ -73,24 +73,6 @@ AcpiTerminate (
ACPI_FUNCTION_TRACE (AcpiTerminate);
- /* Just exit if subsystem is already shutdown */
-
- if (AcpiGbl_Shutdown)
- {
- ACPI_ERROR ((AE_INFO, "ACPI Subsystem is already terminated"));
- return_ACPI_STATUS (AE_OK);
- }
-
- /* Subsystem appears active, go ahead and shut it down */
-
- AcpiGbl_Shutdown = TRUE;
- AcpiGbl_StartupFlags = 0;
- ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Shutting down ACPI Subsystem\n"));
-
- /* Terminate the AML Debugger if present */
-
- ACPI_DEBUGGER_EXEC (AcpiGbl_DbTerminateThreads = TRUE);
-
/* Shutdown and free all resources */
AcpiUtSubsystemShutdown ();
@@ -190,7 +172,6 @@ AcpiGetSystemInfo (
* Populate the return buffer
*/
InfoPtr = (ACPI_SYSTEM_INFO *) OutBuffer->Pointer;
-
InfoPtr->AcpiCaVersion = ACPI_CA_VERSION;
/* System flags (ACPI capabilities) */
@@ -258,11 +239,9 @@ AcpiGetStatistics (
memcpy (Stats->FixedEventCount, AcpiFixedEventCount,
sizeof (AcpiFixedEventCount));
-
/* Other counters */
Stats->MethodCount = AcpiMethodCount;
-
return_ACPI_STATUS (AE_OK);
}
diff --git a/source/components/utilities/utxferror.c b/source/components/utilities/utxferror.c
index a6a6818b6888..8cbb2632c4d4 100644
--- a/source/components/utilities/utxferror.c
+++ b/source/components/utilities/utxferror.c
@@ -133,8 +133,10 @@ AcpiException (
}
else
{
- AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ", AcpiFormatException (Status));
+ AcpiOsPrintf (ACPI_MSG_EXCEPTION "%s, ",
+ AcpiFormatException (Status));
}
+
va_start (ArgList, Format);
AcpiOsVprintf (Format, ArgList);
ACPI_MSG_SUFFIX;
diff --git a/source/components/utilities/utxfmutex.c b/source/components/utilities/utxfmutex.c
index cf27a02df566..3e8d6d858d29 100644
--- a/source/components/utilities/utxfmutex.c
+++ b/source/components/utilities/utxfmutex.c
@@ -98,8 +98,8 @@ AcpiUtGetMutexObject (
MutexNode = Handle;
if (Pathname != NULL)
{
- Status = AcpiGetHandle (Handle, Pathname,
- ACPI_CAST_PTR (ACPI_HANDLE, &MutexNode));
+ Status = AcpiGetHandle (
+ Handle, Pathname, ACPI_CAST_PTR (ACPI_HANDLE, &MutexNode));
if (ACPI_FAILURE (Status))
{
return (Status);