53#define MAX_NESTING 1024
58#define CONTEXT_ENTER(Context, Name) \
61 "%a 0x%x (looking for %c%c%c%c)\n", \
63 (UINT32) ((Context)->CurrentOpcode - (Context)->TableStart), \
64 ((CHAR8 *) (Context)->CurrentIdentifier)[3], \
65 ((CHAR8 *) (Context)->CurrentIdentifier)[2], \
66 ((CHAR8 *) (Context)->CurrentIdentifier)[1], \
67 ((CHAR8 *) (Context)->CurrentIdentifier)[0] \
70#define PRINT_ACPI_NAME(Str, Name, Length) \
73 "%a %u (%c%c%c%c)\n", \
76 (Length) > 0 ? (Name)[((Length) - 1) * 4 + 0] : 'Z', \
77 (Length) > 0 ? (Name)[((Length) - 1) * 4 + 1] : 'Z', \
78 (Length) > 0 ? (Name)[((Length) - 1) * 4 + 2] : 'Z', \
79 (Length) > 0 ? (Name)[((Length) - 1) * 4 + 3] : 'Z' \
85#define CONTEXT_HAS_WORK(Context) do {\
86 ASSERT ((Context) != NULL); \
87 ASSERT ((Context)->CurrentOpcode != NULL); \
88 ASSERT ((Context)->TableEnd != NULL); \
89 ASSERT ((Context)->CurrentOpcode < (Context)->TableEnd); \
90 ASSERT ((Context)->PathStart != NULL); \
91 ASSERT ((Context)->PathEnd != NULL); \
92 ASSERT ((Context)->CurrentIdentifier != NULL); \
93 ASSERT ((Context)->CurrentIdentifier < (Context)->PathEnd); \
94 ASSERT ((Context)->RequiredEntry > 0); \
95 ASSERT ((Context)->EntriesFound < (Context)->RequiredEntry); \
101#define CONTEXT_INCREASE_NESTING(Context) do {\
102 ++(Context)->Nesting; \
103 if ((Context)->Nesting > MAX_NESTING) { \
104 return EFI_OUT_OF_RESOURCES; \
112#define CONTEXT_DECREASE_NESTING(Context) do {\
113 ASSERT ((Context)->Nesting > 0); \
114 --(Context)->Nesting; \
120#define CONTEXT_PEEK_BYTES(Context, Bytes) do {\
121 if ((UINT32) ((Context)->TableEnd - (Context)->CurrentOpcode) < (UINT32) (Bytes)) { \
122 return EFI_DEVICE_ERROR; \
129#define CONTEXT_CONSUME_BYTES(Context, Bytes) do {\
130 if ((UINT32) ((Context)->TableEnd - (Context)->CurrentOpcode) < (UINT32) (Bytes)) { \
131 return EFI_DEVICE_ERROR; \
133 (Context)->CurrentOpcode += (Bytes); \
141#define CONTEXT_ADVANCE_OPCODE(Context) do {\
142 if ((UINT32) ((Context)->TableEnd - (Context)->CurrentOpcode) <= 1U) { \
143 return EFI_DEVICE_ERROR; \
145 ++(Context)->CurrentOpcode; \
EFI_STATUS InternalAcpiParseTerm(IN OUT ACPI_PARSER_CONTEXT *Context, OUT UINT8 **Result)
UINT32 * CurrentIdentifier