VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-template-header.h@ 58666

Last change on this file since 58666 was 58666, checked in by vboxsync, 9 years ago

bs3kit: started adding some useful stuff.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.8 KB
Line 
1/* $Id: bs3kit-template-header.h 58666 2015-11-12 00:04:31Z vboxsync $ */
2/** @file
3 * BS3Kit header for multi-mode code templates.
4 */
5
6/*
7 * Copyright (C) 2007-2015 Oracle Corporation
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 (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27#include "bs3kit.h"
28
29/** @defgroup grp_bs3kit_tmpl BS3Kit Multi-Mode Code Templates
30 * @ingroup grp_bs3kit
31 *
32 * Multi-mode code templates avoid duplicating code for each of the CPU modes.
33 * Instead the code is compiled multiple times, either via multiple inclusions
34 * into a source files with different mode selectors defined or by multiple
35 * compiler invocations.
36 *
37 * In C/C++ code we're restricted to the compiler target bit count, whereas in
38 * assembly we can do everything in assembler run (with some 64-bit
39 * restrictions, that is).
40 *
41 * Before \#defining the next mode selector and including
42 * bs3kit-template-header.h again, include bs3kit-template-footer.h to undefine
43 * all the previous mode selectors and the macros defined by the header.
44 *
45 * @{
46 */
47
48#ifdef DOXYGEN_RUNNING
49/** @name Template mode selectors.
50 *
51 * Exactly one of these are defined by the file including the
52 * bs3kit-template-header.h header file. When building the code libraries, the
53 * kBuild target defines this.
54 *
55 * @{ */
56# define TMPL_RM /**< real mode. */
57# define TMPL_PE16 /**< 16-bit protected mode, unpaged. */
58# define TMPL_PE32 /**< 32-bit protected mode, unpaged. */
59# define TMPL_PEV86 /**< virtual 8086 mode under protected mode, unpaged. */
60# define TMPL_PP16 /**< 16-bit protected mode, paged. */
61# define TMPL_PP32 /**< 32-bit protected mode, paged. */
62# define TMPL_PPV86 /**< virtual 8086 mode under protected mode, paged. */
63# define TMPL_PAE16 /**< 16-bit protected mode with PAE (paged). */
64# define TMPL_PAE32 /**< 16-bit protected mode with PAE (paged). */
65# define TMPL_PAEV86 /**< virtual 8086 mode under protected mode with PAE (paged). */
66# define TMPL_LM16 /**< 16-bit long mode (paged). */
67# define TMPL_LM32 /**< 32-bit long mode (paged). */
68# define TMPL_LM64 /**< 64-bit long mode (paged). */
69/** @} */
70
71/** @name Derived Indicators
72 * @{ */
73# define TMPL_CMN_PE /**< TMPL_PE16 | TMPL_PE32 | TMPL_PEV86 */
74# define TMPL_CMN_PP /**< TMPL_PP16 | TMPL_PP32 | TMPL_PPV86 */
75# define TMPL_CMN_PAE /**< TMPL_PAE16 | TMPL_PAE32 | TMPL_PAEV86 */
76# define TMPL_CMN_LM /**< TMPL_LM16 | TMPL_LM32 | TMPL_LM64 */
77# define TMPL_CMN_V86 /**< TMPL_PEV86 | TMPL_PPV86 | TMPL_PAEV86 */
78# define TMPL_CMN_R86 /**< TMPL_CMN_V86 | TMPL_RM */
79/** @} */
80
81/** @def TMPL_NM
82 * Name mangling macro for the current mode.
83 *
84 * Example: TMPL_NM(PrintChr)
85 *
86 * @param Name The function or variable name to mangle.
87 */
88# define TMPL_NM(Name) RT_CONCAT(Name,_mode)
89
90/** @def TMPL_MODE_STR
91 * Short mode description. */
92# define TMPL_MODE_STR
93
94/** @def TMPL_HAVE_BIOS
95 * Indicates that we have direct access to the BIOS (only in real mode). */
96# define TMPL_HAVE_BIOS
97
98
99/** @name For ASM compatability
100 * @{ */
101/** @def TMPL_16BIT
102 * For ASM compatibility - please use ARCH_BITS == 16. */
103# define TMPL_16BIT
104/** @def TMPL_32BIT
105 * For ASM compatibility - please use ARCH_BITS == 32. */
106# define TMPL_32BIT
107/** @def TMPL_64BIT
108 * For ASM compatibility - please use ARCH_BITS == 64. */
109# define TMPL_64BIT
110
111/** @def TMPL_BITS
112 * For ASM compatibility - please use ARCH_BITS instead. */
113# define TMPL_BITS ARCH_BITS
114/** @} */
115
116#else /* !DOXYGEN_RUNNING */
117
118#undef BS3_CMN_NM
119
120#ifdef TMPL_RM
121# ifdef TMPL_PE16
122# error "Both 'TMPL_RM' and 'TMPL_PE16' are defined."
123# endif
124# ifdef TMPL_PE32
125# error "Both 'TMPL_RM' and 'TMPL_PE32' are defined."
126# endif
127# ifdef TMPL_PEV86
128# error "Both 'TMPL_RM' and 'TMPL_PEV86' are defined."
129# endif
130# ifdef TMPL_PP16
131# error "Both 'TMPL_RM' and 'TMPL_PP16' are defined."
132# endif
133# ifdef TMPL_PP32
134# error "Both 'TMPL_RM' and 'TMPL_PP32' are defined."
135# endif
136# ifdef TMPL_PPV86
137# error "Both 'TMPL_RM' and 'TMPL_PPV86' are defined."
138# endif
139# ifdef TMPL_PAE16
140# error "Both 'TMPL_RM' and 'TMPL_PAE16' are defined."
141# endif
142# ifdef TMPL_PAE32
143# error "Both 'TMPL_RM' and 'TMPL_PAE32' are defined."
144# endif
145# ifdef TMPL_PAEV86
146# error "Both 'TMPL_RM' and 'TMPL_PAEV86' are defined."
147# endif
148# ifdef TMPL_LM16
149# error "Both 'TMPL_RM' and 'TMPL_LM16' are defined."
150# endif
151# ifdef TMPL_LM32
152# error "Both 'TMPL_RM' and 'TMPL_LM32' are defined."
153# endif
154# ifdef TMPL_LM64
155# error "Both 'TMPL_RM' and 'TMPL_LM64' are defined."
156# endif
157# if ARCH_BITS != 16
158# error "TMPL_RM requires ARCH_BITS to be 16."
159# endif
160# define TMPL_16BIT
161# define TMPL_BITS 16
162# define TMPL_NM(Name) RT_CONCAT(Name,_rm)
163# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16)
164# define TMPL_MODE_STR "real mode"
165# define TMPL_HAVE_BIOS
166# define TMPL_CMN_R86
167#endif
168
169#ifdef TMPL_PE16
170# ifdef TMPL_RM
171# error "Both 'TMPL_PE16' and 'TMPL_RM' are defined."
172# endif
173# ifdef TMPL_PE32
174# error "Both 'TMPL_PE16' and 'TMPL_PE32' are defined."
175# endif
176# ifdef TMPL_PEV86
177# error "Both 'TMPL_RM' and 'TMPL_PEV86' are defined."
178# endif
179# ifdef TMPL_PP16
180# error "Both 'TMPL_PE16' and 'TMPL_PP16' are defined."
181# endif
182# ifdef TMPL_PP32
183# error "Both 'TMPL_PE16' and 'TMPL_PP32' are defined."
184# endif
185# ifdef TMPL_PPV86
186# error "Both 'TMPL_PE16' and 'TMPL_PPV86' are defined."
187# endif
188# ifdef TMPL_PAE16
189# error "Both 'TMPL_PE16' and 'TMPL_PAE16' are defined."
190# endif
191# ifdef TMPL_PAE32
192# error "Both 'TMPL_PE16' and 'TMPL_PAE32' are defined."
193# endif
194# ifdef TMPL_PAEV86
195# error "Both 'TMPL_PE32' and 'TMPL_PAEV86' are defined."
196# endif
197# ifdef TMPL_LM16
198# error "Both 'TMPL_PE16' and 'TMPL_LM16' are defined."
199# endif
200# ifdef TMPL_LM32
201# error "Both 'TMPL_PE16' and 'TMPL_LM32' are defined."
202# endif
203# ifdef TMPL_LM64
204# error "Both 'TMPL_PE16' and 'TMPL_LM64' are defined."
205# endif
206# if ARCH_BITS != 16
207# error "TMPL_PE16 requires ARCH_BITS to be 16."
208# endif
209# define TMPL_CMN_PE
210# define TMPL_CMN_P16
211# define TMPL_16BIT
212# define TMPL_BITS 16
213# define TMPL_NM(Name) RT_CONCAT(Name,_pe16)
214# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16)
215# define TMPL_MODE_STR "16-bit unpaged protected mode"
216#endif
217
218#ifdef TMPL_PE32
219# ifdef TMPL_RM
220# error "Both 'TMPL_PE32' and 'TMPL_RM' are defined."
221# endif
222# ifdef TMPL_PE16
223# error "Both 'TMPL_PE32' and 'TMPL_PE16' are defined."
224# endif
225# ifdef TMPL_PEV86
226# error "Both 'TMPL_PE32' and 'TMPL_PEV86' are defined."
227# endif
228# ifdef TMPL_PP16
229# error "Both 'TMPL_PE32' and 'TMPL_PP16' are defined."
230# endif
231# ifdef TMPL_PP32
232# error "Both 'TMPL_PE32' and 'TMPL_PP32' are defined."
233# endif
234# ifdef TMPL_PPV86
235# error "Both 'TMPL_PE32' and 'TMPL_PPV86' are defined."
236# endif
237# ifdef TMPL_PAE16
238# error "Both 'TMPL_PE32' and 'TMPL_PAE16' are defined."
239# endif
240# ifdef TMPL_PAE32
241# error "Both 'TMPL_PE32' and 'TMPL_PAE32' are defined."
242# endif
243# ifdef TMPL_PAE86
244# error "Both 'TMPL_PE32' and 'TMPL_PPV86' are defined."
245# endif
246# ifdef TMPL_LM16
247# error "Both 'TMPL_PE32' and 'TMPL_LM16' are defined."
248# endif
249# ifdef TMPL_LM32
250# error "Both 'TMPL_PE32' and 'TMPL_LM32' are defined."
251# endif
252# ifdef TMPL_LM64
253# error "Both 'TMPL_PE32' and 'TMPL_LM64' are defined."
254# endif
255# if ARCH_BITS != 32
256# error "TMPL_PE32 requires ARCH_BITS to be 32."
257# endif
258# define TMPL_CMN_PE
259# define TMPL_CMN_P32
260# define TMPL_32BIT
261# define TMPL_BITS 32
262# define TMPL_NM(Name) RT_CONCAT(Name,_pe32)
263# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32)
264# define TMPL_MODE_STR "32-bit unpaged protected mode"
265#endif
266
267#ifdef TMPL_PEV86
268# ifdef TMPL_RM
269# error "Both 'TMPL_PEV86' and 'TMPL_RM' are defined."
270# endif
271# ifdef TMPL_PE16
272# error "Both 'TMPL_PEV86' and 'TMPL_PE16' are defined."
273# endif
274# ifdef TMPL_PP32
275# error "Both 'TMPL_PEV86' and 'TMPL_PP32' are defined."
276# endif
277# ifdef TMPL_PP16
278# error "Both 'TMPL_PEV86' and 'TMPL_PP16' are defined."
279# endif
280# ifdef TMPL_PP32
281# error "Both 'TMPL_PEV86' and 'TMPL_PP32' are defined."
282# endif
283# ifdef TMPL_PPV86
284# error "Both 'TMPL_PEV86' and 'TMPL_PPV86' are defined."
285# endif
286# ifdef TMPL_PAE16
287# error "Both 'TMPL_PEV86' and 'TMPL_PAE16' are defined."
288# endif
289# ifdef TMPL_PAE32
290# error "Both 'TMPL_PEV86' and 'TMPL_PAE32' are defined."
291# endif
292# ifdef TMPL_PAE86
293# error "Both 'TMPL_PEV86' and 'TMPL_PPV86' are defined."
294# endif
295# ifdef TMPL_LM16
296# error "Both 'TMPL_PEV86' and 'TMPL_LM16' are defined."
297# endif
298# ifdef TMPL_LM32
299# error "Both 'TMPL_PEV86' and 'TMPL_LM32' are defined."
300# endif
301# ifdef TMPL_LM64
302# error "Both 'TMPL_PEV86' and 'TMPL_LM64' are defined."
303# endif
304# if ARCH_BITS != 16
305# error "TMPL_PEV86 requires ARCH_BITS to be 16."
306# endif
307# define TMPL_CMN_PE
308# define TMPL_CMN_V86
309# define TMPL_CMN_R86
310# define TMPL_16BIT
311# define TMPL_BITS 16
312# define TMPL_NM(Name) RT_CONCAT(Name,_pev86)
313# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16)
314# define TMPL_MODE_STR "v8086 unpaged protected mode"
315#endif
316
317#ifdef TMPL_PP16
318# ifdef TMPL_RM
319# error "Both 'TMPL_PP16' and 'TMPL_RM' are defined."
320# endif
321# ifdef TMPL_PE16
322# error "Both 'TMPL_PP16' and 'TMPL_PE16' are defined."
323# endif
324# ifdef TMPL_PE32
325# error "Both 'TMPL_PP16' and 'TMPL_PE32' are defined."
326# endif
327# ifdef TMPL_PEV86
328# error "Both 'TMPL_PP16' and 'TMPL_PEV86' are defined."
329# endif
330# ifdef TMPL_PP32
331# error "Both 'TMPL_PP16' and 'TMPL_PP32' are defined."
332# endif
333# ifdef TMPL_PPV86
334# error "Both 'TMPL_PP32' and 'TMPL_PPV86' are defined."
335# endif
336# ifdef TMPL_PAE16
337# error "Both 'TMPL_PP16' and 'TMPL_PAE16' are defined."
338# endif
339# ifdef TMPL_PAE32
340# error "Both 'TMPL_PP16' and 'TMPL_PAE32' are defined."
341# endif
342# ifdef TMPL_PAEV86
343# error "Both 'TMPL_PP16' and 'TMPL_PAEV86' are defined."
344# endif
345# ifdef TMPL_LM16
346# error "Both 'TMPL_PP16' and 'TMPL_LM16' are defined."
347# endif
348# ifdef TMPL_LM32
349# error "Both 'TMPL_PP16' and 'TMPL_LM32' are defined."
350# endif
351# ifdef TMPL_LM64
352# error "Both 'TMPL_PP16' and 'TMPL_LM64' are defined."
353# endif
354# if ARCH_BITS != 16
355# error "TMPL_PP16 requires ARCH_BITS to be 16."
356# endif
357# define TMPL_CMN_PP
358# define TMPL_CMN_P16
359# define TMPL_16BIT
360# define TMPL_BITS 16
361# define TMPL_NM(Name) RT_CONCAT(Name,_pp16)
362# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16)
363# define TMPL_MODE_STR "16-bit paged protected mode"
364#endif
365
366#ifdef TMPL_PP32
367# ifdef TMPL_RM
368# error "Both 'TMPL_PP32' and 'TMPL_RM' are defined."
369# endif
370# ifdef TMPL_PE16
371# error "Both 'TMPL_PP32' and 'TMPL_PE16' are defined."
372# endif
373# ifdef TMPL_PE32
374# error "Both 'TMPL_PP32' and 'TMPL_PE32' are defined."
375# endif
376# ifdef TMPL_PEV86
377# error "Both 'TMPL_PP32' and 'TMPL_PEV86' are defined."
378# endif
379# ifdef TMPL_PP16
380# error "Both 'TMPL_PP32' and 'TMPL_PP16' are defined."
381# endif
382# ifdef TMPL_PPV86
383# error "Both 'TMPL_PP32' and 'TMPL_PPV86' are defined."
384# endif
385# ifdef TMPL_PAE16
386# error "Both 'TMPL_PP32' and 'TMPL_PAE16' are defined."
387# endif
388# ifdef TMPL_PAE32
389# error "Both 'TMPL_PP32' and 'TMPL_PAE32' are defined."
390# endif
391# ifdef TMPL_PAEV86
392# error "Both 'TMPL_PP32' and 'TMPL_PAEV86' are defined."
393# endif
394# ifdef TMPL_LM16
395# error "Both 'TMPL_PP32' and 'TMPL_LM16' are defined."
396# endif
397# ifdef TMPL_LM32
398# error "Both 'TMPL_PP32' and 'TMPL_LM32' are defined."
399# endif
400# ifdef TMPL_LM64
401# error "Both 'TMPL_PP32' and 'TMPL_LM64' are defined."
402# endif
403# if ARCH_BITS != 32
404# error "TMPL_PP32 requires ARCH_BITS to be 32."
405# endif
406# define TMPL_CMN_PP
407# define TMPL_CMN_P32
408# define TMPL_32BIT
409# define TMPL_BITS 32
410# define TMPL_NM(Name) RT_CONCAT(Name,_pp32)
411# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32)
412# define TMPL_MODE_STR "32-bit paged protected mode"
413#endif
414
415#ifdef TMPL_PPV86
416# ifdef TMPL_RM
417# error "Both 'TMPL_PPV86' and 'TMPL_RM' are defined."
418# endif
419# ifdef TMPL_PE16
420# error "Both 'TMPL_PPV86' and 'TMPL_PE16' are defined."
421# endif
422# ifdef TMPL_PE32
423# error "Both 'TMPL_PPV86' and 'TMPL_PE32' are defined."
424# endif
425# ifdef TMPL_PEV86
426# error "Both 'TMPL_PPV86' and 'TMPL_PEV86' are defined."
427# endif
428# ifdef TMPL_PP16
429# error "Both 'TMPL_PPV86' and 'TMPL_PP16' are defined."
430# endif
431# ifdef TMPL_PP32
432# error "Both 'TMPL_PPV86' and 'TMPL_PP32' are defined."
433# endif
434# ifdef TMPL_PAE16
435# error "Both 'TMPL_PPV86' and 'TMPL_PAE16' are defined."
436# endif
437# ifdef TMPL_PAE32
438# error "Both 'TMPL_PPV86' and 'TMPL_PAE32' are defined."
439# endif
440# ifdef TMPL_PAEV86
441# error "Both 'TMPL_PPV86' and 'TMPL_PAEV86' are defined."
442# endif
443# ifdef TMPL_LM16
444# error "Both 'TMPL_PPV86' and 'TMPL_LM16' are defined."
445# endif
446# ifdef TMPL_LM32
447# error "Both 'TMPL_PPV86' and 'TMPL_LM32' are defined."
448# endif
449# ifdef TMPL_LM64
450# error "Both 'TMPL_PPV86' and 'TMPL_LM64' are defined."
451# endif
452# if ARCH_BITS != 16
453# error "TMPL_PPV86 requires ARCH_BITS to be 16."
454# endif
455# define TMPL_CMN_PP
456# define TMPL_CMN_V86
457# define TMPL_CMN_R86
458# define TMPL_16BIT
459# define TMPL_BITS 16
460# define TMPL_NM(Name) RT_CONCAT(Name,_ppv86)
461# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c86)
462# define TMPL_MODE_STR "v8086 paged protected mode"
463#endif
464
465#ifdef TMPL_PAE16
466# ifdef TMPL_RM
467# error "Both 'TMPL_PAE16' and 'TMPL_RM' are defined."
468# endif
469# ifdef TMPL_PE16
470# error "Both 'TMPL_PAE16' and 'TMPL_PE16' are defined."
471# endif
472# ifdef TMPL_PE32
473# error "Both 'TMPL_PAE16' and 'TMPL_PE32' are defined."
474# endif
475# ifdef TMPL_PEV86
476# error "Both 'TMPL_PAE16' and 'TMPL_PEV86' are defined."
477# endif
478# ifdef TMPL_PP16
479# error "Both 'TMPL_PAE16' and 'TMPL_PP16' are defined."
480# endif
481# ifdef TMPL_PP32
482# error "Both 'TMPL_PAE16' and 'TMPL_PP32' are defined."
483# endif
484# ifdef TMPL_PPV86
485# error "Both 'TMPL_PAE16' and 'TMPL_PPV86' are defined."
486# endif
487# ifdef TMPL_PAE32
488# error "Both 'TMPL_PAE16' and 'TMPL_PAE32' are defined."
489# endif
490# ifdef TMPL_LM16
491# error "Both 'TMPL_PAE16' and 'TMPL_LM16' are defined."
492# endif
493# ifdef TMPL_PAEV86
494# error "Both 'TMPL_PAE16' and 'TMPL_PAEV86' are defined."
495# endif
496# ifdef TMPL_LM32
497# error "Both 'TMPL_PAE16' and 'TMPL_LM32' are defined."
498# endif
499# ifdef TMPL_LM64
500# error "Both 'TMPL_PAE16' and 'TMPL_LM64' are defined."
501# endif
502# if ARCH_BITS != 16
503# error "TMPL_PAE16 requires ARCH_BITS to be 16."
504# endif
505# define TMPL_CMN_PAE
506# define TMPL_16BIT
507# define TMPL_CMN_P16
508# define TMPL_BITS 16
509# define TMPL_NM(Name) RT_CONCAT(Name,_pae16)
510# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16)
511# define TMPL_MODE_STR "16-bit pae protected mode"
512#endif
513
514#ifdef TMPL_PAE32
515# ifdef TMPL_RM
516# error "Both 'TMPL_PAE32' and 'TMPL_RM' are defined."
517# endif
518# ifdef TMPL_PE16
519# error "Both 'TMPL_PAE32' and 'TMPL_PE16' are defined."
520# endif
521# ifdef TMPL_PE32
522# error "Both 'TMPL_PAE32' and 'TMPL_PE32' are defined."
523# endif
524# ifdef TMPL_PEV86
525# error "Both 'TMPL_PAE32' and 'TMPL_PEV86' are defined."
526# endif
527# ifdef TMPL_PP16
528# error "Both 'TMPL_PAE32' and 'TMPL_PP16' are defined."
529# endif
530# ifdef TMPL_PP32
531# error "Both 'TMPL_PAE32' and 'TMPL_PP32' are defined."
532# endif
533# ifdef TMPL_PPV86
534# error "Both 'TMPL_PAE32' and 'TMPL_PPV86' are defined."
535# endif
536# ifdef TMPL_PAE16
537# error "Both 'TMPL_PAE32' and 'TMPL_PAE16' are defined."
538# endif
539# ifdef TMPL_PAEV86
540# error "Both 'TMPL_PAE32' and 'TMPL_PAEV86' are defined."
541# endif
542# ifdef TMPL_LM16
543# error "Both 'TMPL_PAE32' and 'TMPL_LM16' are defined."
544# endif
545# ifdef TMPL_LM32
546# error "Both 'TMPL_PAE32' and 'TMPL_LM32' are defined."
547# endif
548# ifdef TMPL_LM64
549# error "Both 'TMPL_PAE32' and 'TMPL_LM64' are defined."
550# endif
551# if ARCH_BITS != 32
552# error "TMPL_PAE32 requires ARCH_BITS to be 32."
553# endif
554# define TMPL_CMN_PAE
555# define TMPL_CMN_P32
556# define TMPL_32BIT
557# define TMPL_BITS 32
558# define TMPL_NM(Name) RT_CONCAT(Name,_pae32)
559# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32)
560# define TMPL_MODE_STR "32-bit pae protected mode"
561#endif
562
563#ifdef TMPL_PAEV86
564# ifdef TMPL_RM
565# error "Both 'TMPL_PAEV86' and 'TMPL_RM' are defined."
566# endif
567# ifdef TMPL_PE16
568# error "Both 'TMPL_PAEV86' and 'TMPL_PE16' are defined."
569# endif
570# ifdef TMPL_PE32
571# error "Both 'TMPL_PAEV86' and 'TMPL_PE32' are defined."
572# endif
573# ifdef TMPL_PEV86
574# error "Both 'TMPL_PAEV86' and 'TMPL_PEV86' are defined."
575# endif
576# ifdef TMPL_PP16
577# error "Both 'TMPL_PAEV86' and 'TMPL_PP16' are defined."
578# endif
579# ifdef TMPL_PP32
580# error "Both 'TMPL_PAEV86' and 'TMPL_PP32' are defined."
581# endif
582# ifdef TMPL_PPV86
583# error "Both 'TMPL_PAEV86' and 'TMPL_PPV86' are defined."
584# endif
585# ifdef TMPL_PAE16
586# error "Both 'TMPL_PAEV86' and 'TMPL_PAE16' are defined."
587# endif
588# ifdef TMPL_PAEV86
589# error "Both 'TMPL_PAEV86' and 'TMPL_PAEV86' are defined."
590# endif
591# ifdef TMPL_LM16
592# error "Both 'TMPL_PAEV86' and 'TMPL_LM16' are defined."
593# endif
594# ifdef TMPL_LM32
595# error "Both 'TMPL_PAEV86' and 'TMPL_LM32' are defined."
596# endif
597# ifdef TMPL_LM64
598# error "Both 'TMPL_PAEV86' and 'TMPL_LM64' are defined."
599# endif
600# if ARCH_BITS != 16
601# error "TMPL_PAEV86 requires ARCH_BITS to be 16."
602# endif
603# define TMPL_CMN_PAE
604# define TMPL_CMN_V86
605# define TMPL_CMN_R86
606# define TMPL_16BIT
607# define TMPL_BITS 16
608# define TMPL_NM(Name) RT_CONCAT(Name,_paev86)
609# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c86)
610# define TMPL_MODE_STR "v8086 pae protected mode"
611#endif
612
613#ifdef TMPL_LM16
614# ifdef TMPL_RM
615# error "Both 'TMPL_LM16' and 'TMPL_RM' are defined."
616# endif
617# ifdef TMPL_PE16
618# error "Both 'TMPL_LM16' and 'TMPL_PE16' are defined."
619# endif
620# ifdef TMPL_PE32
621# error "Both 'TMPL_LM16' and 'TMPL_PE32' are defined."
622# endif
623# ifdef TMPL_PEV86
624# error "Both 'TMPL_LM16' and 'TMPL_PEV86' are defined."
625# endif
626# ifdef TMPL_PP16
627# error "Both 'TMPL_LM16' and 'TMPL_PP16' are defined."
628# endif
629# ifdef TMPL_PP32
630# error "Both 'TMPL_LM16' and 'TMPL_PP32' are defined."
631# endif
632# ifdef TMPL_PPV86
633# error "Both 'TMPL_LM16' and 'TMPL_PPV86' are defined."
634# endif
635# ifdef TMPL_PAE16
636# error "Both 'TMPL_LM16' and 'TMPL_PAE16' are defined."
637# endif
638# ifdef TMPL_PAE32
639# error "Both 'TMPL_LM16' and 'TMPL_PAE32' are defined."
640# endif
641# ifdef TMPL_PAEV86
642# error "Both 'TMPL_LM16' and 'TMPL_PAEV86' are defined."
643# endif
644# ifdef TMPL_LM32
645# error "Both 'TMPL_LM16' and 'TMPL_LM32' are defined."
646# endif
647# ifdef TMPL_LM64
648# error "Both 'TMPL_LM16' and 'TMPL_LM64' are defined."
649# endif
650# if ARCH_BITS != 16
651# error "TMPL_LM16 requires ARCH_BITS to be 16."
652# endif
653# define TMPL_CMN_LM
654# define TMPL_CMN_P16
655# define TMPL_16BIT
656# define TMPL_BITS 16
657# define TMPL_NM(Name) RT_CONCAT(Name,_lm16)
658# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c16)
659# define TMPL_MODE_STR "16-bit long mode"
660#endif
661
662#ifdef TMPL_LM32
663# ifdef TMPL_RM
664# error "Both 'TMPL_LM32' and 'TMPL_RM' are defined."
665# endif
666# ifdef TMPL_PE16
667# error "Both 'TMPL_LM32' and 'TMPL_PE16' are defined."
668# endif
669# ifdef TMPL_PE32
670# error "Both 'TMPL_LM32' and 'TMPL_PE32' are defined."
671# endif
672# ifdef TMPL_PEV86
673# error "Both 'TMPL_LM32' and 'TMPL_PEV86' are defined."
674# endif
675# ifdef TMPL_PP16
676# error "Both 'TMPL_LM32' and 'TMPL_PP16' are defined."
677# endif
678# ifdef TMPL_PP32
679# error "Both 'TMPL_LM32' and 'TMPL_PP32' are defined."
680# endif
681# ifdef TMPL_PPV86
682# error "Both 'TMPL_LM32' and 'TMPL_PPV86' are defined."
683# endif
684# ifdef TMPL_PAE16
685# error "Both 'TMPL_LM32' and 'TMPL_PAE16' are defined."
686# endif
687# ifdef TMPL_PAE32
688# error "Both 'TMPL_LM32' and 'TMPL_PAE32' are defined."
689# endif
690# ifdef TMPL_PAEV86
691# error "Both 'TMPL_LM32' and 'TMPL_PAEV86' are defined."
692# endif
693# ifdef TMPL_LM16
694# error "Both 'TMPL_LM32' and 'TMPL_LM16' are defined."
695# endif
696# ifdef TMPL_LM64
697# error "Both 'TMPL_LM32' and 'TMPL_LM64' are defined."
698# endif
699# if ARCH_BITS != 32
700# error "TMPL_LM32 requires ARCH_BITS to be 32."
701# endif
702# define TMPL_CMN_LM
703# define TMPL_CMN_P32
704# define TMPL_32BIT
705# define TMPL_BITS 32
706# define TMPL_NM(Name) RT_CONCAT(Name,_lm32)
707# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c32)
708# define TMPL_MODE_STR "32-bit long mode"
709#endif
710
711#ifdef TMPL_LM64
712# ifdef TMPL_RM
713# error ""Both 'TMPL_LM64' and 'TMPL_RM' are defined.""
714# endif
715# ifdef TMPL_PE16
716# error "Both 'TMPL_LM64' and 'TMPL_PE16' are defined."
717# endif
718# ifdef TMPL_PE32
719# error "Both 'TMPL_LM64' and 'TMPL_PE32' are defined."
720# endif
721# ifdef TMPL_PEV86
722# error "Both 'TMPL_LM64' and 'TMPL_PEV86' are defined."
723# endif
724# ifdef TMPL_PP16
725# error "Both 'TMPL_LM64' and 'TMPL_PP16' are defined."
726# endif
727# ifdef TMPL_PP32
728# error "Both 'TMPL_LM64' and 'TMPL_PP32' are defined."
729# endif
730# ifdef TMPL_PPV86
731# error "Both 'TMPL_LM64' and 'TMPL_PPV86' are defined."
732# endif
733# ifdef TMPL_PAE16
734# error "Both 'TMPL_LM64' and 'TMPL_PAE16' are defined."
735# endif
736# ifdef TMPL_PAE32
737# error "Both 'TMPL_LM64' and 'TMPL_PAE32' are defined."
738# endif
739# ifdef TMPL_PAEV86
740# error "Both 'TMPL_LM64' and 'TMPL_PAEV86' are defined."
741# endif
742# ifdef TMPL_LM16
743# error "Both 'TMPL_LM64' and 'TMPL_LM16' are defined."
744# endif
745# ifdef TMPL_LM32
746# error "Both 'TMPL_LM64' and 'TMPL_LM32' are defined."
747# endif
748# if ARCH_BITS != 64
749# error "TMPL_LM64 requires ARCH_BITS to be 64."
750# endif
751# define TMPL_CMN_LM
752# define TMPL_CMN_P64
753# define TMPL_64BIT
754# define TMPL_BITS 64
755# define TMPL_NM(Name) RT_CONCAT(Name,_lm64)
756# define BS3_CMN_NM(Name) RT_CONCAT(Name,_c64)
757# define TMPL_MODE_STR "64-bit long mode"
758#endif
759
760#ifndef TMPL_MODE_STR
761# error "internal error"
762#endif
763
764#endif /* !DOXYGEN_RUNNING */
765/** @} */
766
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