1 | /* $Id: MsiCommon.h 33315 2010-10-21 15:53:09Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Header for MSI/MSI-X support routines.
|
---|
4 | */
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2010 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 |
|
---|
17 | /* Maybe belongs to types.h */
|
---|
18 | #ifdef IN_RING3
|
---|
19 | typedef PCPDMPCIHLPR3 PCPDMPCIHLP;
|
---|
20 | #endif
|
---|
21 |
|
---|
22 | #ifdef IN_RING0
|
---|
23 | typedef PCPDMPCIHLPR0 PCPDMPCIHLP;
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | #ifdef IN_RC
|
---|
27 | typedef PCPDMPCIHLPRC PCPDMPCIHLP;
|
---|
28 | #endif
|
---|
29 |
|
---|
30 | /* Init MSI support in the device. */
|
---|
31 | int MsiInit(PPCIDEVICE pDev, PPDMMSIREG pMsiReg);
|
---|
32 |
|
---|
33 | /* If MSI is enabled, so that MSINotify() shall be used for notifications. */
|
---|
34 | bool MsiIsEnabled(PPCIDEVICE pDev);
|
---|
35 |
|
---|
36 | /* Device notification (aka interrupt). */
|
---|
37 | void MsiNotify(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, int iVector, int iLevel);
|
---|
38 |
|
---|
39 | /* PCI config space accessors for MSI registers */
|
---|
40 | void MsiPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len);
|
---|
41 | uint32_t MsiPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len);
|
---|
42 |
|
---|
43 |
|
---|
44 | /* Init MSI-X support in the device. */
|
---|
45 | #ifdef IN_RING3
|
---|
46 | int MsixInit(PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, PPDMMSIREG pMsiReg);
|
---|
47 | #endif
|
---|
48 |
|
---|
49 | /* If MSI-X is enabled, so that MSIXNotify() shall be used for notifications. */
|
---|
50 | bool MsixIsEnabled(PPCIDEVICE pDev);
|
---|
51 |
|
---|
52 | /* Device notification (aka interrupt). */
|
---|
53 | void MsixNotify(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, int iVector, int iLevel);
|
---|
54 |
|
---|
55 | /* PCI config space accessors for MSI-X */
|
---|
56 | void MsixPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len);
|
---|
57 | uint32_t MsixPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len);
|
---|