1 | /* $Id: alloc-r0drv.h 3699 2007-07-18 17:37:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * innotek Portable Runtime - Memory Allocation, Ring-0 Driver.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 innotek 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 | #include "internal/magics.h"
|
---|
28 |
|
---|
29 | __BEGIN_DECLS
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Header which heading all memory blocks.
|
---|
33 | */
|
---|
34 | typedef struct RTMEMHDR
|
---|
35 | {
|
---|
36 | /** Magic (RTMEMHDR_MAGIC). */
|
---|
37 | uint32_t u32Magic;
|
---|
38 | /** Block flags (RTMEMHDR_FLAG_*). */
|
---|
39 | uint32_t fFlags;
|
---|
40 | /** The size of the block. */
|
---|
41 | uint32_t cb;
|
---|
42 | /** Alignment padding. */
|
---|
43 | uint32_t u32Padding;
|
---|
44 | } RTMEMHDR, *PRTMEMHDR;
|
---|
45 |
|
---|
46 |
|
---|
47 | /** @name RTMEMHDR::fFlags.
|
---|
48 | * @{ */
|
---|
49 | #define RTMEMHDR_FLAG_ZEROED BIT(0)
|
---|
50 | #define RTMEMHDR_FLAG_EXEC BIT(1)
|
---|
51 | #ifdef RT_OS_LINUX
|
---|
52 | #define RTMEMHDR_FLAG_EXEC_HEAP BIT(30)
|
---|
53 | #define RTMEMHDR_FLAG_KMALLOC BIT(31)
|
---|
54 | #endif
|
---|
55 | /** @} */
|
---|
56 |
|
---|
57 |
|
---|
58 | PRTMEMHDR rtMemAlloc(size_t cb, uint32_t fFlags);
|
---|
59 | void rtMemFree(PRTMEMHDR pHdr);
|
---|
60 |
|
---|
61 | __END_DECLS
|
---|
62 | #endif
|
---|
63 |
|
---|