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