TianoCore EDK2 master
Loading...
Searching...
No Matches
Gasket.h
Go to the documentation of this file.
1
10#ifndef _GASKET_H_
11#define _GASKET_H_
12
13//
14// EMU_THUNK_PROTOCOL gaskets (EFIAPI to UNIX ABI)
15//
16
18EFIAPI
19GasketSecWriteStdErr (
20 IN UINT8 *Buffer,
21 IN UINTN NumberOfBytes
22 );
23
25EFIAPI
26GasketSecConfigStdIn (
27 VOID
28 );
29
31EFIAPI
32GasketSecWriteStdOut (
33 IN UINT8 *Buffer,
34 IN UINTN NumberOfBytes
35 );
36
38EFIAPI
39GasketSecReadStdIn (
40 IN UINT8 *Buffer,
41 IN UINTN NumberOfBytes
42 );
43
44BOOLEAN
45EFIAPI
46GasketSecPollStdIn (
47 VOID
48 );
49
50VOID *
51EFIAPI
52GasketSecMalloc (
53 IN UINTN Size
54 );
55
56VOID *
57EFIAPI
58GasketSecValloc (
59 IN UINTN Size
60 );
61
62BOOLEAN
63EFIAPI
64GasketSecFree (
65 IN VOID *Ptr
66 );
67
68RETURN_STATUS
69EFIAPI
70GasketSecPeCoffGetEntryPoint (
71 IN VOID *Pe32Data,
72 IN OUT VOID **EntryPoint
73 );
74
75VOID
76EFIAPI
77GasketSecPeCoffRelocateImageExtraAction (
79 );
80
81VOID
82EFIAPI
83GasketSecPeCoffUnloadImageExtraAction (
85 );
86
87VOID
88EFIAPI
89GasketSecSetTimer (
90 IN UINT64 PeriodMs,
91 IN EMU_SET_TIMER_CALLBACK CallBack
92 );
93
94VOID
95EFIAPI
96GasketSecEnableInterrupt (
97 VOID
98 );
99
100VOID
101EFIAPI
102GasketSecDisableInterrupt (
103 VOID
104 );
105
106UINT64
107EFIAPI
108GasketQueryPerformanceFrequency (
109 VOID
110 );
111
112UINT64
113EFIAPI
114GasketQueryPerformanceCounter (
115 VOID
116 );
117
118VOID
119EFIAPI
120GasketSecSleep (
121 IN UINT64 Nanoseconds
122 );
123
124VOID
125EFIAPI
126GasketSecCpuSleep (
127 VOID
128 );
129
130VOID
131EFIAPI
132GasketSecExit (
133 UINTN Status
134 );
135
136VOID
137EFIAPI
138GasketSecGetTime (
139 OUT EFI_TIME *Time,
140 OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL
141 );
142
144EFIAPI
145GasketSecSetTime (
146 IN EFI_TIME *Time
147 );
148
150EFIAPI
151GasketSecGetNextProtocol (
152 IN BOOLEAN EmuBusDriver,
153 OUT EMU_IO_THUNK_PROTOCOL **Instance OPTIONAL
154 );
155
156// PPIs produced by SEC
157
159EFIAPI
160GasketSecUnixPeiAutoScan (
161 IN UINTN Index,
162 OUT EFI_PHYSICAL_ADDRESS *MemoryBase,
163 OUT UINT64 *MemorySize
164 );
165
166VOID *
167EFIAPI
168GasketSecEmuThunkAddress (
169 VOID
170 );
171
173EFIAPI
174GasketSecUnixUnixFwhAddress (
175 IN OUT UINT64 *FwhSize,
177 );
178
179//
180// Reverse (UNIX to EFIAPI) gaskets
181//
182
183typedef
184void
185(EFIAPI *CALL_BACK)(
186 UINT64 Delta
187 );
188
189UINTN
190ReverseGasketUint64 (
191 UINTN CallBack,
192 UINT64 a
193 );
194
195UINTN
196ReverseGasketUint64Uint64 (
197 VOID *CallBack,
198 VOID *Context,
199 VOID *Key
200 );
201
202//
203// Gasket functions for EFI_EMU_UGA_IO_PROTOCOL
204//
205
207EFIAPI
208GasketX11Size (
209 EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindowsIo,
210 UINT32 Width,
211 UINT32 Height
212 );
213
215EFIAPI
216GasketX11CheckKey (
217 EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindowsIo
218 );
219
221EFIAPI
222GasketX11GetKey (
223 EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindowsIo,
224 EFI_KEY_DATA *key
225 );
226
228EFIAPI
229GasketX11KeySetState (
230 EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindowsIo,
231 EFI_KEY_TOGGLE_STATE *KeyToggleState
232 );
233
235EFIAPI
236GasketX11RegisterKeyNotify (
237 IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindowsIo,
238 IN EMU_GRAPHICS_WINDOW_REGISTER_KEY_NOTIFY_CALLBACK MakeCallBack,
239 IN EMU_GRAPHICS_WINDOW_REGISTER_KEY_NOTIFY_CALLBACK BreakCallBack,
240 IN VOID *Context
241 );
242
244EFIAPI
245GasketX11Blt (
246 IN EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindows,
247 IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
248 IN EFI_UGA_BLT_OPERATION BltOperation,
250 );
251
253EFIAPI
254GasketX11CheckPointer (
255 EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindowsIo
256 );
257
259EFIAPI
260GasketX11GetPointerState (
261 EMU_GRAPHICS_WINDOW_PROTOCOL *GraphicsWindowsIo,
263 );
264
266EFIAPI
267GasketX11GraphicsWindowOpen (
269 );
270
272EFIAPI
273GasketX11GraphicsWindowClose (
275 );
276
277// Pthreads
278
279UINTN
280EFIAPI
281GasketPthreadMutexLock (
282 IN VOID *Mutex
283 );
284
285UINTN
286EFIAPI
287GasketPthreadMutexUnLock (
288 IN VOID *Mutex
289 );
290
291UINTN
292EFIAPI
293GasketPthreadMutexTryLock (
294 IN VOID *Mutex
295 );
296
297VOID *
298EFIAPI
299GasketPthreadMutexInit (
300 IN VOID
301 );
302
303UINTN
304EFIAPI
305GasketPthreadMutexDestroy (
306 IN VOID *Mutex
307 );
308
309UINTN
310EFIAPI
311GasketPthreadCreate (
312 IN VOID *Thread,
313 IN VOID *Attribute,
314 IN THREAD_THUNK_THREAD_ENTRY Start,
315 IN VOID *Context
316 );
317
318VOID
319EFIAPI
320GasketPthreadExit (
321 IN VOID *ValuePtr
322 );
323
324UINTN
325EFIAPI
326GasketPthreadSelf (
327 VOID
328 );
329
331EFIAPI
332GasketPthreadOpen (
334 );
335
337EFIAPI
338GasketPthreadClose (
340 );
341
342// PosixFileSystem
343
345EFIAPI
346GasketPosixOpenVolume (
349 );
350
352EFIAPI
353GasketPosixFileOpen (
354 IN EFI_FILE_PROTOCOL *This,
355 OUT EFI_FILE_PROTOCOL **NewHandle,
356 IN CHAR16 *FileName,
357 IN UINT64 OpenMode,
358 IN UINT64 Attributes
359 );
360
362EFIAPI
363GasketPosixFileCLose (
365 );
366
368EFIAPI
369GasketPosixFileDelete (
371 );
372
374EFIAPI
375GasketPosixFileRead (
376 IN EFI_FILE_PROTOCOL *This,
377 IN OUT UINTN *BufferSize,
378 OUT VOID *Buffer
379 );
380
382EFIAPI
383GasketPosixFileWrite (
384 IN EFI_FILE_PROTOCOL *This,
385 IN OUT UINTN *BufferSize,
386 IN VOID *Buffer
387 );
388
390EFIAPI
391GasketPosixFileSetPossition (
392 IN EFI_FILE_PROTOCOL *This,
393 IN UINT64 Position
394 );
395
397EFIAPI
398GasketPosixFileGetPossition (
399 IN EFI_FILE_PROTOCOL *This,
400 OUT UINT64 *Position
401 );
402
404EFIAPI
405GasketPosixFileGetInfo (
406 IN EFI_FILE_PROTOCOL *This,
407 IN EFI_GUID *InformationType,
408 IN OUT UINTN *BufferSize,
409 OUT VOID *Buffer
410 );
411
413EFIAPI
414GasketPosixFileSetInfo (
415 IN EFI_FILE_PROTOCOL *This,
416 IN EFI_GUID *InformationType,
417 IN UINTN BufferSize,
418 IN VOID *Buffer
419 );
420
422EFIAPI
423GasketPosixFileFlush (
425 );
426
428EFIAPI
429GasketPosixFileSystmeThunkOpen (
431 );
432
434EFIAPI
435GasketPosixFileSystmeThunkClose (
437 );
438
440EFIAPI
441GasketEmuBlockIoReset (
443 IN BOOLEAN ExtendedVerification
444 );
445
447EFIAPI
448GasketEmuBlockIoReadBlocks (
450 IN UINT32 MediaId,
451 IN EFI_LBA LBA,
453 IN UINTN BufferSize,
454 OUT VOID *Buffer
455 );
456
458EFIAPI
459GasketEmuBlockIoWriteBlocks (
461 IN UINT32 MediaId,
462 IN EFI_LBA LBA,
464 IN UINTN BufferSize,
465 IN VOID *Buffer
466 );
467
469EFIAPI
470GasketEmuBlockIoFlushBlocks (
473 );
474
476EFIAPI
477GasketEmuBlockIoCreateMapping (
480 );
481
483EFIAPI
484GasketBlockIoThunkOpen (
486 );
487
489EFIAPI
490GasketBlockIoThunkClose (
492 );
493
495EFIAPI
496GasketSnpThunkOpen (
498 );
499
501EFIAPI
502GasketSnpThunkClose (
504 );
505
507EFIAPI
508GasketSnpCreateMapping (
509 IN EMU_SNP_PROTOCOL *This,
511 );
512
514EFIAPI
515GasketSnpStart (
516 IN EMU_SNP_PROTOCOL *This
517 );
518
520EFIAPI
521GasketSnpStop (
522 IN EMU_SNP_PROTOCOL *This
523 );
524
526EFIAPI
527GasketSnpInitialize (
528 IN EMU_SNP_PROTOCOL *This,
529 IN UINTN ExtraRxBufferSize OPTIONAL,
530 IN UINTN ExtraTxBufferSize OPTIONAL
531 );
532
534EFIAPI
535GasketSnpReset (
536 IN EMU_SNP_PROTOCOL *This,
537 IN BOOLEAN ExtendedVerification
538 );
539
541EFIAPI
542GasketSnpShutdown (
543 IN EMU_SNP_PROTOCOL *This
544 );
545
547EFIAPI
548GasketSnpReceiveFilters (
549 IN EMU_SNP_PROTOCOL *This,
550 IN UINT32 Enable,
551 IN UINT32 Disable,
552 IN BOOLEAN ResetMCastFilter,
553 IN UINTN MCastFilterCnt OPTIONAL,
554 IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL
555 );
556
558EFIAPI
559GasketSnpStationAddress (
560 IN EMU_SNP_PROTOCOL *This,
561 IN BOOLEAN Reset,
562 IN EFI_MAC_ADDRESS *New OPTIONAL
563 );
564
566EFIAPI
567GasketSnpStatistics (
568 IN EMU_SNP_PROTOCOL *This,
569 IN BOOLEAN Reset,
570 IN OUT UINTN *StatisticsSize OPTIONAL,
571 OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
572 );
573
575EFIAPI
576GasketSnpMCastIpToMac (
577 IN EMU_SNP_PROTOCOL *This,
578 IN BOOLEAN IPv6,
579 IN EFI_IP_ADDRESS *IP,
581 );
582
584EFIAPI
585GasketSnpNvData (
586 IN EMU_SNP_PROTOCOL *This,
587 IN BOOLEAN ReadWrite,
588 IN UINTN Offset,
589 IN UINTN BufferSize,
590 IN OUT VOID *Buffer
591 );
592
594EFIAPI
595GasketSnpGetStatus (
596 IN EMU_SNP_PROTOCOL *This,
597 OUT UINT32 *InterruptStatus OPTIONAL,
598 OUT VOID **TxBuf OPTIONAL
599 );
600
602EFIAPI
603GasketSnpTransmit (
604 IN EMU_SNP_PROTOCOL *This,
605 IN UINTN HeaderSize,
606 IN UINTN BufferSize,
607 IN VOID *Buffer,
608 IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
609 IN EFI_MAC_ADDRESS *DestAddr OPTIONAL,
610 IN UINT16 *Protocol OPTIONAL
611 );
612
614EFIAPI
615GasketSnpReceive (
616 IN EMU_SNP_PROTOCOL *This,
617 OUT UINTN *HeaderSize OPTIONAL,
618 IN OUT UINTN *BufferSize,
619 OUT VOID *Buffer,
620 OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL,
621 OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL,
622 OUT UINT16 *Protocol OPTIONAL
623 );
624
625#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT8 EFI_KEY_TOGGLE_STATE
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
UINT64 EFI_LBA
Definition: UefiBaseType.h:45
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_UGA_BLT_OPERATION
Definition: UgaDraw.h:83
Definition: Base.h:213