tools: add tool to decode AML files and build an ACPI namespace
This commit is contained in:
52
tools/amldecode/aml/object.h
Normal file
52
tools/amldecode/aml/object.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef AML_OBJECT_H_
|
||||
#define AML_OBJECT_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include "constants.h"
|
||||
|
||||
enum acpi_object_type {
|
||||
ACPI_OBJECT_NONE = 0,
|
||||
ACPI_OBJECT_VALUE,
|
||||
ACPI_OBJECT_NAMESPACE,
|
||||
ACPI_OBJECT_CPU,
|
||||
ACPI_OBJECT_DEVICE,
|
||||
ACPI_OBJECT_METHOD,
|
||||
ACPI_OBJECT_POWER_RESOURCE,
|
||||
ACPI_OBJECT_OPERATION_REGION,
|
||||
ACPI_OBJECT_THERMAL_ZONE,
|
||||
ACPI_OBJECT_FIELD,
|
||||
ACPI_OBJECT_PACKAGE,
|
||||
ACPI_OBJECT_BUFFER,
|
||||
};
|
||||
|
||||
struct acpi_object {
|
||||
int ref;
|
||||
enum acpi_object_type type;
|
||||
union {
|
||||
char name[ACPI_OBJECT_NAME_MAX];
|
||||
char *publish_path;
|
||||
};
|
||||
|
||||
size_t scope_end;
|
||||
|
||||
struct acpi_object *parent;
|
||||
struct acpi_object *first_child, *next_sibling;
|
||||
};
|
||||
|
||||
struct acpi_namespace {
|
||||
struct acpi_object *root;
|
||||
};
|
||||
|
||||
extern struct acpi_namespace *acpi_namespace_create(void);
|
||||
extern struct acpi_object *acpi_namespace_get_object(struct acpi_namespace *ns, const char *path);
|
||||
|
||||
extern struct acpi_object *acpi_object_create(const char name[ACPI_OBJECT_NAME_MAX], enum acpi_object_type type);
|
||||
extern struct acpi_object *acpi_object_ref(struct acpi_object *object);
|
||||
extern void acpi_object_deref(struct acpi_object *object);
|
||||
extern void acpi_object_add_child(struct acpi_object *parent, struct acpi_object *child);
|
||||
extern struct acpi_object *acpi_object_get_child(struct acpi_object *object, const char *name);
|
||||
extern void acpi_object_print(struct acpi_object *object, int depth);
|
||||
|
||||
extern const char *acpi_object_type_string(enum acpi_object_type type);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user