Add in VgaClassDxe

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3236 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2007-07-13 12:03:09 +00:00
parent 458e9489a1
commit e081218df7
6 changed files with 2226 additions and 0 deletions

View File

@ -0,0 +1,141 @@
/*++
Copyright (c) 2006, Intel Corporation. All rights reserved. <BR>
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
ComponentName.c
Abstract:
--*/
#include "VgaClass.h"
//
// EFI Component Name Protocol
//
EFI_COMPONENT_NAME_PROTOCOL gVgaClassComponentName = {
VgaClassComponentNameGetDriverName,
VgaClassComponentNameGetControllerName,
"eng"
};
STATIC EFI_UNICODE_STRING_TABLE mVgaClassDriverNameTable[] = {
{
"eng",
L"VGA Class Driver"
},
{
NULL,
NULL
}
};
EFI_STATUS
EFIAPI
VgaClassComponentNameGetDriverName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
)
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
Language - A pointer to a three character ISO 639-2 language identifier.
This is the language of the driver name that that the caller
is requesting, and it must match one of the languages specified
in SupportedLanguages. The number of languages supported by a
driver is up to the driver writer.
DriverName - A pointer to the Unicode string to return. This Unicode string
is the name of the driver specified by This in the language
specified by Language.
Returns:
EFI_SUCCESS - The Unicode string for the Driver specified by This
and the language specified by Language was returned
in DriverName.
EFI_INVALID_PARAMETER - Language is NULL.
EFI_INVALID_PARAMETER - DriverName is NULL.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
--*/
{
return LookupUnicodeString (
Language,
gVgaClassComponentName.SupportedLanguages,
mVgaClassDriverNameTable,
DriverName
);
}
EFI_STATUS
EFIAPI
VgaClassComponentNameGetControllerName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
)
/*++
Routine Description:
Retrieves a Unicode string that is the user readable name of the controller
that is being managed by an EFI Driver.
Arguments:
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
ControllerHandle - The handle of a controller that the driver specified by
This is managing. This handle specifies the controller
whose name is to be returned.
ChildHandle - The handle of the child controller to retrieve the name
of. This is an optional parameter that may be NULL. It
will be NULL for device drivers. It will also be NULL
for a bus drivers that wish to retrieve the name of the
bus controller. It will not be NULL for a bus driver
that wishes to retrieve the name of a child controller.
Language - A pointer to a three character ISO 639-2 language
identifier. This is the language of the controller name
that that the caller is requesting, and it must match one
of the languages specified in SupportedLanguages. The
number of languages supported by a driver is up to the
driver writer.
ControllerName - A pointer to the Unicode string to return. This Unicode
string is the name of the controller specified by
ControllerHandle and ChildHandle in the language
specified by Language from the point of view of the
driver specified by This.
Returns:
EFI_SUCCESS - The Unicode string for the user readable name in the
language specified by Language for the driver
specified by This was returned in DriverName.
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
EFI_HANDLE.
EFI_INVALID_PARAMETER - Language is NULL.
EFI_INVALID_PARAMETER - ControllerName is NULL.
EFI_UNSUPPORTED - The driver specified by This is not currently
managing the controller specified by
ControllerHandle and ChildHandle.
EFI_UNSUPPORTED - The driver specified by This does not support the
language specified by Language.
--*/
{
return EFI_UNSUPPORTED;
}

View File

