1 | /* $Id: GITSInternal.h 108779 2025-03-28 10:09:33Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * GITS - Generic Interrupt Controller Interrupt Translation Service - Internal.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2025 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef VMM_INCLUDED_SRC_include_GITSInternal_h
|
---|
29 | #define VMM_INCLUDED_SRC_include_GITSInternal_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include <VBox/types.h>
|
---|
35 | #include <VBox/gic-its.h>
|
---|
36 |
|
---|
37 | /** @defgroup grp_gits_int Internal
|
---|
38 | * @ingroup grp_gits
|
---|
39 | * @internal
|
---|
40 | * @{
|
---|
41 | */
|
---|
42 |
|
---|
43 | #if 0
|
---|
44 | /**
|
---|
45 | * Interrupt Translation Table Base.
|
---|
46 | */
|
---|
47 | typedef struct GITSITSBASE
|
---|
48 | {
|
---|
49 | /** The physical address of the table. */
|
---|
50 | RTGCPHYS GCPhys;
|
---|
51 | /** Size of every allocated page in bytes. */
|
---|
52 | uint32_t cbPageSize;
|
---|
53 | /** Number of pages allocated. */
|
---|
54 | uint8_t cPages;
|
---|
55 | /** Size of each entry in bytes. */
|
---|
56 | uint8_t cbEntry;
|
---|
57 | /** Whether this is a two-level or flat table. */
|
---|
58 | bool fTwoLevel;
|
---|
59 | /** Whether software has memory allocated for the table. */
|
---|
60 | bool fValid;
|
---|
61 | /** Memory shareability attributes. */
|
---|
62 | GITSATTRSHARE AttrShare;
|
---|
63 | /** Memory cacheability attributes (Inner). */
|
---|
64 | GITSATTRMEM AttrMemInner;
|
---|
65 | /** Memory cacheability attributes (Outer). */
|
---|
66 | GITSATTRMEM AttrMemOuter;
|
---|
67 | } GITSITSBASE;
|
---|
68 | AssertCompileSizeAlignment(GITSITSBASE, 8);
|
---|
69 | AssertCompileMemberAlignment(GITSITSBASE, AttrShare, 8);
|
---|
70 | #endif
|
---|
71 |
|
---|
72 |
|
---|
73 | /**
|
---|
74 | * The GIC Interrupt Translation Service device state.
|
---|
75 | */
|
---|
76 | typedef struct GITSDEV
|
---|
77 | {
|
---|
78 | /** @name Control registers.
|
---|
79 | * @{ */
|
---|
80 | /** Whether the ITS is enabled. */
|
---|
81 | bool fEnabled;
|
---|
82 | /** Whether unmapped MSI reporting interrupt is enabled. */
|
---|
83 | bool fUnmappedMsiReporting;
|
---|
84 | /** Whether ITS is quiescent and can be powered down. */
|
---|
85 | bool fQuiescent;
|
---|
86 | /** Padding. */
|
---|
87 | bool fPadding0;
|
---|
88 | /** The ITS table descriptor registers. */
|
---|
89 | RTUINT64U aItsTableRegs[8];
|
---|
90 | /** The ITS command queue base registers. */
|
---|
91 | RTUINT64U uCmdBaseReg;
|
---|
92 | /** The ITS command write register. */
|
---|
93 | uint32_t uCmdWriteReg;
|
---|
94 | /** The ITS command read register. */
|
---|
95 | uint32_t uCmdReadReg;
|
---|
96 | /** @} */
|
---|
97 |
|
---|
98 | /** @name Interrupt translation space.
|
---|
99 | * @{ */
|
---|
100 | /** @} */
|
---|
101 |
|
---|
102 | /** @name Configurables.
|
---|
103 | * @{ */
|
---|
104 | /** The ITS architecture (GITS_PIDR2.ArchRev). */
|
---|
105 | uint8_t uArchRev;
|
---|
106 | /** Padding. */
|
---|
107 | uint8_t afPadding0[7];
|
---|
108 | /** @} */
|
---|
109 | } GITSDEV;
|
---|
110 | /** Pointer to a GITS device. */
|
---|
111 | typedef GITSDEV *PGITSDEV;
|
---|
112 | /** Pointer to a const GITS device. */
|
---|
113 | typedef GITSDEV const *PCGITSDEV;
|
---|
114 | AssertCompileSizeAlignment(GITSDEV, 8);
|
---|
115 | AssertCompileMemberAlignment(GITSDEV, uArchRev, 8);
|
---|
116 |
|
---|
117 | DECL_HIDDEN_CALLBACK(void) gitsInit(PGITSDEV pGitsDev);
|
---|
118 | DECL_HIDDEN_CALLBACK(int) gitsSendMsi(PVMCC pVM, PCIBDF uBusDevFn, PCMSIMSG pMsi, uint32_t uEventId, uint32_t uTagSrc);
|
---|
119 | DECL_HIDDEN_CALLBACK(uint64_t) gitsMmioReadCtrl(PCGITSDEV pGitsDev, uint16_t offReg, unsigned cb);
|
---|
120 | DECL_HIDDEN_CALLBACK(uint64_t) gitsMmioReadTranslate(PCGITSDEV pGitsDev, uint16_t offReg, unsigned cb);
|
---|
121 | DECL_HIDDEN_CALLBACK(void) gitsMmioWriteCtrl(PGITSDEV pGitsDev, uint16_t offReg, uint64_t uValue, unsigned cb);
|
---|
122 | DECL_HIDDEN_CALLBACK(void) gitsMmioWriteTranslate(PGITSDEV pGitsDev, uint16_t offReg, uint64_t uValue, unsigned cb);
|
---|
123 |
|
---|
124 | #ifdef IN_RING3
|
---|
125 | DECL_HIDDEN_CALLBACK(void) gitsR3DbgInfo(PCGITSDEV pGitsDev, PCDBGFINFOHLP pHlp, const char *pszArgs);
|
---|
126 | #endif
|
---|
127 |
|
---|
128 | #ifdef LOG_ENABLED
|
---|
129 | DECL_HIDDEN_CALLBACK(const char *) gitsGetCtrlRegDescription(uint16_t offReg);
|
---|
130 | DECL_HIDDEN_CALLBACK(const char *) gitsGetTranslationRegDescription(uint16_t offReg);
|
---|
131 | #endif
|
---|
132 |
|
---|
133 | /** @} */
|
---|
134 |
|
---|
135 | #endif /* !VMM_INCLUDED_SRC_include_GITSInternal_h */
|
---|
136 |
|
---|