Skip to content

Commit 6a5c41d

Browse files
committed
acpi: create acpi-tables crate
Add a lib crate for handling ACPI tables. The crate exports types representing the various tables we handle and methods for creating them, modifying them and writing them in guest memory. The crate is based on the cloudhypervisor implementation: https://github.com/rust-vmm/acpi_tables. We reuse the logic for creating AML bytecode but we diverge from the way they create and manipulate the tables. They rely mainly on the SdtHeader type and work with byte offsets, whereas we define concrete types for each table and use those. Signed-off-by: Babis Chalios <[email protected]>
1 parent 72a65f2 commit 6a5c41d

File tree

13 files changed

+2596
-4
lines changed

13 files changed

+2596
-4
lines changed

Cargo.lock

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
2-
members = ["src/clippy-tracing", "src/cpu-template-helper", "src/firecracker", "src/jailer", "src/log-instrument", "src/log-instrument-macros", "src/rebase-snap", "src/seccompiler", "src/snapshot-editor"]
3-
default-members = ["src/clippy-tracing", "src/cpu-template-helper", "src/firecracker", "src/rebase-snap", "src/seccompiler", "src/snapshot-editor"]
2+
members = ["src/acpi-tables", "src/clippy-tracing", "src/cpu-template-helper", "src/firecracker", "src/jailer", "src/log-instrument", "src/log-instrument-macros", "src/rebase-snap", "src/seccompiler", "src/snapshot-editor"]
3+
default-members = ["src/clippy-tracing", "src/cpu-template-helper", "src/firecracker", "src/rebase-snap", "src/seccompiler", "src/snapshot-editor", "src/acpi-tables"]
44
resolver = "2"
55

66
[workspace.lints.rust]

src/acpi-tables/Cargo.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "acpi_tables"
3+
version = "0.1.0"
4+
authors = ["The Cloud Hypervisor Authors", "Amazon Firecracker team <[email protected]>"]
5+
edition = "2021"
6+
license = "Apache-2.0"
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
displaydoc = "0.2.4"
11+
thiserror = "1.0.32"
12+
vm-memory = { version = "0.14.1", features = ["backend-mmap", "backend-bitmap"] }
13+
zerocopy = { version = "0.7.32", features = ["derive"] }
14+
15+
[lib]
16+
bench = false
17+
18+
[lints]
19+
workspace = true

0 commit comments

Comments
 (0)