Print this page
update to acpica-unix2-20140114
update to acpica-unix2-20130927
acpica-unix2-20130823
PANKOVs restructure

*** 4,14 **** * ACPI Namespace oriented interfaces * *****************************************************************************/ /* ! * Copyright (C) 2000 - 2011, 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: --- 4,14 ---- * ACPI Namespace oriented interfaces * *****************************************************************************/ /* ! * Copyright (C) 2000 - 2014, 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:
*** 41,50 **** --- 41,51 ---- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. */ #define __NSXFNAME_C__ + #define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" #include "acnamesp.h" #include "acparser.h"
*** 56,67 **** /* Local prototypes */ static char * AcpiNsCopyDeviceId ( ! ACPI_DEVICE_ID *Dest, ! ACPI_DEVICE_ID *Source, char *StringArea); /****************************************************************************** * --- 57,68 ---- /* Local prototypes */ static char * AcpiNsCopyDeviceId ( ! ACPI_PNP_DEVICE_ID *Dest, ! ACPI_PNP_DEVICE_ID *Source, char *StringArea); /****************************************************************************** *
*** 118,128 **** * 1) Fully qualified pathname * 2) Parent + Relative pathname * * Error for <null Parent + relative path> */ ! if (AcpiNsValidRootPrefix (Pathname[0])) { /* Pathname is fully qualified (starts with '\') */ /* Special case for root-only, since we can't search for it */ --- 119,129 ---- * 1) Fully qualified pathname * 2) Parent + Relative pathname * * Error for <null Parent + relative path> */ ! if (ACPI_IS_ROOT_PREFIX (Pathname[0])) { /* Pathname is fully qualified (starts with '\') */ /* Special case for root-only, since we can't search for it */
*** 175,184 **** --- 176,186 ---- UINT32 NameType, ACPI_BUFFER *Buffer) { ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; + char *NodeName; /* Parameter validation */ if (NameType > ACPI_NAME_TYPE_MAX)
*** 225,236 **** goto UnlockAndExit; } /* Just copy the ACPI name from the Node and zero terminate it */ ! ACPI_STRNCPY (Buffer->Pointer, AcpiUtGetNodeName (Node), ! ACPI_NAME_SIZE); ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; Status = AE_OK; UnlockAndExit: --- 227,238 ---- goto UnlockAndExit; } /* Just copy the ACPI name from the Node and zero terminate it */ ! NodeName = AcpiUtGetNodeName (Node); ! ACPI_MOVE_NAME (Buffer->Pointer, NodeName); ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; Status = AE_OK; UnlockAndExit:
*** 244,271 **** /****************************************************************************** * * FUNCTION: AcpiNsCopyDeviceId * ! * PARAMETERS: Dest - Pointer to the destination DEVICE_ID ! * Source - Pointer to the source DEVICE_ID * StringArea - Pointer to where to copy the dest string * * RETURN: Pointer to the next string area * ! * DESCRIPTION: Copy a single DEVICE_ID, including the string data. * ******************************************************************************/ static char * AcpiNsCopyDeviceId ( ! ACPI_DEVICE_ID *Dest, ! ACPI_DEVICE_ID *Source, char *StringArea) { - /* Create the destination DEVICE_ID */ Dest->String = StringArea; Dest->Length = Source->Length; /* Copy actual string and return a pointer to the next string area */ --- 246,274 ---- /****************************************************************************** * * FUNCTION: AcpiNsCopyDeviceId * ! * PARAMETERS: Dest - Pointer to the destination PNP_DEVICE_ID ! * Source - Pointer to the source PNP_DEVICE_ID * StringArea - Pointer to where to copy the dest string * * RETURN: Pointer to the next string area * ! * DESCRIPTION: Copy a single PNP_DEVICE_ID, including the string data. * ******************************************************************************/ static char * AcpiNsCopyDeviceId ( ! ACPI_PNP_DEVICE_ID *Dest, ! ACPI_PNP_DEVICE_ID *Source, char *StringArea) { + /* Create the destination PNP_DEVICE_ID */ + Dest->String = StringArea; Dest->Length = Source->Length; /* Copy actual string and return a pointer to the next string area */
*** 285,296 **** * * DESCRIPTION: Returns information about an object as gleaned from the * namespace node and possibly by running several standard * control methods (Such as in the case of a device.) * ! * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA, ! * _ADR, _SxW, and _SxD methods. * * Note: Allocates the return buffer, must be freed by the caller. * ******************************************************************************/ --- 288,299 ---- * * DESCRIPTION: Returns information about an object as gleaned from the * namespace node and possibly by running several standard * control methods (Such as in the case of a device.) * ! * For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB, ! * _STA, _ADR, _SxW, and _SxD methods. * * Note: Allocates the return buffer, must be freed by the caller. * ******************************************************************************/
*** 299,311 **** ACPI_HANDLE Handle, ACPI_DEVICE_INFO **ReturnBuffer) { ACPI_NAMESPACE_NODE *Node; ACPI_DEVICE_INFO *Info; ! ACPI_DEVICE_ID_LIST *CidList = NULL; ! ACPI_DEVICE_ID *Hid = NULL; ! ACPI_DEVICE_ID *Uid = NULL; char *NextIdString; ACPI_OBJECT_TYPE Type; ACPI_NAME Name; UINT8 ParamCount= 0; UINT8 Valid = 0; --- 302,315 ---- ACPI_HANDLE Handle, ACPI_DEVICE_INFO **ReturnBuffer) { ACPI_NAMESPACE_NODE *Node; ACPI_DEVICE_INFO *Info; ! ACPI_PNP_DEVICE_ID_LIST *CidList = NULL; ! ACPI_PNP_DEVICE_ID *Hid = NULL; ! ACPI_PNP_DEVICE_ID *Uid = NULL; ! ACPI_PNP_DEVICE_ID *Sub = NULL; char *NextIdString; ACPI_OBJECT_TYPE Type; ACPI_NAME Name; UINT8 ParamCount= 0; UINT8 Valid = 0;
*** 322,332 **** } Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { ! goto Cleanup; } Node = AcpiNsValidateHandle (Handle); if (!Node) { --- 326,336 ---- } Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { ! return (Status); } Node = AcpiNsValidateHandle (Handle); if (!Node) {
*** 354,364 **** if ((Type == ACPI_TYPE_DEVICE) || (Type == ACPI_TYPE_PROCESSOR)) { /* * Get extra info for ACPI Device/Processor objects only: ! * Run the Device _HID, _UID, and _CID methods. * * Note: none of these methods are required, so they may or may * not be present for this device. The Info->Valid bitfield is used * to indicate which methods were found and run successfully. */ --- 358,368 ---- if ((Type == ACPI_TYPE_DEVICE) || (Type == ACPI_TYPE_PROCESSOR)) { /* * Get extra info for ACPI Device/Processor objects only: ! * Run the Device _HID, _UID, _SUB, and _CID methods. * * Note: none of these methods are required, so they may or may * not be present for this device. The Info->Valid bitfield is used * to indicate which methods were found and run successfully. */
*** 379,396 **** { InfoSize += Uid->Length; Valid |= ACPI_VALID_UID; } /* Execute the Device._CID method */ Status = AcpiUtExecute_CID (Node, &CidList); if (ACPI_SUCCESS (Status)) { /* Add size of CID strings and CID pointer array */ ! InfoSize += (CidList->ListSize - sizeof (ACPI_DEVICE_ID_LIST)); Valid |= ACPI_VALID_CID; } } /* --- 383,409 ---- { InfoSize += Uid->Length; Valid |= ACPI_VALID_UID; } + /* Execute the Device._SUB method */ + + Status = AcpiUtExecute_SUB (Node, &Sub); + if (ACPI_SUCCESS (Status)) + { + InfoSize += Sub->Length; + Valid |= ACPI_VALID_SUB; + } + /* Execute the Device._CID method */ Status = AcpiUtExecute_CID (Node, &CidList); if (ACPI_SUCCESS (Status)) { /* Add size of CID strings and CID pointer array */ ! InfoSize += (CidList->ListSize - sizeof (ACPI_PNP_DEVICE_ID_LIST)); Valid |= ACPI_VALID_CID; } } /*
*** 411,423 **** { /* * Get extra info for ACPI Device/Processor objects only: * Run the _STA, _ADR and, SxW, and _SxD methods. * ! * Note: none of these methods are required, so they may or may * not be present for this device. The Info->Valid bitfield is used * to indicate which methods were found and run successfully. */ /* Execute the Device._STA method */ Status = AcpiUtExecute_STA (Node, &Info->CurrentStatus); --- 424,441 ---- { /* * Get extra info for ACPI Device/Processor objects only: * Run the _STA, _ADR and, SxW, and _SxD methods. * ! * Notes: none of these methods are required, so they may or may * not be present for this device. The Info->Valid bitfield is used * to indicate which methods were found and run successfully. + * + * For _STA, if the method does not exist, then (as per the ACPI + * specification), the returned CurrentStatus flags will indicate + * that the device is present/functional/enabled. Otherwise, the + * CurrentStatus flags reflect the value returned from _STA. */ /* Execute the Device._STA method */ Status = AcpiUtExecute_STA (Node, &Info->CurrentStatus);
*** 461,478 **** * Point to the end of the base ACPI_DEVICE_INFO structure. */ NextIdString = ACPI_CAST_PTR (char, Info->CompatibleIdList.Ids); if (CidList) { ! /* Point past the CID DEVICE_ID array */ ! NextIdString += ((ACPI_SIZE) CidList->Count * sizeof (ACPI_DEVICE_ID)); } /* ! * Copy the HID, UID, and CIDs to the return buffer. The variable-length ! * strings are copied to the reserved area at the end of the buffer. * * For HID and CID, check if the ID is a PCI Root Bridge. */ if (Hid) { --- 479,497 ---- * Point to the end of the base ACPI_DEVICE_INFO structure. */ NextIdString = ACPI_CAST_PTR (char, Info->CompatibleIdList.Ids); if (CidList) { ! /* Point past the CID PNP_DEVICE_ID array */ ! NextIdString += ((ACPI_SIZE) CidList->Count * sizeof (ACPI_PNP_DEVICE_ID)); } /* ! * Copy the HID, UID, SUB, and CIDs to the return buffer. ! * The variable-length strings are copied to the reserved area ! * at the end of the buffer. * * For HID and CID, check if the ID is a PCI Root Bridge. */ if (Hid) {
*** 489,498 **** --- 508,523 ---- { NextIdString = AcpiNsCopyDeviceId (&Info->UniqueId, Uid, NextIdString); } + if (Sub) + { + NextIdString = AcpiNsCopyDeviceId (&Info->SubsystemId, + Sub, NextIdString); + } + if (CidList) { Info->CompatibleIdList.Count = CidList->Count; Info->CompatibleIdList.ListSize = CidList->ListSize;
*** 529,538 **** --- 554,567 ---- } if (Uid) { ACPI_FREE (Uid); } + if (Sub) + { + ACPI_FREE (Sub); + } if (CidList) { ACPI_FREE (CidList); } return (Status);