ReactOS  0.4.14-dev-41-g31d7680
machine.h
Go to the documentation of this file.
1 /*
2  * FreeLoader
3  *
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.
8  *
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.
13  *
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.
17  */
18 
19 #pragma once
20 
21 #ifndef __DISK_H
22 #include "disk.h"
23 #endif
24 
25 #ifndef __MEMORY_H
26 #include "mm.h"
27 #endif
28 
29 #ifndef __FS_H
30 #include "fs.h"
31 #endif
32 
33 typedef enum tagVIDEODISPLAYMODE
34 {
38 
39 typedef struct tagMACHVTBL
40 {
41  VOID (*ConsPutChar)(int Ch);
44 
52  VOID (*VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y);
58  VOID (*Beep)(VOID);
60 
61  // NOTE: Not in the machine.c ...
62  FREELDR_MEMORY_DESCRIPTOR* (*GetMemoryDescriptor)(FREELDR_MEMORY_DESCRIPTOR* Current);
65 
68  BOOLEAN (*DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry);
70 
71  // NOTE: In the machine.c under the name of "ArcGetXXXTime"
72  TIMEINFO* (*GetTime)(VOID);
74 
75  // NOTE: Not in the machine.c ...
80 
81 extern MACHVTBL MachVtbl;
82 
83 /* NOTE: Implemented by each architecture */
84 VOID MachInit(const char *CmdLine);
85 
86 #define MachConsPutChar(Ch) \
87  MachVtbl.ConsPutChar(Ch)
88 #define MachConsKbHit() \
89  MachVtbl.ConsKbHit()
90 #define MachConsGetCh() \
91  MachVtbl.ConsGetCh()
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() \
117  MachVtbl.VideoSync()
118 #define MachBeep() \
119  MachVtbl.Beep()
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)
132 
133 #define MachInitializeBootDevices() \
134  MachVtbl.InitializeBootDevices()
135 
136 #define MachHwDetect() MachVtbl.HwDetect()
137 #define MachHwIdle() MachVtbl.HwIdle()
138 
139 /* ARC FUNCTIONS **************************************************************/
140 
143 
144 /* EOF */
ULONG ArcGetRelativeTime(VOID)
Definition: arcemul.c:33
Definition: bl.h:202
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:63
#define ExtendedBIOSDataSize
Definition: winldr.c:287
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:656
#define Y(I)
VOID(* GetExtendedBIOSData)(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
Definition: machine.h:64
VOID(* VideoClearScreen)(UCHAR Attr)
Definition: machine.h:45
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(VOID)
Definition: machine.h:77
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
Definition: bl.h:199
BOOL Init(PUSERCONNECT UserCon)
Definition: dllmain.c:385
#define Ch(x, y, z)
Definition: sha2.c:141
BOOLEAN(* VideoIsPaletteFixed)(VOID)
Definition: machine.h:54
UCHAR(* GetFloppyCount)(VOID)
Definition: machine.h:66
struct Color Color
ULONG(* GetRelativeTime)(VOID)
Definition: machine.h:73
Definition: fw.h:9
VOID(* VideoGetFontsFromFirmware)(PULONG RomFontPointers)
Definition: machine.h:49
unsigned char BOOLEAN
BOOLEAN(* DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry)
Definition: machine.h:68
VOID(* VideoSetTextCursorPosition)(UCHAR X, UCHAR Y)
Definition: machine.h:50
struct tagMACHVTBL * PMACHVTBL
enum tagVIDEODISPLAYMODE * PVIDEODISPLAYMODE
BOOLEAN(* InitializeBootDevices)(VOID)
Definition: machine.h:76
#define ExtendedBIOSDataArea
Definition: winldr.c:286
VOID(* VideoGetPaletteColor)(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: machine.h:56
uint64_t ULONGLONG
Definition: typedefs.h:65
BOOLEAN(* DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
Definition: machine.h:67
BOOLEAN(* ConsKbHit)(VOID)
Definition: machine.h:42
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:115
CHAR CmdLine[MAX_PATH]
Definition: mach.c:34
Definition: bl.h:200
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID(* VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: machine.h:52
VOID MachInit(const char *CmdLine)
Definition: archmach.c:22
TIMEINFO * ArcGetTime(VOID)
Definition: arcemul.c:27
#define VOID
Definition: acefi.h:82
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
VOID(* VideoSetPaletteColor)(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: machine.h:55
ULONG SectorCount
Definition: part_xbox.c:32
VOID(* PrepareForReactOS)(VOID)
Definition: machine.h:59
ULONG(* VideoGetBufferSize)(VOID)
Definition: machine.h:48
int(* ConsGetCh)(VOID)
Definition: machine.h:43
ULONG(* DiskGetCacheableBlockCount)(UCHAR DriveNumber)
Definition: machine.h:69
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
struct _CONFIGURATION_COMPONENT_DATA * PCONFIGURATION_COMPONENT_DATA
#define RomFontPointers
Definition: winldr.c:288
tagVIDEODISPLAYMODE
Definition: machine.h:33
struct tagMACHVTBL MACHVTBL
VOID(* HwIdle)(VOID)
Definition: machine.h:78
Definition: disk.h:24
unsigned int * PULONG
Definition: retypes.h:1
#define BOOLEAN
Definition: pedump.c:73
VOID(* VideoSync)(VOID)
Definition: machine.h:57
unsigned int ULONG
Definition: retypes.h:1
VOID(* VideoCopyOffScreenBufferToVRAM)(PVOID Buffer)
Definition: machine.h:53
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
MACHVTBL MachVtbl
Definition: arcemul.c:21
VOID(* Beep)(VOID)
Definition: machine.h:58
struct _FREELDR_MEMORY_DESCRIPTOR * PFREELDR_MEMORY_DESCRIPTOR
#define X(b, s)
VOID(* VideoHideShowTextCursor)(BOOLEAN Show)
Definition: machine.h:51
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31