4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 typedef enum tagVIDEODISPLAYMODE
37 } VIDEODISPLAYMODE
, *PVIDEODISPLAYMODE
;
39 typedef struct tagMACHVTBL
41 VOID (*ConsPutChar
)(int Ch
);
42 BOOLEAN (*ConsKbHit
)(VOID
);
43 int (*ConsGetCh
)(VOID
);
45 VOID (*VideoClearScreen
)(UCHAR Attr
);
46 VIDEODISPLAYMODE (*VideoSetDisplayMode
)(char *DisplayMode
, BOOLEAN Init
);
47 VOID (*VideoGetDisplaySize
)(PULONG Width
, PULONG Height
, PULONG Depth
);
48 ULONG (*VideoGetBufferSize
)(VOID
);
49 VOID (*VideoSetTextCursorPosition
)(UCHAR X
, UCHAR Y
);
50 VOID (*VideoHideShowTextCursor
)(BOOLEAN Show
);
51 VOID (*VideoPutChar
)(int Ch
, UCHAR Attr
, unsigned X
, unsigned Y
);
52 VOID (*VideoCopyOffScreenBufferToVRAM
)(PVOID Buffer
);
53 BOOLEAN (*VideoIsPaletteFixed
)(VOID
);
54 VOID (*VideoSetPaletteColor
)(UCHAR Color
, UCHAR Red
, UCHAR Green
, UCHAR Blue
);
55 VOID (*VideoGetPaletteColor
)(UCHAR Color
, UCHAR
* Red
, UCHAR
* Green
, UCHAR
* Blue
);
56 VOID (*VideoSync
)(VOID
);
58 VOID (*PrepareForReactOS
)(VOID
);
60 // NOTE: Not in the machine.c ...
61 FREELDR_MEMORY_DESCRIPTOR
* (*GetMemoryDescriptor
)(FREELDR_MEMORY_DESCRIPTOR
* Current
);
62 PFREELDR_MEMORY_DESCRIPTOR (*GetMemoryMap
)(PULONG MaxMemoryMapSize
);
64 BOOLEAN (*DiskGetBootPath
)(PCHAR BootPath
, ULONG Size
);
65 BOOLEAN (*DiskReadLogicalSectors
)(UCHAR DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
66 BOOLEAN (*DiskGetDriveGeometry
)(UCHAR DriveNumber
, PGEOMETRY DriveGeometry
);
67 ULONG (*DiskGetCacheableBlockCount
)(UCHAR DriveNumber
);
69 // NOTE: In the machine.c under the name of "ArcGetXXXTime"
70 TIMEINFO
* (*GetTime
)(VOID
);
71 ULONG (*GetRelativeTime
)(VOID
);
73 // NOTE: Not in the machine.c ...
74 BOOLEAN (*InitializeBootDevices
)(VOID
);
75 PCONFIGURATION_COMPONENT_DATA (*HwDetect
)(VOID
);
77 } MACHVTBL
, *PMACHVTBL
;
79 extern MACHVTBL MachVtbl
;
81 /* NOTE: Implemented by each architecture */
82 VOID
MachInit(const char *CmdLine
);
84 #define MachConsPutChar(Ch) \
85 MachVtbl.ConsPutChar(Ch)
86 #define MachConsKbHit() \
88 #define MachConsGetCh() \
90 #define MachVideoClearScreen(Attr) \
91 MachVtbl.VideoClearScreen(Attr)
92 #define MachVideoSetDisplayMode(Mode, Init) \
93 MachVtbl.VideoSetDisplayMode((Mode), (Init))
94 #define MachVideoGetDisplaySize(W, H, D) \
95 MachVtbl.VideoGetDisplaySize((W), (H), (D))
96 #define MachVideoGetBufferSize() \
97 MachVtbl.VideoGetBufferSize()
98 #define MachVideoSetTextCursorPosition(X, Y) \
99 MachVtbl.VideoSetTextCursorPosition((X), (Y))
100 #define MachVideoHideShowTextCursor(Show) \
101 MachVtbl.VideoHideShowTextCursor(Show)
102 #define MachVideoPutChar(Ch, Attr, X, Y) \
103 MachVtbl.VideoPutChar((Ch), (Attr), (X), (Y))
104 #define MachVideoCopyOffScreenBufferToVRAM(Buf) \
105 MachVtbl.VideoCopyOffScreenBufferToVRAM(Buf)
106 #define MachVideoIsPaletteFixed() \
107 MachVtbl.VideoIsPaletteFixed()
108 #define MachVideoSetPaletteColor(Col, R, G, B) \
109 MachVtbl.VideoSetPaletteColor((Col), (R), (G), (B))
110 #define MachVideoGetPaletteColor(Col, R, G, B) \
111 MachVtbl.VideoGetPaletteColor((Col), (R), (G), (B))
112 #define MachVideoSync() \
116 #define MachPrepareForReactOS() \
117 MachVtbl.PrepareForReactOS()
118 #define MachDiskGetBootPath(Path, Size) \
119 MachVtbl.DiskGetBootPath((Path), (Size))
120 #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) \
121 MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
122 #define MachDiskGetDriveGeometry(Drive, Geom) \
123 MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
124 #define MachDiskGetCacheableBlockCount(Drive) \
125 MachVtbl.DiskGetCacheableBlockCount(Drive)
127 #define MachInitializeBootDevices() \
128 MachVtbl.InitializeBootDevices()
130 #define MachHwDetect() MachVtbl.HwDetect()
131 #define MachHwIdle() MachVtbl.HwIdle()
133 /* ARC FUNCTIONS **************************************************************/
135 TIMEINFO
* ArcGetTime(VOID
);
136 ULONG
ArcGetRelativeTime(VOID
);