hw/intc/i8259: Refactor pic_read_irq() to avoid uninitialized variable
[qemu/ar7.git] / docs / specs / acpi_hw_reduced_hotplug.rst
blob0bd3f9399fee04bc7829f6f5936a398720dc7eeb
1 ==================================================
2 QEMU and ACPI BIOS Generic Event Device interface
3 ==================================================
5 The ACPI *Generic Event Device* (GED) is a HW reduced platform
6 specific device introduced in ACPI v6.1 that handles all platform
7 events, including the hotplug ones. GED is modelled as a device
8 in the namespace with a _HID defined to be ACPI0013. This document
9 describes the interface between QEMU and the ACPI BIOS.
11 GED allows HW reduced platforms to handle interrupts in ACPI ASL
12 statements. It follows a very similar approach to the _EVT method
13 from GPIO events. All interrupts are listed in  _CRS and the handler
14 is written in _EVT method. However, the QEMU implementation uses a
15 single interrupt for the GED device, relying on an IO memory region
16 to communicate the type of device affected by the interrupt. This way,
17 we can support up to 32 events with a unique interrupt.
19 **Here is an example,**
23    Device (\_SB.GED)
24    {
25        Name (_HID, "ACPI0013")
26        Name (_UID, Zero)
27        Name (_CRS, ResourceTemplate ()
28        {
29            Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive, ,, )
30            {
31                0x00000029,
32            }
33        })
34        OperationRegion (EREG, SystemMemory, 0x09080000, 0x04)
35        Field (EREG, DWordAcc, NoLock, WriteAsZeros)
36        {
37            ESEL,   32
38        }
39        Method (_EVT, 1, Serialized)
40        {
41            Local0 = ESEL // ESEL = IO memory region which specifies the
42                          // device type.
43            If (((Local0 & One) == One))
44            {
45                MethodEvent1()
46            }
47            If ((Local0 & 0x2) == 0x2)
48            {
49                MethodEvent2()
50            }
51            ...
52        }
53    }
55 GED IO interface (4 byte access)
56 --------------------------------
57 **read access:**
61    [0x0-0x3] Event selector bit field (32 bit) set by QEMU.
63     bits:
64        0: Memory hotplug event
65        1: System power down event
66        2: NVDIMM hotplug event
67     3-31: Reserved
69 **write_access:**
71 Nothing is expected to be written into GED IO memory