alloc-r0drv-solaris.c revision b34f0f200ed0778053a2a1d93381c2c6b60cb2d5
/* $Id$ */
/** @file
* innotek Portable Runtime - Memory Allocation, Ring-0 Driver, Solaris.
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* 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 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 *
*******************************************************************************/
#include "the-solaris-kernel.h"
#include <malloc.h>
#include "r0drv/alloc-r0drv.h"
/**
* OS specific allocation function.
*/
{
if (fFlags & RTMEMHDR_FLAG_ZEROED)
else
if (pHdr)
{
pHdr->u32Padding= 0;
}
else
return pHdr;
}
/**
* OS specific free function.
*/
{
}
/**
* Allocates physical contiguous memory (below 4GB).
* The allocation is page aligned and the content is undefined.
*
* @returns Pointer to the memory block. This is page aligned.
* @param pPhys Where to store the physical address.
* @param cb The allocation size in bytes. This is always
* rounded up to PAGE_SIZE.
*/
{
/** @todo: implement RTMemContAlloc in Solaris */
/* ddi_umem_alloc without PAGEABLE flag might produce contiguous physical memory, but
the documentation doesn't talk about contiguous at all :(
If we can use ddi_umem_alloc we need to keep track of the ddi_umem_cookie
which kernel allocates, but the ContFree() function only passes us back
the address. Maybe we could for each ContAlloc build a linked list of
structures that have the cookie and corresponding virtual address. */
return NULL;
}
{
/** @todo implement RTMemContFree on solaris, see RTMemContAlloc() for details. */
}