Patchwork [v15,1/2] add pvpanic device driver

login
register
mail settings
Submitter Hu Tao
Date March 21, 2013, 9:08 a.m.
Message ID <1363856914-23399-1-git-send-email-hutao@cn.fujitsu.com>
Download mbox | patch
Permalink /patch/229588/
State New
Headers show

Comments

Hu Tao - March 21, 2013, 9:08 a.m.
pvpanic device is used to notify host(qemu) when guest panic happens.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---

ref: http://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg03630.html
The version number is 15 to consist with qemu patches.

 src/acpi-dsdt-isa.dsl | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

Patch

diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl
index 23761db..87a31b9 100644
--- a/src/acpi-dsdt-isa.dsl
+++ b/src/acpi-dsdt-isa.dsl
@@ -99,4 +99,34 @@  Scope(\_SB.PCI0.ISA) {
             IRQNoFlags() { 3 }
         })
     }
+
+    Device(PEVT) {
+        Name(_HID, "QEMU0001")
+        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
+        Field(PEOR, ByteAcc, NoLock, Preserve) {
+            PEPT,   8,
+        }
+
+        Method(_STA, 0, NotSerialized) {
+            Store(PEPT, Local0)
+            If (LEqual(Local0, Zero)) {
+                Return (0x00)
+            } Else {
+                Return (0x0F)
+            }
+        }
+
+        Method(RDPT, 0, NotSerialized) {
+            Store(PEPT, Local0)
+            Return (Local0)
+        }
+
+        Method(WRPT, 1, NotSerialized) {
+            Store(Arg0, PEPT)
+        }
+
+        Name(_CRS, ResourceTemplate() {
+            IO(Decode16, 0x0505, 0x0505, 0x01, 0x01)
+        })
+    }
 }