1 | /* $Id: alloc-r0drv.h 289 2007-01-25 05:41:27Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * InnoTek Portable Runtime - Memory Allocation, Ring-0 Driver.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * If you received this file as part of a commercial VirtualBox
|
---|
18 | * distribution, then only the terms of your commercial VirtualBox
|
---|
19 | * license agreement apply instead of the previous paragraph.
|
---|
20 | */
|
---|
21 |
|
---|
22 | #ifndef __r0drv_alloc_r0drv_h__
|
---|
23 | #define __r0drv_alloc_r0drv_h__
|
---|
24 |
|
---|
25 | #include <iprt/cdefs.h>
|
---|
26 | #include <iprt/types.h>
|
---|
27 |
|
---|
28 | __BEGIN_DECLS
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * Header which heading all memory blocks.
|
---|
32 | */
|
---|
33 | typedef struct RTMEMHDR
|
---|
34 | {
|
---|
35 | /** Magic (RTMEMHDR_MAGIC). */
|
---|
36 | uint32_t u32Magic;
|
---|
37 | /** Block flags (RTMEMHDR_FLAG_*). */
|
---|
38 | uint32_t fFlags;
|
---|
39 | /** The size of the block. */
|
---|
40 | uint32_t cb;
|
---|
41 | /** Alignment padding. */
|
---|
42 | uint32_t u32Padding;
|
---|
43 | } RTMEMHDR, *PRTMEMHDR;
|
---|
44 |
|
---|
45 | /** Magic number for heap blocks. (Edgar Allan Poe) */
|
---|
46 | #define RTMEMHDR_MAGIC 0x18090119
|
---|
47 |
|
---|
48 | /** @name RTMEMHDR::fFlags.
|
---|
49 | * @{ */
|
---|
50 | #define RTMEMHDR_FLAG_ZEROED BIT(0)
|
---|
51 | #define RTMEMHDR_FLAG_EXEC BIT(1)
|
---|
52 | #ifdef __LINUX__
|
---|
53 | #define RTMEMHDR_FLAG_EXEC_HEAP BIT(30)
|
---|
54 | #define RTMEMHDR_FLAG_KMALLOC BIT(31)
|
---|
55 | #endif
|
---|
56 | /** @} */
|
---|
57 |
|
---|
58 |
|
---|
59 | PRTMEMHDR rtMemAlloc(size_t cb, uint32_t fFlags);
|
---|
60 | void rtMemFree(PRTMEMHDR pHdr);
|
---|
61 |
|
---|
62 | __END_DECLS
|
---|
63 | #endif
|
---|
64 |
|
---|