Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1875 → Rev 2216

/drivers/devman/acpica/namespace/nsaccess.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
250,8 → 250,8
#else
/* Mark this as a very SPECIAL method */
 
ObjDesc->Method.MethodFlags = AML_METHOD_INTERNAL_ONLY;
ObjDesc->Method.Extra.Implementation = AcpiUtOsiImplementation;
ObjDesc->Method.InfoFlags = ACPI_METHOD_INTERNAL_ONLY;
ObjDesc->Method.Dispatch.Implementation = AcpiUtOsiImplementation;
#endif
break;
 
/drivers/devman/acpica/namespace/nsalloc.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
341,7 → 341,7
* modified the namespace. This is used for cleanup when the
* method exits.
*/
WalkState->MethodDesc->Method.Flags |= AOPOBJ_MODIFIED_NAMESPACE;
WalkState->MethodDesc->Method.InfoFlags |= ACPI_METHOD_MODIFIED_NAMESPACE;
}
}
 
459,6 → 459,7
{
ACPI_NAMESPACE_NODE *ChildNode = NULL;
UINT32 Level = 1;
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_TRACE (NsDeleteNamespaceSubtree);
469,6 → 470,14
return_VOID;
}
 
/* Lock namespace for possible update */
 
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
return_VOID;
}
 
/*
* Traverse the tree of objects until we bubble back up
* to where we started.
521,6 → 530,7
}
}
 
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return_VOID;
}
 
/drivers/devman/acpica/namespace/nsdump.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
725,11 → 725,25
ACPI_HANDLE StartHandle)
{
ACPI_WALK_INFO Info;
ACPI_STATUS Status;
 
 
ACPI_FUNCTION_ENTRY ();
 
 
/*
* Just lock the entire namespace for the duration of the dump.
* We don't want any changes to the namespace during this time,
* especially the temporary nodes since we are going to display
* them also.
*/
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("Could not acquire namespace mutex\n");
return;
}
 
Info.DebugLevel = ACPI_LV_TABLES;
Info.OwnerId = OwnerId;
Info.DisplayType = DisplayType;
737,6 → 751,8
(void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth,
ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
 
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}
 
 
/drivers/devman/acpica/namespace/nsdumpdv.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
/drivers/devman/acpica/namespace/nseval.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
486,7 → 486,7
*/
if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object)
{
MethodObj->Method.Extra.Handler =
MethodObj->Method.Dispatch.Handler =
ParentNode->Object->Device.Handler;
}
 
/drivers/devman/acpica/namespace/nsinit.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
/drivers/devman/acpica/namespace/nsload.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
/drivers/devman/acpica/namespace/nsnames.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
/drivers/devman/acpica/namespace/nsobject.c
9,7 → 9,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
/drivers/devman/acpica/namespace/nsparse.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
/drivers/devman/acpica/namespace/nspredef.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
288,14 → 288,20
}
 
