memobj.h revision b7de308d8bc28d42249256bddb16bbace71f60fa
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* $Revision$ */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * innotek Portable Runtime - Ring-0 Memory Objects.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Copyright (C) 2006-2007 innotek GmbH
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * available from http://www.virtualbox.org. This file is free software;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * you can redistribute it and/or modify it under the terms of the GNU
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * General Public License as published by the Free Software Foundation,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/** @defgroup grp_rt_memobj_int Internals.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * @ingroup grp_rt_memobj
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * @internal
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Ring-0 memory object type.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** The traditional invalid value. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** @name Primary types (parents)
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** RTR0MemObjAllocPage.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This memory is page aligned and fixed. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** RTR0MemObjAllocLow.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This memory is page aligned, fixed and is backed by physical memory below 4GB. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** RTR0MemObjAllocCont.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This memory is page aligned, fixed and is backed by contiguous physical memory below 4GB. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** RTR0MemObjLockKernel, RTR0MemObjLockUser.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This memory is page aligned and fixed. It was locked/pinned/wired down by the API call. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** RTR0MemObjAllocPhys, RTR0MemObjEnterPhys.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This memory is physical memory, page aligned, contiguous and doesn't need to have a mapping. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** RTR0MemObjAllocPhysNC.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This memory is physical memory, page aligned and doesn't need to have a mapping. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** RTR0MemObjReserveKernel, RTR0MemObjReserveUser.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This memory is page aligned and has no backing. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** @name Secondary types (children)
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** RTR0MemObjMapUser, RTR0MemObjMapKernel.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * This is a user or kernel context mapping of another ring-0 memory object. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** The end of the valid types. Used for sanity checking. */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct RTR0MEMOBJINTERNAL *PRTR0MEMOBJINTERNAL;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef struct RTR0MEMOBJINTERNAL **PPRTR0MEMOBJINTERNAL;
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Ring-0 memory object.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * When using the PRTR0MEMOBJINTERNAL and PPRTR0MEMOBJINTERNAL types
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * we get pMem and ppMem variable names.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * When using the RTR0MEMOBJ and PRTR0MEMOBJ types we get MemObj and
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * pMemObj variable names. We never dereference variables of the RTR0MEMOBJ
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * type, we always convert it to a PRTR0MEMOBJECTINTERNAL variable first.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync /** Magic number (RTR0MEM_MAGIC). */
void *pv;
} Parent;
} Child;
} uRel;
unsigned iDummy;
} Page;
unsigned iDummy;
} Low;
} Cont;
} Lock;
bool fAllocated;
} Phys;
unsigned iDummy;
} PhysNC;
} ResVirt;
} Mapping;
case RTR0MEMOBJTYPE_MAPPING:
case RTR0MEMOBJTYPE_RES_VIRT:
case RTR0MEMOBJTYPE_LOCK:
case RTR0MEMOBJTYPE_MAPPING:
* @param fExecutable Flag indicating whether it should be permitted to executed code in the memory object.
* @param fExecutable Flag indicating whether it should be permitted to executed code in the memory object.
* @param fExecutable Flag indicating whether it should be permitted to executed code in the memory object.
int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, RTR0PROCESS R0Process);
* @param pvFixed Requested address. (void *)-1 means any address. This matches uAlignment if specified.
int rtR0MemObjNativeReserveKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment);
* @param R3PtrFixed Requested address. (RTR3PTR)-1 means any address. This matches uAlignment if specified.
int rtR0MemObjNativeReserveUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process);
* @param pvFixed Requested address. (void *)-1 means any address. This matches uAlignment if specified.
int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, PRTR0MEMOBJINTERNAL pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt);
* @param R3PtrFixed Requested address. (RTR3PTR)-1 means any address. This matches uAlignment if specified.