[EXT2] Upgrade to 0.69
[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 #else
54 #include <ntsup.h>
55 #endif
56
57 /* Internal headers */
58 // #include <arcemul.h>
59 #include <arcname.h>
60 #include <bytesex.h>
61 #include <cache.h>
62 #include <cmdline.h>
63 #include <comm.h>
64 #include <disk.h>
65 #include <fs.h>
66 #include <inffile.h>
67 #include <inifile.h>
68 #include <keycodes.h>
69 #include <linux.h>
70 #include <custom.h>
71 #include <miscboot.h>
72 #include <machine.h>
73 #include <mm.h>
74 #include <multiboot.h>
75 #include <options.h>
76 #include <oslist.h>
77 #include <ramdisk.h>
78 #include <ui.h>
79 #include <ver.h>
80 #include <video.h>
81
82 /* NTOS loader */
83 #include <winldr.h>
84 #include <conversion.h> // More-or-less related to MM also...
85
86 /* File system headers */
87 #include <fs/ext2.h>
88 #include <fs/fat.h>
89 #include <fs/ntfs.h>
90 #include <fs/iso.h>
91 #include <fs/pxe.h>
92
93 /* UI support */
94 #include <ui/gui.h>
95 #include <ui/minitui.h>
96 #include <ui/noui.h>
97 #include <ui/tui.h>
98
99 /* Arch specific includes */
100 #include <arch/archwsup.h>
101 #if defined(_M_IX86) || defined(_M_AMD64)
102 #include <arch/pc/hardware.h>
103 #include <arch/pc/pcbios.h>
104 #include <arch/pc/machpc.h>
105 #include <arch/pc/x86common.h>
106 #include <arch/pc/pxe.h>
107 #include <arch/i386/drivemap.h>
108 #endif
109 #if defined(_M_IX86)
110 #include <arch/i386/i386.h>
111 #include <arch/i386/machxbox.h>
112 #include <internal/i386/intrin_i.h>
113 #elif defined(_M_AMD64)
114 #include <arch/amd64/amd64.h>
115 #include <internal/amd64/intrin_i.h>
116 #elif defined(_M_PPC)
117 #include <arch/powerpc/hardware.h>
118 #elif defined(_M_ARM)
119 #include <arch/arm/hardware.h>
120 #elif defined(_M_MIPS)
121 #include <arch/mips/arcbios.h>
122 #endif
123
124 VOID __cdecl BootMain(IN PCCH CmdLine);
125 VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem);
126 VOID RunLoader(VOID);
127 VOID FrLdrCheckCpuCompatibility(VOID);
128
129 #endif /* __FREELDR_H */