sync with trunk (r46275)
[reactos.git] / boot / freeldr / freeldr / include / machine.h
1 /* $Id$
2 *
3 * FreeLoader
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 #pragma once
21
22 #ifndef __DISK_H
23 #include "disk.h"
24 #endif
25
26 #ifndef __MEMORY_H
27 #include "mm.h"
28 #endif
29
30 #ifndef __FS_H
31 #include "fs.h"
32 #endif
33
34 typedef enum tagVIDEODISPLAYMODE
35 {
36 VideoTextMode,
37 VideoGraphicsMode
38 } VIDEODISPLAYMODE, *PVIDEODISPLAYMODE;
39
40 typedef struct tagMACHVTBL
41 {
42 VOID (*ConsPutChar)(int Ch);
43 BOOLEAN (*ConsKbHit)(VOID);
44 int (*ConsGetCh)(VOID);
45
46 VOID (*VideoClearScreen)(UCHAR Attr);
47 VIDEODISPLAYMODE (*VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init);
48 VOID (*VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth);
49 ULONG (*VideoGetBufferSize)(VOID);
50 VOID (*VideoSetTextCursorPosition)(ULONG X, ULONG Y);
51 VOID (*VideoHideShowTextCursor)(BOOLEAN Show);
52 VOID (*VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y);
53 VOID (*VideoCopyOffScreenBufferToVRAM)(PVOID Buffer);
54 BOOLEAN (*VideoIsPaletteFixed)(VOID);
55 VOID (*VideoSetPaletteColor)(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue);
56 VOID (*VideoGetPaletteColor)(UCHAR Color, UCHAR* Red, UCHAR* Green, UCHAR* Blue);
57 VOID (*VideoSync)(VOID);
58 VOID (*Beep)(VOID);
59 VOID (*PrepareForReactOS)(IN BOOLEAN Setup);
60
61 MEMORY_DESCRIPTOR* (*GetMemoryDescriptor)(MEMORY_DESCRIPTOR* Current);
62 ULONG (*GetMemoryMap)(PBIOS_MEMORY_MAP BiosMemoryMap, ULONG MaxMemoryMapSize);
63
64 BOOLEAN (*DiskGetBootPath)(char *BootPath, unsigned Size);
65 BOOLEAN (*DiskNormalizeSystemPath)(char *SystemPath, unsigned Size);
66 BOOLEAN (*DiskReadLogicalSectors)(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
67 BOOLEAN (*DiskGetDriveGeometry)(ULONG DriveNumber, PGEOMETRY DriveGeometry);
68 ULONG (*DiskGetCacheableBlockCount)(ULONG DriveNumber);
69
70 TIMEINFO* (*GetTime)(VOID);
71 ULONG (*GetRelativeTime)(VOID);
72
73 PCONFIGURATION_COMPONENT_DATA (*HwDetect)(VOID);
74 } MACHVTBL, *PMACHVTBL;
75
76 VOID MachInit(const char *CmdLine);
77
78 extern MACHVTBL MachVtbl;
79
80 VOID MachConsPutChar(int Ch);
81 BOOLEAN MachConsKbHit();
82 int MachConsGetCh();
83 VOID MachVideoClearScreen(UCHAR Attr);
84 VIDEODISPLAYMODE MachVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init);
85 VOID MachVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth);
86 ULONG MachVideoGetBufferSize(VOID);
87 VOID MachVideoSetTextCursorPosition(ULONG X, ULONG Y);
88 VOID MachVideoHideShowTextCursor(BOOLEAN Show);
89 VOID MachVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y);
90 VOID MachVideoCopyOffScreenBufferToVRAM(PVOID Buffer);
91 BOOLEAN MachVideoIsPaletteFixed(VOID);
92 VOID MachVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue);
93 VOID MachVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue);
94 VOID MachVideoSync(VOID);
95 VOID MachBeep(VOID);
96 MEMORY_DESCRIPTOR* ArcGetMemoryDescriptor(MEMORY_DESCRIPTOR* Current);
97 BOOLEAN MachDiskGetBootPath(char *BootPath, unsigned Size);
98 BOOLEAN MachDiskNormalizeSystemPath(char *SystemPath, unsigned Size);
99 BOOLEAN MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
100 BOOLEAN MachDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry);
101 ULONG MachDiskGetCacheableBlockCount(ULONG DriveNumber);
102 VOID MachPrepareForReactOS(IN BOOLEAN Setup);
103
104 #define MachConsPutChar(Ch) MachVtbl.ConsPutChar(Ch)
105 #define MachConsKbHit() MachVtbl.ConsKbHit()
106 #define MachConsGetCh() MachVtbl.ConsGetCh()
107 #define MachVideoClearScreen(Attr) MachVtbl.VideoClearScreen(Attr)
108 #define MachVideoSetDisplayMode(Mode, Init) MachVtbl.VideoSetDisplayMode((Mode), (Init))
109 #define MachVideoGetDisplaySize(W, H, D) MachVtbl.VideoGetDisplaySize((W), (H), (D))
110 #define MachVideoGetBufferSize() MachVtbl.VideoGetBufferSize()
111 #define MachVideoSetTextCursorPosition(X, Y) MachVtbl.VideoSetTextCursorPosition((X), (Y))
112 #define MachVideoHideShowTextCursor(Show) MachVtbl.VideoHideShowTextCursor(Show)
113 #define MachVideoPutChar(Ch, Attr, X, Y) MachVtbl.VideoPutChar((Ch), (Attr), (X), (Y))
114 #define MachVideoCopyOffScreenBufferToVRAM(Buf) MachVtbl.VideoCopyOffScreenBufferToVRAM(Buf)
115 #define MachVideoIsPaletteFixed() MachVtbl.VideoIsPaletteFixed()
116 #define MachVideoSetPaletteColor(Col, R, G, B) MachVtbl.VideoSetPaletteColor((Col), (R), (G), (B))
117 #define MachVideoGetPaletteColor(Col, R, G, B) MachVtbl.VideoGetPaletteColor((Col), (R), (G), (B))
118 #define MachVideoSync() MachVtbl.VideoSync()
119 #define MachBeep() MachVtbl.Beep()
120 #define MachPrepareForReactOS(a) MachVtbl.PrepareForReactOS(a)
121 #define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size))
122 #define MachDiskNormalizeSystemPath(Path, Size) MachVtbl.DiskNormalizeSystemPath((Path), (Size))
123 #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
124 #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
125 #define MachDiskGetCacheableBlockCount(Drive) MachVtbl.DiskGetCacheableBlockCount(Drive)
126 #define MachHwDetect() MachVtbl.HwDetect()
127
128 /* EOF */