4 Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved. <BR>
5 Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
13 /* This header file does not include internal Node definition,
14 i.e. AML_ROOT_NODE, AML_OBJECT_NODE, etc. The node definitions
15 must be included by the caller file. The function prototypes must
16 only expose AML_NODE_HANDLE, AML_ROOT_NODE_HANDLE, etc. node
18 This allows to keep the functions defined here both internal and
19 potentially external. If necessary, any function of this file can
20 be exposed externally.
21 The Api folder is internal to the AmlLib, but should only use these
22 functions. They provide a "safe" way to interact with the AmlLib.
25 #if !defined (MDEPKG_NDEBUG)
27 #include <AmlInclude.h>
30 @defgroup DbgPrintApis Print APIs for debugging.
33 Print APIs provide a way to print:
35 - A (root/object/data) node;
37 - The AML NameSpace from the root node.
41 /** This function performs a raw data dump of the ACPI table.
43 @param [in] Ptr Pointer to the start of the table buffer.
44 @param [in] Length The length of the buffer.
53 /** Print Size chars at Buffer address.
57 @param [in] ErrorLevel Error level for the DEBUG macro.
58 @param [in] Buffer Buffer containing the chars.
59 @param [in] Size Number of chars to print.
65 IN CONST CHAR8
*Buffer
,
69 /** Print an AML NameSeg.
70 Don't print trailing underscores ('_').
72 @param [in] Buffer Buffer containing an AML NameSeg.
77 IN CONST CHAR8
*Buffer
80 /** Print an AML NameString.
82 @param [in] Buffer Buffer containing an AML NameString.
83 @param [in] NewLine Print a newline char at the end of the NameString.
87 AmlDbgPrintNameString (
88 IN CONST CHAR8
*Buffer
,
92 /** Print Node information.
96 @param [in] Node Pointer to the Node to print.
97 Can be a root/object/data node.
102 IN AML_NODE_HANDLE Node
105 /** Recursively print the subtree under the Node.
107 @ingroup DbgPrintApis
109 @param [in] Node Pointer to the root of the subtree to print.
110 Can be a root/object/data node.
115 IN AML_NODE_HANDLE Node
118 /** Print the absolute pathnames in the AML namespace of
119 all the nodes in the tree starting from the Root node.
121 @ingroup DbgPrintApis
123 @param [in] RootNode Pointer to a root node.
125 @retval EFI_SUCCESS The function completed successfully.
126 @retval EFI_BUFFER_TOO_SMALL No space left in the buffer.
127 @retval EFI_INVALID_PARAMETER Invalid parameter.
128 @retval EFI_OUT_OF_RESOURCES Out of memory.
132 AmlDbgPrintNameSpace (
133 IN AML_ROOT_NODE_HANDLE RootNode
136 /* Macros to encapsulate Aml Debug Print APIs.
139 #define AMLDBG_DUMP_RAW(Ptr, Length) \
140 AmlDbgDumpRaw (Ptr, Length)
142 #define AMLDBG_PRINT_CHARS(ErrorLevel, Buffer, Size) \
143 AmlDbgPrintChars (ErrorLevel, Buffer, Size)
145 #define AMLDBG_PRINT_NAMESEG(Buffer) \
146 AmlDbgPrintNameSeg (Buffer)
148 #define AMLDBG_PRINT_NAMESTR(Buffer, NewLine) \
149 AmlDbgPrintNameString (Buffer,NewLine)
151 #define AMLDBG_PRINT_NODE(Node) \
152 AmlDbgPrintNode (Node)
154 #define AMLDBG_PRINT_TREE(Node) \
155 AmlDbgPrintTree (Node)
157 #define AMLDBG_PRINT_NAMESPACE(RootNode) \
158 AmlDbgPrintNameSpace (RootNode)
162 #define AMLDBG_DUMP_RAW(Ptr, Length)
164 #define AMLDBG_PRINT_CHARS(ErrorLevel, Buffer, Size)
166 #define AMLDBG_PRINT_NAMESEG(Buffer)
168 #define AMLDBG_PRINT_NAMESTR(Buffer, NewLine)
170 #define AMLDBG_PRINT_NODE(Node)
172 #define AMLDBG_PRINT_TREE(Node)
174 #define AMLDBG_PRINT_NAMESPACE(RootNode)
176 #endif // MDEPKG_NDEBUG
178 #endif // AML_PRINT_H_