[SeaBIOS] [PATCH 1/2] acpi: remove unnecessary reads
Michael S. Tsirkin
mst at redhat.com
Wed Mar 28 17:31:03 CEST 2012
Read each of the up/down registers only once
and store in a local temporary.
This refactoring makes it a bit easier to
clear these registers, which is done by a follow-up patch.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
src/acpi-dsdt.dsl | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index 4e04c48..15201e9 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -487,12 +487,14 @@ DefinitionBlock (
Method(PCNF, 0) {
// Local0 = iterator
Store (Zero, Local0)
+ Store (PCIU, Local1)
+ Store (PCID, Local2)
While (LLess(Local0, 31)) {
Increment(Local0)
- If (And(PCIU, ShiftLeft(1, Local0))) {
+ If (And(Local1, ShiftLeft(1, Local0))) {
PCNT(Local0, 1)
}
- If (And(PCID, ShiftLeft(1, Local0))) {
+ If (And(Local2, ShiftLeft(1, Local0))) {
PCNT(Local0, 3)
}
}
--
1.7.9.111.gf3fb0
More information about the SeaBIOS
mailing list