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/BaseMemoryLib.h>
32 #include <Library/MemoryAllocationLib.h>
33 #include <Library/UefiBootServicesTableLib.h>
34 #include <Library/ReportStatusCodeLib.h>
37 #include <IndustryStandard/Pci22.h>
38 #include "ComponentName.h"
39 #include <Protocol/VgaMiniPort.h>
42 // VGA specific registers
44 #define CRTC_CURSOR_START 0xA
45 #define CRTC_CURSOR_END 0xB
47 #define CRTC_CURSOR_LOCATION_HIGH 0xE
48 #define CRTC_CURSOR_LOCATION_LOW 0xF
50 #define EFI_MAX_ATTRIBUTE 0x7f
53 // VGA Class Device Structure
55 #define VGA_CLASS_DEV_SIGNATURE EFI_SIGNATURE_32 ('V', 'G', 'A', 'C')
60 EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut
;
61 EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode
;
62 EFI_VGA_MINI_PORT_PROTOCOL
*VgaMiniPort
;
63 EFI_PCI_IO_PROTOCOL
*PciIo
;
64 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
67 #define VGA_CLASS_DEV_FROM_THIS(a) CR (a, VGA_CLASS_DEV, SimpleTextOut, VGA_CLASS_DEV_SIGNATURE)
72 extern EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding
;
75 // Driver Binding Protocol functions
79 VgaClassDriverBindingSupported (
80 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
81 IN EFI_HANDLE Controller
,
82 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
88 GC_TODO: Add function description
92 This - GC_TODO: add argument description
93 Controller - GC_TODO: add argument description
94 RemainingDevicePath - GC_TODO: add argument description
98 GC_TODO: add return values
105 VgaClassDriverBindingStart (
106 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
107 IN EFI_HANDLE Controller
,
108 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
114 GC_TODO: Add function description
118 This - GC_TODO: add argument description
119 Controller - GC_TODO: add argument description
120 RemainingDevicePath - GC_TODO: add argument description
124 GC_TODO: add return values
131 VgaClassDriverBindingStop (
132 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
133 IN EFI_HANDLE Controller
,
134 IN UINTN NumberOfChildren
,
135 IN EFI_HANDLE
*ChildHandleBuffer
141 GC_TODO: Add function description
145 This - GC_TODO: add argument description
146 Controller - GC_TODO: add argument description
147 NumberOfChildren - GC_TODO: add argument description
148 ChildHandleBuffer - GC_TODO: add argument description
152 GC_TODO: add return values
158 // Simple Text Output Protocol functions
163 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
164 IN BOOLEAN ExtendedVerification
170 GC_TODO: Add function description
174 This - GC_TODO: add argument description
175 ExtendedVerification - GC_TODO: add argument description
179 GC_TODO: add return values
186 VgaClassOutputString (
187 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
194 GC_TODO: Add function description
198 This - GC_TODO: add argument description
199 WString - GC_TODO: add argument description
203 GC_TODO: add return values
211 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
218 GC_TODO: Add function description
222 This - GC_TODO: add argument description
223 WString - GC_TODO: add argument description
227 GC_TODO: add return values
234 VgaClassClearScreen (
235 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
241 GC_TODO: Add function description
245 This - GC_TODO: add argument description
249 GC_TODO: add return values
256 VgaClassSetAttribute (
257 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
264 GC_TODO: Add function description
268 This - GC_TODO: add argument description
269 Attribute - GC_TODO: add argument description
273 GC_TODO: add return values
280 VgaClassSetCursorPosition (
281 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
289 GC_TODO: Add function description
293 This - GC_TODO: add argument description
294 Column - GC_TODO: add argument description
295 Row - GC_TODO: add argument description
299 GC_TODO: add return values
306 VgaClassEnableCursor (
307 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
314 GC_TODO: Add function description
318 This - GC_TODO: add argument description
319 Visible - GC_TODO: add argument description
323 GC_TODO: add return values
331 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
340 GC_TODO: Add function description
344 This - GC_TODO: add argument description
345 ModeNumber - GC_TODO: add argument description
346 Columns - GC_TODO: add argument description
347 Rows - GC_TODO: add argument description
351 GC_TODO: add return values
359 IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
*This
,
366 GC_TODO: Add function description
370 This - GC_TODO: add argument description
371 ModeNumber - GC_TODO: add argument description
375 GC_TODO: add return values