| 1 | # -*- Mode: Python -*- |
| 2 | # vim: filetype=python |
| 3 | # |
| 4 | # This work is licensed under the terms of the GNU GPL, version 2 or later. |
| 5 | # See the COPYING file in the top-level directory. |
| 6 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 7 | |
| 8 | ## |
| 9 | # **** |
| 10 | # ACPI |
| 11 | # **** |
| 12 | ## |
| 13 | |
| 14 | ## |
| 15 | # @AcpiTableOptions: |
| 16 | # |
| 17 | # Specify an ACPI table on the command line to load. |
| 18 | # |
| 19 | # At most one of @file and @data can be specified. The list of files |
| 20 | # specified by any one of them is loaded and concatenated in order. |
| 21 | # If both are omitted, @data is implied. |
| 22 | # |
| 23 | # Other fields / optargs can be used to override fields of the generic |
| 24 | # ACPI table header; refer to the ACPI specification 5.0, section |
| 25 | # 5.2.6 System Description Table Header. If a header field is not |
| 26 | # overridden, then the corresponding value from the concatenated blob |
| 27 | # is used (in case of @file), or it is filled in with a hard-coded |
| 28 | # value (in case of @data). |
| 29 | # |
| 30 | # String fields are copied into the matching ACPI member from lowest |
| 31 | # address upwards, and silently truncated / NUL-padded to length. |
| 32 | # |
| 33 | # @sig: table signature / identifier (4 bytes) |
| 34 | # |
| 35 | # @rev: table revision number (dependent on signature, 1 byte) |
| 36 | # |
| 37 | # @oem_id: OEM identifier (6 bytes) |
| 38 | # |
| 39 | # @oem_table_id: OEM table identifier (8 bytes) |
| 40 | # |
| 41 | # @oem_rev: OEM-supplied revision number (4 bytes) |
| 42 | # |
| 43 | # @asl_compiler_id: identifier of the utility that created the table |
| 44 | # (4 bytes) |
| 45 | # |
| 46 | # @asl_compiler_rev: revision number of the utility that created the |
| 47 | # table (4 bytes) |
| 48 | # |
| 49 | # @file: colon (:) separated list of pathnames to load and concatenate |
| 50 | # as table data. The resultant binary blob is expected to have an |
| 51 | # ACPI table header. At least one file is required. This field |
| 52 | # excludes @data. |
| 53 | # |
| 54 | # @data: colon (:) separated list of pathnames to load and concatenate |
| 55 | # as table data. The resultant binary blob must not have an ACPI |
| 56 | # table header. At least one file is required. This field |
| 57 | # excludes @file. |
| 58 | # |
| 59 | # Since: 1.5 |
| 60 | ## |
| 61 | { 'struct': 'AcpiTableOptions', |
| 62 | 'data': { |
| 63 | '*sig': 'str', |
| 64 | '*rev': 'uint8', |
| 65 | '*oem_id': 'str', |
| 66 | '*oem_table_id': 'str', |
| 67 | '*oem_rev': 'uint32', |
| 68 | '*asl_compiler_id': 'str', |
| 69 | '*asl_compiler_rev': 'uint32', |
| 70 | '*file': 'str', |
| 71 | '*data': 'str' }} |
| 72 | |
| 73 | ## |
| 74 | # @ACPISlotType: |
| 75 | # |
| 76 | # @DIMM: memory slot |
| 77 | # |
| 78 | # @CPU: logical CPU slot (since 2.7) |
| 79 | ## |
| 80 | { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] } |
| 81 | |
| 82 | ## |
| 83 | # @ACPIOSTInfo: |
| 84 | # |
| 85 | # OSPM Status Indication for a device. For description of possible |
| 86 | # values of @source and @status fields see "_OST (OSPM Status |
| 87 | # Indication)" chapter of ACPI5.0 spec. |
| 88 | # |
| 89 | # @device: device ID associated with slot |
| 90 | # |
| 91 | # @slot: slot ID, unique per slot of a given @slot-type |
| 92 | # |
| 93 | # @slot-type: type of the slot |
| 94 | # |
| 95 | # @source: an integer containing the source event |
| 96 | # |
| 97 | # @status: an integer containing the status code |
| 98 | # |
| 99 | # Since: 2.1 |
| 100 | ## |
| 101 | { 'struct': 'ACPIOSTInfo', |
| 102 | 'data' : { '*device': 'str', |
| 103 | 'slot': 'str', |
| 104 | 'slot-type': 'ACPISlotType', |
| 105 | 'source': 'int', |
| 106 | 'status': 'int' } } |
| 107 | |
| 108 | ## |
| 109 | # @query-acpi-ospm-status: |
| 110 | # |
| 111 | # Return a list of `ACPIOSTInfo` for devices that support status |
| 112 | # reporting via ACPI _OST method. |
| 113 | # |
| 114 | # Since: 2.1 |
| 115 | # |
| 116 | # .. qmp-example:: |
| 117 | # |
| 118 | # -> { "execute": "query-acpi-ospm-status" } |
| 119 | # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0}, |
| 120 | # { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0}, |
| 121 | # { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0}, |
| 122 | # { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0} |
| 123 | # ]} |
| 124 | ## |
| 125 | { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] } |
| 126 | |
| 127 | ## |
| 128 | # @ACPI_DEVICE_OST: |
| 129 | # |
| 130 | # Emitted when guest executes ACPI _OST method. |
| 131 | # |
| 132 | # @info: OSPM Status Indication |
| 133 | # |
| 134 | # Since: 2.1 |
| 135 | # |
| 136 | # .. qmp-example:: |
| 137 | # |
| 138 | # <- { "event": "ACPI_DEVICE_OST", |
| 139 | # "data": { "info": { "device": "d1", "slot": "0", |
| 140 | # "slot-type": "DIMM", "source": 1, "status": 0 } }, |
| 141 | # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } |
| 142 | ## |
| 143 | { 'event': 'ACPI_DEVICE_OST', |
| 144 | 'data': { 'info': 'ACPIOSTInfo' } } |