VirtualBox

source: vbox/trunk/include/VBox/gic.h@ 108132

最後變更 在這個檔案從108132是 107984,由 vboxsync 提交於 6 週 前

VMM/GIC: bugref:10404 CFGM bits.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 29.0 KB
 
1/** @file
2 * ARMv8 Generic Interrupt Controller Architecture (GIC) definitions.
3 */
4
5/*
6 * Copyright (C) 2023-2024 Oracle and/or its affiliates.
7 *
8 * This file is part of VirtualBox base platform packages, as
9 * available from https://www.alldomusa.eu.org.
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation, in version 3 of the
14 * License.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, see <https://www.gnu.org/licenses>.
23 *
24 * The contents of this file may alternatively be used under the terms
25 * of the Common Development and Distribution License Version 1.0
26 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
27 * in the VirtualBox distribution, in which case the provisions of the
28 * CDDL are applicable instead of those of the GPL.
29 *
30 * You may elect to license modified versions of this file under the
31 * terms and conditions of either the GPL or the CDDL or both.
32 *
33 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
34 */
35
36#ifndef VBOX_INCLUDED_gic_h
37#define VBOX_INCLUDED_gic_h
38#ifndef RT_WITHOUT_PRAGMA_ONCE
39# pragma once
40#endif
41
42#include <iprt/types.h>
43#include <iprt/armv8.h>
44
45/** @name INTIDs - Interrupt identifier ranges.
46 * @{ */
47/** Start of the SGI (Software Generated Interrupts) range. */
48#define GIC_INTID_RANGE_SGI_START 0
49/** Last valid SGI (Software Generated Interrupts) identifier. */
50#define GIC_INTID_RANGE_SGI_LAST 15
51
52/** Start of the PPI (Private Peripheral Interrupts) range. */
53#define GIC_INTID_RANGE_PPI_START 16
54/** Last valid PPI (Private Peripheral Interrupts) identifier. */
55#define GIC_INTID_RANGE_PPI_LAST 31
56
57/** Start of the SPI (Shared Peripheral Interrupts) range. */
58#define GIC_INTID_RANGE_SPI_START 32
59/** Last valid SPI (Shared Peripheral Interrupts) identifier. */
60#define GIC_INTID_RANGE_SPI_LAST 1019
61
62/** Start of the special interrupt range. */
63#define GIC_INTID_RANGE_SPECIAL_START 1020
64/** Last valid special interrupt identifier. */
65#define GIC_INTID_RANGE_SPECIAL_LAST 1023
66/** Value for an interrupt acknowledge if no pending interrupt with sufficient
67 * priority, security state or interrupt group. */
68# define GIC_INTID_RANGE_SPECIAL_NO_INTERRUPT 1023
69
70/** Start of the extended PPI (Private Peripheral Interrupts) range. */
71#define GIC_INTID_RANGE_EPPI_START 1056
72/** Last valid extended PPI (Private Peripheral Interrupts) identifier. */
73#define GIC_INTID_RANGE_EPPI_LAST 1119
74
75/** Start of the extended SPI (Shared Peripheral Interrupts) range. */
76#define GIC_INTID_RANGE_ESPI_START 4096
77/** Last valid extended SPI (Shared Peripheral Interrupts) identifier. */
78#define GIC_INTID_RANGE_ESPI_LAST 5119
79
80/** Start of the LPI (Locality-specific Peripheral Interrupts) range. */
81#define GIC_INTID_RANGE_LPI_START 8192
82/** @} */
83
84
85/** @name GICD - GIC Distributor registers.
86 * @{ */
87/** Size of the distributor register frame. */
88#define GIC_DIST_REG_FRAME_SIZE _64K
89
90/** Distributor Control Register - RW. */
91#define GIC_DIST_REG_CTLR_OFF 0x0000
92/** Bit 0 - Enable Group 0 interrupts. */
93# define GIC_DIST_REG_CTRL_ENABLE_GRP0 RT_BIT_32(0)
94# define GIC_DIST_REG_CTRL_ENABLE_GRP0_BIT 0
95/** Bit 1 - Enable Non-secure Group 1 interrupts. */
96# define GIC_DIST_REG_CTRL_ENABLE_GRP1_NS RT_BIT_32(1)
97# define GIC_DIST_REG_CTRL_ENABLE_GRP1_NS_BIT 1
98/** Bit 2 - Enable Secure Group 1 interrupts. */
99# define GIC_DIST_REG_CTRL_ENABLE_GRP1_S RT_BIT_32(2)
100# define GIC_DIST_REG_CTRL_ENABLE_GRP1_S_BIT 2
101/** Bit 4 - Affinity Routing Enable, Secure state. */
102# define GIC_DIST_REG_CTRL_ARE_S RT_BIT_32(4)
103# define GIC_DIST_REG_CTRL_ARE_S_BIT 4
104/** Bit 5 - Affinity Routing Enable, Non-secure state. */
105# define GIC_DIST_REG_CTRL_ARE_NS RT_BIT_32(5)
106# define GIC_DIST_REG_CTRL_ARE_NS_BIT 5
107/** Bit 6 - Disable Security. */
108# define GIC_DIST_REG_CTRL_DS RT_BIT_32(6)
109# define GIC_DIST_REG_CTRL_DS_BIT 6
110/** Bit 7 - Enable 1 of N Wakeup Functionality. */
111# define GIC_DIST_REG_CTRL_E1NWF RT_BIT_32(7)
112# define GIC_DIST_REG_CTRL_E1NWF_BIT 7
113/** Bit 31 - Register Write Pending. */
114# define GIC_DIST_REG_CTRL_RWP RT_BIT_32(31)
115# define GIC_DIST_REG_CTRL_RWP_BIT 31
116
117/** Interrupt Controller Type Register - RO. */
118#define GIC_DIST_REG_TYPER_OFF 0x0004
119/** Bit 0 - 4 - Maximum number of SPIs supported. */
120# define GIC_DIST_REG_TYPER_NUM_ITLINES ( RT_BIT_32(0) | RT_BIT_32(1) | RT_BIT(2) \
121 | RT_BIT_32(3) | RT_BIT_32(4))
122# define GIC_DIST_REG_TYPER_NUM_ITLINES_SET(a_NumSpis) ((a_NumSpis) & GIC_DIST_REG_TYPER_NUM_ITLINES)
123/** Bit 5 - 7 - Reports number of PEs that can be used when affinity routing is not enabled, minus 1. */
124# define GIC_DIST_REG_TYPER_NUM_PES (RT_BIT_32(5) | RT_BIT_32(6) | RT_BIT(7))
125# define GIC_DIST_REG_TYPER_NUM_PES_SET(a_Pes) (((a_Pes) << 5) & GIC_DIST_REG_TYPER_NUM_PES)
126/** Bit 8 - Extended SPI range implemented. */
127# define GIC_DIST_REG_TYPER_ESPI RT_BIT_32(8)
128# define GIC_DIST_REG_TYPER_ESPI_BIT 8
129/** Bit 9 - Non-maskable interrupt priority supported. */
130# define GIC_DIST_REG_TYPER_NMI RT_BIT_32(9)
131# define GIC_DIST_REG_TYPER_NMI_BIT 9
132/** Bit 10 - Indicates whether the implementation supports two security states. */
133# define GIC_DIST_REG_TYPER_SECURITY_EXTN RT_BIT_32(10)
134# define GIC_DIST_REG_TYPER_SECURITY_EXTN_BIT 10
135/** Bit 11 - 15 - The number of supported LPIs. */
136# define GIC_DIST_REG_TYPER_NUM_LPIS ( RT_BIT_32(11) | RT_BIT_32(12) | RT_BIT(13) \
137 | RT_BIT_32(14) | RT_BIT_32(15))
138# define GIC_DIST_REG_TYPER_NUM_LPIS_SET(a_Lpis) (((a_Lpis) << 11) & GIC_DIST_REG_TYPER_NUM_LPIS)
139/** Bit 16 - Indicates whether the implementation supports message based interrupts by writing to Distributor registers. */
140# define GIC_DIST_REG_TYPER_MBIS RT_BIT_32(16)
141# define GIC_DIST_REG_TYPER_MBIS_BIT 16
142/** Bit 17 - Indicates whether the implementation supports LPIs. */
143# define GIC_DIST_REG_TYPER_LPIS RT_BIT_32(17)
144# define GIC_DIST_REG_TYPER_LPIS_BIT 17
145/** Bit 18 - Indicates whether the implementation supports Direct Virtual LPI injection (FEAT_GICv4). */
146# define GIC_DIST_REG_TYPER_DVIS RT_BIT_32(18)
147# define GIC_DIST_REG_TYPER_DVIS_BIT 18
148/** Bit 19 - 23 - The number of interrupt identifer bits supported, minus one. */
149# define GIC_DIST_REG_TYPER_IDBITS ( RT_BIT_32(19) | RT_BIT_32(20) | RT_BIT(21) \
150 | RT_BIT_32(22) | RT_BIT_32(23))
151# define GIC_DIST_REG_TYPER_IDBITS_SET(a_Bits) (((a_Bits) << 19) & GIC_DIST_REG_TYPER_IDBITS)
152/** Bit 24 - Affinity 3 valid. Indicates whether the Distributor supports nonzero values of Affinity level 3. */
153# define GIC_DIST_REG_TYPER_A3V RT_BIT_32(24)
154# define GIC_DIST_REG_TYPER_A3V_BIT 24
155/** Bit 25 - Indicates whether 1 of N SPI interrupts are supported. */
156# define GIC_DIST_REG_TYPER_NO1N RT_BIT_32(25)
157# define GIC_DIST_REG_TYPER_NO1N_BIT 25
158/** Bit 26 - Range Selector Support. */
159# define GIC_DIST_REG_TYPER_RSS RT_BIT_32(26)
160# define GIC_DIST_REG_TYPER_RSS_BIT 26
161/** Bit 27 - 31 - Indicates maximum INTID in the Extended SPI range. */
162# define GIC_DIST_REG_TYPER_ESPI_RANGE ( RT_BIT_32(27) | RT_BIT_32(28) | RT_BIT(29) \
163 | RT_BIT_32(30) | RT_BIT_32(31))
164# define GIC_DIST_REG_TYPER_ESPI_RANGE_BIT 27
165# define GIC_DIST_REG_TYPER_ESPI_RANGE_SET(a_Range) (((a_Range) << 27) & GIC_DIST_REG_TYPER_ESPI_RANGE)
166
167/** Distributor Implementer Identification Register - RO. */
168#define GIC_DIST_REG_IIDR_OFF 0x0008
169/** Interrupt Controller Type Register 2 - RO. */
170#define GIC_DIST_REG_TYPER2_OFF 0x000c
171/** Error Reporting Status Register (optional) - RW. */
172#define GIC_DIST_REG_STATUSR_OFF 0x0010
173/** Set SPI Register - WO. */
174#define GIC_DIST_REG_SETSPI_NSR_OFF 0x0040
175/** Clear SPI Register - WO. */
176#define GIC_DIST_REG_CLRSPI_NSR_OFF 0x0048
177/** Set SPI, Secure Register - WO. */
178#define GIC_DIST_REG_SETSPI_SR_OFF 0x0050
179/** Clear SPI, Secure Register - WO. */
180#define GIC_DIST_REG_CLRSPI_SR_OFF 0x0058
181
182/** Interrupt Group Registers, start offset - RW. */
183#define GIC_DIST_REG_IGROUPRn_OFF_START 0x0080
184/** Interrupt Group Registers, last offset - RW. */
185#define GIC_DIST_REG_IGROUPRn_OFF_LAST 0x00fc
186
187/** Interrupt Set Enable Registers, start offset - RW. */
188#define GIC_DIST_REG_ISENABLERn_OFF_START 0x0100
189/** Interrupt Set Enable Registers, last offset - RW. */
190#define GIC_DIST_REG_ISENABLERn_OFF_LAST 0x017c
191/** Interrupt Clear Enable Registers, start offset - RW. */
192#define GIC_DIST_REG_ICENABLERn_OFF_START 0x0180
193/** Interrupt Clear Enable Registers, last offset - RW. */
194#define GIC_DIST_REG_ICENABLERn_OFF_LAST 0x01fc
195
196/** Interrupt Set Pending Registers, start offset - RW. */
197#define GIC_DIST_REG_ISPENDRn_OFF_START 0x0200
198/** Interrupt Set Pending Registers, last offset - RW. */
199#define GIC_DIST_REG_ISPENDRn_OFF_LAST 0x027c
200/** Interrupt Clear Pending Registers, start offset - RW. */
201#define GIC_DIST_REG_ICPENDRn_OFF_START 0x0280
202/** Interrupt Clear Pending Registers, last offset - RW. */
203#define GIC_DIST_REG_ICPENDRn_OFF_LAST 0x02fc
204
205/** Interrupt Set Active Registers, start offset - RW. */
206#define GIC_DIST_REG_ISACTIVERn_OFF_START 0x0300
207/** Interrupt Set Active Registers, last offset - RW. */
208#define GIC_DIST_REG_ISACTIVERn_OFF_LAST 0x037c
209/** Interrupt Clear Active Registers, start offset - RW. */
210#define GIC_DIST_REG_ICACTIVERn_OFF_START 0x0380
211/** Interrupt Clear Active Registers, last offset - RW. */
212#define GIC_DIST_REG_ICACTIVERn_OFF_LAST 0x03fc
213
214/** Interrupt Priority Registers, start offset - RW. */
215#define GIC_DIST_REG_IPRIORITYRn_OFF_START 0x0400
216/** Interrupt Priority Registers, last offset - RW. */
217#define GIC_DIST_REG_IPRIORITYRn_OFF_LAST 0x07f8
218
219/** Interrupt Processor Targets Registers, start offset - RO/RW. */
220#define GIC_DIST_REG_ITARGETSRn_OFF_START 0x0800
221/** Interrupt Processor Targets Registers, last offset - RO/RW. */
222#define GIC_DIST_REG_ITARGETSRn_OFF_LAST 0x0bf8
223
224/** Interrupt Configuration Registers, start offset - RW. */
225#define GIC_DIST_REG_ICFGRn_OFF_START 0x0c00
226/** Interrupt Configuration Registers, last offset - RW. */
227#define GIC_DIST_REG_ICFGRn_OFF_LAST 0x0cfc
228
229/** Interrupt Group Modifier Registers, start offset - RW. */
230#define GIC_DIST_REG_IGRPMODRn_OFF_START 0x0d00
231/** Interrupt Group Modifier Registers, last offset - RW. */
232#define GIC_DIST_REG_IGRPMODRn_OFF_LAST 0x0d7c
233
234/** Non-secure Access Control Registers, start offset - RW. */
235#define GIC_DIST_REG_NSACRn_OFF_START 0x0e00
236/** Non-secure Access Control Registers, last offset - RW. */
237#define GIC_DIST_REG_NSACRn_OFF_LAST 0x0efc
238
239/** Software Generated Interrupt Register - RW. */
240#define GIC_DIST_REG_SGIR_OFF 0x0f00
241
242/** SGI Clear Pending Registers, start offset - RW. */
243#define GIC_DIST_REG_CPENDSGIRn_OFF_START 0x0f10
244/** SGI Clear Pending Registers, last offset - RW. */
245#define GIC_DIST_REG_CPENDSGIRn_OFF_LAST 0x0f1c
246/** SGI Set Pending Registers, start offset - RW. */
247#define GIC_DIST_REG_SPENDSGIRn_OFF_START 0x0f20
248/** SGI Set Pending Registers, last offset - RW. */
249#define GIC_DIST_REG_SPENDSGIRn_OFF_LAST 0x0f2c
250
251/** Non-maskable Interrupt Registers, start offset - RW. */
252#define GIC_DIST_REG_INMIn_OFF_START 0x0f80
253/** Non-maskable Interrupt Registers, last offset - RW. */
254#define GIC_DIST_REG_INMIn_OFF_LAST 0x0ffc
255
256
257/** Interrupt Group Registers for extended SPI range, start offset - RW. */
258#define GIC_DIST_REG_IGROUPRnE_OFF_START 0x1000
259/** Interrupt Group Registers for extended SPI range, last offset - RW. */
260#define GIC_DIST_REG_IGROUPRnE_OFF_LAST 0x107c
261
262/** Interrupt Set Enable Registers for extended SPI range, start offset - RW. */
263#define GIC_DIST_REG_ISENABLERnE_OFF_START 0x1200
264/** Interrupt Set Enable Registers for extended SPI range, last offset - RW. */
265#define GIC_DIST_REG_ISENABLERnE_OFF_LAST 0x127c
266/** Interrupt Clear Enable Registers for extended SPI range, start offset - RW. */
267#define GIC_DIST_REG_ICENABLERnE_OFF_START 0x1400
268/** Interrupt Clear Enable Registers for extended SPI range, last offset - RW. */
269#define GIC_DIST_REG_ICENABLERnE_OFF_LAST 0x147c
270
271/** Interrupt Set Pending Registers for extended SPI range, start offset - RW. */
272#define GIC_DIST_REG_ISPENDRnE_OFF_START 0x1600
273/** Interrupt Set Pending Registers for extended SPI range, last offset - RW. */
274#define GIC_DIST_REG_ISPENDRnE_OFF_LAST 0x167c
275/** Interrupt Clear Pending Registers for extended SPI range, start offset - RW. */
276#define GIC_DIST_REG_ICPENDRnE_OFF_START 0x1800
277/** Interrupt Clear Pending Registers for extended SPI range, last offset - RW. */
278#define GIC_DIST_REG_ICPENDRnE_OFF_LAST 0x187c
279
280/** Interrupt Set Active Registers for extended SPI range, start offset - RW. */
281#define GIC_DIST_REG_ISACTIVERnE_OFF_START 0x1a00
282/** Interrupt Set Active Registers for extended SPI range, last offset - RW. */
283#define GIC_DIST_REG_ISACTIVERnE_OFF_LAST 0x1a7c
284/** Interrupt Clear Active Registers for extended SPI range, start offset - RW. */
285#define GIC_DIST_REG_ICACTIVERnE_OFF_START 0x1c00
286/** Interrupt Clear Active Registers for extended SPI range, last offset - RW. */
287#define GIC_DIST_REG_ICACTIVERnE_OFF_LAST 0x1c7c
288
289/** Interrupt Priority Registers for extended SPI range, start offset - RW. */
290#define GIC_DIST_REG_IPRIORITYRnE_OFF_START 0x2000
291/** Interrupt Priority Registers for extended SPI range, last offset - RW. */
292#define GIC_DIST_REG_IPRIORITYRnE_OFF_LAST 0x23fc
293
294/** Interrupt Configuration Registers for extended SPI range, start offset - RW. */
295#define GIC_DIST_REG_ICFGRnE_OFF_START 0x3000
296/** Interrupt Configuration Registers for extended SPI range, last offset - RW. */
297#define GIC_DIST_REG_ICFGRnE_OFF_LAST 0x30fc
298
299/** Interrupt Group Modifier Registers for extended SPI range, start offset - RW. */
300#define GIC_DIST_REG_IGRPMODRnE_OFF_START 0x3400
301/** Interrupt Group Modifier Registers for extended SPI range, last offset - RW. */
302#define GIC_DIST_REG_IGRPMODRnE_OFF_LAST 0x347c
303
304/** Non-secure Access Control Registers for extended SPI range, start offset - RW. */
305#define GIC_DIST_REG_NSACRnE_OFF_START 0x3600
306/** Non-secure Access Control Registers for extended SPI range, last offset - RW. */
307#define GIC_DIST_REG_NSACRnE_OFF_LAST 0x367c
308
309/** Non-maskable Interrupt Registers for extended SPIs, start offset - RW. */
310#define GIC_DIST_REG_INMInE_OFF_START 0x3b00
311/** Non-maskable Interrupt Registers for extended SPIs, last offset - RW. */
312#define GIC_DIST_REG_INMInE_OFF_LAST 0x3b7c
313
314/** Interrupt Routing Registers, start offset - RW. */
315#define GIC_DIST_REG_IROUTERn_OFF_START 0x6100
316/** Interrupt Routing Registers, last offset - RW. */
317#define GIC_DIST_REG_IROUTERn_OFF_LAST 0x7fd8
318/** Interrupt Routing Registers for extended SPI range, start offset - RW. */
319#define GIC_DIST_REG_IROUTERnE_OFF_START 0x8000
320/** Interrupt Routing Registers for extended SPI range, last offset - RW. */
321#define GIC_DIST_REG_IROUTERnE_OFF_LAST 0x9ffc
322
323/** Distributor Peripheral ID2 Register - RO. */
324#define GIC_DIST_REG_PIDR2_OFF 0xffe8
325/** Bit 4 - 7 - GIC architecture revision */
326# define GIC_DIST_REG_PIDR2_ARCH_REV ( RT_BIT_32(4) | RT_BIT_32(5) | RT_BIT_32(6) \
327 | RT_BIT_32(7))
328# define GIC_DIST_REG_PIDR2_ARCH_REV_SET(a_ArchRev) (((a_ArchRev) << 4) & GIC_DIST_REG_PIDR2_ARCH_REV)
329/** GICv1 architecture revision. */
330# define GIC_DIST_REG_PIDR2_ARCH_REV_GICV1 0x1
331/** GICv2 architecture revision. */
332# define GIC_DIST_REG_PIDR2_ARCH_REV_GICV2 0x2
333/** GICv3 architecture revision. */
334# define GIC_DIST_REG_PIDR2_ARCH_REV_GICV3 0x3
335/** GICv4 architecture revision. */
336# define GIC_DIST_REG_PIDR2_ARCH_REV_GICV4 0x4
337/** @} */
338
339
340/** @name GICD - GIC Redistributor registers.
341 * @{ */
342/** Size of the redistributor register frame. */
343#define GIC_REDIST_REG_FRAME_SIZE _64K
344/** Redistributor Control Register - RW. */
345#define GIC_REDIST_REG_CTLR_OFF 0x0000
346/** Implementer Identification Register - RO. */
347#define GIC_REDIST_REG_IIDR_OFF 0x0004
348
349/** Redistributor Type Register - RO. */
350#define GIC_REDIST_REG_TYPER_OFF 0x0008
351/** Bit 0 - Indicates whether the GIC implementation supports physical LPIs. */
352# define GIC_REDIST_REG_TYPER_PLPIS RT_BIT_32(0)
353# define GIC_REDIST_REG_TYPER_PLPIS_BIT 0
354/** Bit 1 - Indicates whether the GIC implementation supports virtual LPIs and the direct injection of those. */
355# define GIC_REDIST_REG_TYPER_VLPIS RT_BIT_32(1)
356# define GIC_REDIST_REG_TYPER_VLPIS_BIT 1
357/** Bit 2 - Controls the functionality of GICR_VPENDBASER.Dirty. */
358# define GIC_REDIST_REG_TYPER_DIRTY RT_BIT_32(2)
359# define GIC_REDIST_REG_TYPER_DIRTY_BIT 2
360/** Bit 3 - Indicates whether the redistributor supports direct injection of LPIs. */
361# define GIC_REDIST_REG_TYPER_DIRECT_LPI RT_BIT_32(3)
362# define GIC_REDIST_REG_TYPER_DIRECT_LPI_BIT 3
363/** Bit 4 - Indicates whether this redistributor is the highest numbered Redistributor in a series. */
364# define GIC_REDIST_REG_TYPER_LAST RT_BIT_32(4)
365# define GIC_REDIST_REG_TYPER_LAST_BIT 4
366/** Bit 5 - Sets support for GICR_CTLR.DPG* bits. */
367# define GIC_REDIST_REG_TYPER_DPGS RT_BIT_32(5)
368# define GIC_REDIST_REG_TYPER_DPGS_BIT 5
369/** Bit 6 - Indicates whether MPAM is supported. */
370# define GIC_REDIST_REG_TYPER_MPAM RT_BIT_32(6)
371# define GIC_REDIST_REG_TYPER_MPAM_BIT 6
372/** Bit 7 - Indicates how the resident vPE is specified. */
373# define GIC_REDIST_REG_TYPER_RVPEID RT_BIT_32(7)
374# define GIC_REDIST_REG_TYPER_RVPEID_BIT 7
375/** Bit 8 - 23 - A unique identifier for the PE. */
376# define GIC_REDIST_REG_TYPER_CPU_NUMBER UINT32_C(0x00ffff00)
377# define GIC_REDIST_REG_TYPER_CPU_NUMBER_SET(a_CpuNum) (((a_CpuNum) << 8) & GIC_REDIST_REG_TYPER_CPU_NUMBER)
378/** Bit 24 - 25 - The affinity level at Redistributorsshare an LPI Configuration table. */
379# define GIC_REDIST_REG_TYPER_CMN_LPI_AFF (RT_BIT_32(24) | RT_BIT_32(25))
380# define GIC_REDIST_REG_TYPER_CMN_LPI_AFF_SET(a_LpiAff) (((a_LpiAff) << 24) & GIC_REDIST_REG_TYPER_CMN_LPI_AFF)
381/** All Redistributors must share an LPI Configuration table. */
382# define GIC_REDIST_REG_TYPER_CMN_LPI_AFF_ALL 0
383/** All Redistributors with the same affinity 3 value must share an LPI Configuration table. */
384# define GIC_REDIST_REG_TYPER_CMN_LPI_AFF_3 1
385/** All Redistributors with the same affinity 3.2 value must share an LPI Configuration table. */
386# define GIC_REDIST_REG_TYPER_CMN_LPI_AFF_3_2 2
387/** All Redistributors with the same affinity 3.2.1 value must share an LPI Configuration table. */
388# define GIC_REDIST_REG_TYPER_CMN_LPI_AFF_3_2_1 3
389/** Bit 26 - Indicates whether vSGIs are supported. */
390# define GIC_REDIST_REG_TYPER_VSGI RT_BIT_32(26)
391# define GIC_REDIST_REG_TYPER_VSGI_BIT 26
392/** Bit 27 - 31 - Indicates the maximum PPI INTID that a GIC implementation can support. */
393# define GIC_REDIST_REG_TYPER_PPI_NUM ( RT_BIT_32(27) | RT_BIT_32(28) | RT_BIT_32(29) \
394 | RT_BIT_32(30) | RT_BIT_32(31))
395# define GIC_REDIST_REG_TYPER_PPI_NUM_SET(a_PpiNum) (((a_PpiNum) << 27) & GIC_REDIST_REG_TYPER_PPI_NUM)
396/** Maximum PPI INTID is 31. */
397# define GIC_REDIST_REG_TYPER_PPI_NUM_MAX_31 0
398/** Maximum PPI INTID is 1087. */
399# define GIC_REDIST_REG_TYPER_PPI_NUM_MAX_1087 1
400/** Maximum PPI INTID is 1119. */
401# define GIC_REDIST_REG_TYPER_PPI_NUM_MAX_1119 2
402
403/** Redistributor Type Register (the affinity value of the 64-bit register) - RO. */
404#define GIC_REDIST_REG_TYPER_AFFINITY_OFF 0x000c
405/** Bit 0 - 31 - The identity of the PE associated with this Redistributor. */
406# define GIC_REDIST_REG_TYPER_AFFINITY_VALUE UINT32_C(0xffffffff)
407# define GIC_REDIST_REG_TYPER_AFFINITY_VALUE_SET(a_Aff) ((a_Aff) & GIC_REDIST_REG_TYPER_AFFINITY_VALUE)
408
409
410/** Redistributor Error Reporting Status Register (optional) - RW. */
411#define GIC_REDIST_REG_STATUSR_OFF 0x0010
412/** Redistributor Wake Register - RW. */
413#define GIC_REDIST_REG_WAKER_OFF 0x0014
414/** Redistributor Report maximum PARTID and PMG Register - RO. */
415#define GIC_REDIST_REG_MPAMIDR_OFF 0x0018
416/** Redistributor Set PARTID and PMG Register - RW. */
417#define GIC_REDIST_REG_PARTIDR_OFF 0x001c
418/** Redistributor Set LPI Pending Register - WO. */
419#define GIC_REDIST_REG_SETLPIR_OFF 0x0040
420/** Redistributor Clear LPI Pending Register - WO. */
421#define GIC_REDIST_REG_CLRLPIR_OFF 0x0048
422/** Redistributor Properties Base Address Register - RW. */
423#define GIC_REDIST_REG_PROPBASER_OFF 0x0070
424/** Redistributor LPI Pending Table Base Address Register - RW. */
425#define GIC_REDIST_REG_PENDBASER_OFF 0x0078
426/** Redistributor Invalidate LPI Register - WO. */
427#define GIC_REDIST_REG_INVLPIR_OFF 0x00a0
428/** Redistributor Invalidate All Register - WO. */
429#define GIC_REDIST_REG_INVALLR_OFF 0x00b0
430/** Redistributor Synchronize Register - RO. */
431#define GIC_REDIST_REG_SYNCR_OFF 0x00c0
432
433/** Redistributor Peripheral ID2 Register - RO. */
434#define GIC_REDIST_REG_PIDR2_OFF 0xffe8
435/** Bit 4 - 7 - GIC architecture revision */
436# define GIC_REDIST_REG_PIDR2_ARCH_REV ( RT_BIT_32(4) | RT_BIT_32(5) | RT_BIT_32(6) \
437 | RT_BIT_32(7))
438# define GIC_REDIST_REG_PIDR2_ARCH_REV_SET(a_ArchRev) (((a_ArchRev) << 4) & GIC_DIST_REG_PIDR2_ARCH_REV)
439/** GICv1 architecture revision. */
440# define GIC_REDIST_REG_PIDR2_ARCH_REV_GICV1 0x1
441/** GICv2 architecture revision. */
442# define GIC_REDIST_REG_PIDR2_ARCH_REV_GICV2 0x2
443/** GICv3 architecture revision. */
444# define GIC_REDIST_REG_PIDR2_ARCH_REV_GICV3 0x3
445/** GICv4 architecture revision. */
446# define GIC_REDIST_REG_PIDR2_ARCH_REV_GICV4 0x4
447/** @} */
448
449
450/** @name GICD - GIC SGI and PPI Redistributor registers (Adjacent to the GIC Redistributor register space).
451 * @{ */
452/** Size of the SGI and PPI redistributor register frame. */
453#define GIC_REDIST_SGI_PPI_REG_FRAME_SIZE _64K
454
455/** Interrupt Group Register 0 - RW. */
456#define GIC_REDIST_SGI_PPI_REG_IGROUPR0_OFF 0x0080
457/** Interrupt Group Register 1 for extended PPI range - RW. */
458#define GIC_REDIST_SGI_PPI_REG_IGROUPR1E_OFF 0x0084
459/** Interrupt Group Register 2 for extended PPI range - RW. */
460#define GIC_REDIST_SGI_PPI_REG_IGROUPR2E_OFF 0x0084
461
462/** Interrupt Set Enable Register 0 - RW. */
463#define GIC_REDIST_SGI_PPI_REG_ISENABLER0_OFF 0x0100
464/** Interrupt Set Enable Register 1 for extended PPI range - RW. */
465#define GIC_REDIST_SGI_PPI_REG_ISENABLER1E_OFF 0x0104
466/** Interrupt Set Enable Register 2 for extended PPI range - RW. */
467#define GIC_REDIST_SGI_PPI_REG_ISENABLER2E_OFF 0x0108
468
469/** Interrupt Clear Enable Register 0 - RW. */
470#define GIC_REDIST_SGI_PPI_REG_ICENABLER0_OFF 0x0180
471/** Interrupt Clear Enable Register 1 for extended PPI range - RW. */
472#define GIC_REDIST_SGI_PPI_REG_ICENABLER1E_OFF 0x0184
473/** Interrupt Clear Enable Register 2 for extended PPI range - RW. */
474#define GIC_REDIST_SGI_PPI_REG_ICENABLER2E_OFF 0x0188
475
476/** Interrupt Set Pend Register 0 - RW. */
477#define GIC_REDIST_SGI_PPI_REG_ISPENDR0_OFF 0x0200
478/** Interrupt Set Pend Register 1 for extended PPI range - RW. */
479#define GIC_REDIST_SGI_PPI_REG_ISPENDR1E_OFF 0x0204
480/** Interrupt Set Pend Register 2 for extended PPI range - RW. */
481#define GIC_REDIST_SGI_PPI_REG_ISPENDR2E_OFF 0x0208
482
483/** Interrupt Clear Pend Register 0 - RW. */
484#define GIC_REDIST_SGI_PPI_REG_ICPENDR0_OFF 0x0280
485/** Interrupt Clear Pend Register 1 for extended PPI range - RW. */
486#define GIC_REDIST_SGI_PPI_REG_ICPENDR1E_OFF 0x0284
487/** Interrupt Clear Pend Register 2 for extended PPI range - RW. */
488#define GIC_REDIST_SGI_PPI_REG_ICPENDR2E_OFF 0x0288
489
490/** Interrupt Set Active Register 0 - RW. */
491#define GIC_REDIST_SGI_PPI_REG_ISACTIVER0_OFF 0x0300
492/** Interrupt Set Active Register 1 for extended PPI range - RW. */
493#define GIC_REDIST_SGI_PPI_REG_ISACTIVER1E_OFF 0x0304
494/** Interrupt Set Active Register 2 for extended PPI range - RW. */
495#define GIC_REDIST_SGI_PPI_REG_ISACTIVER2E_OFF 0x0308
496
497/** Interrupt Clear Active Register 0 - RW. */
498#define GIC_REDIST_SGI_PPI_REG_ICACTIVER0_OFF 0x0380
499/** Interrupt Clear Active Register 1 for extended PPI range - RW. */
500#define GIC_REDIST_SGI_PPI_REG_ICACTIVER1E_OFF 0x0384
501/** Interrupt Clear Active Register 2 for extended PPI range - RW. */
502#define GIC_REDIST_SGI_PPI_REG_ICACTIVER2E_OFF 0x0388
503
504/** Interrupt Priority Registers, start offset - RW. */
505#define GIC_REDIST_SGI_PPI_REG_IPRIORITYRn_OFF_START 0x0400
506/** Interrupt Priority Registers, last offset - RW. */
507#define GIC_REDIST_SGI_PPI_REG_IPRIORITYRn_OFF_LAST 0x041c
508/** Interrupt Priority Registers for extended PPI range, start offset - RW. */
509#define GIC_REDIST_SGI_PPI_REG_IPRIORITYRnE_OFF_START 0x0420
510/** Interrupt Priority Registers for extended PPI range, last offset - RW. */
511#define GIC_REDIST_SGI_PPI_REG_IPRIORITYRnE_OFF_LAST 0x045c
512
513/** SGI Configuration Register - RW. */
514#define GIC_REDIST_SGI_PPI_REG_ICFGR0_OFF 0x0c00
515/** PPI Configuration Register - RW. */
516#define GIC_REDIST_SGI_PPI_REG_ICFGR1_OFF 0x0c04
517/** Extended PPI Configuration Register, start offset - RW. */
518#define GIC_REDIST_SGI_PPI_REG_ICFGRnE_OFF_START 0x0c08
519/** Extended PPI Configuration Register, last offset - RW. */
520#define GIC_REDIST_SGI_PPI_REG_ICFGRnE_OFF_LAST 0x0c14
521
522/** Interrupt Group Modifier Register 0 - RW. */
523#define GIC_REDIST_SGI_PPI_REG_IGRPMODR0_OFF 0x0d00
524/** Interrupt Group Modifier Register 1 for extended PPI range - RW. */
525#define GIC_REDIST_SGI_PPI_REG_IGRPMODR1E_OFF 0x0d04
526/** Interrupt Group Modifier Register 2 for extended PPI range - RW. */
527#define GIC_REDIST_SGI_PPI_REG_IGRPMODR2E_OFF 0x0d08
528
529/** Non Secure Access Control Register - RW. */
530#define GIC_REDIST_SGI_PPI_REG_NSACR_OFF 0x0e00
531
532/** Non maskable Interrupt Register for PPIs - RW. */
533#define GIC_REDIST_SGI_PPI_REG_INMIR0_OFF 0x0f80
534/** Non maskable Interrupt Register for Extended PPIs, start offset - RW. */
535#define GIC_REDIST_SGI_PPI_REG_INMIRnE_OFF_START 0x0f84
536/** Non maskable Interrupt Register for Extended PPIs, last offset - RW. */
537#define GIC_REDIST_SGI_PPI_REG_INMIRnE_OFF_LAST 0x0ffc
538/** @} */
539
540
541#endif /* !VBOX_INCLUDED_gic_h */
542
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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