xref: /netbsd-src/sys/external/bsd/gnu-efi/dist/inc/efiprot.h (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1 /*	$NetBSD: efiprot.h,v 1.1.1.1 2014/04/01 16:16:07 jakllsch Exp $	*/
2 
3 #ifndef _EFI_PROT_H
4 #define _EFI_PROT_H
5 
6 /*++
7 
8 Copyright (c) 1998  Intel Corporation
9 
10 Module Name:
11 
12     efiprot.h
13 
14 Abstract:
15 
16     EFI Protocols
17 
18 
19 
20 Revision History
21 
22 --*/
23 
24 //
25 //  FPSWA library protocol
26 //
27 #define FPSWA_PROTOCOL          \
28     { 0xc41b6531, 0x97b9, 0x11d3, {0x9a, 0x29, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
29 
30 //
31 // Device Path protocol
32 //
33 
34 #define DEVICE_PATH_PROTOCOL    \
35     { 0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
36 
37 
38 //
39 // Block IO protocol
40 //
41 
42 #define BLOCK_IO_PROTOCOL \
43     { 0x964e5b21, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
44 #define EFI_BLOCK_IO_INTERFACE_REVISION   0x00010000
45 #define EFI_BLOCK_IO_INTERFACE_REVISION2  0x00020001
46 #define EFI_BLOCK_IO_INTERFACE_REVISION3  ((2<<16) | 31)
47 
48 INTERFACE_DECL(_EFI_BLOCK_IO);
49 
50 typedef
51 EFI_STATUS
52 (EFIAPI *EFI_BLOCK_RESET) (
53     IN struct _EFI_BLOCK_IO     *This,
54     IN BOOLEAN                  ExtendedVerification
55     );
56 
57 typedef
58 EFI_STATUS
59 (EFIAPI *EFI_BLOCK_READ) (
60     IN struct _EFI_BLOCK_IO     *This,
61     IN UINT32                   MediaId,
62     IN EFI_LBA                  LBA,
63     IN UINTN                    BufferSize,
64     OUT VOID                    *Buffer
65     );
66 
67 
68 typedef
69 EFI_STATUS
70 (EFIAPI *EFI_BLOCK_WRITE) (
71     IN struct _EFI_BLOCK_IO     *This,
72     IN UINT32                   MediaId,
73     IN EFI_LBA                  LBA,
74     IN UINTN                    BufferSize,
75     IN VOID                     *Buffer
76     );
77 
78 
79 typedef
80 EFI_STATUS
81 (EFIAPI *EFI_BLOCK_FLUSH) (
82     IN struct _EFI_BLOCK_IO     *This
83     );
84 
85 
86 
87 typedef struct {
88     UINT32              MediaId;
89     BOOLEAN             RemovableMedia;
90     BOOLEAN             MediaPresent;
91 
92     BOOLEAN             LogicalPartition;
93     BOOLEAN             ReadOnly;
94     BOOLEAN             WriteCaching;
95 
96     UINT32              BlockSize;
97     UINT32              IoAlign;
98 
99     EFI_LBA             LastBlock;
100 
101     /* revision 2 */
102     EFI_LBA             LowestAlignedLba;
103     UINT32              LogicalBlocksPerPhysicalBlock;
104     /* revision 3 */
105     UINT32              OptimalTransferLengthGranularity;
106 } EFI_BLOCK_IO_MEDIA;
107 
108 typedef struct _EFI_BLOCK_IO {
109     UINT64                  Revision;
110 
111     EFI_BLOCK_IO_MEDIA      *Media;
112 
113     EFI_BLOCK_RESET         Reset;
114     EFI_BLOCK_READ          ReadBlocks;
115     EFI_BLOCK_WRITE         WriteBlocks;
116     EFI_BLOCK_FLUSH         FlushBlocks;
117 
118 } EFI_BLOCK_IO;
119 
120 
121 
122 //
123 // Disk Block IO protocol
124 //
125 
126 #define DISK_IO_PROTOCOL \
127     { 0xce345171, 0xba0b, 0x11d2,  {0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
128 #define EFI_DISK_IO_INTERFACE_REVISION   0x00010000
129 
130 INTERFACE_DECL(_EFI_DISK_IO);
131 
132 typedef
133 EFI_STATUS
134 (EFIAPI *EFI_DISK_READ) (
135     IN struct _EFI_DISK_IO      *This,
136     IN UINT32                   MediaId,
137     IN UINT64                   Offset,
138     IN UINTN                    BufferSize,
139     OUT VOID                    *Buffer
140     );
141 
142 
143 typedef
144 EFI_STATUS
145 (EFIAPI *EFI_DISK_WRITE) (
146     IN struct _EFI_DISK_IO      *This,
147     IN UINT32                   MediaId,
148     IN UINT64                   Offset,
149     IN UINTN                    BufferSize,
150     IN VOID                     *Buffer
151     );
152 
153 
154 typedef struct _EFI_DISK_IO {
155     UINT64              Revision;
156     EFI_DISK_READ       ReadDisk;
157     EFI_DISK_WRITE      WriteDisk;
158 } EFI_DISK_IO;
159 
160 
161 //
162 // Simple file system protocol
163 //
164 
165 #define SIMPLE_FILE_SYSTEM_PROTOCOL \
166     { 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
167 
168 INTERFACE_DECL(_EFI_FILE_IO_INTERFACE);
169 INTERFACE_DECL(_EFI_FILE_HANDLE);
170 
171 typedef
172 EFI_STATUS
173 (EFIAPI *EFI_VOLUME_OPEN) (
174     IN struct _EFI_FILE_IO_INTERFACE    *This,
175     OUT struct _EFI_FILE_HANDLE         **Root
176     );
177 
178 #define EFI_FILE_IO_INTERFACE_REVISION   0x00010000
179 
180 typedef struct _EFI_FILE_IO_INTERFACE {
181     UINT64                  Revision;
182     EFI_VOLUME_OPEN         OpenVolume;
183 } EFI_FILE_IO_INTERFACE;
184 
185 //
186 //
187 //
188 
189 typedef
190 EFI_STATUS
191 (EFIAPI *EFI_FILE_OPEN) (
192     IN struct _EFI_FILE_HANDLE  *File,
193     OUT struct _EFI_FILE_HANDLE **NewHandle,
194     IN CHAR16                   *FileName,
195     IN UINT64                   OpenMode,
196     IN UINT64                   Attributes
197     );
198 
199 // Open modes
200 #define EFI_FILE_MODE_READ      0x0000000000000001
201 #define EFI_FILE_MODE_WRITE     0x0000000000000002
202 #define EFI_FILE_MODE_CREATE    0x8000000000000000
203 
204 // File attributes
205 #define EFI_FILE_READ_ONLY      0x0000000000000001
206 #define EFI_FILE_HIDDEN         0x0000000000000002
207 #define EFI_FILE_SYSTEM         0x0000000000000004
208 #define EFI_FILE_RESERVIED      0x0000000000000008
209 #define EFI_FILE_DIRECTORY      0x0000000000000010
210 #define EFI_FILE_ARCHIVE        0x0000000000000020
211 #define EFI_FILE_VALID_ATTR     0x0000000000000037
212 
213 typedef
214 EFI_STATUS
215 (EFIAPI *EFI_FILE_CLOSE) (
216     IN struct _EFI_FILE_HANDLE  *File
217     );
218 
219 typedef
220 EFI_STATUS
221 (EFIAPI *EFI_FILE_DELETE) (
222     IN struct _EFI_FILE_HANDLE  *File
223     );
224 
225 typedef
226 EFI_STATUS
227 (EFIAPI *EFI_FILE_READ) (
228     IN struct _EFI_FILE_HANDLE  *File,
229     IN OUT UINTN                *BufferSize,
230     OUT VOID                    *Buffer
231     );
232 
233 typedef
234 EFI_STATUS
235 (EFIAPI *EFI_FILE_WRITE) (
236     IN struct _EFI_FILE_HANDLE  *File,
237     IN OUT UINTN                *BufferSize,
238     IN VOID                     *Buffer
239     );
240 
241 typedef
242 EFI_STATUS
243 (EFIAPI *EFI_FILE_SET_POSITION) (
244     IN struct _EFI_FILE_HANDLE  *File,
245     IN UINT64                   Position
246     );
247 
248 typedef
249 EFI_STATUS
250 (EFIAPI *EFI_FILE_GET_POSITION) (
251     IN struct _EFI_FILE_HANDLE  *File,
252     OUT UINT64                  *Position
253     );
254 
255 typedef
256 EFI_STATUS
257 (EFIAPI *EFI_FILE_GET_INFO) (
258     IN struct _EFI_FILE_HANDLE  *File,
259     IN EFI_GUID                 *InformationType,
260     IN OUT UINTN                *BufferSize,
261     OUT VOID                    *Buffer
262     );
263 
264 typedef
265 EFI_STATUS
266 (EFIAPI *EFI_FILE_SET_INFO) (
267     IN struct _EFI_FILE_HANDLE  *File,
268     IN EFI_GUID                 *InformationType,
269     IN UINTN                    BufferSize,
270     IN VOID                     *Buffer
271     );
272 
273 typedef
274 EFI_STATUS
275 (EFIAPI *EFI_FILE_FLUSH) (
276     IN struct _EFI_FILE_HANDLE  *File
277     );
278 
279 
280 
281 #define EFI_FILE_HANDLE_REVISION         0x00010000
282 typedef struct _EFI_FILE_HANDLE {
283     UINT64                  Revision;
284     EFI_FILE_OPEN           Open;
285     EFI_FILE_CLOSE          Close;
286     EFI_FILE_DELETE         Delete;
287     EFI_FILE_READ           Read;
288     EFI_FILE_WRITE          Write;
289     EFI_FILE_GET_POSITION   GetPosition;
290     EFI_FILE_SET_POSITION   SetPosition;
291     EFI_FILE_GET_INFO       GetInfo;
292     EFI_FILE_SET_INFO       SetInfo;
293     EFI_FILE_FLUSH          Flush;
294 } EFI_FILE, *EFI_FILE_HANDLE;
295 
296 
297 //
298 // File information types
299 //
300 
301 #define EFI_FILE_INFO_ID   \
302     { 0x9576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
303 
304 typedef struct {
305     UINT64                  Size;
306     UINT64                  FileSize;
307     UINT64                  PhysicalSize;
308     EFI_TIME                CreateTime;
309     EFI_TIME                LastAccessTime;
310     EFI_TIME                ModificationTime;
311     UINT64                  Attribute;
312     CHAR16                  FileName[1];
313 } EFI_FILE_INFO;
314 
315 //
316 // The FileName field of the EFI_FILE_INFO data structure is variable length.
317 // Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
318 // be the size of the data structure without the FileName field.  The following macro
319 // computes this size correctly no matter how big the FileName array is declared.
320 // This is required to make the EFI_FILE_INFO data structure ANSI compilant.
321 //
322 
323 #define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
324 
325 #define EFI_FILE_SYSTEM_INFO_ID    \
326     { 0x9576e93, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
327 
328 typedef struct {
329     UINT64                  Size;
330     BOOLEAN                 ReadOnly;
331     UINT64                  VolumeSize;
332     UINT64                  FreeSpace;
333     UINT32                  BlockSize;
334     CHAR16                  VolumeLabel[1];
335 } EFI_FILE_SYSTEM_INFO;
336 
337 //
338 // The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
339 // Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
340 // to be the size of the data structure without the VolumeLable field.  The following macro
341 // computes this size correctly no matter how big the VolumeLable array is declared.
342 // This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
343 //
344 
345 #define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
346 
347 #define EFI_FILE_SYSTEM_VOLUME_LABEL_INFO_ID    \
348     { 0xDB47D7D3,0xFE81, 0x11d3, {0x9A, 0x35, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }
349 
350 typedef struct {
351     CHAR16                  VolumeLabel[1];
352 } EFI_FILE_SYSTEM_VOLUME_LABEL_INFO;
353 
354 #define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
355 
356 //
357 // Load file protocol
358 //
359 
360 
361 #define LOAD_FILE_PROTOCOL \
362     { 0x56EC3091, 0x954C, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
363 
364 INTERFACE_DECL(_EFI_LOAD_FILE_INTERFACE);
365 
366 typedef
367 EFI_STATUS
368 (EFIAPI *EFI_LOAD_FILE) (
369     IN struct _EFI_LOAD_FILE_INTERFACE  *This,
370     IN EFI_DEVICE_PATH                  *FilePath,
371     IN BOOLEAN                          BootPolicy,
372     IN OUT UINTN                        *BufferSize,
373     IN VOID                             *Buffer OPTIONAL
374     );
375 
376 typedef struct _EFI_LOAD_FILE_INTERFACE {
377     EFI_LOAD_FILE                       LoadFile;
378 } EFI_LOAD_FILE_INTERFACE;
379 
380 
381 //
382 // Device IO protocol
383 //
384 
385 #define DEVICE_IO_PROTOCOL \
386     { 0xaf6ac311, 0x84c3, 0x11d2, {0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
387 
388 INTERFACE_DECL(_EFI_DEVICE_IO_INTERFACE);
389 
390 typedef enum {
391     IO_UINT8,
392     IO_UINT16,
393     IO_UINT32,
394     IO_UINT64,
395 //
396 // Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO
397 //
398     MMIO_COPY_UINT8,
399     MMIO_COPY_UINT16,
400     MMIO_COPY_UINT32,
401     MMIO_COPY_UINT64
402 } EFI_IO_WIDTH;
403 
404 #define EFI_PCI_ADDRESS(_bus,_dev,_func) \
405     ( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) )
406 
407 
408 typedef
409 EFI_STATUS
410 (EFIAPI *EFI_DEVICE_IO) (
411     IN struct _EFI_DEVICE_IO_INTERFACE *This,
412     IN EFI_IO_WIDTH                 Width,
413     IN UINT64                       Address,
414     IN UINTN                        Count,
415     IN OUT VOID                     *Buffer
416     );
417 
418 typedef struct {
419     EFI_DEVICE_IO                   Read;
420     EFI_DEVICE_IO                   Write;
421 } EFI_IO_ACCESS;
422 
423 typedef
424 EFI_STATUS
425 (EFIAPI *EFI_PCI_DEVICE_PATH) (
426     IN struct _EFI_DEVICE_IO_INTERFACE  *This,
427     IN UINT64                           Address,
428     IN OUT EFI_DEVICE_PATH              **PciDevicePath
429     );
430 
431 typedef enum {
432     EfiBusMasterRead,
433     EfiBusMasterWrite,
434     EfiBusMasterCommonBuffer
435 } EFI_IO_OPERATION_TYPE;
436 
437 typedef
438 EFI_STATUS
439 (EFIAPI *EFI_IO_MAP) (
440     IN struct _EFI_DEVICE_IO_INTERFACE  *This,
441     IN EFI_IO_OPERATION_TYPE            Operation,
442     IN EFI_PHYSICAL_ADDRESS             *HostAddress,
443     IN OUT UINTN                        *NumberOfBytes,
444     OUT EFI_PHYSICAL_ADDRESS            *DeviceAddress,
445     OUT VOID                            **Mapping
446     );
447 
448 typedef
449 EFI_STATUS
450 (EFIAPI *EFI_IO_UNMAP) (
451     IN struct _EFI_DEVICE_IO_INTERFACE  *This,
452     IN VOID                             *Mapping
453     );
454 
455 typedef
456 EFI_STATUS
457 (EFIAPI *EFI_IO_ALLOCATE_BUFFER) (
458     IN struct _EFI_DEVICE_IO_INTERFACE  *This,
459     IN EFI_ALLOCATE_TYPE                Type,
460     IN EFI_MEMORY_TYPE                  MemoryType,
461     IN UINTN                            Pages,
462     IN OUT EFI_PHYSICAL_ADDRESS         *HostAddress
463     );
464 
465 typedef
466 EFI_STATUS
467 (EFIAPI *EFI_IO_FLUSH) (
468     IN struct _EFI_DEVICE_IO_INTERFACE  *This
469     );
470 
471 typedef
472 EFI_STATUS
473 (EFIAPI *EFI_IO_FREE_BUFFER) (
474     IN struct _EFI_DEVICE_IO_INTERFACE  *This,
475     IN UINTN                            Pages,
476     IN EFI_PHYSICAL_ADDRESS             HostAddress
477     );
478 
479 typedef struct _EFI_DEVICE_IO_INTERFACE {
480     EFI_IO_ACCESS                       Mem;
481     EFI_IO_ACCESS                       Io;
482     EFI_IO_ACCESS                       Pci;
483     EFI_IO_MAP                          Map;
484     EFI_PCI_DEVICE_PATH                 PciDevicePath;
485     EFI_IO_UNMAP                        Unmap;
486     EFI_IO_ALLOCATE_BUFFER              AllocateBuffer;
487     EFI_IO_FLUSH                        Flush;
488     EFI_IO_FREE_BUFFER                  FreeBuffer;
489 } EFI_DEVICE_IO_INTERFACE;
490 
491 
492 //
493 // Unicode Collation protocol
494 //
495 
496 #define UNICODE_COLLATION_PROTOCOL \
497     { 0x1d85cd7f, 0xf43d, 0x11d2, {0x9a, 0xc,  0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
498 
499 #define UNICODE_BYTE_ORDER_MARK       (CHAR16)(0xfeff)
500 
501 INTERFACE_DECL(_EFI_UNICODE_COLLATION_INTERFACE);
502 
503 typedef
504 INTN
505 (EFIAPI *EFI_UNICODE_STRICOLL) (
506     IN struct _EFI_UNICODE_COLLATION_INTERFACE  *This,
507     IN CHAR16                         *s1,
508     IN CHAR16                         *s2
509     );
510 
511 typedef
512 BOOLEAN
513 (EFIAPI *EFI_UNICODE_METAIMATCH) (
514     IN struct _EFI_UNICODE_COLLATION_INTERFACE  *This,
515     IN CHAR16                         *String,
516     IN CHAR16                         *Pattern
517     );
518 
519 typedef
520 VOID
521 (EFIAPI *EFI_UNICODE_STRLWR) (
522     IN struct _EFI_UNICODE_COLLATION_INTERFACE  *This,
523     IN OUT CHAR16                       *Str
524     );
525 
526 typedef
527 VOID
528 (EFIAPI *EFI_UNICODE_STRUPR) (
529     IN struct _EFI_UNICODE_COLLATION_INTERFACE  *This,
530     IN OUT CHAR16                       *Str
531     );
532 
533 typedef
534 VOID
535 (EFIAPI *EFI_UNICODE_FATTOSTR) (
536     IN struct _EFI_UNICODE_COLLATION_INTERFACE  *This,
537     IN UINTN                            FatSize,
538     IN CHAR8                            *Fat,
539     OUT CHAR16                          *String
540     );
541 
542 typedef
543 BOOLEAN
544 (EFIAPI *EFI_UNICODE_STRTOFAT) (
545     IN struct _EFI_UNICODE_COLLATION_INTERFACE  *This,
546     IN CHAR16                           *String,
547     IN UINTN                            FatSize,
548     OUT CHAR8                           *Fat
549     );
550 
551 
552 typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
553 
554     // general
555     EFI_UNICODE_STRICOLL                StriColl;
556     EFI_UNICODE_METAIMATCH              MetaiMatch;
557     EFI_UNICODE_STRLWR                  StrLwr;
558     EFI_UNICODE_STRUPR                  StrUpr;
559 
560     // for supporting fat volumes
561     EFI_UNICODE_FATTOSTR                FatToStr;
562     EFI_UNICODE_STRTOFAT                StrToFat;
563 
564     CHAR8                               *SupportedLanguages;
565 } EFI_UNICODE_COLLATION_INTERFACE;
566 
567 /* Graphics output protocol */
568 #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
569   { \
570     0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
571   }
572 
573 typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;
574 
575 typedef struct {
576   UINT32            RedMask;
577   UINT32            GreenMask;
578   UINT32            BlueMask;
579   UINT32            ReservedMask;
580 } EFI_PIXEL_BITMASK;
581 
582 typedef enum {
583   PixelRedGreenBlueReserved8BitPerColor,
584   PixelBlueGreenRedReserved8BitPerColor,
585   PixelBitMask,
586   PixelBltOnly,
587   PixelFormatMax
588 } EFI_GRAPHICS_PIXEL_FORMAT;
589 
590 typedef struct {
591   UINT32                     Version;
592   UINT32                     HorizontalResolution;
593   UINT32                     VerticalResolution;
594   EFI_GRAPHICS_PIXEL_FORMAT  PixelFormat;
595   EFI_PIXEL_BITMASK          PixelInformation;
596   UINT32                     PixelsPerScanLine;
597 } EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;
598 
599 /**
600   Return the current video mode information.
601 
602   @param  This       Protocol instance pointer.
603   @param  ModeNumber The mode number to return information on.
604   @param  SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
605   @param  Info       A pointer to callee allocated buffer that returns information about ModeNumber.
606 
607   @retval EFI_SUCCESS           Mode information returned.
608   @retval EFI_BUFFER_TOO_SMALL  The Info buffer was too small.
609   @retval EFI_DEVICE_ERROR      A hardware error occurred trying to retrieve the video mode.
610   @retval EFI_NOT_STARTED       Video display is not initialized. Call SetMode ()
611   @retval EFI_INVALID_PARAMETER One of the input args was NULL.
612 
613 **/
614 typedef
615 EFI_STATUS
616 (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (
617   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL          *This,
618   IN  UINT32                                ModeNumber,
619   OUT UINTN                                 *SizeOfInfo,
620   OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION  **Info
621   )
622 ;
623 
624 /**
625   Return the current video mode information.
626 
627   @param  This              Protocol instance pointer.
628   @param  ModeNumber        The mode number to be set.
629 
630   @retval EFI_SUCCESS       Graphics mode was changed.
631   @retval EFI_DEVICE_ERROR  The device had an error and could not complete the request.
632   @retval EFI_UNSUPPORTED   ModeNumber is not supported by this device.
633 
634 **/
635 typedef
636 EFI_STATUS
637 (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (
638   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
639   IN  UINT32                       ModeNumber
640   );
641 
642 typedef struct {
643   UINT8 Blue;
644   UINT8 Green;
645   UINT8 Red;
646   UINT8 Reserved;
647 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL;
648 
649 typedef union {
650   EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;
651   UINT32                        Raw;
652 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;
653 
654 typedef enum {
655   EfiBltVideoFill,
656   EfiBltVideoToBltBuffer,
657   EfiBltBufferToVideo,
658   EfiBltVideoToVideo,
659   EfiGraphicsOutputBltOperationMax
660 } EFI_GRAPHICS_OUTPUT_BLT_OPERATION;
661 
662 /**
663   The following table defines actions for BltOperations:
664 
665   <B>EfiBltVideoFill</B> - Write data from the  BltBuffer pixel (SourceX, SourceY)
666   directly to every pixel of the video display rectangle
667   (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
668   Only one pixel will be used from the BltBuffer. Delta is NOT used.
669 
670   <B>EfiBltVideoToBltBuffer</B> - Read data from the video display rectangle
671   (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
672   the BltBuffer rectangle (DestinationX, DestinationY )
673   (DestinationX + Width, DestinationY + Height). If DestinationX or
674   DestinationY is not zero then Delta must be set to the length in bytes
675   of a row in the BltBuffer.
676 
677   <B>EfiBltBufferToVideo</B> - Write data from the  BltBuffer rectangle
678   (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
679   video display rectangle (DestinationX, DestinationY)
680   (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
681   not zero then Delta must be set to the length in bytes of a row in the
682   BltBuffer.
683 
684   <B>EfiBltVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
685   (SourceX + Width, SourceY + Height) .to the video display rectangle
686   (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
687   The BltBuffer and Delta  are not used in this mode.
688 
689   @param  This         Protocol instance pointer.
690   @param  BltBuffer    Buffer containing data to blit into video buffer. This
691                        buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
692   @param  BltOperation Operation to perform on BlitBuffer and video memory
693   @param  SourceX      X coordinate of source for the BltBuffer.
694   @param  SourceY      Y coordinate of source for the BltBuffer.
695   @param  DestinationX X coordinate of destination for the BltBuffer.
696   @param  DestinationY Y coordinate of destination for the BltBuffer.
697   @param  Width        Width of rectangle in BltBuffer in pixels.
698   @param  Height       Hight of rectangle in BltBuffer in pixels.
699   @param  Delta        OPTIONAL
700 
701   @retval EFI_SUCCESS           The Blt operation completed.
702   @retval EFI_INVALID_PARAMETER BltOperation is not valid.
703   @retval EFI_DEVICE_ERROR      A hardware error occured writting to the video buffer.
704 
705 **/
706 typedef
707 EFI_STATUS
708 (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (
709   IN  EFI_GRAPHICS_OUTPUT_PROTOCOL            *This,
710   IN  EFI_GRAPHICS_OUTPUT_BLT_PIXEL           *BltBuffer,   OPTIONAL
711   IN  EFI_GRAPHICS_OUTPUT_BLT_OPERATION       BltOperation,
712   IN  UINTN                                   SourceX,
713   IN  UINTN                                   SourceY,
714   IN  UINTN                                   DestinationX,
715   IN  UINTN                                   DestinationY,
716   IN  UINTN                                   Width,
717   IN  UINTN                                   Height,
718   IN  UINTN                                   Delta         OPTIONAL
719   );
720 
721 typedef struct {
722   UINT32                                 MaxMode;
723   UINT32                                 Mode;
724   EFI_GRAPHICS_OUTPUT_MODE_INFORMATION   *Info;
725   UINTN                                  SizeOfInfo;
726   EFI_PHYSICAL_ADDRESS                   FrameBufferBase;
727   UINTN                                  FrameBufferSize;
728 } EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;
729 
730 struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {
731   EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE  QueryMode;
732   EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE    SetMode;
733   EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT         Blt;
734   EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE        *Mode;
735 };
736 
737 INTERFACE_DECL(_EFI_SERVICE_BINDING);
738 
739 typedef
740 EFI_STATUS
741 (EFIAPI *EFI_SERVICE_BINDING_CREATE_CHILD) (
742     IN struct _EFI_SERVICE_BINDING *This,
743     IN EFI_HANDLE                  *ChildHandle
744     );
745 
746 typedef
747 EFI_STATUS
748 (EFIAPI *EFI_SERVICE_BINDING_DESTROY_CHILD) (
749     IN struct _EFI_SERVICE_BINDING *This,
750     IN EFI_HANDLE                  ChildHandle
751     );
752 
753 typedef struct _EFI_SERVICE_BINDING {
754     EFI_SERVICE_BINDING_CREATE_CHILD  CreateChild;
755     EFI_SERVICE_BINDING_DESTROY_CHILD DestroyChild;
756 } EFI_SERVICE_BINDING;
757 
758 #endif
759 
760