Field in ACPI
How Field definitions map bits and bytes inside an OperationRegion to names used by AML methods.
OperationRegion says where an address space exists. Field says how AML names map onto bits and bytes inside that region.
Without Field, an EC region is just a byte range. With Field, AML can say LIDS, BSTA, or TMP0 and the OS interpreter knows exactly which bits to access.
OperationRegion (ERAM, EmbeddedControl, 0x00, 0xFF)
Field (ERAM, ByteAcc, NoLock, Preserve)
{
Offset (0x10),
BSTA, 8,
Offset (0x20),
LIDS, 1,
Offset (0x30),
TMP0, 16
}
| Item | Value | Note |
|---|---|---|
| Region name | ERAM | The OperationRegion that backs this field. |
| Access type | ByteAcc / WordAcc / DWordAcc | How the interpreter accesses the region. |
| Lock rule | NoLock / Lock | Whether the global lock is used. |
| Update rule | Preserve / WriteAsZeros / WriteAsOnes | How untouched bits are handled during writes. |
| Offset | Byte offset | Moves the field cursor to a specific byte position. |
| Named field | Name + bit length | Maps a readable AML name to a bit range. |
Real World Example: one wrong bit breaks lid wake
If LIDS is defined at the wrong offset, the OS may think the lid is always open or always closed.
Offset (0x20),
LIDS, 1
If the EC firmware moved lid state to 0x21[0] but ACPI still reads 0x20[0], the AML method is syntactically correct but semantically wrong.
Common Pitfall: Preserve is not always harmless
When writing a small bit field, the update rule matters. Preserve means the interpreter should preserve other bits in the same access unit. But if the hardware register is write-one-to-clear or has side effects, a naive field write can still be dangerous.
Field review checklist
Related notes
Found this useful?
Save it or share it with someone learning firmware, BIOS/UEFI, and embedded systems.
Nội dung liên quan
Một số bài viết, ghi chú hoặc project có liên quan đến nội dung bạn vừa đọc.
OperationRegion Deep Dive
How ACPI OperationRegion connects AML methods to EC RAM, system memory, I/O ports, PCI config, GPIO, and other hardware-backed address spaces.
Embedded Controller OperationRegion
How AML talks to EC RAM through EmbeddedControl OperationRegion and how to debug EC timeout, SCI storm, battery, thermal, and hotkey issues.
GPIO OperationRegion
How ACPI models GPIO-backed platform state and why GPIO numbering, polarity, wake flags, and controller paths are common firmware bugs.
Biến note thành bài viết hoàn chỉnh
Notes là nơi ghi nhanh khái niệm.