/*
* 1) We have a return value, but if one wasn't expected, just exit, this is
* not a problem. For example, if the "Implicit Return" feature is
* enabled, methods will always return a value.
* Return value validation and possible repair.
*
* 2) If the return value can be of any type, then we cannot perform any
* validation, exit.
* 1) Don't perform return value validation/repair if this feature
* has been disabled via a global option.
*
* 2) We have a return value, but if one wasn't expected, just exit,
* this is not a problem. For example, if the "Implicit Return"
* feature is enabled, methods will always return a value.
*
* 3) If the return value can be of any type, then we cannot perform
* any validation, just exit.
*/
if ((!Predefined->Info.ExpectedBtypes) ||
if (AcpiGbl_DisableAutoRepair ||
(!Predefined->Info.ExpectedBtypes) ||
(Predefined->Info.ExpectedBtypes == ACPI_RTYPE_ALL))
{
goto Cleanup;
309,6 → 315,7
goto Cleanup;
}
Data->Predefined = Predefined;
Data->Node = Node;
Data->NodeFlags = Node->Flags;
Data->Pathname = Pathname;
 
/drivers/devman/acpica/namespace/nsrepair.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
149,7 → 149,6
*
* Additional possible repairs:
*
* Optional/unnecessary NULL package elements removed
* Required package elements that are NULL replaced by Integer/String/Buffer
* Incorrect standalone package wrapped with required outer package
*
683,7 → 682,7
{
/* Need an Integer - create a zero-value integer */
 
NewObject = AcpiUtCreateIntegerObject (0);
NewObject = AcpiUtCreateIntegerObject ((UINT64) 0);
}
else if (ExpectedBtypes & ACPI_RTYPE_STRING)
{
756,17 → 755,13
 
 
/*
* PTYPE1 packages contain no subpackages.
* PTYPE2 packages contain a variable number of sub-packages. We can
* safely remove all NULL elements from the PTYPE2 packages.
* We can safely remove all NULL elements from these package types:
* PTYPE1_VAR packages contain a variable number of simple data types.
* PTYPE2 packages contain a variable number of sub-packages.
*/
switch (PackageType)
{
case ACPI_PTYPE1_FIXED:
case ACPI_PTYPE1_VAR:
case ACPI_PTYPE1_OPTION:
return;
 
case ACPI_PTYPE2:
case ACPI_PTYPE2_COUNT:
case ACPI_PTYPE2_PKG_COUNT:
776,6 → 771,8
break;
 
default:
case ACPI_PTYPE1_FIXED:
case ACPI_PTYPE1_OPTION:
return;
}
 
/drivers/devman/acpica/namespace/nsrepair2.c
9,7 → 9,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
153,11 → 153,21
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
 
static ACPI_STATUS
AcpiNsRepair_CID (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
 
static ACPI_STATUS
AcpiNsRepair_FDE (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
 
static ACPI_STATUS
AcpiNsRepair_HID (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
 
static ACPI_STATUS
AcpiNsRepair_PSS (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
196,8 → 206,10
* As necessary:
*
* _ALR: Sort the list ascending by AmbientIlluminance
* _CID: Strings: uppercase all, remove any leading asterisk
* _FDE: Convert Buffer of BYTEs to a Buffer of DWORDs
* _GTM: Convert Buffer of BYTEs to a Buffer of DWORDs
* _HID: Strings: uppercase all, remove any leading asterisk
* _PSS: Sort the list descending by Power
* _TSS: Sort the list descending by Power
*
211,8 → 223,10
static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] =
{
{"_ALR", AcpiNsRepair_ALR},
{"_CID", AcpiNsRepair_CID},
{"_FDE", AcpiNsRepair_FDE},
{"_GTM", AcpiNsRepair_FDE}, /* _GTM has same repair as _FDE */
{"_HID", AcpiNsRepair_HID},
{"_PSS", AcpiNsRepair_PSS},
{"_TSS", AcpiNsRepair_TSS},
{{0,0,0,0}, NULL} /* Table terminator */
427,6 → 441,172
 
/******************************************************************************
*
* FUNCTION: AcpiNsRepair_CID
*
* PARAMETERS: Data - Pointer to validation data structure
* ReturnObjectPtr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if object is OK or was repaired successfully
*
* DESCRIPTION: Repair for the _CID object. If a string, ensure that all
* letters are uppercase and that there is no leading asterisk.
* If a Package, ensure same for all string elements.
*
*****************************************************************************/
 
static ACPI_STATUS
AcpiNsRepair_CID (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_OPERAND_OBJECT **ElementPtr;
ACPI_OPERAND_OBJECT *OriginalElement;
UINT16 OriginalRefCount;
UINT32 i;
 
 
/* Check for _CID as a simple string */
 
if (ReturnObject->Common.Type == ACPI_TYPE_STRING)
{
Status = AcpiNsRepair_HID (Data, ReturnObjectPtr);
return (Status);
}
 
/* Exit if not a Package */
 
if (ReturnObject->Common.Type != ACPI_TYPE_PACKAGE)
{
return (AE_OK);
}
 
/* Examine each element of the _CID package */
 
ElementPtr = ReturnObject->Package.Elements;
for (i = 0; i < ReturnObject->Package.Count; i++)
{
OriginalElement = *ElementPtr;
OriginalRefCount = OriginalElement->Common.ReferenceCount;
 
Status = AcpiNsRepair_HID (Data, ElementPtr);
if (ACPI_FAILURE (Status))
{
return (Status);
}
 
/* Take care with reference counts */
 
if (OriginalElement != *ElementPtr)
{
/* Element was replaced */
 
(*ElementPtr)->Common.ReferenceCount =
OriginalRefCount;
 
AcpiUtRemoveReference (OriginalElement);
}
 
ElementPtr++;
}
 
return (AE_OK);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiNsRepair_HID
*
* PARAMETERS: Data - Pointer to validation data structure
* ReturnObjectPtr - Pointer to the object returned from the
* evaluation of a method or object
*
* RETURN: Status. AE_OK if object is OK or was repaired successfully
*
* DESCRIPTION: Repair for the _HID object. If a string, ensure that all
* letters are uppercase and that there is no leading asterisk.
*
*****************************************************************************/
 
static ACPI_STATUS
AcpiNsRepair_HID (
ACPI_PREDEFINED_DATA *Data,
ACPI_OPERAND_OBJECT **ReturnObjectPtr)
{
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_OPERAND_OBJECT *NewString;
char *Source;
char *Dest;
 
 
ACPI_FUNCTION_NAME (NsRepair_HID);
 
 
/* We only care about string _HID objects (not integers) */
 
if (ReturnObject->Common.Type != ACPI_TYPE_STRING)
{
return (AE_OK);
}
 
if (ReturnObject->String.Length == 0)
{
ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags,
"Invalid zero-length _HID or _CID string"));
 
/* Return AE_OK anyway, let driver handle it */
 
Data->Flags |= ACPI_OBJECT_REPAIRED;
return (AE_OK);
}
 
/* It is simplest to always create a new string object */
 
NewString = AcpiUtCreateStringObject (ReturnObject->String.Length);
if (!NewString)
{
return (AE_NO_MEMORY);
}
 
/*
* Remove a leading asterisk if present. For some unknown reason, there
* are many machines in the field that contains IDs like this.
*
* Examples: "*PNP0C03", "*ACPI0003"
*/
Source = ReturnObject->String.Pointer;
if (*Source == '*')
{
Source++;
NewString->String.Length--;
 
ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
"%s: Removed invalid leading asterisk\n", Data->Pathname));
}
 
/*
* Copy and uppercase the string. From the ACPI specification:
*
* A valid PNP ID must be of the form "AAA####" where A is an uppercase
* letter and # is a hex digit. A valid ACPI ID must be of the form
* "ACPI####" where # is a hex digit.
*/
for (Dest = NewString->String.Pointer; *Source; Dest++, Source++)
{
*Dest = (char) ACPI_TOUPPER (*Source);
}
 
AcpiUtRemoveReference (ReturnObject);
*ReturnObjectPtr = NewString;
return (AE_OK);
}
 
 
/******************************************************************************
*
* FUNCTION: AcpiNsRepair_TSS
*
* PARAMETERS: Data - Pointer to validation data structure
447,8 → 627,23
{
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node;
 
 
/*
* We can only sort the _TSS return package if there is no _PSS in the
* same scope. This is because if _PSS is present, the ACPI specification
* dictates that the _TSS Power Dissipation field is to be ignored, and
* therefore some BIOSs leave garbage values in the _TSS Power field(s).
* In this case, it is best to just return the _TSS package as-is.
* (May, 2011)
*/
Status = AcpiNsGetNode (Data->Node, "^_PSS", ACPI_NS_NO_UPSEARCH, &Node);
if (ACPI_SUCCESS (Status))
{
return (AE_OK);
}
 
Status = AcpiNsCheckSortedList (Data, ReturnObject, 5, 1,
ACPI_SORT_DESCENDING, "PowerDissipation");
 
/drivers/devman/acpica/namespace/nssearch.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
/drivers/devman/acpica/namespace/nsutils.c
9,7 → 9,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
139,118 → 139,6
 
/*******************************************************************************
*
* FUNCTION: AcpiNsReportError
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* InternalName - Name or path of the namespace node
* LookupStatus - Exception code from NS lookup
*
* RETURN: None
*
* DESCRIPTION: Print warning message with full pathname
*
******************************************************************************/
 
void
AcpiNsReportError (
const char *ModuleName,
UINT32 LineNumber,
const char *InternalName,
ACPI_STATUS LookupStatus)
{
ACPI_STATUS Status;
UINT32 BadName;
char *Name = NULL;
 
 
AcpiOsPrintf ("ACPI Error (%s-%04d): ", ModuleName, LineNumber);
 
if (LookupStatus == AE_BAD_CHARACTER)
{
/* There is a non-ascii character in the name */
 
ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName));
AcpiOsPrintf ("[0x%4.4X] (NON-ASCII)", BadName);
}
else
{
/* Convert path to external format */
 
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
InternalName, NULL, &Name);
 
/* Print target name */
 
if (ACPI_SUCCESS (Status))
{
AcpiOsPrintf ("[%s]", Name);
}
else
{
AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]");
}
 
if (Name)
{
ACPI_FREE (Name);
}
}
 
