ReactOS  0.4.13-dev-235-g7373cb3
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 
51  VOID (*VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y);
57  VOID (*Beep)(VOID);
59 
60  // NOTE: Not in the machine.c ...
61  FREELDR_MEMORY_DESCRIPTOR* (*GetMemoryDescriptor)(FREELDR_MEMORY_DESCRIPTOR* Current);
63 
66  BOOLEAN (*DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry);
68 
69  // NOTE: In the machine.c under the name of "ArcGetXXXTime"
70  TIMEINFO* (*GetTime)(VOID);
72 
73  // NOTE: Not in the machine.c ...
78 
79 extern MACHVTBL MachVtbl;
80 
81 /* NOTE: Implemented by each architecture */
82 VOID MachInit(const char *CmdLine);
83 
84 #define MachConsPutChar(Ch) \
85  MachVtbl.ConsPutChar(Ch)
86 #define MachConsKbHit() \
87  MachVtbl.ConsKbHit()
88 #define MachConsGetCh() \
89  MachVtbl.ConsGetCh()
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() \
113  MachVtbl.VideoSync()
114 #define MachBeep() \
115  MachVtbl.Beep()
116 #define MachPrepareForReactOS(Setup) \
117  MachVtbl.PrepareForReactOS(Setup)
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)
126 
127 #define MachInitializeBootDevices() \
128  MachVtbl.InitializeBootDevices()
129 
130 #define MachHwDetect() MachVtbl.HwDetect()
131 #define MachHwIdle() MachVtbl.HwIdle()
132 
133 /* ARC FUNCTIONS **************************************************************/
134 
137 
138 /* EOF */
signed char * PCHAR
Definition: retypes.h:7
ULONG ArcGetRelativeTime(VOID)
Definition: machine.c:33
Definition: bl.h:202
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:62
char CmdLine[0x100]
Definition: mach.c:35
#define IN
Definition: typedefs.h:38
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:656
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE ACPI_HANDLE ACPI_HANDLE *OutHandle ACPI_HANDLE *OutHandle void *Context void *Context ACPI_EVENT_HANDLER Handler UINT32 UINT32 ACPI_GPE_HANDLER void *Context UINT32 ACPI_NOTIFY_HANDLER void *Context ACPI_ADR_SPACE_TYPE ACPI_ADR_SPACE_HANDLER ACPI_ADR_SPACE_SETUP Setup
Definition: acpixf.h:816
#define Y(I)
VOID(* VideoClearScreen)(UCHAR Attr)
Definition: machine.h:45
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(VOID)
Definition: machine.h:75
BOOLEAN(* DiskGetBootPath)(PCHAR BootPath, ULONG Size)
Definition: machine.h:64
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
Definition: bl.h:199
BOOL Init(PUSERCONNECT UserCon)
Definition: dllmain.c:367
#define Ch(x, y, z)
Definition: sha2.c:141
BOOLEAN(* VideoIsPaletteFixed)(VOID)
Definition: machine.h:53
struct Color Color
ULONG(* GetRelativeTime)(VOID)
Definition: machine.h:71
Definition: fw.h:9
unsigned char BOOLEAN
BOOLEAN(* DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry)
Definition: machine.h:66
VOID(* VideoSetTextCursorPosition)(UCHAR X, UCHAR Y)
Definition: machine.h:49
struct tagMACHVTBL * PMACHVTBL
enum tagVIDEODISPLAYMODE * PVIDEODISPLAYMODE
BOOLEAN(* InitializeBootDevices)(VOID)
Definition: machine.h:74
VOID(* VideoGetPaletteColor)(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: machine.h:55
uint64_t ULONGLONG
Definition: typedefs.h:65
BOOLEAN(* DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
Definition: machine.h:65
BOOLEAN(* ConsKbHit)(VOID)
Definition: machine.h:42
static VIDEODISPLAYMODE DisplayMode
Definition: pcvideo.c:116
Definition: bl.h:200
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID(* VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: machine.h:51
VOID MachInit(const char *CmdLine)
Definition: archmach.c:22
TIMEINFO * ArcGetTime(VOID)
Definition: machine.c:27
#define VOID
Definition: acefi.h:82
enum tagVIDEODISPLAYMODE VIDEODISPLAYMODE
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
VOID(* VideoSetPaletteColor)(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: machine.h:54
ULONG SectorCount
Definition: part_xbox.c:32
ULONG(* VideoGetBufferSize)(VOID)
Definition: machine.h:48
int(* ConsGetCh)(VOID)
Definition: machine.h:43
ULONG(* DiskGetCacheableBlockCount)(UCHAR DriveNumber)
Definition: machine.h:67
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
struct _CONFIGURATION_COMPONENT_DATA * PCONFIGURATION_COMPONENT_DATA
tagVIDEODISPLAYMODE
Definition: machine.h:33
struct tagMACHVTBL MACHVTBL
VOID(* HwIdle)(VOID)
Definition: machine.h:76
Definition: disk.h:24
unsigned int * PULONG
Definition: retypes.h:1
#define BOOLEAN
Definition: pedump.c:73
VOID(* VideoSync)(VOID)
Definition: machine.h:56
unsigned int ULONG
Definition: retypes.h:1
VOID(* VideoCopyOffScreenBufferToVRAM)(PVOID Buffer)
Definition: machine.h:52
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
MACHVTBL MachVtbl
Definition: machine.c:21
VOID(* Beep)(VOID)
Definition: machine.h:57
struct _FREELDR_MEMORY_DESCRIPTOR * PFREELDR_MEMORY_DESCRIPTOR
#define X(b, s)
char BootPath[0x100]
Definition: mach.c:35
VOID(* VideoHideShowTextCursor)(BOOLEAN Show)
Definition: machine.h:50
VOID(* PrepareForReactOS)(IN BOOLEAN Setup)
Definition: machine.h:58
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31