aboutsummaryrefslogtreecommitdiff
path: root/src/acpi-dsdt.dsl
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2011-09-21 21:19:51 -0400
committerKevin O'Connor <kevin@koconnor.net>2011-10-12 21:07:23 -0400
commit9d3d7cb4b163d3fbcba64a01c4fa42eb6bc53128 (patch)
tree46c167c454816555e7a0f47d7f286020159393ba /src/acpi-dsdt.dsl
parentf0521c90e89b5c1ce0ddd2e61b475b4a11820c14 (diff)
downloadseabios-hppa-9d3d7cb4b163d3fbcba64a01c4fa42eb6bc53128.zip
seabios-hppa-9d3d7cb4b163d3fbcba64a01c4fa42eb6bc53128.tar.gz
seabios-hppa-9d3d7cb4b163d3fbcba64a01c4fa42eb6bc53128.tar.bz2
Move code from PCI hotplug DSDT macros to methods.
Simplify the hotplug code by moving the bulk of the logic out of the macros and into static method definitions. This also reduces the ACPI DSDT code size. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/acpi-dsdt.dsl')
-rw-r--r--src/acpi-dsdt.dsl64
1 files changed, 40 insertions, 24 deletions
diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index 1d6bf5f..e37b2ef 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -465,16 +465,19 @@ DefinitionBlock (
****************************************************************/
Scope(\_SB.PCI0) {
+ /* Methods called by bulk generated PCI devices below */
+ Method (PRMV, 1, NotSerialized) {
+ // _RMV method - check if device can be removed
+ If (And(\_SB.PCI0.PCRM, ShiftLeft(1, Arg0))) {
+ Return (0x1)
+ }
+ Return (0x0)
+ }
#define gen_pci_device(slot) \
Device(SL##slot) { \
Name (_ADR, 0x##slot##0000) \
- Method (_RMV) { \
- If (And(\_SB.PCI0.PCRM, ShiftLeft(1, 0x##slot))) { \
- Return (0x1) \
- } \
- Return (0x0) \
- } \
+ Method (_RMV) { Return (PRMV(0x##slot)) } \
Name (_SUN, 0x##slot) \
}
@@ -509,14 +512,19 @@ DefinitionBlock (
gen_pci_device(1e)
gen_pci_device(1f)
-#define hotplug_slot(slot) \
- Device (S##slot) { \
- Name (_ADR, 0x##slot##0000) \
- Method (_EJ0,1) { \
- Store(ShiftLeft(1, 0x##slot), B0EJ) \
- Return (0x0) \
- } \
- Name (_SUN, 0x##slot) \
+ /* Methods called by bulk generated hotplug devices below */
+ Method (PCEJ, 1, NotSerialized) {
+ // _EJ0 method - eject callback
+ Store(ShiftLeft(1, Arg0), B0EJ)
+ Return (0x0)
+ }
+
+ /* Bulk generated PCI hotplug devices */
+#define hotplug_slot(slot) \
+ Device (S##slot) { \
+ Name (_ADR, 0x##slot##0000) \
+ Method (_EJ0, 1) { Return(PCEJ(0x##slot)) } \
+ Name (_SUN, 0x##slot) \
}
hotplug_slot(01)
@@ -551,16 +559,26 @@ DefinitionBlock (
hotplug_slot(1e)
hotplug_slot(1f)
-#define gen_pci_hotplug(slot) \
- If (And(\_SB.PCI0.PCIU, ShiftLeft(1, 0x##slot))) { \
- Notify(\_SB.PCI0.S##slot, 1) \
- } \
- If (And(\_SB.PCI0.PCID, ShiftLeft(1, 0x##slot))) { \
- Notify(\_SB.PCI0.S##slot, 3) \
- }
-
/* PCI hotplug notify method */
Method(PCNF, 0) {
+ // Local0 = iterator
+ Store (Zero, Local0)
+ While (LLess(Local0, 31)) {
+ Increment(Local0)
+ If (And(PCIU, ShiftLeft(1, Local0))) {
+ PCNT(Local0, 1)
+ }
+ If (And(PCID, ShiftLeft(1, Local0))) {
+ PCNT(Local0, 3)
+ }
+ }
+ Return(One)
+ }
+
+#define gen_pci_hotplug(slot) \
+ If (LEqual(Arg0, 0x##slot)) { Notify(S##slot, Arg1) }
+
+ Method(PCNT, 2) {
gen_pci_hotplug(01)
gen_pci_hotplug(02)
gen_pci_hotplug(03)
@@ -592,8 +610,6 @@ DefinitionBlock (
gen_pci_hotplug(1d)
gen_pci_hotplug(1e)
gen_pci_hotplug(1f)
-
- Return (0x01)
}
}