/** @file\r
ACPI Sdt Protocol Driver\r
\r
- Copyright (c) 2010, Intel Corporation. All rights reserved. <BR>\r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
\r
/**\r
Return the child objects buffer from AML Handle's buffer.\r
- \r
+\r
@param[in] AmlParentHandle Parent handle.\r
@param[in] CurrentBuffer The current child buffer.\r
@param[out] Buffer On return, points to the next returned child buffer or NULL if there are no\r
child buffer.\r
\r
@retval EFI_SUCCESS Success\r
- @retval EFI_INVALID_PARAMETER AmlParentHandle does not refer to a valid ACPI object. \r
+ @retval EFI_INVALID_PARAMETER AmlParentHandle does not refer to a valid ACPI object.\r
**/\r
EFI_STATUS\r
AmlGetChildFromObjectBuffer (\r
- IN EFI_AML_HANDLE *AmlParentHandle,\r
- IN UINT8 *CurrentBuffer,\r
- OUT VOID **Buffer\r
+ IN EFI_AML_HANDLE *AmlParentHandle,\r
+ IN UINT8 *CurrentBuffer,\r
+ OUT VOID **Buffer\r
)\r
{\r
- AML_BYTE_ENCODING *AmlByteEncoding;\r
- UINTN DataSize;\r
+ AML_BYTE_ENCODING *AmlByteEncoding;\r
+ UINTN DataSize;\r
\r
//\r
// Root is considered as SCOPE, which has TermList.\r
if (AmlByteEncoding == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
+\r
//\r
// NOTE: We need return everything, because user might need parse the returned object.\r
//\r
if (DataSize == 0) {\r
return EFI_INVALID_PARAMETER;\r
}\r
+\r
CurrentBuffer += DataSize;\r
}\r
\r
\r
/**\r
Return the child ACPI objects from Root Handle.\r
- \r
+\r
@param[in] AmlParentHandle Parent handle. It is Root Handle.\r
@param[in] AmlHandle The previously returned handle or NULL to start with the first handle.\r
@param[out] Buffer On return, points to the next returned ACPI handle or NULL if there are no\r
child objects.\r
\r
@retval EFI_SUCCESS Success\r
- @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object. \r
+ @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.\r
**/\r
EFI_STATUS\r
AmlGetChildFromRoot (\r
- IN EFI_AML_HANDLE *AmlParentHandle,\r
- IN EFI_AML_HANDLE *AmlHandle,\r
- OUT VOID **Buffer\r
+ IN EFI_AML_HANDLE *AmlParentHandle,\r
+ IN EFI_AML_HANDLE *AmlHandle,\r
+ OUT VOID **Buffer\r
)\r
{\r
- UINT8 *CurrentBuffer;\r
+ UINT8 *CurrentBuffer;\r
\r
if (AmlHandle == NULL) {\r
//\r
\r
/**\r
Return the child objects buffer from AML Handle's option list.\r
- \r
+\r
@param[in] AmlParentHandle Parent handle.\r
@param[in] AmlHandle The current child handle.\r
@param[out] Buffer On return, points to the next returned child buffer or NULL if there are no\r
child buffer.\r
\r
@retval EFI_SUCCESS Success\r
- @retval EFI_INVALID_PARAMETER AmlParentHandle does not refer to a valid ACPI object. \r
+ @retval EFI_INVALID_PARAMETER AmlParentHandle does not refer to a valid ACPI object.\r
**/\r
EFI_STATUS\r
AmlGetChildFromOptionList (\r
- IN EFI_AML_HANDLE *AmlParentHandle,\r
- IN EFI_AML_HANDLE *AmlHandle,\r
- OUT VOID **Buffer\r
+ IN EFI_AML_HANDLE *AmlParentHandle,\r
+ IN EFI_AML_HANDLE *AmlHandle,\r
+ OUT VOID **Buffer\r
)\r
{\r
EFI_ACPI_DATA_TYPE DataType;\r
EFI_STATUS Status;\r
AML_OP_PARSE_INDEX MaxTerm;\r
\r
- Index = AML_OP_PARSE_INDEX_GET_TERM1;\r
+ Index = AML_OP_PARSE_INDEX_GET_TERM1;\r
MaxTerm = AmlParentHandle->AmlByteEncoding->MaxIndex;\r
while (Index <= MaxTerm) {\r
Status = AmlParseOptionHandleCommon (\r
if (EFI_ERROR (Status)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
+\r
if (DataType == EFI_ACPI_DATA_TYPE_NONE) {\r
//\r
// Not found\r
// Find it, and Check Data\r
//\r
if ((DataType == EFI_ACPI_DATA_TYPE_CHILD) &&\r
- ((UINTN)AmlHandle->Buffer < (UINTN)Data)) {\r
+ ((UINTN)AmlHandle->Buffer < (UINTN)Data))\r
+ {\r
//\r
// Buffer < Data means current node is next one\r
//\r
*Buffer = Data;\r
return EFI_SUCCESS;\r
}\r
+\r
//\r
// Not Child\r
//\r
- Index ++;\r
+ Index++;\r
}\r
\r
*Buffer = NULL;\r
\r
/**\r
Return the child objects buffer from AML Handle's object child list.\r
- \r
+\r
@param[in] AmlParentHandle Parent handle.\r
@param[in] AmlHandle The current child handle.\r
@param[out] Buffer On return, points to the next returned child buffer or NULL if there are no\r
child buffer.\r
\r
@retval EFI_SUCCESS Success\r
- @retval EFI_INVALID_PARAMETER AmlParentHandle does not refer to a valid ACPI object. \r
+ @retval EFI_INVALID_PARAMETER AmlParentHandle does not refer to a valid ACPI object.\r
**/\r
EFI_STATUS\r
AmlGetChildFromObjectChildList (\r
- IN EFI_AML_HANDLE *AmlParentHandle,\r
- IN EFI_AML_HANDLE *AmlHandle,\r
- OUT VOID **Buffer\r
+ IN EFI_AML_HANDLE *AmlParentHandle,\r
+ IN EFI_AML_HANDLE *AmlHandle,\r
+ OUT VOID **Buffer\r
)\r
{\r
- EFI_STATUS Status;\r
- UINT8 *CurrentBuffer;\r
+ EFI_STATUS Status;\r
+ UINT8 *CurrentBuffer;\r
+\r
+ CurrentBuffer = NULL;\r
\r
if ((AmlParentHandle->AmlByteEncoding->Attribute & AML_HAS_CHILD_OBJ) == 0) {\r
//\r
\r
/**\r
Return the child ACPI objects from Non-Root Handle.\r
- \r
+\r
@param[in] AmlParentHandle Parent handle. It is Non-Root Handle.\r
@param[in] AmlHandle The previously returned handle or NULL to start with the first handle.\r
@param[out] Buffer On return, points to the next returned ACPI handle or NULL if there are no\r
child objects.\r
\r
@retval EFI_SUCCESS Success\r
- @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object. \r
+ @retval EFI_INVALID_PARAMETER ParentHandle is NULL or does not refer to a valid ACPI object.\r
**/\r
EFI_STATUS\r
AmlGetChildFromNonRoot (\r
- IN EFI_AML_HANDLE *AmlParentHandle,\r
- IN EFI_AML_HANDLE *AmlHandle,\r
- OUT VOID **Buffer\r
+ IN EFI_AML_HANDLE *AmlParentHandle,\r
+ IN EFI_AML_HANDLE *AmlHandle,\r
+ OUT VOID **Buffer\r
)\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
\r
if (AmlHandle == NULL) {\r
//\r
if (EFI_ERROR (Status)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
+\r
if (*Buffer != NULL) {\r
return EFI_SUCCESS;\r
}\r