SUPDRV.h revision 9e1ec27b046ccfc5c9f225ad73831ac3b72b1093
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster/* $Revision$ */
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * VirtualBox Support Driver - Internal header.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Copyright (C) 2006-2007 Sun Microsystems, Inc.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * This file is part of VirtualBox Open Source Edition (OSE), as
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * available from http://www.virtualbox.org. This file is free software;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * you can redistribute it and/or modify it under the terms of the GNU
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * General Public License (GPL) as published by the Free Software
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Foundation, in version 2 as it comes in the "COPYING" file of the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * The contents of this file may alternatively be used under the terms
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * of the Common Development and Distribution License Version 1.0
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * VirtualBox OSE distribution, in which case the provisions of the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * CDDL are applicable instead of those of the GPL.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * You may elect to license modified versions of this file under the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * terms and conditions of either the GPL or the CDDL or both.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
449854c2a07b50ea64d9d6a8b03d18d4afeeee43Ken Stubbings * Clara, CA 95054 USA or visit http://www.sun.com if you need
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * additional information or have any questions.
449854c2a07b50ea64d9d6a8b03d18d4afeeee43Ken Stubbings/*******************************************************************************
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster* Header Files *
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster*******************************************************************************/
# define USE_NEW_OS_INTERFACE_FOR_MM
# define USE_NEW_OS_INTERFACE_FOR_GIP
#if defined(USE_NEW_OS_INTERFACE) || defined(USE_NEW_OS_INTERFACE_FOR_LOW) || defined(USE_NEW_OS_INTERFACE_FOR_MM) || defined(USE_NEW_OS_INTERFACE_FOR_GIP)
#if defined(RT_OS_WINDOWS)
# include <ntddk.h>
# include <ntddk.h>
# include <memory.h>
# define MODVERSIONS
# ifndef KBUILD_STR
# define KBUILD_STR(s) s
# define KBUILD_STR(s) #s
# define VBOX_HRTIMER
#include "SUPDRVIOC.h"
#if defined(RT_OS_WINDOWS)
#ifdef RT_ARCH_X86
#ifdef RT_ARCH_AMD64
# ifdef LOG_TO_COM
# define dprintf(a) do {} while (0)
# define dprintf2(a) do { } while (0)
#ifdef RT_OS_LINUX
# ifdef VBOX_HRTIMER
#ifdef VBOX_WITH_IDT_PATCHING
typedef struct SUPDRVIDTE
#ifdef RT_ARCH_AMD64
#ifdef RT_ARCH_AMD64
typedef struct SUPDRVPATCH
void *pvIdt;
typedef struct SUPDRVPATCHUSAGE
MEMREF_TYPE_UNUSED = 0,
typedef struct SUPDRVMEMREF
#ifdef USE_NEW_OS_INTERFACE_FOR_MM
void *pvR0;
unsigned cb;
#if defined(RT_OS_WINDOWS)
unsigned cMdls;
unsigned cPages;
} locked;
#if defined(RT_OS_WINDOWS)
unsigned cPages;
} cont;
#if defined(RT_OS_WINDOWS)
unsigned cPages;
} mem;
#if defined(USE_NEW_OS_INTERFACE_FOR_LOW)
} iprt;
typedef struct SUPDRVBUNDLE
typedef struct SUPDRVLDRIMAGE
void *pvImage;
typedef struct SUPDRVLDRUSAGE
typedef struct SUPDRVOBJ
void *pvUser1;
void *pvUser2;
typedef struct SUPDRVUSAGE
typedef struct SUPDRVSESSION
#ifdef VBOX_WITH_IDT_PATCHING
#ifdef USE_NEW_OS_INTERFACE_FOR_GIP
#if defined(RT_OS_OS2)
typedef struct SUPDRVDEVEXT
#ifdef VBOX_WITH_IDT_PATCHING
void * volatile pvVMMR0;
DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryEx, (PVM pVM, unsigned uOperation, PSUPVMMR0REQHDR pReq, uint64_t u64Arg));
#ifdef USE_NEW_OS_INTERFACE_FOR_GIP
#ifdef RT_OS_WINDOWS
#ifdef RT_OS_LINUX
unsigned long ulLastJiffies;
# ifdef CONFIG_SMP
struct LINUXCPU
unsigned long ulLastJiffies;
unsigned iSmpProcessorId;
} SUPDRVDEVEXT;
bool VBOXCALL supdrvOSObjCanAccess(PSUPDRVOBJ pObj, PSUPDRVSESSION pSession, const char *pszObjName, int *prc);
#ifndef USE_NEW_OS_INTERFACE_FOR_MM
int VBOXCALL supdrvOSContAllocOne(PSUPDRVMEMREF pMem, PRTR0PTR ppvR0, PRTR3PTR ppvR3, PRTHCPHYS pHCPhys);
int VBOXCALL supdrvOSLowAllocOne(PSUPDRVMEMREF pMem, PRTR0PTR ppvR0, PRTR3PTR ppvR3, PSUPPAGE paPages);
#ifndef USE_NEW_OS_INTERFACE_FOR_GIP
int VBOXCALL supdrvIOCtl(uintptr_t uIOCtl, PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPREQHDR pReqHdr);
int VBOXCALL supdrvGipInit(PSUPDRVDEVEXT pDevExt, PSUPGLOBALINFOPAGE pGip, RTHCPHYS HCPhys, uint64_t u64NanoTS, unsigned uUpdateHz);