VirtualBox

source: vbox/trunk/src/VBox/Runtime/r0drv/alloc-r0drv.h@ 2034

Last change on this file since 2034 was 1816, checked in by vboxsync, 18 years ago

moved magics to a common header to avoid duplicating the same defines all over the place.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1/* $Id: alloc-r0drv.h 1816 2007-03-29 18:59:35Z 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#include "internal/magics.h"
28
29__BEGIN_DECLS
30
31/**
32 * Header which heading all memory blocks.
33 */
34typedef 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 __LINUX__
52#define RTMEMHDR_FLAG_EXEC_HEAP BIT(30)
53#define RTMEMHDR_FLAG_KMALLOC BIT(31)
54#endif
55/** @} */
56
57
58PRTMEMHDR rtMemAlloc(size_t cb, uint32_t fFlags);
59void rtMemFree(PRTMEMHDR pHdr);
60
61__END_DECLS
62#endif
63
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette