[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [patch 02/24] QEMU/KVM: add OperationRegion and GPE handler
From: |
Marcelo Tosatti |
Subject: |
[Qemu-devel] [patch 02/24] QEMU/KVM: add OperationRegion and GPE handler for add/removal notification |
Date: |
Tue, 11 Mar 2008 17:11:53 -0300 |
User-agent: |
quilt/0.46-1 |
Use GPE _L01 to notify OSPM.
Signed-off-by: Marcelo Tosatti <address@hidden>
Index: kvm-userspace.hotplug2/bios/acpi-dsdt.dsl
===================================================================
--- kvm-userspace.hotplug2.orig/bios/acpi-dsdt.dsl
+++ kvm-userspace.hotplug2/bios/acpi-dsdt.dsl
@@ -407,6 +407,13 @@ DefinitionBlock (
Package() {0x001fffff, 3, LNKB, 0},
})
+ OperationRegion(PCST, SystemIO, 0xae00, 0x08)
+ Field (PCST, DWordAcc, NoLock, WriteAsZeros)
+ {
+ PCIU, 32,
+ PCID, 32,
+ }
+
Device (S1) { // Slot 1
Name (_ADR, 0x00010000)
Method (_EJ0,1) { Return (0x0) }
@@ -1142,6 +1149,256 @@ DefinitionBlock (
Return(0x01)
}
Method(_L01) {
+ /* Up status */
+ If (And(\_SB.PCI0.PCIU, 0x2)) {
+ Notify(\_SB.PCI0.S1, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x4)) {
+ Notify(\_SB.PCI0.S2, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x8)) {
+ Notify(\_SB.PCI0.S3, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x10)) {
+ Notify(\_SB.PCI0.S4, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x20)) {
+ Notify(\_SB.PCI0.S5, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x40)) {
+ Notify(\_SB.PCI0.S6, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x80)) {
+ Notify(\_SB.PCI0.S7, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x0100)) {
+ Notify(\_SB.PCI0.S8, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x0200)) {
+ Notify(\_SB.PCI0.S9, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x0400)) {
+ Notify(\_SB.PCI0.S10, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x0800)) {
+ Notify(\_SB.PCI0.S11, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x1000)) {
+ Notify(\_SB.PCI0.S12, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x2000)) {
+ Notify(\_SB.PCI0.S13, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x4000)) {
+ Notify(\_SB.PCI0.S14, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x8000)) {
+ Notify(\_SB.PCI0.S15, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x10000)) {
+ Notify(\_SB.PCI0.S16, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x20000)) {
+ Notify(\_SB.PCI0.S17, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x40000)) {
+ Notify(\_SB.PCI0.S18, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x80000)) {
+ Notify(\_SB.PCI0.S19, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x100000)) {
+ Notify(\_SB.PCI0.S20, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x200000)) {
+ Notify(\_SB.PCI0.S21, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x400000)) {
+ Notify(\_SB.PCI0.S22, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x800000)) {
+ Notify(\_SB.PCI0.S23, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x1000000)) {
+ Notify(\_SB.PCI0.S24, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x2000000)) {
+ Notify(\_SB.PCI0.S25, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x4000000)) {
+ Notify(\_SB.PCI0.S26, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x8000000)) {
+ Notify(\_SB.PCI0.S27, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x10000000)) {
+ Notify(\_SB.PCI0.S28, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x20000000)) {
+ Notify(\_SB.PCI0.S29, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x40000000)) {
+ Notify(\_SB.PCI0.S30, 0x1)
+ }
+
+ If (And(\_SB.PCI0.PCIU, 0x80000000)) {
+ Notify(\_SB.PCI0.S31, 0x1)
+ }
+
+ /* Down status */
+ If (And(\_SB.PCI0.PCID, 0x2)) {
+ Notify(\_SB.PCI0.S1, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x4)) {
+ Notify(\_SB.PCI0.S2, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x8)) {
+ Notify(\_SB.PCI0.S3, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x10)) {
+ Notify(\_SB.PCI0.S4, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x20)) {
+ Notify(\_SB.PCI0.S5, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x40)) {
+ Notify(\_SB.PCI0.S6, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x80)) {
+ Notify(\_SB.PCI0.S7, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x0100)) {
+ Notify(\_SB.PCI0.S8, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x0200)) {
+ Notify(\_SB.PCI0.S9, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x0400)) {
+ Notify(\_SB.PCI0.S10, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x0800)) {
+ Notify(\_SB.PCI0.S11, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x1000)) {
+ Notify(\_SB.PCI0.S12, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x2000)) {
+ Notify(\_SB.PCI0.S13, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x4000)) {
+ Notify(\_SB.PCI0.S14, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x8000)) {
+ Notify(\_SB.PCI0.S15, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x10000)) {
+ Notify(\_SB.PCI0.S16, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x20000)) {
+ Notify(\_SB.PCI0.S17, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x40000)) {
+ Notify(\_SB.PCI0.S18, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x80000)) {
+ Notify(\_SB.PCI0.S19, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x100000)) {
+ Notify(\_SB.PCI0.S20, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x200000)) {
+ Notify(\_SB.PCI0.S21, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x400000)) {
+ Notify(\_SB.PCI0.S22, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x800000)) {
+ Notify(\_SB.PCI0.S23, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x1000000)) {
+ Notify(\_SB.PCI0.S24, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x2000000)) {
+ Notify(\_SB.PCI0.S25, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x4000000)) {
+ Notify(\_SB.PCI0.S26, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x8000000)) {
+ Notify(\_SB.PCI0.S27, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x10000000)) {
+ Notify(\_SB.PCI0.S28, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x20000000)) {
+ Notify(\_SB.PCI0.S29, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x40000000)) {
+ Notify(\_SB.PCI0.S30, 0x3)
+ }
+
+ If (And(\_SB.PCI0.PCID, 0x80000000)) {
+ Notify(\_SB.PCI0.S31, 0x3)
+ }
+
Return(0x01)
}
Method(_L02) {
--
- [Qemu-devel] [patch 00/24] QEMU ACPI PCI hotplug support, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 01/24] QEMU/KVM: add devices to represent PCI slots with _EJ0 method, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 02/24] QEMU/KVM: add OperationRegion and GPE handler for add/removal notification,
Marcelo Tosatti <=
- [Qemu-devel] [patch 05/24] QEMU/KVM: pci hotplug GPE support, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 03/24] QEMU/KVM: add pci_find_bus, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 07/24] QEMU/KVM: dynamic nic info index allocation, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 06/24] QEMU/KVM: dynamic drive/drive_opt index allocation, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 04/24] QEMU/KVM: return PCIDevice on net device init and record devfn, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 09/24] QEMU/KVM: record devfn on block driver instance, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 13/24] QEMU/KVM: export get_param_value/check_params, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 10/24] QEMU/KVM: move drives_opt for external use, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 12/24] QEMU/KVM: add net_client_uninit, Marcelo Tosatti, 2008/03/12
- [Qemu-devel] [patch 14/24] QEMU/KVM: add pci_find_device, Marcelo Tosatti, 2008/03/12