[WINE]
[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 (*DiskReadLogicalSectors)(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
66 BOOLEAN (*DiskGetDriveGeometry)(ULONG DriveNumber, PGEOMETRY DriveGeometry);
67 ULONG (*DiskGetCacheableBlockCount)(ULONG DriveNumber);
68
69 TIMEINFO* (*GetTime)(VOID);
70 ULONG (*GetRelativeTime)(VOID);
71
72 PCONFIGURATION_COMPONENT_DATA (*HwDetect)(VOID);
73 } MACHVTBL, *PMACHVTBL;
74
75 VOID MachInit(const char *CmdLine);
76
77 extern MACHVTBL MachVtbl;
78
79 VOID MachConsPutChar(int Ch);
80 BOOLEAN MachConsKbHit();
81 int MachConsGetCh();
82 VOID MachVideoClearScreen(UCHAR Attr);
83 VIDEODISPLAYMODE MachVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init);
84 VOID MachVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth);
85 ULONG MachVideoGetBufferSize(VOID);
86 VOID MachVideoSetTextCursorPosition(ULONG X, ULONG Y);
87 VOID MachVideoHideShowTextCursor(BOOLEAN Show);
88 VOID MachVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y);
89 VOID MachVideoCopyOffScreenBufferToVRAM(PVOID Buffer);
90 BOOLEAN MachVideoIsPaletteFixed(VOID);
91 VOID MachVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue);
92 VOID MachVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue);
93 VOID MachVideoSync(VOID);
94 VOID MachBeep(VOID);
95 MEMORY_DESCRIPTOR* ArcGetMemoryDescriptor(MEMORY_DESCRIPTOR* Current);
96 BOOLEAN MachDiskGetBootPath(char *BootPath, unsigned Size);
97 BOOLEAN MachDiskNormalizeSystemPath(char *SystemPath, unsigned Size);
98 BOOLEAN MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer);
99 BOOLEAN MachDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry);
100 ULONG MachDiskGetCacheableBlockCount(ULONG DriveNumber);
101 VOID MachPrepareForReactOS(IN BOOLEAN Setup);
102
103 #define MachConsPutChar(Ch) MachVtbl.ConsPutChar(Ch)
104 #define MachConsKbHit() MachVtbl.ConsKbHit()
105 #define MachConsGetCh() MachVtbl.ConsGetCh()
106 #define MachVideoClearScreen(Attr) MachVtbl.VideoClearScreen(Attr)
107 #define MachVideoSetDisplayMode(Mode, Init) MachVtbl.VideoSetDisplayMode((Mode), (Init))
108 #define MachVideoGetDisplaySize(W, H, D) MachVtbl.VideoGetDisplaySize((W), (H), (D))
109 #define MachVideoGetBufferSize() MachVtbl.VideoGetBufferSize()
110 #define MachVideoSetTextCursorPosition(X, Y) MachVtbl.VideoSetTextCursorPosition((X), (Y))
111 #define MachVideoHideShowTextCursor(Show) MachVtbl.VideoHideShowTextCursor(Show)
112 #define MachVideoPutChar(Ch, Attr, X, Y) MachVtbl.VideoPutChar((Ch), (Attr), (X), (Y))
113 #define MachVideoCopyOffScreenBufferToVRAM(Buf) MachVtbl.VideoCopyOffScreenBufferToVRAM(Buf)
114 #define MachVideoIsPaletteFixed() MachVtbl.VideoIsPaletteFixed()
115 #define MachVideoSetPaletteColor(Col, R, G, B) MachVtbl.VideoSetPaletteColor((Col), (R), (G), (B))
116 #define MachVideoGetPaletteColor(Col, R, G, B) MachVtbl.VideoGetPaletteColor((Col), (R), (G), (B))
117 #define MachVideoSync() MachVtbl.VideoSync()
118 #define MachBeep() MachVtbl.Beep()
119 #define MachPrepareForReactOS(a) MachVtbl.PrepareForReactOS(a)
120 #define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size))
121 #define MachDiskNormalizeSystemPath(Path, Size) MachVtbl.DiskNormalizeSystemPath((Path), (Size))
122 #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
123 #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
124 #define MachDiskGetCacheableBlockCount(Drive) MachVtbl.DiskGetCacheableBlockCount(Drive)
125 #define MachHwDetect() MachVtbl.HwDetect()
126
127 /* EOF */