Skip to content

Commit 1f5d7cb

Browse files
authored
Add August 2021 changes for acpi (#70)
1 parent 15cf4cb commit 1f5d7cb

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

content/this-month/2021-08/index.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ date = 0000-01-01
66
month = "August 2021"
77
authors = [
88
"phil-opp",
9+
"IsaacWoods",
910
# add yourself here
1011
]
1112
+++
@@ -36,6 +37,38 @@ The `x86_64` crate provides various abstractions for `x86_64` systems, including
3637

3738
In August, …
3839

40+
### [`acpi`](https://github.com/rust-osdev/acpi)
41+
42+
The `acpi` repository contains crates for parsing the ACPI tables – data structures that the firmware of modern computers use to relay information about the hardware to the OS.
43+
44+
There was a fair amount of progress this month, including adding support for a major AML feature: buffer fields.
45+
These are objects that represent bit-level slices of buffer objects, allowing a section of a buffer to be read and
46+
written. This requires us to support multiple namespace objects operating on the same underlying data -
47+
currently this is handled simply with spinlocks, but we're looking to improve this situation in the future.
48+
With this, we grew support for the `DefCreateBitField`, `DefCreateByteField`, `DefCreateWordField`,
49+
`DefCreateDWordField`, `DefCreateQWordField`, and `DefCreateField` opcodes, as well as logic for reading and
50+
writing `Integer`s and `Buffer`s out of them. <span class="gray">(published as `aml v0.16.0`)</span>
51+
52+
The `acpi` crate also saw improvement, and unfortunately some more breakage. We now support X2APIC entries
53+
appearing in the MADT, and so have changed the representation of Processor UIDs and Local APIC IDs in
54+
`acpi::platform::Processor` to `u32`, to support the wider IDs that X2APIC uses to support more processors. On
55+
older platforms that only support APIC, the upper bits will simply always be zeroed, and so these values can be
56+
cast down to `u8` when needed. Note that for complex legacy reasons, you cannot rely upon ACPI for detecting
57+
whether a platform has X2APIC support or not, and so whether the MADT actually contained X2APIC entries is not exposed
58+
by this interface - this is by design. <span class="gray">(published as `acpi v4.0.0`)</span>
59+
60+
Other changes were:
61+
- [`aml`: the contents of the `namespace` module were made public](https://github.com/rust-osdev/acpi/pull/107).
62+
Thanks to [@Andy-Python-Programmer](https://github.com/Andy-Python-Programmer) for this contribution!
63+
- [`aml`: store locals and method arguments in arrays](https://github.com/rust-osdev/acpi/commit/c1597aba3d39344834292637fb81e2f2971d6c04). If you're manually calling AML methods
64+
that take arguments, you will need to update how you create them.
65+
- [`aml`: support the `DefFatal` opcode](https://github.com/rust-osdev/acpi/commit/514e55df07acbca93dfd4eb2db3cdd6fdea5aaf5). `DefFatal` will cause a panic by default, but this behaviour can be overridden by implementing `Handler::handle_fatal_error`.
66+
- [`aml`: implement the `DefWhile` opcode](https://github.com/rust-osdev/acpi/commit/06409b360ef30b3b08b56865f3ee380315751f14)
67+
- [`aml`: implement the `DefBreak` opcode](https://github.com/rust-osdev/acpi/commit/da5f5cec8096d2ebd5697212e282abbeaed6edb7)
68+
- [`aml`: implement the `DefContinue` opcode](https://github.com/rust-osdev/acpi/commit/ed0400092e18598c73ca6048fb96b2522237808d)
69+
- [`aml`: implement the `DefIncrement` and `DefDecrement` opcodes](https://github.com/rust-osdev/acpi/commit/b854d5491e48e5a4f332ff259ce185cb357261d0)
70+
- [`aml`: implement the `ToInteger` opcode](https://github.com/rust-osdev/acpi/commit/00a61d8b7471dae725283296f4ee9c0c20013156)
71+
3972
## Call for Participation
4073

4174
Want to contribute to a Rust OSDev project, but don't know where to start? Pick up one of these outstanding

0 commit comments

Comments
 (0)