MsixCommon.cpp revision 0f1ee7c0c041f17c1c692fc7f09af458a62ceaee
/* $Id$ */
/** @file
* MSI-X support routines
*/
/*
* Copyright (C) 2010 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#define LOG_GROUP LOG_GROUP_DEV_PCI
/* Hack to get PCIDEVICEINT declare at the right point - include "PCIInternal.h". */
#define PCI_INCLUDE_PRIVATE
#include "MsiCommon.h"
{
}
{
}
{
if (pMsiReg->cMsixVectors == 0)
return VINF_SUCCESS;
if (cVectors != 1)
/* We cannot handle multiple vectors yet */
return VERR_TOO_MUCH_DATA;
if (cVectors > VBOX_MSIX_MAX_ENTRIES)
return VERR_TOO_MUCH_DATA;
return VINF_SUCCESS;
}
{
}
{
}
void MsixPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, uint32_t u32Address, uint32_t val, unsigned len)
{
{
switch (reg)
{
case 0: /* Capability ID, ro */
case 1: /* Next pointer, ro */
break;
/* don't change read-only bits: 0-7 */
break;
case VBOX_MSIX_CAP_MESSAGE_CONTROL + 1:
/* don't change read-only bits 8-13 */
break;
default:
/* other fields read-only too */
break;
}
uAddr++;
val >>= 8;
}
}
{
switch (len)
{
case 1:
break;
case 2:
break;
case 4:
break;
default:
Assert(false);
}
return rv;
}