mpnotification-r0drv-nt.cpp revision e6e2974634808306e2557acf7b9faae14ff5b93b
/* $Id$ */
/** @file
* IPRT - Multiprocessor Event Notifications, Ring-0 Driver, NT.
*/
/*
* Copyright (C) 2008 Sun Microsystems, Inc.
*
* 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.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "the-nt-kernel.h"
#include "r0drv/mp-r0drv.h"
#include "internal-r0drv-nt.h"
#if /*NTDDI_VERSION >= NTDDI_WS08*/ 0
/* The following is 100% untested code which probably doesn't even compile. */
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
/** Typedef of KeRegisterProcessorChangeCallback. */
typedef PROCESSOR_CALLBACK_HANDLE (__stdcall *PFNMYKEREGISTERPROCESSORCHANGECALLBACK)(IN PPROCESSOR_CALLBACK_FUNCTION, IN PVOID, IN ULONG);
/** Typedef of KeDeregisterProcessorChangeCallback. */
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/** The pointer to KeRegisterProcessorChangeCallback if found. */
/** The pointer to KeDeregisterProcessorChangeCallback if found. */
/** The callback handle. */
/**
* The native callback.
*
* @param pNotifierBlock Pointer to g_NotifierBlock.
* @param ulNativeEvent The native event.
* @param pvCpu The cpu id cast into a pointer value.
*/
{
switch (pChangeContext->State)
{
break;
break;
//case KeProcessorDelCompleteNotify:
// rtMpNotificationDoCallbacks(RTMPEVENT_ONLINE, idCpu);
// break;
default:
break;
}
return 0;
}
int rtR0MpNotificationNativeInit(void *pvOS)
{
/*
* Try resolve the symbols.
*/
g_pfnKeRegisterProcessorChangeCallback = (PFNMYKEREGISTERPROCESSORCHANGECALLBACK)MmGetSystemRoutineAddress(&RoutineName);
{
g_pfnKeDeregisterProcessorChangeCallback = (PFNMYKEDEREGISTERPROCESSORCHANGECALLBACK)MmGetSystemRoutineAddress(&RoutineName);
{
/*
* Try call it.
*/
g_hCallback = g_pfnKeRegisterProcessorChangeCallback(rtMpNotificationNtCallback, &ntRc, KE_PROCESSOR_CHANGE_ADD_EXISTING);
if (g_hCallback != NULL)
return VINF_SUCCESS;
/* Genuine failure. */
return rc;
}
/* this shouldn't happen. */
AssertFailed();
}
/* Not supported - success. */
return VINF_SUCCESS;
}
void rtR0MpNotificationNativeTerm(void *pvOS)
{
&& g_hCallback)
{
g_hCallback = NULL;
}
}
#else /* Not supported */
int rtR0MpNotificationNativeInit(void *pvOS)
{
return VINF_SUCCESS;
}
void rtR0MpNotificationNativeTerm(void *pvOS)
{
}
#endif /* Not supported */