[FREELDR] Fix x64 build.
[reactos.git] / boot / freeldr / freeldr / include / freeldr.h
1 /*
2 * FreeLoader
3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef __FREELDR_H
21 #define __FREELDR_H
22
23 #define UINT64_C(val) val##ULL
24 #define RVA(m, b) ((PVOID)((ULONG_PTR)(b) + (ULONG_PTR)(m)))
25
26 #define ROUND_DOWN(n, align) \
27 (((ULONG)n) & ~((align) - 1l))
28
29 #define ROUND_UP(n, align) \
30 ROUND_DOWN(((ULONG)n) + (align) - 1, (align))
31
32 /* Public headers */
33 #ifdef __REACTOS__
34 #define NTOSAPI
35 #define printf TuiPrintf
36 #include <ntddk.h>
37 #include <ntifs.h>
38 #include <ioaccess.h>
39 #include <arc/arc.h>
40 #include <ketypes.h>
41 #include <mmtypes.h>
42 #include <ndk/asm.h>
43 #include <ndk/rtlfuncs.h>
44 #include <ndk/ldrtypes.h>
45 #include <ndk/halfuncs.h>
46 #include <stdlib.h>
47 #include <stdio.h>
48 #include <ctype.h>
49 #include <ntdddisk.h>
50 #include <internal/hal.h>
51 #include <drivers/pci/pci.h>
52 #include <winerror.h>
53 #include <ntstrsafe.h>
54 #else
55 #include <ntsup.h>
56 #endif
57
58 /* Internal headers */
59 // #include <arcemul.h>
60 #include <arcname.h>
61 #include <arcsupp.h>
62 #include <bytesex.h>
63 #include <cache.h>
64 #include <cmdline.h>
65 #include <comm.h>
66 #include <disk.h>
67 #include <fs.h>
68 #include <inffile.h>
69 #include <inifile.h>
70 #include <keycodes.h>
71 #include <linux.h>
72 #include <custom.h>
73 #include <miscboot.h>
74 #include <machine.h>
75 #include <mm.h>
76 #include <multiboot.h>
77 #include <options.h>
78 #include <oslist.h>
79 #include <ramdisk.h>
80 #include <ui.h>
81 #include <ver.h>
82 #include <video.h>
83
84 /* NTOS loader */
85 #include <winldr.h>
86 #include <conversion.h> // More-or-less related to MM also...
87
88 /* File system headers */
89 #include <fs/ext2.h>
90 #include <fs/fat.h>
91 #include <fs/ntfs.h>
92 #include <fs/iso.h>
93 #include <fs/pxe.h>
94 #include <fs/btrfs.h>
95
96 /* UI support */
97 #include <ui/gui.h>
98 #include <ui/minitui.h>
99 #include <ui/noui.h>
100 #include <ui/tui.h>
101
102 /* Arch specific includes */
103 #include <arch/archwsup.h>
104 #if defined(_M_IX86) || defined(_M_AMD64)
105 #include <arch/pc/hardware.h>
106 #include <arch/pc/pcbios.h>
107 #include <arch/pc/machpc.h>
108 #include <arch/pc/x86common.h>
109 #include <arch/pc/pxe.h>
110 #endif
111 #if defined(_M_IX86)
112 #include <arch/i386/i386.h>
113 #include <arch/i386/drivemap.h>
114 #include <arch/i386/machxbox.h>
115 #include <internal/i386/intrin_i.h>
116 #elif defined(_M_AMD64)
117 #include <arch/amd64/amd64.h>
118 #include <internal/amd64/intrin_i.h>
119 #elif defined(_M_PPC)
120 #include <arch/powerpc/hardware.h>
121 #elif defined(_M_ARM)
122 #include <arch/arm/hardware.h>
123 #elif defined(_M_MIPS)
124 #include <arch/mips/arcbios.h>
125 #endif
126
127 VOID __cdecl BootMain(IN PCCH CmdLine);
128 VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem);
129 VOID RunLoader(VOID);
130 VOID FrLdrCheckCpuCompatibility(VOID);
131
132 #endif /* __FREELDR_H */