@ -0,0 +1,90 @@
/*++
Copyright (c) 2006, Intel Corporation. All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
ComponentName.h
Abstract:
Revision History
--*/
#ifndef _VGA_CLASS_COMPONENT_NAME_H
#define _VGA_CLASS_COMPONENT_NAME_H
#include <PiDxe.h>
#include <Protocol/ComponentName.h>
extern EFI_COMPONENT_NAME_PROTOCOL gVgaClassComponentName;
//
// EFI Component Name Functions
//
EFI_STATUS
EFIAPI
VgaClassComponentNameGetDriverName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN CHAR8 *Language,
OUT CHAR16 **DriverName
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Language - GC_TODO: add argument description
DriverName - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassComponentNameGetControllerName (
IN EFI_COMPONENT_NAME_PROTOCOL *This,
IN EFI_HANDLE ControllerHandle,
IN EFI_HANDLE ChildHandle OPTIONAL,
IN CHAR8 *Language,
OUT CHAR16 **ControllerName
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
ControllerHandle - GC_TODO: add argument description
ChildHandle - GC_TODO: add argument description
Language - GC_TODO: add argument description
ControllerName - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,393 @@
/*++
Copyright (c) 2006, Intel Corporation. All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.
Module Name:
VgaClass.h
Abstract:
Revision History
--*/
#ifndef _VGA_CLASS_H
#define _VGA_CLASS_H
#include <PiDxe.h>
#include <FrameworkDxe.h>
//
// The protocols, PPI and GUID defintions for this module
//
#include <Protocol/SimpleTextIn.h>
#include <Protocol/SimpleTextOut.h>
#include <Protocol/PciIo.h>
#include <Protocol/VgaMiniPort.h>
#include <Protocol/DevicePath.h>
//
// The Library classes this module consumes
//
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/BaseLib.h>
#include <Library/UefiLib.h>
#include <Library/DevicePathLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <IndustryStandard/Pci22.h>
#include "ComponentName.h"
#include <Protocol/VgaMiniPort.h>
//
// VGA specific registers
//
#define CRTC_CURSOR_START 0xA
#define CRTC_CURSOR_END 0xB
#define CRTC_CURSOR_LOCATION_HIGH 0xE
#define CRTC_CURSOR_LOCATION_LOW 0xF
#define EFI_MAX_ATTRIBUTE 0x7f
//
// VGA Class Device Structure
//
#define VGA_CLASS_DEV_SIGNATURE EFI_SIGNATURE_32 ('V', 'G', 'A', 'C')
typedef struct {
UINTN Signature;
EFI_HANDLE Handle;
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOut;
EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;
EFI_VGA_MINI_PORT_PROTOCOL *VgaMiniPort;
EFI_PCI_IO_PROTOCOL *PciIo;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
} VGA_CLASS_DEV;
#define VGA_CLASS_DEV_FROM_THIS(a) CR (a, VGA_CLASS_DEV, SimpleTextOut, VGA_CLASS_DEV_SIGNATURE)
//
// Global Variables
//
extern EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding;
//
// Driver Binding Protocol functions
//
EFI_STATUS
EFIAPI
VgaClassDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Controller - GC_TODO: add argument description
RemainingDevicePath - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Controller - GC_TODO: add argument description
RemainingDevicePath - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Controller - GC_TODO: add argument description
NumberOfChildren - GC_TODO: add argument description
ChildHandleBuffer - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
//
// Simple Text Output Protocol functions
//
EFI_STATUS
EFIAPI
VgaClassReset (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN BOOLEAN ExtendedVerification
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
ExtendedVerification - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassOutputString (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN CHAR16 *WString
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
WString - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassTestString (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN CHAR16 *WString
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
WString - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassClearScreen (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassSetAttribute (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN UINTN Attribute
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Attribute - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassSetCursorPosition (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN UINTN Column,
IN UINTN Row
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Column - GC_TODO: add argument description
Row - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassEnableCursor (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN BOOLEAN Visible
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
Visible - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassQueryMode (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN UINTN ModeNumber,
OUT UINTN *Columns,
OUT UINTN *Rows
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
ModeNumber - GC_TODO: add argument description
Columns - GC_TODO: add argument description
Rows - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
EFI_STATUS
EFIAPI
VgaClassSetMode (
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
IN UINTN ModeNumber
)
/*++
Routine Description:
GC_TODO: Add function description
Arguments:
This - GC_TODO: add argument description
ModeNumber - GC_TODO: add argument description
Returns:
GC_TODO: add return values
--*/
;
#endif

View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<ModuleSurfaceArea xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd" xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<MsaHeader>
<ModuleName>VgaClass</ModuleName>
<ModuleType>DXE_DRIVER</ModuleType>
<GuidValue>BF89F10D-B205-474f-96E3-7A7BB1B4A407</GuidValue>
<Version>1.0</Version>
<Abstract>Component description file for VgaClass module.</Abstract>
<Description>This driver produces a VGA console.</Description>
<Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>
<License>All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.</License>
<Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
</MsaHeader>
<ModuleDefinitions>
<SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
<BinaryModule>false</BinaryModule>
<OutputFileBasename>VgaClass</OutputFileBasename>
</ModuleDefinitions>
<LibraryClassDefinitions>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DebugLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiDriverModelLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiDriverEntryPoint</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>BaseLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>DevicePathLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>BaseMemoryLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>MemoryAllocationLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>UefiBootServicesTableLib</Keyword>
</LibraryClass>
<LibraryClass Usage="ALWAYS_CONSUMED">
<Keyword>ReportStatusCodeLib</Keyword>
</LibraryClass>
</LibraryClassDefinitions>
<SourceFiles>
<Filename>VgaClass.c</Filename>
<Filename>VgaClass.h</Filename>
<Filename>ComponentName.h</Filename>
<Filename>ComponentName.c</Filename>
</SourceFiles>
<PackageDependencies>
<Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
<Package PackageGuid="68169ab0-d41b-4009-9060-292c253ac43d"/>
<Package PackageGuid="bea835f9-fd62-464a-81ff-f3a806360c6b"/>
</PackageDependencies>
<Protocols>
<Protocol Usage="ALWAYS_CONSUMED">
<ProtocolCName>gEfiDevicePathProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="ALWAYS_CONSUMED">
<ProtocolCName>gEfiPciIoProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="ALWAYS_CONSUMED">
<ProtocolCName>gEfiVgaMiniPortProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="ALWAYS_CONSUMED">
<ProtocolCName>gEfiSimpleTextInProtocolGuid</ProtocolCName>
</Protocol>
<Protocol Usage="ALWAYS_CONSUMED">
<ProtocolCName>gEfiSimpleTextOutProtocolGuid</ProtocolCName>
</Protocol>
</Protocols>
<Externs>
<Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
<Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
<Extern>
<DriverBinding>gVgaClassDriverBinding</DriverBinding>
<ComponentName>gVgaClassComponentName</ComponentName>
</Extern>
</Externs>
</ModuleSurfaceArea>

View File

@ -0,0 +1,103 @@
#/** @file
# Component description file for VgaClass module.
#
# This driver produces a VGA console.
# Copyright (c) 2006, Intel Corporation.
#
# All rights reserved.
# This software and associated documentation (if any) is furnished
# under a license and may only be used or copied in accordance
# with the terms of the license. Except as permitted by such
# license, no part of this software or documentation may be
# reproduced, stored in a retrieval system, or transmitted in any
# form or by any means without the express written consent of
# Intel Corporation.
#
#
#**/
################################################################################
#
# Defines Section - statements that will be processed to create a Makefile.
#
################################################################################
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = VgaClassDxe
FILE_GUID = BF89F10D-B205-474f-96E3-7A7BB1B4A407
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
EDK_RELEASE_VERSION = 0x00020000
EFI_SPECIFICATION_VERSION = 0x00020000
ENTRY_POINT = InitializeVgaClass
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
# DRIVER_BINDING = gVgaClassDriverBinding
# COMPONENT_NAME = gVgaClassComponentName
#
################################################################################
#
# Sources Section - list of files that are required for the build to succeed.
#
################################################################################
[Sources.common]
ComponentName.c
ComponentName.h
VgaClass.h
VgaClass.c
################################################################################
#
# Package Dependency Section - list of Package files that are required for
# this module.
#
################################################################################
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec
R9/TianoModulePkg/TianoModulePkg.dec
################################################################################
#
# Library Class Section - list of Library Classes that are required for
# this module.
#
################################################################################
[LibraryClasses]
ReportStatusCodeLib
UefiBootServicesTableLib
MemoryAllocationLib
BaseMemoryLib
DevicePathLib
UefiLib
BaseLib
UefiDriverEntryPoint
DebugLib
################################################################################
#
# Protocol C Name Section - list of Protocol and Protocol Notify C Names
# that this module uses or produces.
#
################################################################################
[Protocols]
gEfiSimpleTextOutProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiSimpleTextInProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiVgaMiniPortProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED