3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #include <FrameworkDxe.h>
21 #include <Protocol/SimpleTextIn.h>
22 #include <Protocol/SimpleTextOut.h>
23 #include <Protocol/PciIo.h>
24 #include <Protocol/VgaMiniPort.h>
25 #include <Protocol/DevicePath.h>
27 #include <Library/DebugLib.h>
28 #include <Library/UefiDriverEntryPoint.h>
29 #include <Library/BaseLib.h>
30 #include <Library/UefiLib.h>
31 #include <Library/DevicePathLib.h>
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/MemoryAllocationLib.h>
34 #include <Library/UefiBootServicesTableLib.h>
35 #include <Library/ReportStatusCodeLib.h>
38 #include <IndustryStandard/Pci22.h>
39 #include "ComponentName.h"
40 #include <Protocol/VgaMiniPort.h>
43 // VGA specific registers
45 #define CRTC_CURSOR_START 0xA
46 #define CRTC_CURSOR_END 0xB
48 #define CRTC_CURSOR_LOCATION_HIGH 0xE
49 #define CRTC_CURSOR_LOCATION_LOW 0xF
51 #define EFI_MAX_ATTRIBUTE 0x7f
54 // VGA Class Device Structure
56 #define VGA_CLASS_DEV_SIGNATURE EFI_SIGNATURE_32 ('V', 'G', 'A', 'C')
61 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut
;
62 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode
;
63 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
64 EFI_PCI_IO_PROTOCOL
*PciIo
;
65 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
68 #define VGA_CLASS_DEV_FROM_THIS(a) CR (a, VGA_CLASS_DEV, SimpleTextOut, VGA_CLASS_DEV_SIGNATURE)
73 extern EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding
;
76 // Driver Binding Protocol functions
80 VgaClassDriverBindingSupported (
81 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
82 IN EFI_HANDLE Controller
,
83 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
89 GC_TODO: Add function description
93 This - GC_TODO: add argument description
94 Controller - GC_TODO: add argument description
95 RemainingDevicePath - GC_TODO: add argument description
99 GC_TODO: add return values
106 VgaClassDriverBindingStart (
107 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
108 IN EFI_HANDLE Controller
,
109 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
115 GC_TODO: Add function description
119 This - GC_TODO: add argument description
120 Controller - GC_TODO: add argument description
121 RemainingDevicePath - GC_TODO: add argument description
125 GC_TODO: add return values
132 VgaClassDriverBindingStop (
133 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
134 IN EFI_HANDLE Controller
,
135 IN UINTN NumberOfChildren
,
136 IN EFI_HANDLE
*ChildHandleBuffer
142 GC_TODO: Add function description
146 This - GC_TODO: add argument description
147 Controller - GC_TODO: add argument description
148 NumberOfChildren - GC_TODO: add argument description
149 ChildHandleBuffer - GC_TODO: add argument description
153 GC_TODO: add return values
159 // Simple Text Output Protocol functions
164 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
165 IN BOOLEAN ExtendedVerification
171 GC_TODO: Add function description
175 This - GC_TODO: add argument description
176 ExtendedVerification - GC_TODO: add argument description
180 GC_TODO: add return values
187 VgaClassOutputString (
188 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
195 GC_TODO: Add function description
199 This - GC_TODO: add argument description
200 WString - GC_TODO: add argument description
204 GC_TODO: add return values
212 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
219 GC_TODO: Add function description
223 This - GC_TODO: add argument description
224 WString - GC_TODO: add argument description
228 GC_TODO: add return values
235 VgaClassClearScreen (
236 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
242 GC_TODO: Add function description
246 This - GC_TODO: add argument description
250 GC_TODO: add return values
257 VgaClassSetAttribute (
258 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
265 GC_TODO: Add function description
269 This - GC_TODO: add argument description
270 Attribute - GC_TODO: add argument description
274 GC_TODO: add return values
281 VgaClassSetCursorPosition (
282 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
290 GC_TODO: Add function description
294 This - GC_TODO: add argument description
295 Column - GC_TODO: add argument description
296 Row - GC_TODO: add argument description
300 GC_TODO: add return values
307 VgaClassEnableCursor (
308 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
315 GC_TODO: Add function description
319 This - GC_TODO: add argument description
320 Visible - GC_TODO: add argument description
324 GC_TODO: add return values
332 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
341 GC_TODO: Add function description
345 This - GC_TODO: add argument description
346 ModeNumber - GC_TODO: add argument description
347 Columns - GC_TODO: add argument description
348 Rows - GC_TODO: add argument description
352 GC_TODO: add return values
360 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
367 GC_TODO: Add function description
371 This - GC_TODO: add argument description
372 ModeNumber - GC_TODO: add argument description
376 GC_TODO: add return values