PatchworkOS
Loading...
Searching...
No Matches
debug.c
Go to the documentation of this file.
2
5
7{
9 {
10 AML_DEBUG_ERROR(ctx, "Failed to read DebugOp");
11 return NULL;
12 }
13
15 if (obj == NULL)
16 {
17 return NULL;
18 }
19
20 if (aml_debug_object_set(obj) == ERR)
21 {
22 DEREF(obj);
23 return NULL;
24 }
25
26 return obj; // Transfer ownership
27}
#define AML_DEBUG_ERROR(ctx, format,...)
Macro to simplify calling aml_debug_error() with the current function name.
Definition debug.h:30
aml_object_t * aml_debug_obj_read(aml_term_list_ctx_t *ctx)
Reads a DebugObj structure from the AML byte stream.
Definition debug.c:6
aml_object_t * aml_object_new(void)
Allocate a new ACPI object.
Definition object.c:54
uint64_t aml_debug_object_set(aml_object_t *object)
Set a object as a debug object.
Definition object.c:564
static uint64_t aml_token_expect(aml_term_list_ctx_t *ctx, aml_token_num_t expected)
Reads a token from the AML stream and verifies it matches the expected token.
Definition token.h:353
@ AML_DEBUG_OP
Definition token.h:184
#define DEREF(ptr)
Decrement reference count.
Definition ref.h:80
#define NULL
Pointer error value.
Definition NULL.h:23
#define ERR
Integer error value.
Definition ERR.h:17
ACPI object.
Definition object.h:425
Context for reading a TermList.
Definition term.h:37