From 3cdc10be2488734ee1246f5bab6ca6b2b3f4b6a1 Mon Sep 17 00:00:00 2001 From: Achilleas Anagnostopoulos Date: Mon, 25 Dec 2017 18:44:53 +0000 Subject: [PATCH] acpi: define structs for holding the AML VM bytecode --- src/gopheros/device/acpi/aml/vm/vm.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/gopheros/device/acpi/aml/vm/vm.go diff --git a/src/gopheros/device/acpi/aml/vm/vm.go b/src/gopheros/device/acpi/aml/vm/vm.go new file mode 100644 index 0000000..6a1340f --- /dev/null +++ b/src/gopheros/device/acpi/aml/vm/vm.go @@ -0,0 +1,25 @@ +package vm + +import "gopheros/device/acpi/aml/entity" + +// Context contains the result of transforming the methods defined by a +// hierarchy of AML entities into the bytecode format that can be executed by +// the VM implementation in this package. +type Context struct { + // The root namespace for the parsed AML entities. + rootNS entity.Container + + constants []*entity.Const + buffers []*entity.Buffer + packages []*entity.Package + methodCalls []*methodCall + + bytecode []uint8 +} + +// methodCall contains information about the bytecode address where a particular +// AML method begins as well as a link to the actual method entity. +type methodCall struct { + entrypoint uint32 + method *entity.Method +}