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 // The protocols, PPI and GUID defintions for this module
31 #include <Protocol/SimpleTextIn.h>
32 #include <Protocol/SimpleTextOut.h>
33 #include <Protocol/PciIo.h>
34 #include <Protocol/VgaMiniPort.h>
35 #include <Protocol/DevicePath.h>
37 // The Library classes this module consumes
39 #include <Library/DebugLib.h>
40 #include <Library/UefiDriverEntryPoint.h>
41 #include <Library/BaseLib.h>
42 #include <Library/UefiLib.h>
43 #include <Library/DevicePathLib.h>
44 #include <Library/BaseMemoryLib.h>
45 #include <Library/MemoryAllocationLib.h>
46 #include <Library/UefiBootServicesTableLib.h>
47 #include <Library/ReportStatusCodeLib.h>
50 #include <IndustryStandard/Pci22.h>
51 #include "ComponentName.h"
52 #include <Protocol/VgaMiniPort.h>
55 // VGA specific registers
57 #define CRTC_CURSOR_START 0xA
58 #define CRTC_CURSOR_END 0xB
60 #define CRTC_CURSOR_LOCATION_HIGH 0xE
61 #define CRTC_CURSOR_LOCATION_LOW 0xF
63 #define EFI_MAX_ATTRIBUTE 0x7f
66 // VGA Class Device Structure
68 #define VGA_CLASS_DEV_SIGNATURE EFI_SIGNATURE_32 ('V', 'G', 'A', 'C')
73 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut
;
74 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode
;
75 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
76 EFI_PCI_IO_PROTOCOL
*PciIo
;
77 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
80 #define VGA_CLASS_DEV_FROM_THIS(a) CR (a, VGA_CLASS_DEV, SimpleTextOut, VGA_CLASS_DEV_SIGNATURE)
85 extern EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding
;
88 // Driver Binding Protocol functions
92 VgaClassDriverBindingSupported (
93 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
94 IN EFI_HANDLE Controller
,
95 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
101 GC_TODO: Add function description
105 This - GC_TODO: add argument description
106 Controller - GC_TODO: add argument description
107 RemainingDevicePath - GC_TODO: add argument description
111 GC_TODO: add return values
118 VgaClassDriverBindingStart (
119 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
120 IN EFI_HANDLE Controller
,
121 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
127 GC_TODO: Add function description
131 This - GC_TODO: add argument description
132 Controller - GC_TODO: add argument description
133 RemainingDevicePath - GC_TODO: add argument description
137 GC_TODO: add return values
144 VgaClassDriverBindingStop (
145 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
146 IN EFI_HANDLE Controller
,
147 IN UINTN NumberOfChildren
,
148 IN EFI_HANDLE
*ChildHandleBuffer
154 GC_TODO: Add function description
158 This - GC_TODO: add argument description
159 Controller - GC_TODO: add argument description
160 NumberOfChildren - GC_TODO: add argument description
161 ChildHandleBuffer - GC_TODO: add argument description
165 GC_TODO: add return values
171 // Simple Text Output Protocol functions
176 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
177 IN BOOLEAN ExtendedVerification
183 GC_TODO: Add function description
187 This - GC_TODO: add argument description
188 ExtendedVerification - GC_TODO: add argument description
192 GC_TODO: add return values
199 VgaClassOutputString (
200 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
207 GC_TODO: Add function description
211 This - GC_TODO: add argument description
212 WString - GC_TODO: add argument description
216 GC_TODO: add return values
224 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
231 GC_TODO: Add function description
235 This - GC_TODO: add argument description
236 WString - GC_TODO: add argument description
240 GC_TODO: add return values
247 VgaClassClearScreen (
248 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
254 GC_TODO: Add function description
258 This - GC_TODO: add argument description
262 GC_TODO: add return values
269 VgaClassSetAttribute (
270 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
277 GC_TODO: Add function description
281 This - GC_TODO: add argument description
282 Attribute - GC_TODO: add argument description
286 GC_TODO: add return values
293 VgaClassSetCursorPosition (
294 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
302 GC_TODO: Add function description
306 This - GC_TODO: add argument description
307 Column - GC_TODO: add argument description
308 Row - GC_TODO: add argument description
312 GC_TODO: add return values
319 VgaClassEnableCursor (
320 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
327 GC_TODO: Add function description
331 This - GC_TODO: add argument description
332 Visible - GC_TODO: add argument description
336 GC_TODO: add return values
344 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
353 GC_TODO: Add function description
357 This - GC_TODO: add argument description
358 ModeNumber - GC_TODO: add argument description
359 Columns - GC_TODO: add argument description
360 Rows - GC_TODO: add argument description
364 GC_TODO: add return values
372 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
379 GC_TODO: Add function description
383 This - GC_TODO: add argument description
384 ModeNumber - GC_TODO: add argument description
388 GC_TODO: add return values