PDMDevMiscHlp.cpp revision 3c3191e9a631cbe39a5e2e1ecda06031565f1b2b
/* $Id$ */
/** @file
* PDM - Pluggable Device and Driver Manager, Misc. Device Helpers.
*/
/*
* Copyright (C) 2006-2011 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DEVICE
#include "PDMInternal.h"
/** @name Ring-3 PIC Helpers
* @{
*/
/** @interface_method_impl{PDMPICHLPR3,pfnSetInterruptFF} */
{
{
LogFlow(("pdmR3PicHlp_SetInterruptFF: caller='%s'/%d: Setting local interrupt on LAPIC\n",
/* Raise the LAPIC's LINT0 line instead of signaling the CPU directly. */
return;
}
LogFlow(("pdmR3PicHlp_SetInterruptFF: caller='%s'/%d: VMCPU_FF_INTERRUPT_PIC %d -> 1\n",
}
/** @interface_method_impl{PDMPICHLPR3,pfnClearInterruptFF} */
{
{
/* Raise the LAPIC's LINT0 line instead of signaling the CPU directly. */
LogFlow(("pdmR3PicHlp_ClearInterruptFF: caller='%s'/%d: Clearing local interrupt on LAPIC\n",
/* Lower the LAPIC's LINT0 line instead of signaling the CPU directly. */
return;
}
LogFlow(("pdmR3PicHlp_ClearInterruptFF: caller='%s'/%d: VMCPU_FF_INTERRUPT_PIC %d -> 0\n",
}
/** @interface_method_impl{PDMPICHLPR3,pfnLock} */
{
}
/** @interface_method_impl{PDMPICHLPR3,pfnUnlock} */
{
}
/** @interface_method_impl{PDMPICHLPR3,pfnGetRCHelpers} */
{
RTRCPTR pRCHelpers = 0;
LogFlow(("pdmR3PicHlp_GetRCHelpers: caller='%s'/%d: returns %RRv\n",
return pRCHelpers;
}
/** @interface_method_impl{PDMPICHLPR3,pfnGetR0Helpers} */
{
PCPDMPICHLPR0 pR0Helpers = 0;
LogFlow(("pdmR3PicHlp_GetR0Helpers: caller='%s'/%d: returns %RHv\n",
return pR0Helpers;
}
/**
* PIC Device Helpers.
*/
const PDMPICHLPR3 g_pdmR3DevPicHlp =
{
PDM_PICHLPR3_VERSION /* the end */
};
/** @} */
/** @name R3 APIC Helpers
* @{
*/
/** @interface_method_impl{PDMAPICHLPR3,pfnSetInterruptFF} */
static DECLCALLBACK(void) pdmR3ApicHlp_SetInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu)
{
LogFlow(("pdmR3ApicHlp_SetInterruptFF: caller='%s'/%d: VMCPU_FF_INTERRUPT_APIC(%d) %d -> 1\n",
switch (enmType)
{
case PDMAPICIRQ_HARDWARE:
break;
case PDMAPICIRQ_NMI:
break;
case PDMAPICIRQ_SMI:
break;
case PDMAPICIRQ_EXTINT:
break;
default:
break;
}
}
/** @interface_method_impl{PDMAPICHLPR3,pfnClearInterruptFF} */
static DECLCALLBACK(void) pdmR3ApicHlp_ClearInterruptFF(PPDMDEVINS pDevIns, PDMAPICIRQ enmType, VMCPUID idCpu)
{
LogFlow(("pdmR3ApicHlp_ClearInterruptFF: caller='%s'/%d: VMCPU_FF_INTERRUPT_APIC(%d) %d -> 0\n",
switch (enmType)
{
case PDMAPICIRQ_HARDWARE:
break;
case PDMAPICIRQ_EXTINT:
break;
default:
break;
}
}
/** @interface_method_impl{PDMAPICHLPR3,pfnChangeFeature} */
{
LogFlow(("pdmR3ApicHlp_ChangeFeature: caller='%s'/%d: version=%d\n",
switch (enmVersion)
{
case PDMAPICVERSION_NONE:
break;
case PDMAPICVERSION_APIC:
break;
case PDMAPICVERSION_X2APIC:
break;
default:
}
}
/** @interface_method_impl{PDMAPICHLPR3,pfnGetCpuId} */
{
}
/** @interface_method_impl{PDMAPICHLPR3,pfnSendSipi} */
static DECLCALLBACK(void) pdmR3ApicHlp_SendSipi(PPDMDEVINS pDevIns, VMCPUID idCpu, uint32_t uVector)
{
}
/** @interface_method_impl{PDMAPICHLPR3,pfnSendInitIpi} */
{
}
/** @interface_method_impl{PDMAPICHLPR3,pfnGetRCHelpers} */
{
RTRCPTR pRCHelpers = 0;
LogFlow(("pdmR3ApicHlp_GetRCHelpers: caller='%s'/%d: returns %RRv\n",
return pRCHelpers;
}
/** @interface_method_impl{PDMAPICHLPR3,pfnGetR0Helpers} */
{
PCPDMAPICHLPR0 pR0Helpers = 0;
LogFlow(("pdmR3ApicHlp_GetR0Helpers: caller='%s'/%d: returns %RHv\n",
return pR0Helpers;
}
/** @interface_method_impl{PDMAPICHLPR3,pfnGetR3CritSect} */
{
}
/** @interface_method_impl{PDMAPICHLPR3,pfnGetRCCritSect} */
{
LogFlow(("pdmR3ApicHlp_GetR0CritSect: caller='%s'/%d: return %RRv\n", pDevIns->pReg->szName, pDevIns->iInstance, RCPtr));
return RCPtr;
}
/** @interface_method_impl{PDMAPICHLPR3,pfnGetR3CritSect} */
{
LogFlow(("pdmR3ApicHlp_GetR0CritSect: caller='%s'/%d: return %RHv\n", pDevIns->pReg->szName, pDevIns->iInstance, R0Ptr));
return R0Ptr;
}
/**
* APIC Device Helpers.
*/
const PDMAPICHLPR3 g_pdmR3DevApicHlp =
{
PDM_APICHLPR3_VERSION /* the end */
};
/** @} */
/** @name Ring-3 I/O APIC Helpers
* @{
*/
/** @interface_method_impl{PDMIOAPICHLPR3,pfnApicBusDeliver} */
static DECLCALLBACK(int) pdmR3IoApicHlp_ApicBusDeliver(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
{
LogFlow(("pdmR3IoApicHlp_ApicBusDeliver: caller='%s'/%d: u8Dest=%RX8 u8DestMode=%RX8 u8DeliveryMode=%RX8 iVector=%RX8 u8Polarity=%RX8 u8TriggerMode=%RX8\n",
pDevIns->pReg->szName, pDevIns->iInstance, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode));
return pVM->pdm.s.Apic.pfnBusDeliverR3(pVM->pdm.s.Apic.pDevInsR3, u8Dest, u8DestMode, u8DeliveryMode, iVector, u8Polarity, u8TriggerMode);
return VINF_SUCCESS;
}
/** @interface_method_impl{PDMIOAPICHLPR3,pfnLock} */
{
LogFlow(("pdmR3IoApicHlp_Lock: caller='%s'/%d: rc=%Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
}
/** @interface_method_impl{PDMIOAPICHLPR3,pfnUnlock} */
{
}
/** @interface_method_impl{PDMIOAPICHLPR3,pfnGetRCHelpers} */
{
RTRCPTR pRCHelpers = 0;
LogFlow(("pdmR3IoApicHlp_GetRCHelpers: caller='%s'/%d: returns %RRv\n",
return pRCHelpers;
}
/** @interface_method_impl{PDMIOAPICHLPR3,pfnGetR0Helpers} */
{
LogFlow(("pdmR3IoApicHlp_GetR0Helpers: caller='%s'/%d: returns %RHv\n",
return pR0Helpers;
}
/**
* I/O APIC Device Helpers.
*/
const PDMIOAPICHLPR3 g_pdmR3DevIoApicHlp =
{
PDM_IOAPICHLPR3_VERSION /* the end */
};
/** @} */
/** @name Ring-3 PCI Bus Helpers
* @{
*/
/** @interface_method_impl{PDMPCIHLPR3,pfnIsaSetIrq} */
{
}
/** @interface_method_impl{PDMPCIHLPR3,pfnIoApicSetIrq} */
{
}
/** @interface_method_impl{PDMPCIHLPR3,pfnIoApicSendMsi} */
static DECLCALLBACK(void) pdmR3PciHlp_IoApicSendMsi(PPDMDEVINS pDevIns, RTGCPHYS GCAddr, uint32_t uValue)
{
}
/** @interface_method_impl{PDMPCIHLPR3,pfnIsMMIO2Base} */
static DECLCALLBACK(bool) pdmR3PciHlp_IsMMIO2Base(PPDMDEVINS pDevIns, PPDMDEVINS pOwner, RTGCPHYS GCPhys)
{
return fRc;
}
/** @interface_method_impl{PDMPCIHLPR3,pfnLock} */
{
LogFlow(("pdmR3PciHlp_Lock: caller='%s'/%d: rc=%Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
}
/** @interface_method_impl{PDMPCIHLPR3,pfnUnlock} */
{
}
/** @interface_method_impl{PDMPCIHLPR3,pfnGetRCHelpers} */
{
RTRCPTR pRCHelpers = 0;
LogFlow(("pdmR3IoApicHlp_GetGCHelpers: caller='%s'/%d: returns %RRv\n",
return pRCHelpers;
}
/** @interface_method_impl{PDMPCIHLPR3,pfnGetR0Helpers} */
{
PCPDMPCIHLPR0 pR0Helpers = 0;
LogFlow(("pdmR3IoApicHlp_GetR0Helpers: caller='%s'/%d: returns %RHv\n",
return pR0Helpers;
}
/**
* PCI Bus Device Helpers.
*/
const PDMPCIHLPR3 g_pdmR3DevPciHlp =
{
PDM_PCIHLPR3_VERSION, /* the end */
};
/** @} */
/** @name Ring-3 HPET Helpers
* {@
*/
/** @interface_method_impl{PDMHPETHLPR3,pfnSetLegacyMode} */
{
LogFlow(("pdmR3HpetHlp_SetLegacyMode: caller='%s'/%d: fActivated=%RTbool\n", pDevIns->pReg->szName, pDevIns->iInstance, fActivated));
size_t i;
int rc = VINF_SUCCESS;
static const char * const s_apszDevsToNotify[] =
{
"i8254",
"mc146818"
};
for (i = 0; i < RT_ELEMENTS(s_apszDevsToNotify); i++)
{
if (RT_SUCCESS(rc))
{
}
else if ( rc == VERR_PDM_DEVICE_NOT_FOUND
else
}
/* Don't bother cleaning up, any failure here will cause a guru meditation. */
LogFlow(("pdmR3HpetHlp_SetLegacyMode: caller='%s'/%d: returns %Rrc\n", pDevIns->pReg->szName, pDevIns->iInstance, rc));
return rc;
}
/** @interface_method_impl{PDMHPETHLPR3,pfnSetIrq} */
{
LogFlow(("pdmR3HpetHlp_SetIrq: caller='%s'/%d: iIrq=%d iLevel=%d\n", pDevIns->pReg->szName, pDevIns->iInstance, iIrq, iLevel));
return 0;
}
/** @interface_method_impl{PDMHPETHLPR3,pfnGetRCHelpers} */
{
RTRCPTR pRCHelpers = 0;
LogFlow(("pdmR3HpetHlp_GetGCHelpers: caller='%s'/%d: returns %RRv\n",
return pRCHelpers;
}
/** @interface_method_impl{PDMHPETHLPR3,pfnGetR0Helpers} */
{
PCPDMHPETHLPR0 pR0Helpers = 0;
LogFlow(("pdmR3HpetHlp_GetR0Helpers: caller='%s'/%d: returns %RHv\n",
return pR0Helpers;
}
/**
* HPET Device Helpers.
*/
const PDMHPETHLPR3 g_pdmR3DevHpetHlp =
{
PDM_HPETHLPR3_VERSION, /* the end */
};
/** @} */
/** @name Ring-3 Raw PCI Device Helpers
* {@
*/
/** @interface_method_impl{PDMPCIRAWHLPR3,pfnGetRCHelpers} */
{
LogFlow(("pdmR3PciRawHlp_GetGCHelpers: caller='%s'/%d: returns %RRv\n",
return pRCHelpers;
}
/** @interface_method_impl{PDMPCIRAWHLPR3,pfnGetR0Helpers} */
{
LogFlow(("pdmR3PciRawHlp_GetR0Helpers: caller='%s'/%d: returns %RHv\n",
return pR0Helpers;
}
/**
* Raw PCI Device Helpers.
*/
const PDMPCIRAWHLPR3 g_pdmR3DevPciRawHlp =
{
PDM_PCIRAWHLPR3_VERSION, /* the end */
};
/** @} */
/* none yet */
/**
* DMAC Device Helpers.
*/
const PDMDMACHLP g_pdmR3DevDmacHlp =
{
};
/* none yet */
/**
* RTC Device Helpers.
*/
const PDMRTCHLP g_pdmR3DevRtcHlp =
{
};