ReactOS 0.4.16-dev-197-g92996da
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
34{
38
39typedef struct tagMACHVTBL
40{
44
52 VOID (*VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y);
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
81extern MACHVTBL MachVtbl;
82
83/* NOTE: Implemented by each architecture */
84VOID 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(Options) \
137 MachVtbl.HwDetect(Options)
138
139#define MachHwIdle() \
140 MachVtbl.HwIdle()
141
142/* ARC FUNCTIONS **************************************************************/
143
146
147/* EOF */
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
#define RomFontPointers
Definition: winldr.c:348
#define ExtendedBIOSDataArea
Definition: winldr.c:346
#define ExtendedBIOSDataSize
Definition: winldr.c:347
@ Green
Definition: bl.h:199
@ Red
Definition: bl.h:201
@ Blue
Definition: bl.h:198
tagVIDEODISPLAYMODE
Definition: machine.h:34
@ VideoTextMode
Definition: machine.h:35
@ VideoGraphicsMode
Definition: machine.h:36
MACHVTBL MachVtbl
Definition: arcemul.c:21
VOID MachInit(const char *CmdLine)
Definition: machpc.c:1761
struct tagMACHVTBL * PMACHVTBL
ULONG ArcGetRelativeTime(VOID)
Definition: arcemul.c:33
enum tagVIDEODISPLAYMODE * PVIDEODISPLAYMODE
TIMEINFO * ArcGetTime(VOID)
Definition: arcemul.c:27
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
struct tagMACHVTBL MACHVTBL
struct _FREELDR_MEMORY_DESCRIPTOR * PFREELDR_MEMORY_DESCRIPTOR
Definition: bufpool.h:45
#define Y(I)
static const WCHAR CmdLine[]
Definition: install.c:48
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define X(b, s)
#define _In_opt_
Definition: ms_sal.h:309
ULONG SectorCount
Definition: part_xbox.c:31
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:117
#define BOOLEAN
Definition: pedump.c:73
struct _CONFIGURATION_COMPONENT_DATA * PCONFIGURATION_COMPONENT_DATA
#define Ch(x, y, z)
Definition: sha2.c:141
Definition: disk.h:26
Definition: fw.h:10
VOID(* VideoGetPaletteColor)(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: machine.h:56
VOID(* GetExtendedBIOSData)(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
Definition: machine.h:64
int(* ConsGetCh)(VOID)
Definition: machine.h:43
VOID(* PrepareForReactOS)(VOID)
Definition: machine.h:59
VOID(* VideoSetPaletteColor)(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: machine.h:55
BOOLEAN(* InitializeBootDevices)(VOID)
Definition: machine.h:76
VOID(* VideoCopyOffScreenBufferToVRAM)(PVOID Buffer)
Definition: machine.h:53
BOOLEAN(* ConsKbHit)(VOID)
Definition: machine.h:42
VOID(* VideoHideShowTextCursor)(BOOLEAN Show)
Definition: machine.h:51
UCHAR(* GetFloppyCount)(VOID)
Definition: machine.h:66
BOOLEAN(* DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry)
Definition: machine.h:68
BOOLEAN(* DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
Definition: machine.h:67
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:63
VOID(* VideoGetFontsFromFirmware)(PULONG RomFontPointers)
Definition: machine.h:49
VOID(* Beep)(VOID)
Definition: machine.h:58
VOID(* VideoSetTextCursorPosition)(UCHAR X, UCHAR Y)
Definition: machine.h:50
ULONG(* VideoGetBufferSize)(VOID)
Definition: machine.h:48
VOID(* VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: machine.h:52
ULONG(* DiskGetCacheableBlockCount)(UCHAR DriveNumber)
Definition: machine.h:69
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
ULONG(* GetRelativeTime)(VOID)
Definition: machine.h:73
VOID(* VideoClearScreen)(UCHAR Attr)
Definition: machine.h:45
VOID(* HwIdle)(VOID)
Definition: machine.h:78
VOID(* VideoSync)(VOID)
Definition: machine.h:57
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
BOOLEAN(* VideoIsPaletteFixed)(VOID)
Definition: machine.h:54
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(_In_opt_ PCSTR Options)
Definition: machine.h:77
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
uint32_t * PULONG
Definition: typedefs.h:59
const char * PCSTR
Definition: typedefs.h:52
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3534
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819
unsigned char UCHAR
Definition: xmlstorage.h:181