VirtualBox

source: vbox/trunk/include/iprt/formats/acpi-resources.h

最後變更 在這個檔案是 108184,由 vboxsync 提交於 4 週 前

Runtime/RTAcpi*: Parser updates, the code is now able to parse vbox.dsl successfully and generate an AST, bugref:10733

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 10.9 KB
 
1/* $Id: acpi-resources.h 108184 2025-02-12 15:27:06Z vboxsync $ */
2/** @file
3 * IPRT, ACPI (Advanced Configuration and Power Interface) Resource Data Types format.
4 *
5 * Spec taken from: https://uefi.org/specs/ACPI/6.5/06_Device_Configuration.html#resource-data-types-for-acpi (2024-09-18)
6 */
7
8/*
9 * Copyright (C) 2024 Oracle and/or its affiliates.
10 *
11 * This file is part of VirtualBox base platform packages, as
12 * available from https://www.alldomusa.eu.org.
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation, in version 3 of the
17 * License.
18 *
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see <https://www.gnu.org/licenses>.
26 *
27 * The contents of this file may alternatively be used under the terms
28 * of the Common Development and Distribution License Version 1.0
29 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
30 * in the VirtualBox distribution, in which case the provisions of the
31 * CDDL are applicable instead of those of the GPL.
32 *
33 * You may elect to license modified versions of this file under the
34 * terms and conditions of either the GPL or the CDDL or both.
35 *
36 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
37 */
38
39#ifndef IPRT_INCLUDED_formats_acpi_resources_h
40#define IPRT_INCLUDED_formats_acpi_resources_h
41#ifndef RT_WITHOUT_PRAGMA_ONCE
42# pragma once
43#endif
44
45#include <iprt/types.h>
46#include <iprt/cdefs.h>
47#include <iprt/assertcompile.h>
48
49
50/** @defgroup grp_rt_formats_acpi_resouces Advanced Configuration and Power Interface (ACPI) Resource Data Types structures and definitions
51 * @ingroup grp_rt_formats
52 * @{
53 */
54
55/** End tag. */
56#define ACPI_RSRCS_TAG_END 0x79
57
58
59/** @name Small Resource Data Type.
60 * @{ */
61/** The bit identifying a small resource data type. */
62#define ACPI_RSRCS_SMALL_TYPE 0
63/** IRQ format descriptor. */
64#define ACPI_RSRCS_ITEM_IRQ 0x04
65/** DMA format descriptor. */
66#define ACPI_RSRCS_ITEM_DMA 0x05
67/** Start dependent functions descriptor. */
68#define ACPI_RSRCS_ITEM_START_DEP_FN 0x06
69/** End dependent functions descriptor. */
70#define ACPI_RSRCS_ITEM_END_DEP_FN 0x07
71/** I/O port descriptor. */
72#define ACPI_RSRCS_ITEM_IO 0x08
73/** Fixed location I/O port descriptor. */
74#define ACPI_RSRCS_ITEM_FIXED_LOCATION_IO 0x09
75/** Fixed DMA descriptor. */
76#define ACPI_RSRCS_ITEM_FIXED_DMA 0x0a
77/** End tag descriptor. */
78#define ACPI_RSRCS_ITEM_END_TAG 0x0f
79/** @} */
80
81
82/** @name Large Resource Data Type.
83 * @{ */
84/** The bit identifying a large resource data type. */
85#define ACPI_RSRCS_LARGE_TYPE RT_BIT(7)
86/** 24-bit memory range descriptor. */
87#define ACPI_RSRCS_ITEM_24BIT_MEMORY_RANGE 0x01
88/** Generic register descriptor. */
89#define ACPI_RSRCS_ITEM_GENERIC_REGISTER 0x02
90/** Vendor defined descriptor. */
91#define ACPI_RSRCS_ITEM_VENDOR_DEFINED 0x04
92/** 32-bit memory range descriptor. */
93#define ACPI_RSRCS_ITEM_32BIT_MEMORY_RANGE 0x05
94/** 32-bit fixed memory range descriptor. */
95#define ACPI_RSRCS_ITEM_32BIT_FIXED_MEMORY_RANGE 0x06
96/** DWord address space descriptor. */
97#define ACPI_RSRCS_ITEM_DWORD_ADDR_SPACE 0x07
98/** Word address space descriptor. */
99#define ACPI_RSRCS_ITEM_WORD_ADDR_SPACE 0x08
100/** Extended interrupt descriptor. */
101#define ACPI_RSRCS_ITEM_EXTENDED_INTERRUPT 0x09
102/** QWord address space descriptor. */
103#define ACPI_RSRCS_ITEM_QWORD_ADDR_SPACE 0x0a
104/** Extended Address space descriptor. */
105#define ACPI_RSRCS_ITEM_EXT_ADDR_SPACE_RESOURCE 0x0b
106/** GPIO connection descriptor. */
107#define ACPI_RSRCS_ITEM_GPIO_CONNECTION 0x0c
108/** Pin function descriptor. */
109#define ACPI_RSRCS_ITEM_PIN_FUNCTION 0x0d
110/** GenericSerialBus connection descriptor. */
111#define ACPI_RSRCS_ITEM_GENERIC_SERIAL_BUS 0x0e
112/** Pin configuration descriptor. */
113#define ACPI_RSRCS_ITEM_PIN_CONFIGURATION 0x0f
114/** Pin group descriptor. */
115#define ACPI_RSRCS_ITEM_PIN_GROUP 0x10
116/** Pin group function descriptor. */
117#define ACPI_RSRCS_ITEM_PIN_GROUP_FUNCTION 0x11
118/** Pin group configuration descriptor. */
119#define ACPI_RSRCS_ITEM_PIN_GROUP_CONFIGURATION 0x12
120/** Clock input resource. */
121#define ACPI_RSRCS_ITEM_CLOCK_INPUT_RESOURCE 0x13
122/** @} */
123
124
125/** @name Extended interrupt descriptor related definitions.
126 * @{ */
127/** The device consumes the resource. */
128#define ACPI_RSRCS_EXT_INTR_VEC_F_CONSUMER RT_BIT(0)
129/** The device produces the resource. */
130#define ACPI_RSRCS_EXT_INTR_VEC_F_PRODUCER 0
131
132/** Interrupt is edge triggered. */
133#define ACPI_RSRCS_EXT_INTR_VEC_F_EDGE_TRIGGERED RT_BIT(1)
134/** Interrupt is level triggered. */
135#define ACPI_RSRCS_EXT_INTR_VEC_F_LEVEL_TRIGGERED 0
136
137/** Interrupt polarity is active low. */
138#define ACPI_RSRCS_EXT_INTR_VEC_F_ACTIVE_LOW RT_BIT(2)
139/** Interrupt polarity is active high. */
140#define ACPI_RSRCS_EXT_INTR_VEC_F_ACTIVE_HIGH 0
141
142/** Interrupt is shared. */
143#define ACPI_RSRCS_EXT_INTR_VEC_F_SHARED RT_BIT(3)
144/** Interrupt is exclusive. */
145#define ACPI_RSRCS_EXT_INTR_VEC_F_EXCLUSIVE 0
146
147/** Interrupt is capable of waking the system. */
148#define ACPI_RSRCS_EXT_INTR_VEC_F_WAKE_CAP RT_BIT(4)
149/** Interrupt is not capable of waking the system. */
150#define ACPI_RSRCS_EXT_INTR_VEC_F_NOT_WAKE_CAP 0
151/** @} */
152
153
154/** @name IRQ descriptor related definitions.
155 * @{ */
156/** Interrupt is edge triggered. */
157#define ACPI_RSRCS_IRQ_F_EDGE_TRIGGERED RT_BIT(0)
158/** Interrupt is level triggered. */
159#define ACPI_RSRCS_IRQ_F_LEVEL_TRIGGERED 0
160
161/** Interrupt polarity is active low. */
162#define ACPI_RSRCS_IRQ_F_ACTIVE_LOW RT_BIT(3)
163/** Interrupt polarity is active high. */
164#define ACPI_RSRCS_IRQ_F_ACTIVE_HIGH 0
165
166/** Interrupt is shared. */
167#define ACPI_RSRCS_IRQ_F_SHARED RT_BIT(4)
168/** Interrupt is exclusive. */
169#define ACPI_RSRCS_IRQ_F_EXCLUSIVE 0
170
171/** Interrupt is capable of waking the system. */
172#define ACPI_RSRCS_IRQ_F_WAKE_CAP RT_BIT(5)
173/** Interrupt is not capable of waking the system. */
174#define ACPI_RSRCS_IRQ_F_NOT_WAKE_CAP 0
175/** @} */
176
177
178/** @name Address space resource descriptors related definitions.
179 * @{ */
180/** @name Resource type.
181 * @{ */
182/** Memory range. */
183#define ACPI_RSRCS_ADDR_SPACE_TYPE_MEMORY 0
184/** I/O range. */
185#define ACPI_RSRCS_ADDR_SPACE_TYPE_IO 1
186/** Bus number range. */
187#define ACPI_RSRCS_ADDR_SPACE_TYPE_BUS_NUM_RANGE 2
188/** @} */
189
190/** @name General flags.
191 * @{ */
192/** The device consumes this resource. */
193#define ACPI_RSRCS_ADDR_SPACE_F_CONSUMER RT_BIT(0)
194/** The device produces and consumes this resource. */
195#define ACPI_RSRCS_ADDR_SPACE_F_PRODUCER 0
196
197/** The bridge subtractively decodes this address. */
198#define ACPI_RSRCS_ADDR_SPACE_F_DECODE_TYPE_SUB RT_BIT(1)
199/** The bridge positively decodes this address. */
200#define ACPI_RSRCS_ADDR_SPACE_F_DECODE_TYPE_POS 0
201
202/** The specified minimum address is fixed. */
203#define ACPI_RSRCS_ADDR_SPACE_F_MIN_ADDR_FIXED RT_BIT(2)
204/** The specified minimum address can be changed. */
205#define ACPI_RSRCS_ADDR_SPACE_F_MIN_ADDR_CHANGEABLE 0
206
207/** The specified maximum address is fixed. */
208#define ACPI_RSRCS_ADDR_SPACE_F_MAX_ADDR_FIXED RT_BIT(3)
209/** The specified maximum address can be changed. */
210#define ACPI_RSRCS_ADDR_SPACE_F_MAX_ADDR_CHANGEABLE 0
211/** @} */
212
213/** @name Memory type specific flags.
214 * @{ */
215/** Memory range is read-write. */
216#define ACPI_RSRCS_ADDR_SPACE_MEM_F_RW RT_BIT(0)
217/** Memory range is read-only. */
218#define ACPI_RSRCS_ADDR_SPACE_MEM_F_RO 0
219
220/** Cacheability mask. */
221#define ACPI_RSRCS_ADDR_SPACE_MEM_F_CACHE_MASK (RT_BIT(1) | RT_BIT(2))
222/** Memory range is non-cacheable. */
223#define ACPI_RSRCS_ADDR_SPACE_MEM_F_CACHE_NON_CACHEABLE 0
224/** Memory range is cacheable. */
225#define ACPI_RSRCS_ADDR_SPACE_MEM_F_CACHE_CACHEABLE 2
226/** Memory range is cacheable and supports write combining. */
227#define ACPI_RSRCS_ADDR_SPACE_MEM_F_CACHE_CACHEABLE_WR_COMB 4
228/** Memory range is cacheable and prefetchable. */
229#define ACPI_RSRCS_ADDR_SPACE_MEM_F_CACHE_CACHEABLE_PREFETCHABLE 6
230
231/** Attribute mask. */
232#define ACPI_RSRCS_ADDR_SPACE_MEM_F_ATTR_MASK (RT_BIT(3) | RT_BIT(4))
233/** Memory range is actual memory. */
234#define ACPI_RSRCS_ADDR_SPACE_MEM_F_ATTR_MEMORY 0x00
235/** Memory range is reserved. */
236#define ACPI_RSRCS_ADDR_SPACE_MEM_F_ATTR_RESERVED 0x08
237/** Memory range is ACPI reclaimable memory after the operating system read the ACPI tables. */
238#define ACPI_RSRCS_ADDR_SPACE_MEM_F_ATTR_ACPI 0x10
239/** Memory range is in use by the system and must not be used by the operating system. */
240#define ACPI_RSRCS_ADDR_SPACE_MEM_F_ATTR_NVS 0x18
241
242/** Memory on the secondary side of the bridge, I/O on the primary side. */
243#define ACPI_RSRCS_ADDR_SPACE_MEM_F_TYPE_TRANSLATION RT_BIT(5)
244/** Memory on both secondary and primary side of the bridge. */
245#define ACPI_RSRCS_ADDR_SPACE_MEM_F_TYPE_STATIC 0
246/** @} */
247
248/** @name I/O type specific flags.
249 * @{ */
250/** Range bitmask. */
251#define ACPI_RSRCS_ADDR_SPACE_IO_F_RANGE_MASK (RT_BIT(0) | RT_BIT(1))
252/** Memory window covers only non ISA ranges. */
253#define ACPI_RSRCS_ADDR_SPACE_IO_F_RANGE_NON_ISA_ONLY 1
254/** Memory windows covers only ISA ranges. */
255#define ACPI_RSRCS_ADDR_SPACE_IO_F_RANGE_ISA_ONLY 2
256/** Memory window covers the entire range. */
257#define ACPI_RSRCS_ADDR_SPACE_IO_F_RANGE_WHOLE 3
258
259/** I/O on the secondary side of the bridge, memory on the primary side. */
260#define ACPI_RSRCS_ADDR_SPACE_IO_F_TYPE_TRANSLATION RT_BIT(4)
261/** I/O on both secondary and primary side of the bridge. */
262#define ACPI_RSRCS_ADDR_SPACE_IO_F_TYPE_STATIC 0
263
264/** address = (((port & 0xFFFc) << 10) || (port & 0xFFF)) + _TRA. */
265#define ACPI_RSRCS_ADDR_SPACE_IO_F_TRANSLATION_SPARSE RT_BIT(5)
266/** address = port + _TRA. */
267#define ACPI_RSRCS_ADDR_SPACE_IO_F_TRANSLATION_DENSE 0
268/** @} */
269
270/** @} */
271
272/** @} */
273
274#endif /* !IPRT_INCLUDED_formats_acpi_resources_h */
275
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette