VirtualBox

source: vbox/trunk/include/VBox/vmm/apic.h@ 87518

Last change on this file since 87518 was 84652, checked in by vboxsync, 5 years ago

APIC: Move generic defs from VBox/vmm/apic.h and APICInternal.h to VBox/apic.h.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.2 KB
Line 
1/** @file
2 * APIC - Advanced Programmable Interrupt Controller.
3 */
4
5/*
6 * Copyright (C) 2006-2020 Oracle Corporation
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 */
25
26#ifndef VBOX_INCLUDED_vmm_apic_h
27#define VBOX_INCLUDED_vmm_apic_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include <VBox/types.h>
33#include <VBox/apic.h>
34struct PDMDEVREGCB;
35
36/** @defgroup grp_apic The local APIC VMM API
37 * @ingroup grp_vmm
38 * @{
39 */
40
41RT_C_DECLS_BEGIN
42
43#ifdef VBOX_INCLUDED_vmm_pdmdev_h
44extern const PDMDEVREG g_DeviceAPIC;
45#endif
46
47/* These functions are exported as they are called from external modules (recompiler). */
48VMMDECL(void) APICUpdatePendingInterrupts(PVMCPUCC pVCpu);
49VMMDECL(int) APICGetTpr(PCVMCPUCC pVCpu, uint8_t *pu8Tpr, bool *pfPending, uint8_t *pu8PendingIntr);
50VMMDECL(int) APICSetTpr(PVMCPUCC pVCpu, uint8_t u8Tpr);
51
52/* These functions are VMM internal. */
53VMM_INT_DECL(bool) APICIsEnabled(PCVMCPUCC pVCpu);
54VMM_INT_DECL(bool) APICGetHighestPendingInterrupt(PVMCPUCC pVCpu, uint8_t *pu8PendingIntr);
55VMM_INT_DECL(bool) APICQueueInterruptToService(PVMCPUCC pVCpu, uint8_t u8PendingIntr);
56VMM_INT_DECL(void) APICDequeueInterruptFromService(PVMCPUCC pVCpu, uint8_t u8PendingIntr);
57VMM_INT_DECL(VBOXSTRICTRC) APICReadMsr(PVMCPUCC pVCpu, uint32_t u32Reg, uint64_t *pu64Value);
58VMM_INT_DECL(VBOXSTRICTRC) APICWriteMsr(PVMCPUCC pVCpu, uint32_t u32Reg, uint64_t u64Value);
59VMM_INT_DECL(int) APICGetTimerFreq(PVMCC pVM, uint64_t *pu64Value);
60VMM_INT_DECL(VBOXSTRICTRC) APICLocalInterrupt(PVMCPUCC pVCpu, uint8_t u8Pin, uint8_t u8Level, int rcRZ);
61VMM_INT_DECL(uint64_t) APICGetBaseMsrNoCheck(PCVMCPUCC pVCpu);
62VMM_INT_DECL(VBOXSTRICTRC) APICGetBaseMsr(PVMCPUCC pVCpu, uint64_t *pu64Value);
63VMM_INT_DECL(int) APICSetBaseMsr(PVMCPUCC pVCpu, uint64_t u64BaseMsr);
64VMM_INT_DECL(int) APICGetInterrupt(PVMCPUCC pVCpu, uint8_t *pu8Vector, uint32_t *pu32TagSrc);
65VMM_INT_DECL(int) APICBusDeliver(PVMCC pVM, uint8_t uDest, uint8_t uDestMode, uint8_t uDeliveryMode, uint8_t uVector,
66 uint8_t uPolarity, uint8_t uTriggerMode, uint32_t uTagSrc);
67VMM_INT_DECL(int) APICGetApicPageForCpu(PCVMCPUCC pVCpu, PRTHCPHYS pHCPhys, PRTR0PTR pR0Ptr, PRTR3PTR pR3Ptr);
68
69/** @name Hyper-V interface (Ring-3 and all-context API).
70 * @{ */
71#ifdef IN_RING3
72VMMR3_INT_DECL(void) APICR3HvSetCompatMode(PVM pVM, bool fHyperVCompatMode);
73#endif
74VMM_INT_DECL(void) APICHvSendInterrupt(PVMCPUCC pVCpu, uint8_t uVector, bool fAutoEoi, XAPICTRIGGERMODE enmTriggerMode);
75VMM_INT_DECL(VBOXSTRICTRC) APICHvSetTpr(PVMCPUCC pVCpu, uint8_t uTpr);
76VMM_INT_DECL(uint8_t) APICHvGetTpr(PVMCPUCC pVCpu);
77VMM_INT_DECL(VBOXSTRICTRC) APICHvSetIcr(PVMCPUCC pVCpu, uint64_t uIcr);
78VMM_INT_DECL(uint64_t) APICHvGetIcr(PVMCPUCC pVCpu);
79VMM_INT_DECL(VBOXSTRICTRC) APICHvSetEoi(PVMCPUCC pVCpu, uint32_t uEoi);
80/** @} */
81
82#ifdef IN_RING3
83/** @defgroup grp_apic_r3 The APIC Host Context Ring-3 API
84 * @{
85 */
86VMMR3_INT_DECL(int) APICR3RegisterDevice(struct PDMDEVREGCB *pCallbacks);
87VMMR3_INT_DECL(void) APICR3InitIpi(PVMCPU pVCpu);
88VMMR3_INT_DECL(void) APICR3HvEnable(PVM pVM);
89/** @} */
90#endif /* IN_RING3 */
91
92RT_C_DECLS_END
93
94/** @} */
95
96#endif /* !VBOX_INCLUDED_vmm_apic_h */
97
Note: See TracBrowser for help on using the repository browser.

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