VirtualBox

source: vbox/trunk/include/iprt/param.h@ 4071

Last change on this file since 4071 was 4071, checked in by vboxsync, 17 years ago

Biggest check-in ever. New source code headers for all (C) innotek files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/** @file
2 * innotek Portable Runtime - Parameter Definitions.
3 */
4
5/*
6 * Copyright (C) 2006-2007 innotek GmbH
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License as published by the Free Software Foundation,
12 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13 * distribution. VirtualBox OSE is distributed in the hope that it will
14 * be useful, but WITHOUT ANY WARRANTY of any kind.
15 */
16
17#ifndef ___iprt_param_h
18#define ___iprt_param_h
19
20/** @todo Much of the PAGE_* stuff here is obsolete and highly risky to have around.
21 * As for component configs (MM_*), either we gather all in here or we move those bits away! */
22
23/** @defgroup grp_rt_param System Parameter Definitions
24 * @ingroup grp_rt_cdefs
25 * @{
26 */
27
28/* Undefine PAGE_SIZE and PAGE_SHIFT to avoid unnecessary noice when clashing
29 with system headers. Include system headers before / after iprt depending
30 on which you wish to take precedence. */
31#undef PAGE_SIZE
32#undef PAGE_SHIFT
33
34/**
35 * i386 Page size.
36 */
37#define PAGE_SIZE 4096
38
39/**
40 * i386 Page shift.
41 * This is used to convert between size (in bytes) and page count.
42 */
43#define PAGE_SHIFT 12
44
45/**
46 * i386 Page offset mask.
47 *
48 * Do NOT one-complement this for whatever purpose. You may get a 32-bit const when you want a 64-bit one.
49 * Use PAGE_BASE_MASK, PAGE_BASE_GC_MASK, PAGE_BASE_HC_MASK, PAGE_ADDRESS() or X86_PTE_PAE_PG_MASK.
50 */
51#define PAGE_OFFSET_MASK 0xfff
52
53/**
54 * Page address mask for the guest context POINTERS.
55 * @remark Physical addresses are always masked using X86_PTE_PAE_PG_MASK!
56 */
57#define PAGE_BASE_GC_MASK (~(RTGCUINTPTR)0xfff)
58
59/**
60 * Page address mask for the host context POINTERS.
61 * @remark Physical addresses are always masked using X86_PTE_PAE_PG_MASK!
62 */
63#define PAGE_BASE_HC_MASK (~(RTHCUINTPTR)0xfff)
64
65/**
66 * Page address mask for the both context POINTERS.
67 *
68 * Be careful when using this since it may be a size too big!
69 * @remark Physical addresses are always masked using X86_PTE_PAE_PG_MASK!
70 */
71#define PAGE_BASE_MASK (~(RTUINTPTR)0xfff)
72
73/**
74 * Get the page aligned address of a POINTER in the CURRENT context.
75 *
76 * @returns Page aligned address (it's an uintptr_t).
77 * @param pv The address to align.
78 *
79 * @remark Physical addresses are always masked using X86_PTE_PAE_PG_MASK!
80 */
81#define PAGE_ADDRESS(pv) ((uintptr_t)(pv) & ~(uintptr_t)0xfff)
82
83#if 1 /** @todo remove this! Use X86_PAGE_* defines. */
84/**
85 * i386 Page directory shift.
86 * This is used to convert between PDR index and virtual address.
87 * @deprecated Use X86_*.
88 */
89#define PGDIR_SHIFT 22
90
91/**
92 * i386 Page table mask.
93 * This is used together with PAGE_SHIFT to get the page table
94 * index from a virtual address.
95 * @deprecated Use X86_*.
96 */
97#define PTE_MASK 0x3ff
98
99/**
100 * i386 Page table and page directory entry count for the default
101 * paging mode.
102 * @deprecated Use X86_*.
103 */
104#define PAGE_ENTRIES 1024
105
106/**
107 * i386 4MB Page offset mask.
108 * @deprecated Use X86_*.
109 */
110#define PAGE_OFFSET_MASK_BIG 0x3fffff
111#endif /* obsolete */
112
113/**
114 * Host max path (the reasonable value).
115 */
116#define RTPATH_MAX (4096 + 4) /* (PATH_MAX + 1) on linux w/ some alignment */
117
118/** @} */
119
120
121/** @} */
122
123#endif
124
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