-
Notifications
You must be signed in to change notification settings - Fork 0
/
EFICon.cs
107 lines (96 loc) · 3.36 KB
/
EFICon.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential)]
public struct SimpleTextOutputMode
{
public int MaxMode;
// current settings
public int Mode;
public int Attribute;
public int CursorColumn;
public int CursorRow;
public bool CursorVisible;
}
[StructLayout(LayoutKind.Sequential)]
public readonly unsafe struct SimpleTextOutputInterface
{
public readonly delegate* unmanaged<SimpleTextOutputInterface*, bool, EfiStatus> Reset;
public readonly delegate* unmanaged<SimpleTextOutputInterface*, char*, EfiStatus> OutputString;
public readonly delegate* unmanaged<SimpleTextOutputInterface*, bool, EfiStatus> TestString;
public readonly delegate* unmanaged<SimpleTextOutputInterface*, ulong, ulong*, ulong*, EfiStatus> QueryMode;
public readonly delegate* unmanaged<SimpleTextOutputInterface*, ulong, EfiStatus> SetMode;
public readonly delegate* unmanaged<SimpleTextOutputInterface*, EfiTextAttribute, EfiStatus> SetAttribute;
public readonly delegate* unmanaged<SimpleTextOutputInterface*, EfiStatus> ClearScreen;
public readonly delegate* unmanaged<SimpleTextOutputInterface*, ulong, ulong, EfiStatus> SetCursorPosition;
public readonly delegate* unmanaged<SimpleTextOutputInterface*, bool, EfiStatus> EnableCursor;
public readonly SimpleTextOutputMode* Mode;
}
[Flags]
public enum EfiTextAttribute : ulong
{
EfiBlack = 0x00,
EfiBlue = 0x01,
EfiGreen = 0x02,
EfiCyan = EfiBlue | EfiGreen,
EfiRed = 0x04,
EfiMagenta = EfiBlue | EfiRed,
EfiBrown = EfiGreen | EfiRed,
EfiLightgray = EfiBlue | EfiGreen | EfiRed,
EfiBright = 0x08,
EfiDarkgray = EfiBright,
EfiLightblue = EfiBlue | EfiBright,
EfiLightgreen = EfiGreen | EfiBright,
EfiLightcyan = EfiCyan | EfiBright,
EfiLightred = EfiRed | EfiBright,
EfiLightmagenta = EfiMagenta | EfiBright,
EfiYellow = EfiBrown | EfiBright,
EfiWhite = EfiBlue | EfiGreen | EfiRed | EfiBright,
EfiBackgroundBlack = 0x00,
EfiBackgroundBlue = 0x10,
EfiBackgroundGreen = 0x20,
EfiBackgroundCyan = EfiBackgroundBlue | EfiBackgroundGreen,
EfiBackgroundRed = 0x40,
EfiBackgroundMagenta = EfiBackgroundBlue | EfiBackgroundRed,
EfiBackgroundBrown = EfiBackgroundGreen | EfiBackgroundRed,
EfiBackgroundLightgray = EfiBackgroundBlue | EfiBackgroundGreen | EfiBackgroundRed
}
public enum EfiScanCode : ushort
{
ScanNull = 0x0000,
ScanUp = 0x0001,
ScanDown = 0x0002,
ScanRight = 0x0003,
ScanLeft = 0x0004,
ScanHome = 0x0005,
ScanEnd = 0x0006,
ScanInsert = 0x0007,
ScanDelete = 0x0008,
ScanPageUp = 0x0009,
ScanPageDown = 0x000A,
ScanF1 = 0x000B,
ScanF2 = 0x000C,
ScanF3 = 0x000D,
ScanF4 = 0x000E,
ScanF5 = 0x000F,
ScanF6 = 0x0010,
ScanF7 = 0x0011,
ScanF8 = 0x0012,
ScanF9 = 0x0013,
ScanF10 = 0x0014,
ScanF11 = 0x0015,
ScanF12 = 0x0016,
ScanEsc = 0x0017
}
[StructLayout(LayoutKind.Sequential)]
internal struct EFI_INPUT_KEY
{
public EfiScanCode ScanCode;
public char UnicodeChar;
}
[StructLayout(LayoutKind.Sequential)]
public unsafe struct SIMPLE_INPUT_INTERFACE
{
public readonly delegate* unmanaged<SIMPLE_INPUT_INTERFACE*, bool, EfiStatus> Reset;
public readonly delegate* unmanaged<SIMPLE_INPUT_INTERFACE*, EFI_INPUT_KEY*, EfiStatus> ReadKeyStroke;
public readonly EfiEvent WaitForKey;
}