alloc-r0drv.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
0N/A/* $Id$ */
2362N/A/** @file
0N/A * InnoTek Portable Runtime - Memory Allocation, Ring-0 Driver.
0N/A */
0N/A
0N/A/*
2362N/A * Copyright (C) 2006 InnoTek Systemberatung GmbH
0N/A *
2362N/A * This file is part of VirtualBox Open Source Edition (OSE), as
0N/A * available from http://www.virtualbox.org. This file is free software;
0N/A * you can redistribute it and/or modify it under the terms of the GNU
0N/A * General Public License as published by the Free Software Foundation,
0N/A * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
0N/A * distribution. VirtualBox OSE is distributed in the hope that it will
0N/A * be useful, but WITHOUT ANY WARRANTY of any kind.
0N/A *
0N/A * If you received this file as part of a commercial VirtualBox
0N/A * distribution, then only the terms of your commercial VirtualBox
0N/A * license agreement apply instead of the previous paragraph.
0N/A */
2362N/A
2362N/A#ifndef __r0drv_alloc_r0drv_h__
2362N/A#define __r0drv_alloc_r0drv_h__
0N/A
0N/A#include <iprt/cdefs.h>
0N/A#include <iprt/types.h>
0N/A
0N/A__BEGIN_DECLS
178N/A
0N/A/**
0N/A * Header which heading all memory blocks.
0N/A */
0N/Atypedef struct RTMEMHDR
0N/A{
0N/A /** Magic (RTMEMHDR_MAGIC). */
0N/A uint32_t u32Magic;
0N/A /** Block flags (RTMEMHDR_FLAG_*). */
0N/A uint32_t fFlags;
0N/A /** The size of the block. */
0N/A uint32_t cb;
0N/A /** Alignment padding. */
0N/A uint32_t u32Padding;
0N/A} RTMEMHDR, *PRTMEMHDR;
0N/A
0N/A/** Magic number for heap blocks. (Edgar Allan Poe) */
0N/A#define RTMEMHDR_MAGIC 0x18090119
0N/A
0N/A/** @name RTMEMHDR::fFlags.
0N/A * @{ */
0N/A#define RTMEMHDR_FLAG_ZEROED BIT(0)
0N/A#define RTMEMHDR_FLAG_EXEC BIT(1)
0N/A#ifdef __LINUX__
0N/A#define RTMEMHDR_FLAG_KMALLOC BIT(31)
0N/A#endif
0N/A/** @} */
0N/A
0N/A
0N/APRTMEMHDR rtMemAlloc(size_t cb, uint32_t fFlags);
0N/Avoid rtMemFree(PRTMEMHDR pHdr);
0N/A
0N/A__END_DECLS
0N/A#endif
0N/A
0N/A