3 Copyright (c) 2006, Intel Corporation. All rights reserved.
4 This software and associated documentation (if any) is furnished
5 under a license and may only be used or copied in accordance
6 with the terms of the license. Except as permitted by such
7 license, no part of this software or documentation may be
8 reproduced, stored in a retrieval system, or transmitted in any
9 form or by any means without the express written consent of
27 #include <FrameworkDxe.h>
29 #include <Protocol/SimpleTextIn.h>
30 #include <Protocol/SimpleTextOut.h>
31 #include <Protocol/PciIo.h>
32 #include <Protocol/VgaMiniPort.h>
33 #include <Protocol/DevicePath.h>
35 #include <Library/DebugLib.h>
36 #include <Library/UefiDriverEntryPoint.h>
37 #include <Library/BaseLib.h>
38 #include <Library/UefiLib.h>
39 #include <Library/DevicePathLib.h>
40 #include <Library/BaseMemoryLib.h>
41 #include <Library/MemoryAllocationLib.h>
42 #include <Library/UefiBootServicesTableLib.h>
43 #include <Library/ReportStatusCodeLib.h>
46 #include <IndustryStandard/Pci22.h>
47 #include "ComponentName.h"
48 #include <Protocol/VgaMiniPort.h>
51 // VGA specific registers
53 #define CRTC_CURSOR_START 0xA
54 #define CRTC_CURSOR_END 0xB
56 #define CRTC_CURSOR_LOCATION_HIGH 0xE
57 #define CRTC_CURSOR_LOCATION_LOW 0xF
59 #define EFI_MAX_ATTRIBUTE 0x7f
62 // VGA Class Device Structure
64 #define VGA_CLASS_DEV_SIGNATURE EFI_SIGNATURE_32 ('V', 'G', 'A', 'C')
69 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut
;
70 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode
;
71 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
72 EFI_PCI_IO_PROTOCOL
*PciIo
;
73 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
76 #define VGA_CLASS_DEV_FROM_THIS(a) CR (a, VGA_CLASS_DEV, SimpleTextOut, VGA_CLASS_DEV_SIGNATURE)
81 extern EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding
;
84 // Driver Binding Protocol functions
88 VgaClassDriverBindingSupported (
89 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
90 IN EFI_HANDLE Controller
,
91 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
97 GC_TODO: Add function description
101 This - GC_TODO: add argument description
102 Controller - GC_TODO: add argument description
103 RemainingDevicePath - GC_TODO: add argument description
107 GC_TODO: add return values
114 VgaClassDriverBindingStart (
115 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
116 IN EFI_HANDLE Controller
,
117 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
123 GC_TODO: Add function description
127 This - GC_TODO: add argument description
128 Controller - GC_TODO: add argument description
129 RemainingDevicePath - GC_TODO: add argument description
133 GC_TODO: add return values
140 VgaClassDriverBindingStop (
141 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
142 IN EFI_HANDLE Controller
,
143 IN UINTN NumberOfChildren
,
144 IN EFI_HANDLE
*ChildHandleBuffer
150 GC_TODO: Add function description
154 This - GC_TODO: add argument description
155 Controller - GC_TODO: add argument description
156 NumberOfChildren - GC_TODO: add argument description
157 ChildHandleBuffer - GC_TODO: add argument description
161 GC_TODO: add return values
167 // Simple Text Output Protocol functions
172 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
173 IN BOOLEAN ExtendedVerification
179 GC_TODO: Add function description
183 This - GC_TODO: add argument description
184 ExtendedVerification - GC_TODO: add argument description
188 GC_TODO: add return values
195 VgaClassOutputString (
196 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
203 GC_TODO: Add function description
207 This - GC_TODO: add argument description
208 WString - GC_TODO: add argument description
212 GC_TODO: add return values
220 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
227 GC_TODO: Add function description
231 This - GC_TODO: add argument description
232 WString - GC_TODO: add argument description
236 GC_TODO: add return values
243 VgaClassClearScreen (
244 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
250 GC_TODO: Add function description
254 This - GC_TODO: add argument description
258 GC_TODO: add return values
265 VgaClassSetAttribute (
266 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
273 GC_TODO: Add function description
277 This - GC_TODO: add argument description
278 Attribute - GC_TODO: add argument description
282 GC_TODO: add return values
289 VgaClassSetCursorPosition (
290 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
298 GC_TODO: Add function description
302 This - GC_TODO: add argument description
303 Column - GC_TODO: add argument description
304 Row - GC_TODO: add argument description
308 GC_TODO: add return values
315 VgaClassEnableCursor (
316 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
323 GC_TODO: Add function description
327 This - GC_TODO: add argument description
328 Visible - GC_TODO: add argument description
332 GC_TODO: add return values
340 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
349 GC_TODO: Add function description
353 This - GC_TODO: add argument description
354 ModeNumber - GC_TODO: add argument description
355 Columns - GC_TODO: add argument description
356 Rows - GC_TODO: add argument description
360 GC_TODO: add return values
368 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
375 GC_TODO: Add function description
379 This - GC_TODO: add argument description
380 ModeNumber - GC_TODO: add argument description
384 GC_TODO: add return values