MsiCommon.h revision f1f55b6ac890efaabca0ff940f58aa8df1dc84c8
ea0316554d23852601ee840c4a856339501411a4vboxsync/* $Id$ */
ea0316554d23852601ee840c4a856339501411a4vboxsync/** @file
ea0316554d23852601ee840c4a856339501411a4vboxsync * Header for MSI support routines.
ea0316554d23852601ee840c4a856339501411a4vboxsync */
ea0316554d23852601ee840c4a856339501411a4vboxsync/*
ea0316554d23852601ee840c4a856339501411a4vboxsync * Copyright (C) 2010 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
ea0316554d23852601ee840c4a856339501411a4vboxsync/* Init MSI support in the device. */
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsyncint MsiInit(PPCIDEVICE pDev, PPDMMSIREG pMsiReg);
ea0316554d23852601ee840c4a856339501411a4vboxsync
ea0316554d23852601ee840c4a856339501411a4vboxsync/* If MSI is enabled, so that MSINotify() shall be used for notifications. */
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsyncbool MsiIsEnabled(PPCIDEVICE pDev);
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsync
ea0316554d23852601ee840c4a856339501411a4vboxsync/* Device notification (aka interrupt). */
f1f55b6ac890efaabca0ff940f58aa8df1dc84c8vboxsyncvoid MsiNotify(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, int iVector);
ea0316554d23852601ee840c4a856339501411a4vboxsync
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);