1
/*********************************************************
2
* Copyright (C) 1998 VMware, Inc. All rights reserved.
4
* The contents of this file are subject to the terms of the Common
5
* Development and Distribution License (the "License") version 1.0
6
* and no later version. You may not use this file except in
7
* compliance with the License.
9
* You can obtain a copy of the License at
10
* http://www.opensource.org/licenses/cddl1.php
12
* See the License for the specific language governing permissions
13
* and limitations under the License.
15
*********************************************************/
20
* Restrict include file use.
22
* In every .h file, define one or more of these
25
* INCLUDE_ALLOW_USERLEVEL
26
* INCLUDE_ALLOW_VMMEXT
27
* INCLUDE_ALLOW_VMCORE
28
* INCLUDE_ALLOW_MODULE
29
* INCLUDE_ALLOW_VMNIXMOD
30
* INCLUDE_ALLOW_VMKERNEL
31
* INCLUDE_ALLOW_DISTRIBUTE
32
* INCLUDE_ALLOW_VMK_MODULE
33
* INCLUDE_ALLOW_VMKDRIVERS
34
* INCLUDE_ALLOW_VMIROM
36
* Then include this file.
38
* Any file that has INCLUDE_ALLOW_DISTRIBUTE defined will potentially
39
* be distributed in source form along with GPLed code. Ensure
40
* that this is acceptable.
45
* Declare a VMCORE-only variable to help classify object
46
* files. The variable goes in the common block and does
47
* not create multiple definition link-time conflicts.
50
#if defined VMCORE && defined VMX86_DEVEL && defined VMX86_DEBUG && \
51
defined linux && !defined MODULE && \
52
!defined COMPILED_WITH_VMCORE
53
#define COMPILED_WITH_VMCORE compiled_with_vmcore
55
.comm compiled_with_vmcore, 0
57
asm(".comm compiled_with_vmcore, 0");
62
#if defined VMCORE && \
63
!(defined VMX86_VMX || defined VMM || \
64
defined MONITOR_APP || defined VMMON)
65
#error "Makefile problem: VMCORE without VMX86_VMX or \
66
VMM or MONITOR_APP or MODULE."
69
#if defined VMCORE && !defined INCLUDE_ALLOW_VMCORE
70
#error "The surrounding include file is not allowed in vmcore."
72
#undef INCLUDE_ALLOW_VMCORE
74
#if defined VMX86_VMX && !defined VMCORE && \
75
!(defined INCLUDE_ALLOW_VMX || defined INCLUDE_ALLOW_USERLEVEL)
76
#error "The surrounding include file is not allowed in the VMX."
78
#undef INCLUDE_ALLOW_VMX
80
#if defined USERLEVEL && !defined VMX86_VMX && !defined VMCORE && \
81
!defined INCLUDE_ALLOW_USERLEVEL
82
#error "The surrounding include file is not allowed at userlevel."
84
#undef INCLUDE_ALLOW_USERLEVEL
86
#if defined VMM && !defined VMCORE && \
87
!defined INCLUDE_ALLOW_VMMEXT
88
#error "The surrounding include file is not allowed in the monitor."
90
#undef INCLUDE_ALLOW_VMMEXT
92
#if defined MODULE && !defined VMKERNEL_MODULE && !defined VMNIXMOD && \
93
!defined VMMON && !defined INCLUDE_ALLOW_MODULE
94
#error "The surrounding include file is not allowed in driver modules."
96
#undef INCLUDE_ALLOW_MODULE
98
#if defined VMMON && !defined INCLUDE_ALLOW_VMMON
99
#error "The surrounding include file is not allowed in vmmon."
101
#undef INCLUDE_ALLOW_VMMON
103
#if defined VMKERNEL && !defined INCLUDE_ALLOW_VMKERNEL
104
#error "The surrounding include file is not allowed in the vmkernel."
106
#undef INCLUDE_ALLOW_VMKERNEL
108
#if defined GPLED_CODE && !defined INCLUDE_ALLOW_DISTRIBUTE
109
#error "The surrounding include file is not allowed in GPL code."
111
#undef INCLUDE_ALLOW_DISTRIBUTE
113
#if defined VMKERNEL_MODULE && !defined VMKERNEL && \
114
!defined INCLUDE_ALLOW_VMK_MODULE && !defined INCLUDE_ALLOW_VMKDRIVERS
115
#error "The surrounding include file is not allowed in vmkernel modules."
117
#undef INCLUDE_ALLOW_VMK_MODULE
118
#undef INCLUDE_ALLOW_VMKDRIVERS
120
#if defined VMNIXMOD && !defined INCLUDE_ALLOW_VMNIXMOD
122
#error "The surrounding include file is not allowed in vmnixmod."
125
#undef INCLUDE_ALLOW_VMNIXMOD
127
#if defined VMIROM && ! defined INCLUDE_ALLOW_VMIROM
128
#error "The surrounding include file is not allowed in vmirom."
130
#undef INCLUDE_ALLOW_VMIROM