ea0316554d23852601ee840c4a856339501411a4vboxsync/* $Id$ */
ea0316554d23852601ee840c4a856339501411a4vboxsync/** @file
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsync * Header for MSI/MSI-X support routines.
ea0316554d23852601ee840c4a856339501411a4vboxsync */
ea0316554d23852601ee840c4a856339501411a4vboxsync/*
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2010-2012 Oracle Corporation
ea0316554d23852601ee840c4a856339501411a4vboxsync *
ea0316554d23852601ee840c4a856339501411a4vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
ea0316554d23852601ee840c4a856339501411a4vboxsync * available from http://www.virtualbox.org. This file is free software;
ea0316554d23852601ee840c4a856339501411a4vboxsync * you can redistribute it and/or modify it under the terms of the GNU
ea0316554d23852601ee840c4a856339501411a4vboxsync * General Public License (GPL) as published by the Free Software
ea0316554d23852601ee840c4a856339501411a4vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
ea0316554d23852601ee840c4a856339501411a4vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
ea0316554d23852601ee840c4a856339501411a4vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
ea0316554d23852601ee840c4a856339501411a4vboxsync */
ea0316554d23852601ee840c4a856339501411a4vboxsync
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync/* Maybe belongs to types.h */
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync#ifdef IN_RING3
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsynctypedef PCPDMPCIHLPR3 PCPDMPCIHLP;
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync#endif
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync#ifdef IN_RING0
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsynctypedef PCPDMPCIHLPR0 PCPDMPCIHLP;
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync#endif
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync#ifdef IN_RC
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsynctypedef PCPDMPCIHLPRC PCPDMPCIHLP;
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync#endif
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync
e792133826a035b6af26ba1577d38bf259680d2avboxsync#ifdef IN_RING3
ea0316554d23852601ee840c4a856339501411a4vboxsync/* Init MSI support in the device. */
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsyncint MsiInit(PPCIDEVICE pDev, PPDMMSIREG pMsiReg);
e792133826a035b6af26ba1577d38bf259680d2avboxsync#endif
ea0316554d23852601ee840c4a856339501411a4vboxsync
ea0316554d23852601ee840c4a856339501411a4vboxsync/* If MSI is enabled, so that MSINotify() shall be used for notifications. */
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsyncbool MsiIsEnabled(PPCIDEVICE pDev);
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync
ea0316554d23852601ee840c4a856339501411a4vboxsync/* Device notification (aka interrupt). */
377f1df8d6ec248927bcdf0efabf87ab55c4a615vboxsyncvoid MsiNotify(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, int iVector, int iLevel, uint32_t uTagSrc);
ea0316554d23852601ee840c4a856339501411a4vboxsync
e792133826a035b6af26ba1577d38bf259680d2avboxsync#ifdef IN_RING3
ea0316554d23852601ee840c4a856339501411a4vboxsync/* PCI config space accessors for MSI registers */
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsyncvoid MsiPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len);
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsyncuint32_t MsiPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len);
e792133826a035b6af26ba1577d38bf259680d2avboxsync#endif
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsync
4ef4ca335d8ad12329cb55f9f7e54648412f1ce4vboxsync#ifdef IN_RING3
e792133826a035b6af26ba1577d38bf259680d2avboxsync/* Init MSI-X support in the device. */
4ef4ca335d8ad12329cb55f9f7e54648412f1ce4vboxsyncint MsixInit(PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, PPDMMSIREG pMsiReg);
4ef4ca335d8ad12329cb55f9f7e54648412f1ce4vboxsync#endif
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsync
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsync/* If MSI-X is enabled, so that MSIXNotify() shall be used for notifications. */
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsyncbool MsixIsEnabled(PPCIDEVICE pDev);
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsync
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsync/* Device notification (aka interrupt). */
377f1df8d6ec248927bcdf0efabf87ab55c4a615vboxsyncvoid MsixNotify(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, int iVector, int iLevel, uint32_t uTagSrc);
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsync
e792133826a035b6af26ba1577d38bf259680d2avboxsync#ifdef IN_RING3
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsync/* PCI config space accessors for MSI-X */
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsyncvoid MsixPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len);
0f1ee7c0c041f17c1c692fc7f09af458a62ceaeevboxsyncuint32_t MsixPciConfigRead (PPDMDEVINS pDevIns, PPCIDEVICE pDev, uint32_t u32Address, unsigned len);
e792133826a035b6af26ba1577d38bf259680d2avboxsync#endif