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 (*VideoGetFontsFromFirmware
)(PULONG RomFontPointers
);
50 VOID (*VideoSetTextCursorPosition
)(UCHAR X
, UCHAR 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
);
59 VOID (*PrepareForReactOS
)(VOID
);
61 // NOTE: Not in the machine.c ...
62 FREELDR_MEMORY_DESCRIPTOR
* (*GetMemoryDescriptor
)(FREELDR_MEMORY_DESCRIPTOR
* Current
);
63 PFREELDR_MEMORY_DESCRIPTOR (*GetMemoryMap
)(PULONG MaxMemoryMapSize
);
64 VOID (*GetExtendedBIOSData
)(PULONG ExtendedBIOSDataArea
, PULONG ExtendedBIOSDataSize
);
66 UCHAR (*GetFloppyCount
)(VOID
);
67 BOOLEAN (*DiskReadLogicalSectors
)(UCHAR DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
68 BOOLEAN (*DiskGetDriveGeometry
)(UCHAR DriveNumber
, PGEOMETRY DriveGeometry
);
69 ULONG (*DiskGetCacheableBlockCount
)(UCHAR DriveNumber
);
71 // NOTE: In the machine.c under the name of "ArcGetXXXTime"
72 TIMEINFO
* (*GetTime
)(VOID
);
73 ULONG (*GetRelativeTime
)(VOID
);
75 // NOTE: Not in the machine.c ...
76 BOOLEAN (*InitializeBootDevices
)(VOID
);
77 PCONFIGURATION_COMPONENT_DATA (*HwDetect
)(VOID
);
79 } MACHVTBL
, *PMACHVTBL
;
81 extern MACHVTBL MachVtbl
;
83 /* NOTE: Implemented by each architecture */
84 VOID
MachInit(const char *CmdLine
);
86 #define MachConsPutChar(Ch) \
87 MachVtbl.ConsPutChar(Ch)
88 #define MachConsKbHit() \
90 #define MachConsGetCh() \
92 #define MachVideoClearScreen(Attr) \
93 MachVtbl.VideoClearScreen(Attr)
94 #define MachVideoSetDisplayMode(Mode, Init) \
95 MachVtbl.VideoSetDisplayMode((Mode), (Init))
96 #define MachVideoGetDisplaySize(W, H, D) \
97 MachVtbl.VideoGetDisplaySize((W), (H), (D))
98 #define MachVideoGetBufferSize() \
99 MachVtbl.VideoGetBufferSize()
100 #define MachVideoGetFontsFromFirmware(RomFontPointers) \
101 MachVtbl.VideoGetFontsFromFirmware((RomFontPointers))
102 #define MachVideoSetTextCursorPosition(X, Y) \
103 MachVtbl.VideoSetTextCursorPosition((X), (Y))
104 #define MachVideoHideShowTextCursor(Show) \
105 MachVtbl.VideoHideShowTextCursor(Show)
106 #define MachVideoPutChar(Ch, Attr, X, Y) \
107 MachVtbl.VideoPutChar((Ch), (Attr), (X), (Y))
108 #define MachVideoCopyOffScreenBufferToVRAM(Buf) \
109 MachVtbl.VideoCopyOffScreenBufferToVRAM(Buf)
110 #define MachVideoIsPaletteFixed() \
111 MachVtbl.VideoIsPaletteFixed()
112 #define MachVideoSetPaletteColor(Col, R, G, B) \
113 MachVtbl.VideoSetPaletteColor((Col), (R), (G), (B))
114 #define MachVideoGetPaletteColor(Col, R, G, B) \
115 MachVtbl.VideoGetPaletteColor((Col), (R), (G), (B))
116 #define MachVideoSync() \
120 #define MachPrepareForReactOS() \
121 MachVtbl.PrepareForReactOS()
122 #define MachGetExtendedBIOSData(ExtendedBIOSDataArea, ExtendedBIOSDataSize) \
123 MachVtbl.GetExtendedBIOSData((ExtendedBIOSDataArea), (ExtendedBIOSDataSize))
124 #define MachGetFloppyCount() \
125 MachVtbl.GetFloppyCount()
126 #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) \
127 MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
128 #define MachDiskGetDriveGeometry(Drive, Geom) \
129 MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
130 #define MachDiskGetCacheableBlockCount(Drive) \
131 MachVtbl.DiskGetCacheableBlockCount(Drive)
133 #define MachInitializeBootDevices() \
134 MachVtbl.InitializeBootDevices()
136 #define MachHwDetect() MachVtbl.HwDetect()
137 #define MachHwIdle() MachVtbl.HwIdle()
139 /* ARC FUNCTIONS **************************************************************/
141 TIMEINFO
* ArcGetTime(VOID
);
142 ULONG
ArcGetRelativeTime(VOID
);