AcpiOsPrintf (" Namespace lookup failure, %s\n",
AcpiFormatException (LookupStatus));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiNsReportMethodError
*
* PARAMETERS: ModuleName - Caller's module name (for error output)
* LineNumber - Caller's line number (for error output)
* Message - Error message to use on failure
* PrefixNode - Prefix relative to the path
* Path - Path to the node (optional)
* MethodStatus - Execution status
*
* RETURN: None
*
* DESCRIPTION: Print warning message with full pathname
*
******************************************************************************/
 
void
AcpiNsReportMethodError (
const char *ModuleName,
UINT32 LineNumber,
const char *Message,
ACPI_NAMESPACE_NODE *PrefixNode,
const char *Path,
ACPI_STATUS MethodStatus)
{
ACPI_STATUS Status;
ACPI_NAMESPACE_NODE *Node = PrefixNode;
 
 
AcpiOsPrintf ("ACPI Error (%s-%04d): ", ModuleName, LineNumber);
 
if (Path)
{
Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH,
&Node);
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("[Could not get node by pathname]");
}
}
 
AcpiNsPrintNodePathname (Node, Message);
AcpiOsPrintf (", %s\n", AcpiFormatException (MethodStatus));
}
 
 
/*******************************************************************************
*
* FUNCTION: AcpiNsPrintNodePathname
*
* PARAMETERS: Node - Object
/drivers/devman/acpica/namespace/nswalk.c
8,7 → 8,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
/drivers/devman/acpica/namespace/nsxfeval.c
9,7 → 9,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
/drivers/devman/acpica/namespace/nsxfname.c
9,7 → 9,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License
738,11 → 738,10
MethodObj->Method.ParamCount = (UINT8)
(MethodFlags & AML_METHOD_ARG_COUNT);
 
MethodObj->Method.MethodFlags = (UINT8)
(MethodFlags & ~AML_METHOD_ARG_COUNT);
 
if (MethodFlags & AML_METHOD_SERIALIZED)
{
MethodObj->Method.InfoFlags = ACPI_METHOD_SERIALIZED;
 
MethodObj->Method.SyncLevel = (UINT8)
((MethodFlags & AML_METHOD_SYNC_LEVEL) >> 4);
}
751,8 → 750,7
* Now that it is complete, we can attach the new method object to
* the method Node (detaches/deletes any existing object)
*/
Status = AcpiNsAttachObject (Node, MethodObj,
ACPI_TYPE_METHOD);
Status = AcpiNsAttachObject (Node, MethodObj, ACPI_TYPE_METHOD);
 
/*
* Flag indicates AML buffer is dynamic, must be deleted later.
/drivers/devman/acpica/namespace/nsxfobj.c
9,7 → 9,7
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
* All rights reserved.
*
* 2. License