Code scrub for VgaClass Driver.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8163 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
UEFI Component Name(2) protocol implementation for VGA Class Driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2009, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -53,10 +54,9 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mVgaClassDriverNameTable[
|
|||||||
by This does not support the language specified by Language,
|
by This does not support the language specified by Language,
|
||||||
then EFI_UNSUPPORTED is returned.
|
then EFI_UNSUPPORTED is returned.
|
||||||
|
|
||||||
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
@param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
||||||
EFI_COMPONENT_NAME_PROTOCOL instance.
|
EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||||
|
@param Language A pointer to a Null-terminated ASCII string
|
||||||
@param Language[in] A pointer to a Null-terminated ASCII string
|
|
||||||
array indicating the language. This is the
|
array indicating the language. This is the
|
||||||
language of the driver name that the caller is
|
language of the driver name that the caller is
|
||||||
requesting, and it must match one of the
|
requesting, and it must match one of the
|
||||||
@ -64,8 +64,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mVgaClassDriverNameTable[
|
|||||||
number of languages supported by a driver is up
|
number of languages supported by a driver is up
|
||||||
to the driver writer. Language is specified
|
to the driver writer. Language is specified
|
||||||
in RFC 3066 or ISO 639-2 language code format.
|
in RFC 3066 or ISO 639-2 language code format.
|
||||||
|
@param DriverName A pointer to the Unicode string to return.
|
||||||
@param DriverName[out] A pointer to the Unicode string to return.
|
|
||||||
This Unicode string is the name of the
|
This Unicode string is the name of the
|
||||||
driver specified by This in the language
|
driver specified by This in the language
|
||||||
specified by Language.
|
specified by Language.
|
||||||
@ -73,11 +72,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mVgaClassDriverNameTable[
|
|||||||
@retval EFI_SUCCESS The Unicode string for the Driver specified by
|
@retval EFI_SUCCESS The Unicode string for the Driver specified by
|
||||||
This and the language specified by Language was
|
This and the language specified by Language was
|
||||||
returned in DriverName.
|
returned in DriverName.
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER Language is NULL.
|
@retval EFI_INVALID_PARAMETER Language is NULL.
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER DriverName is NULL.
|
@retval EFI_INVALID_PARAMETER DriverName is NULL.
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
||||||
the language specified by Language.
|
the language specified by Language.
|
||||||
|
|
||||||
@ -112,15 +108,13 @@ VgaClassComponentNameGetDriverName (
|
|||||||
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
|
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
|
||||||
support the language specified by Language, then EFI_UNSUPPORTED is returned.
|
support the language specified by Language, then EFI_UNSUPPORTED is returned.
|
||||||
|
|
||||||
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
@param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
||||||
EFI_COMPONENT_NAME_PROTOCOL instance.
|
EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||||
|
@param ControllerHandle The handle of a controller that the driver
|
||||||
@param ControllerHandle[in] The handle of a controller that the driver
|
|
||||||
specified by This is managing. This handle
|
specified by This is managing. This handle
|
||||||
specifies the controller whose name is to be
|
specifies the controller whose name is to be
|
||||||
returned.
|
returned.
|
||||||
|
@param ChildHandle The handle of the child controller to retrieve
|
||||||
@param ChildHandle[in] The handle of the child controller to retrieve
|
|
||||||
the name of. This is an optional parameter that
|
the name of. This is an optional parameter that
|
||||||
may be NULL. It will be NULL for device
|
may be NULL. It will be NULL for device
|
||||||
drivers. It will also be NULL for a bus drivers
|
drivers. It will also be NULL for a bus drivers
|
||||||
@ -128,8 +122,7 @@ VgaClassComponentNameGetDriverName (
|
|||||||
controller. It will not be NULL for a bus
|
controller. It will not be NULL for a bus
|
||||||
driver that wishes to retrieve the name of a
|
driver that wishes to retrieve the name of a
|
||||||
child controller.
|
child controller.
|
||||||
|
@param Language A pointer to a Null-terminated ASCII string
|
||||||
@param Language[in] A pointer to a Null-terminated ASCII string
|
|
||||||
array indicating the language. This is the
|
array indicating the language. This is the
|
||||||
language of the driver name that the caller is
|
language of the driver name that the caller is
|
||||||
requesting, and it must match one of the
|
requesting, and it must match one of the
|
||||||
@ -137,8 +130,7 @@ VgaClassComponentNameGetDriverName (
|
|||||||
number of languages supported by a driver is up
|
number of languages supported by a driver is up
|
||||||
to the driver writer. Language is specified in
|
to the driver writer. Language is specified in
|
||||||
RFC 3066 or ISO 639-2 language code format.
|
RFC 3066 or ISO 639-2 language code format.
|
||||||
|
@param ControllerName A pointer to the Unicode string to return.
|
||||||
@param ControllerName[out] A pointer to the Unicode string to return.
|
|
||||||
This Unicode string is the name of the
|
This Unicode string is the name of the
|
||||||
controller specified by ControllerHandle and
|
controller specified by ControllerHandle and
|
||||||
ChildHandle in the language specified by
|
ChildHandle in the language specified by
|
||||||
@ -149,20 +141,14 @@ VgaClassComponentNameGetDriverName (
|
|||||||
the language specified by Language for the
|
the language specified by Language for the
|
||||||
driver specified by This was returned in
|
driver specified by This was returned in
|
||||||
DriverName.
|
DriverName.
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
|
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
|
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
|
||||||
EFI_HANDLE.
|
EFI_HANDLE.
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER Language is NULL.
|
@retval EFI_INVALID_PARAMETER Language is NULL.
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
|
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED The driver specified by This is not currently
|
@retval EFI_UNSUPPORTED The driver specified by This is not currently
|
||||||
managing the controller specified by
|
managing the controller specified by
|
||||||
ControllerHandle and ChildHandle.
|
ControllerHandle and ChildHandle.
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
||||||
the language specified by Language.
|
the language specified by Language.
|
||||||
|
|
||||||
|
@ -1,153 +0,0 @@
|
|||||||
/**@file
|
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
|
||||||
All rights reserved. This program and the accompanying materials
|
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
|
||||||
http://opensource.org/licenses/bsd-license.php
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#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;
|
|
||||||
extern EFI_COMPONENT_NAME2_PROTOCOL gVgaClassComponentName2;
|
|
||||||
|
|
||||||
//
|
|
||||||
// EFI Component Name Functions
|
|
||||||
//
|
|
||||||
/**
|
|
||||||
Retrieves a Unicode string that is the user readable name of the driver.
|
|
||||||
|
|
||||||
This function retrieves the user readable name of a driver in the form of a
|
|
||||||
Unicode string. If the driver specified by This has a user readable name in
|
|
||||||
the language specified by Language, then a pointer to the driver name is
|
|
||||||
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
|
|
||||||
by This does not support the language specified by Language,
|
|
||||||
then EFI_UNSUPPORTED is returned.
|
|
||||||
|
|
||||||
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
|
||||||
EFI_COMPONENT_NAME_PROTOCOL instance.
|
|
||||||
|
|
||||||
@param Language[in] A pointer to a Null-terminated ASCII string
|
|
||||||
array indicating the language. This is the
|
|
||||||
language of the driver name 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. Language is specified
|
|
||||||
in RFC 3066 or ISO 639-2 language code format.
|
|
||||||
|
|
||||||
@param DriverName[out] 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.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The Unicode string for the Driver specified by
|
|
||||||
This and the language specified by Language was
|
|
||||||
returned in DriverName.
|
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER Language is NULL.
|
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER DriverName is NULL.
|
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
|
||||||
the language specified by Language.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
VgaClassComponentNameGetDriverName (
|
|
||||||
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
|
||||||
IN CHAR8 *Language,
|
|
||||||
OUT CHAR16 **DriverName
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Retrieves a Unicode string that is the user readable name of the controller
|
|
||||||
that is being managed by a driver.
|
|
||||||
|
|
||||||
This function retrieves the user readable name of the controller specified by
|
|
||||||
ControllerHandle and ChildHandle in the form of a Unicode string. If the
|
|
||||||
driver specified by This has a user readable name in the language specified by
|
|
||||||
Language, then a pointer to the controller name is returned in ControllerName,
|
|
||||||
and EFI_SUCCESS is returned. If the driver specified by This is not currently
|
|
||||||
managing the controller specified by ControllerHandle and ChildHandle,
|
|
||||||
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
|
|
||||||
support the language specified by Language, then EFI_UNSUPPORTED is returned.
|
|
||||||
|
|
||||||
@param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
|
||||||
EFI_COMPONENT_NAME_PROTOCOL instance.
|
|
||||||
|
|
||||||
@param ControllerHandle[in] The handle of a controller that the driver
|
|
||||||
specified by This is managing. This handle
|
|
||||||
specifies the controller whose name is to be
|
|
||||||
returned.
|
|
||||||
|
|
||||||
@param ChildHandle[in] 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.
|
|
||||||
|
|
||||||
@param Language[in] A pointer to a Null-terminated ASCII string
|
|
||||||
array indicating the language. This is the
|
|
||||||
language of the driver name 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. Language is specified in
|
|
||||||
RFC 3066 or ISO 639-2 language code format.
|
|
||||||
|
|
||||||
@param ControllerName[out] 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.
|
|
||||||
|
|
||||||
@retval 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.
|
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
|
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
|
|
||||||
EFI_HANDLE.
|
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER Language is NULL.
|
|
||||||
|
|
||||||
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
|
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED The driver specified by This is not currently
|
|
||||||
managing the controller specified by
|
|
||||||
ControllerHandle and ChildHandle.
|
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
|
||||||
the language specified by Language.
|
|
||||||
|
|
||||||
**/
|
|
||||||
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
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
This driver produces a VGA console.
|
VGA Class Driver that managers VGA devices and produces Simple Text Output Protocol.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2009, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -26,53 +26,11 @@ EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
The user Entry Point for module VgaClass. The user code starts with this function.
|
|
||||||
|
|
||||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
|
||||||
@param[in] SystemTable A pointer to the EFI System Table.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
|
||||||
@retval other Some error occurs when executing this entry point.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
InitializeVgaClass(
|
|
||||||
IN EFI_HANDLE ImageHandle,
|
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Install driver model protocol(s).
|
|
||||||
//
|
|
||||||
Status = EfiLibInstallDriverBindingComponentName2 (
|
|
||||||
ImageHandle,
|
|
||||||
SystemTable,
|
|
||||||
&gVgaClassDriverBinding,
|
|
||||||
ImageHandle,
|
|
||||||
&gVgaClassComponentName,
|
|
||||||
&gVgaClassComponentName2
|
|
||||||
);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Local variables
|
// Local variables
|
||||||
//
|
//
|
||||||
CHAR16 CrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };
|
CHAR16 CrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
CHAR16 Unicode;
|
|
||||||
CHAR8 PcAnsi;
|
|
||||||
CHAR8 Ascii;
|
|
||||||
} UNICODE_TO_CHAR;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// This list is used to define the valid extend chars.
|
// This list is used to define the valid extend chars.
|
||||||
// It also provides a mapping from Unicode to PCANSI or
|
// It also provides a mapping from Unicode to PCANSI or
|
||||||
@ -344,53 +302,220 @@ UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Entrypoint of this VGA Class Driver.
|
||||||
|
|
||||||
|
This function is the entrypoint of this VGA Class Driver. It installs Driver Binding
|
||||||
|
Protocols together with Component Name Protocols.
|
||||||
|
|
||||||
|
@param ImageHandle The firmware allocated handle for the EFI image.
|
||||||
|
@param SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||||
|
|
||||||
|
**/
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
InitializeVgaClass(
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
|
)
|
||||||
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private worker functions
|
// Install driver model protocol(s).
|
||||||
//
|
//
|
||||||
|
Status = EfiLibInstallDriverBindingComponentName2 (
|
||||||
|
ImageHandle,
|
||||||
|
SystemTable,
|
||||||
|
&gVgaClassDriverBinding,
|
||||||
|
ImageHandle,
|
||||||
|
&gVgaClassComponentName,
|
||||||
|
&gVgaClassComponentName2
|
||||||
|
);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
return EFI_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Internal worker function to program CRTC register via PCI I/O Protocol.
|
||||||
|
|
||||||
|
@param VgaClassDev device instance object
|
||||||
|
@param Address Address of register to write
|
||||||
|
@param Data Data to write to register.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
WriteCrtc (
|
||||||
|
IN VGA_CLASS_DEV *VgaClassDev,
|
||||||
|
IN UINT16 Address,
|
||||||
|
IN UINT8 Data
|
||||||
|
)
|
||||||
|
{
|
||||||
|
VgaClassDev->PciIo->Io.Write (
|
||||||
|
VgaClassDev->PciIo,
|
||||||
|
EfiPciIoWidthUint8,
|
||||||
|
VgaClassDev->VgaMiniPort->CrtcAddressRegisterBar,
|
||||||
|
VgaClassDev->VgaMiniPort->CrtcAddressRegisterOffset,
|
||||||
|
1,
|
||||||
|
&Address
|
||||||
|
);
|
||||||
|
|
||||||
|
VgaClassDev->PciIo->Io.Write (
|
||||||
|
VgaClassDev->PciIo,
|
||||||
|
EfiPciIoWidthUint8,
|
||||||
|
VgaClassDev->VgaMiniPort->CrtcDataRegisterBar,
|
||||||
|
VgaClassDev->VgaMiniPort->CrtcDataRegisterOffset,
|
||||||
|
1,
|
||||||
|
&Data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Internal worker function to set cursor's position to VgaClass device
|
||||||
|
|
||||||
|
@param VgaClassDev Private data structure for device instance.
|
||||||
|
@param Column Colomn of position to set cursor to.
|
||||||
|
@param Row Row of position to set cursor to.
|
||||||
|
@param MaxColumn Max value of column.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
SetVideoCursorPosition (
|
SetVideoCursorPosition (
|
||||||
IN VGA_CLASS_DEV *VgaClassDev,
|
IN VGA_CLASS_DEV *VgaClassDev,
|
||||||
IN UINTN Column,
|
IN UINTN Column,
|
||||||
IN UINTN Row,
|
IN UINTN Row,
|
||||||
IN UINTN MaxColumn
|
IN UINTN MaxColumn
|
||||||
);
|
)
|
||||||
|
{
|
||||||
|
Column = Column & 0xff;
|
||||||
|
Row = Row & 0xff;
|
||||||
|
MaxColumn = MaxColumn & 0xff;
|
||||||
|
|
||||||
VOID
|
|
||||||
WriteCrtc (
|
WriteCrtc (
|
||||||
IN VGA_CLASS_DEV *VgaClassDev,
|
VgaClassDev,
|
||||||
IN UINT16 Address,
|
CRTC_CURSOR_LOCATION_HIGH,
|
||||||
IN UINT8 Data
|
(UINT8) ((Row * MaxColumn + Column) >> 8)
|
||||||
);
|
);
|
||||||
|
WriteCrtc (
|
||||||
|
VgaClassDev,
|
||||||
|
CRTC_CURSOR_LOCATION_LOW,
|
||||||
|
(UINT8) ((Row * MaxColumn + Column) & 0xff)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Internal worker function to detect if a Unicode char is for Box Drawing text graphics.
|
||||||
|
|
||||||
|
@param Graphic Unicode char to test.
|
||||||
|
@param PcAnsi Pointer to PCANSI equivalent of Graphic for output.
|
||||||
|
If NULL, then PCANSI value is not returned.
|
||||||
|
@param Ascii Pointer to ASCII equivalent of Graphic for output.
|
||||||
|
If NULL, then ASCII value is not returned.
|
||||||
|
|
||||||
|
@retval TRUE Gpaphic is a supported Unicode Box Drawing character.
|
||||||
|
@retval FALSE Gpaphic is not a supported Unicode Box Drawing character.
|
||||||
|
|
||||||
|
**/
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
LibIsValidTextGraphics (
|
LibIsValidTextGraphics (
|
||||||
IN CHAR16 Graphic,
|
IN CHAR16 Graphic,
|
||||||
OUT CHAR8 *PcAnsi, OPTIONAL
|
OUT CHAR8 *PcAnsi, OPTIONAL
|
||||||
OUT CHAR8 *Ascii OPTIONAL
|
OUT CHAR8 *Ascii OPTIONAL
|
||||||
);
|
)
|
||||||
|
{
|
||||||
|
UNICODE_TO_CHAR *Table;
|
||||||
|
|
||||||
BOOLEAN
|
//
|
||||||
IsValidAscii (
|
// Unicode drawing code charts are all in the 0x25xx range, arrows are 0x21xx.
|
||||||
IN CHAR16 Ascii
|
// So first filter out values not in these 2 ranges.
|
||||||
);
|
//
|
||||||
|
if ((((Graphic & 0xff00) != 0x2500) && ((Graphic & 0xff00) != 0x2100))) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
BOOLEAN
|
//
|
||||||
IsValidEfiCntlChar (
|
// Search UnicodeToPcAnsiOrAscii table for matching entry.
|
||||||
IN CHAR16 c
|
//
|
||||||
);
|
for (Table = UnicodeToPcAnsiOrAscii; Table->Unicode != 0x0000; Table++) {
|
||||||
|
if (Graphic == Table->Unicode) {
|
||||||
|
if (PcAnsi != NULL) {
|
||||||
|
*PcAnsi = Table->PcAnsi;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Ascii != NULL) {
|
||||||
|
*Ascii = Table->Ascii;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// If value is not found in UnicodeToPcAnsiOrAscii table, then return FALSE.
|
||||||
|
//
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Test to see if this driver supports ControllerHandle. Any ControllerHandle
|
Internal worker function to check whether input value is an ASCII char.
|
||||||
than contains a VgaMiniPort and PciIo protocol can be supported.
|
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param Char Character to check.
|
||||||
|
|
||||||
|
@retval TRUE Input value is an ASCII char.
|
||||||
|
@retval FALSE Input value is not an ASCII char.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
IsValidAscii (
|
||||||
|
IN CHAR16 Char
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if ((Char >= 0x20) && (Char <= 0x7f)) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Internal worker function to check whether input value is a unicode control char.
|
||||||
|
|
||||||
|
@param Char Character to check.
|
||||||
|
|
||||||
|
@retval TRUE Input value is a unicode control char.
|
||||||
|
@retval FALSE Input value is not a unicode control char.
|
||||||
|
|
||||||
|
**/
|
||||||
|
BOOLEAN
|
||||||
|
IsValidEfiCntlChar (
|
||||||
|
IN CHAR16 Char
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (Char == CHAR_NULL || Char == CHAR_BACKSPACE || Char == CHAR_LINEFEED || Char == CHAR_CARRIAGE_RETURN) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Tests to see if this driver supports a given controller.
|
||||||
|
|
||||||
|
This function implments EFI_DRIVER_BINDING_PROTOCOL.Supported().
|
||||||
|
It Checks if this driver supports the controller specified. Any Controller
|
||||||
|
with VgaMiniPort Protocol and Pci I/O protocol can be supported.
|
||||||
|
|
||||||
|
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
@param ControllerHandle Handle of device to test
|
@param ControllerHandle Handle of device to test
|
||||||
@param RemainingDevicePath Optional parameter use to pick a specific child
|
@param RemainingDevicePath Optional parameter use to pick a specific child
|
||||||
device to start.
|
device to start.
|
||||||
|
|
||||||
@retval EFI_SUCCESS This driver supports this device
|
@retval EFI_SUCCESS This driver supports this device.
|
||||||
@retval EFI_ALREADY_STARTED This driver is already running on this device
|
@retval EFI_ALREADY_STARTED This driver is already running on this device.
|
||||||
@retval other This driver does not support this device
|
@retval EFI_UNSUPPORTED This driver does not support this device.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -398,19 +523,18 @@ EFIAPI
|
|||||||
VgaClassDriverBindingSupported (
|
VgaClassDriverBindingSupported (
|
||||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
IN EFI_HANDLE Controller,
|
IN EFI_HANDLE Controller,
|
||||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_VGA_MINI_PORT_PROTOCOL *VgaMiniPort;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Open the IO Abstraction(s) needed to perform the supported test
|
// Checks if Abstraction(s) needed to perform the supported test
|
||||||
//
|
//
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
Controller,
|
Controller,
|
||||||
&gEfiVgaMiniPortProtocolGuid,
|
&gEfiVgaMiniPortProtocolGuid,
|
||||||
(VOID **) &VgaMiniPort,
|
NULL,
|
||||||
This->DriverBindingHandle,
|
This->DriverBindingHandle,
|
||||||
Controller,
|
Controller,
|
||||||
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
|
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
|
||||||
@ -437,18 +561,19 @@ VgaClassDriverBindingSupported (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Start this driver on ControllerHandle by opening a PciIo and VgaMiniPort
|
Starts the device controller.
|
||||||
protocol, creating VGA_CLASS_DEV device and install gEfiSimpleTextOutProtocolGuid
|
|
||||||
finnally.
|
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
This function implments EFI_DRIVER_BINDING_PROTOCOL.Start().
|
||||||
|
It starts the device specified by Controller with the driver based on PCI I/O Protocol
|
||||||
|
and VgaMiniPort Protocol. It creates context for device instance and install EFI_SIMPLE_TEXT_OUT_PROTOCOL.
|
||||||
|
|
||||||
|
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
@param ControllerHandle Handle of device to bind driver to
|
@param ControllerHandle Handle of device to bind driver to
|
||||||
@param RemainingDevicePath Optional parameter use to pick a specific child
|
@param RemainingDevicePath Optional parameter use to pick a specific child
|
||||||
device to start.
|
device to start.
|
||||||
|
|
||||||
@retval EFI_SUCCESS This driver is added to ControllerHandle
|
@retval EFI_SUCCESS The device was started.
|
||||||
@retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
|
@retval other Fail to start the device.
|
||||||
@retval other This driver does not support this device
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -456,7 +581,7 @@ EFIAPI
|
|||||||
VgaClassDriverBindingStart (
|
VgaClassDriverBindingStart (
|
||||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
IN EFI_HANDLE Controller,
|
IN EFI_HANDLE Controller,
|
||||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -483,7 +608,7 @@ VgaClassDriverBindingStart (
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Open the IO Abstraction(s) needed
|
// Open the PCI I/O Protocol
|
||||||
//
|
//
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
Controller,
|
Controller,
|
||||||
@ -496,7 +621,9 @@ VgaClassDriverBindingStart (
|
|||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// Open the VGA Mini Port Protocol
|
||||||
|
//
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
Controller,
|
Controller,
|
||||||
&gEfiVgaMiniPortProtocolGuid,
|
&gEfiVgaMiniPortProtocolGuid,
|
||||||
@ -511,22 +638,8 @@ VgaClassDriverBindingStart (
|
|||||||
//
|
//
|
||||||
// Allocate the private device structure
|
// Allocate the private device structure
|
||||||
//
|
//
|
||||||
Status = gBS->AllocatePool (
|
VgaClassPrivate = AllocateZeroPool (sizeof (VGA_CLASS_DEV));
|
||||||
EfiBootServicesData,
|
ASSERT (VgaClassPrivate != NULL);
|
||||||
sizeof (VGA_CLASS_DEV),
|
|
||||||
(VOID **) &VgaClassPrivate
|
|
||||||
);
|
|
||||||
if (EFI_ERROR (Status)) {
|
|
||||||
gBS->CloseProtocol (
|
|
||||||
Controller,
|
|
||||||
&gEfiVgaMiniPortProtocolGuid,
|
|
||||||
This->DriverBindingHandle,
|
|
||||||
Controller
|
|
||||||
);
|
|
||||||
return EFI_OUT_OF_RESOURCES;
|
|
||||||
}
|
|
||||||
|
|
||||||
ZeroMem (VgaClassPrivate, sizeof (VGA_CLASS_DEV));
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize the private device structure
|
// Initialize the private device structure
|
||||||
@ -550,10 +663,12 @@ VgaClassDriverBindingStart (
|
|||||||
VgaClassPrivate->SimpleTextOutputMode.MaxMode = VgaMiniPort->MaxMode;
|
VgaClassPrivate->SimpleTextOutputMode.MaxMode = VgaMiniPort->MaxMode;
|
||||||
VgaClassPrivate->DevicePath = DevicePath;
|
VgaClassPrivate->DevicePath = DevicePath;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Initialize the VGA device.
|
||||||
|
//
|
||||||
Status = VgaClassPrivate->SimpleTextOut.SetAttribute (
|
Status = VgaClassPrivate->SimpleTextOut.SetAttribute (
|
||||||
&VgaClassPrivate->SimpleTextOut,
|
&VgaClassPrivate->SimpleTextOut,
|
||||||
EFI_TEXT_ATTR (EFI_WHITE,
|
EFI_TEXT_ATTR (EFI_WHITE, EFI_BLACK)
|
||||||
EFI_BLACK)
|
|
||||||
);
|
);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
goto ErrorExit;
|
goto ErrorExit;
|
||||||
@ -596,14 +711,16 @@ ErrorExit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Stop this driver on ControllerHandle. Support stoping any child handles
|
Starts the device controller.
|
||||||
|
|
||||||
|
This function implments EFI_DRIVER_BINDING_PROTOCOL.Stop().
|
||||||
|
It stops this driver on Controller. Support stoping any child handles
|
||||||
created by this driver.
|
created by this driver.
|
||||||
|
|
||||||
@param This Protocol instance pointer.
|
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
@param ControllerHandle Handle of device to stop driver on
|
@param ControllerHandle A handle to the device being stopped.
|
||||||
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
|
@param NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
||||||
children is zero stop the entire bus driver.
|
@param ChildHandleBuffer An array of child handles to be freed.
|
||||||
@param ChildHandleBuffer List of Child Handles to Stop.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS This driver is removed ControllerHandle
|
@retval EFI_SUCCESS This driver is removed ControllerHandle
|
||||||
@retval other This driver was not removed from this device
|
@retval other This driver was not removed from this device
|
||||||
@ -615,7 +732,7 @@ VgaClassDriverBindingStop (
|
|||||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
IN EFI_HANDLE Controller,
|
IN EFI_HANDLE Controller,
|
||||||
IN UINTN NumberOfChildren,
|
IN UINTN NumberOfChildren,
|
||||||
IN EFI_HANDLE *ChildHandleBuffer
|
IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -670,16 +787,25 @@ VgaClassDriverBindingStop (
|
|||||||
Controller
|
Controller
|
||||||
);
|
);
|
||||||
|
|
||||||
gBS->FreePool (VgaClassPrivate);
|
FreePool (VgaClassPrivate);
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reset VgaClass device and clear output.
|
Resets the text output device hardware.
|
||||||
|
|
||||||
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset().
|
||||||
|
It resets the text output device hardware. The cursor position is set to (0, 0),
|
||||||
|
and the screen is cleared to the default background color for the output device.
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param ExtendedVerification Indicates that the driver may perform a more exhaustive
|
||||||
|
verification operation of the device during reset.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The text output device was reset.
|
||||||
|
@retval EFI_DEVICE_ERROR The text output device is not functioning correctly and could not be reset.
|
||||||
|
|
||||||
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
|
|
||||||
@param ExtendedVerification Whether need additional judgement
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -710,16 +836,27 @@ VgaClassReset (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Output a string to VgaClass device.
|
Writes a Unicode string to the output device.
|
||||||
|
|
||||||
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString().
|
||||||
|
It writes a Unicode string to the output device. This is the most basic output mechanism
|
||||||
|
on an output device.
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param String The Null-terminated Unicode string to be displayed on the output device(s).
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The string was output to the device.
|
||||||
|
@retval EFI_DEVICE_ERROR The device reported an error while attempting to output the text.
|
||||||
|
@retval EFI_UNSUPPORTED The output device<63>s mode is not currently in a defined text mode.
|
||||||
|
@retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the characters in
|
||||||
|
the Unicode string could not be rendered and were skipped.
|
||||||
|
|
||||||
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
|
|
||||||
@param WString wide chars.
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassOutputString (
|
VgaClassOutputString (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||||
IN CHAR16 *WString
|
IN CHAR16 *String
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -731,7 +868,6 @@ VgaClassOutputString (
|
|||||||
CHAR8 GraphicChar;
|
CHAR8 GraphicChar;
|
||||||
|
|
||||||
VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);
|
VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);
|
||||||
|
|
||||||
Mode = This->Mode;
|
Mode = This->Mode;
|
||||||
|
|
||||||
Status = This->QueryMode (
|
Status = This->QueryMode (
|
||||||
@ -744,9 +880,12 @@ VgaClassOutputString (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; *WString != CHAR_NULL; WString++) {
|
//
|
||||||
|
// Parse each character of the string to output
|
||||||
|
//
|
||||||
|
for (; *String != CHAR_NULL; String++) {
|
||||||
|
|
||||||
switch (*WString) {
|
switch (*String) {
|
||||||
case CHAR_BACKSPACE:
|
case CHAR_BACKSPACE:
|
||||||
if (Mode->CursorColumn > 0) {
|
if (Mode->CursorColumn > 0) {
|
||||||
Mode->CursorColumn--;
|
Mode->CursorColumn--;
|
||||||
@ -794,14 +933,14 @@ VgaClassOutputString (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (!LibIsValidTextGraphics (*WString, &GraphicChar, NULL)) {
|
if (!LibIsValidTextGraphics (*String, &GraphicChar, NULL)) {
|
||||||
//
|
//
|
||||||
// Just convert to ASCII
|
// If this character is not ,Box Drawing text graphics, then convert it to ASCII.
|
||||||
//
|
//
|
||||||
GraphicChar = (CHAR8) *WString;
|
GraphicChar = (CHAR8) *String;
|
||||||
if (!IsValidAscii (GraphicChar)) {
|
if (!IsValidAscii (GraphicChar)) {
|
||||||
//
|
//
|
||||||
// Keep the API from supporting PCANSI Graphics chars
|
// If not valid ASCII char, convert it to "?"
|
||||||
//
|
//
|
||||||
GraphicChar = '?';
|
GraphicChar = '?';
|
||||||
}
|
}
|
||||||
@ -837,38 +976,50 @@ VgaClassOutputString (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Detects if a Unicode char is for Box Drawing text graphics.
|
Verifies that all characters in a Unicode string can be output to the target device.
|
||||||
|
|
||||||
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.TestString().
|
||||||
@param WString Unicode chars
|
It verifies that all characters in a Unicode string can be output to the target device.
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param String The Null-terminated Unicode string to be examined for the output device(s).
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The device(s) are capable of rendering the output string.
|
||||||
|
@retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be rendered by
|
||||||
|
one or more of the output devices mapped by the EFI handle.
|
||||||
|
|
||||||
@return if a Unicode char is for Box Drawing text graphics.
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassTestString (
|
VgaClassTestString (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||||
IN CHAR16 *WString
|
IN CHAR16 *String
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
while (*WString != 0x0000) {
|
while (*String != CHAR_NULL) {
|
||||||
if (!(IsValidAscii (*WString) || IsValidEfiCntlChar (*WString) || LibIsValidTextGraphics (*WString, NULL, NULL))) {
|
if (!(IsValidAscii (*String) || IsValidEfiCntlChar (*String) || LibIsValidTextGraphics (*String, NULL, NULL))) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
WString++;
|
String++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Clear Screen via VgaClass device
|
Clears the output device(s) display to the currently selected background color.
|
||||||
|
|
||||||
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.ClearScreen().
|
||||||
|
The ClearScreen() function clears the output device(s) display to the currently
|
||||||
|
selected background color. The cursor position is set to (0, 0).
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
|
||||||
|
@retval EFI_SUCESS The operation completed successfully.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
|
@retval EFI_UNSUPPORTED The output device is not in a valid text mode.
|
||||||
|
|
||||||
@retval EFI_SUCESS Success to clear screen
|
|
||||||
@retval Others Wrong displaying mode.
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -911,13 +1062,22 @@ VgaClassClearScreen (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Set displaying mode's attribute
|
Sets the background and foreground colors for theOutputString() and ClearScreen() functions.
|
||||||
|
|
||||||
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute().
|
||||||
@param Attribute Mode's attribute
|
It sets the background and foreground colors for the OutputString() and ClearScreen() functions.
|
||||||
|
The color mask can be set even when the device is in an invalid text mode.
|
||||||
|
Devices supporting a different number of text colors are required to emulate the above colors
|
||||||
|
to the best of the device<63>s capabilities.
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param Attribute The attribute to set.
|
||||||
|
Bits 0..3 are the foreground color,
|
||||||
|
and bits 4..6 are the background color.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The requested attributes were set.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
|
|
||||||
@param EFI_SUCCESS Success to set attribute
|
|
||||||
@param EFI_UNSUPPORTED Wrong mode's attribute wanted to be set
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -935,14 +1095,21 @@ VgaClassSetAttribute (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Set cursor position.
|
Sets the current coordinates of the cursor position.
|
||||||
|
|
||||||
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetCursorPosition().
|
||||||
@param Column Column of new cursor position.
|
It sets the current coordinates of the cursor position.
|
||||||
@param Row Row of new cursor position.
|
The upper left corner of the screen is defined as coordinate (0, 0).
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param Column Column of position to set the cursor to.
|
||||||
|
@param Row Row of position to set the cursor to.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The operation completed successfully.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
|
@retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the cursor
|
||||||
|
position is invalid for the current mode.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Sucess to set cursor's position.
|
|
||||||
@retval Others Wrong current displaying mode.
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -982,12 +1149,20 @@ VgaClassSetCursorPosition (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Enable cursor to display or not.
|
Makes the cursor visible or invisible.
|
||||||
|
|
||||||
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.EnableCursor().
|
||||||
@param Visible Display cursor or not.
|
It makes the cursor visible or invisible.
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param Visible If TRUE, the cursor is set to be visible.
|
||||||
|
If FALSE, the cursor is set to be invisible.
|
||||||
|
|
||||||
|
@retval EFI_SUCESS The operation completed successfully.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request or the
|
||||||
|
device does not support changing the cursor mode.
|
||||||
|
@retval EFI_UNSUPPORTED The output device does not support visibility control of the cursor.
|
||||||
|
|
||||||
@retval EFI_SUCESS Success to display the cursor or not.
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -1000,16 +1175,18 @@ VgaClassEnableCursor (
|
|||||||
|
|
||||||
VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);
|
VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);
|
||||||
if (Visible) {
|
if (Visible) {
|
||||||
switch (This->Mode->Mode) {
|
if (This->Mode->Mode == 1) {
|
||||||
case 1:
|
//
|
||||||
|
// 80 * 50
|
||||||
|
//
|
||||||
WriteCrtc (VgaClassDev, CRTC_CURSOR_START, 0x06);
|
WriteCrtc (VgaClassDev, CRTC_CURSOR_START, 0x06);
|
||||||
WriteCrtc (VgaClassDev, CRTC_CURSOR_END, 0x07);
|
WriteCrtc (VgaClassDev, CRTC_CURSOR_END, 0x07);
|
||||||
break;
|
} else {
|
||||||
|
//
|
||||||
default:
|
// 80 * 25
|
||||||
|
//
|
||||||
WriteCrtc (VgaClassDev, CRTC_CURSOR_START, 0x0e);
|
WriteCrtc (VgaClassDev, CRTC_CURSOR_START, 0x0e);
|
||||||
WriteCrtc (VgaClassDev, CRTC_CURSOR_END, 0x0f);
|
WriteCrtc (VgaClassDev, CRTC_CURSOR_END, 0x0f);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
WriteCrtc (VgaClassDev, CRTC_CURSOR_START, 0x20);
|
WriteCrtc (VgaClassDev, CRTC_CURSOR_START, 0x20);
|
||||||
@ -1020,18 +1197,22 @@ VgaClassEnableCursor (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Query colum and row according displaying mode number
|
Returns information for an available text mode that the output device(s) supports.
|
||||||
The mode:
|
|
||||||
0: 80 * 25
|
|
||||||
1: 80 * 50
|
|
||||||
|
|
||||||
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode().
|
||||||
@param ModeNumber Mode number
|
It returns information for an available text mode that the output device(s) supports.
|
||||||
@param Columns return the columen in current mode number
|
It is required that all output devices support at least 80x25 text mode. This mode is defined to be mode 0.
|
||||||
@param Rows return the row in current mode number.
|
If the output devices support 80x50, that is defined to be mode 1.
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param ModeNumber The mode number to return information on.
|
||||||
|
@param Columns Columen in current mode number
|
||||||
|
@param Rows Row in current mode number.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The requested mode information was returned.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
|
@retval EFI_UNSUPPORTED The mode number was not valid.
|
||||||
|
|
||||||
@return EFI_SUCCESS Sucess to get columns and rows according to mode number
|
|
||||||
@return EFI_UNSUPPORTED Unsupported mode number
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -1069,13 +1250,20 @@ VgaClassQueryMode (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Set displaying mode number
|
Sets the output device(s) to a specified mode.
|
||||||
|
|
||||||
@param This Pointer of EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode().
|
||||||
@param ModeNumber mode number
|
It sets the output device(s) to the requested mode.
|
||||||
|
On success the device is in the geometry for the requested mode,
|
||||||
|
and the device has been cleared to the current background color with the cursor at (0,0).
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param ModeNumber The text mode to set.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The requested text mode was set.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
|
@retval EFI_UNSUPPORTED The mode number was not valid.
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED Unsupported mode number in parameter
|
|
||||||
@retval EFI_SUCCESS Success to set the mode number.
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -1084,7 +1272,6 @@ VgaClassSetMode (
|
|||||||
IN UINTN ModeNumber
|
IN UINTN ModeNumber
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
|
||||||
VGA_CLASS_DEV *VgaClassDev;
|
VGA_CLASS_DEV *VgaClassDev;
|
||||||
|
|
||||||
VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);
|
VgaClassDev = VGA_CLASS_DEV_FROM_THIS (This);
|
||||||
@ -1097,153 +1284,5 @@ VgaClassSetMode (
|
|||||||
|
|
||||||
This->Mode->Mode = (INT32) ModeNumber;
|
This->Mode->Mode = (INT32) ModeNumber;
|
||||||
|
|
||||||
Status = VgaClassDev->VgaMiniPort->SetMode (VgaClassDev->VgaMiniPort, ModeNumber);
|
return VgaClassDev->VgaMiniPort->SetMode (VgaClassDev->VgaMiniPort, ModeNumber);
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
Set logic cursor's position to VgaClass device
|
|
||||||
|
|
||||||
@param VgaClassDev device instance object
|
|
||||||
@param Column cursor logic position.
|
|
||||||
@param Row cursor logic position.
|
|
||||||
@param MaxColumn max logic column
|
|
||||||
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
SetVideoCursorPosition (
|
|
||||||
IN VGA_CLASS_DEV *VgaClassDev,
|
|
||||||
IN UINTN Column,
|
|
||||||
IN UINTN Row,
|
|
||||||
IN UINTN MaxColumn
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Column = Column & 0xff;
|
|
||||||
Row = Row & 0xff;
|
|
||||||
MaxColumn = MaxColumn & 0xff;
|
|
||||||
WriteCrtc (
|
|
||||||
VgaClassDev,
|
|
||||||
CRTC_CURSOR_LOCATION_HIGH,
|
|
||||||
(UINT8) ((Row * MaxColumn + Column) >> 8)
|
|
||||||
);
|
|
||||||
WriteCrtc (
|
|
||||||
VgaClassDev,
|
|
||||||
CRTC_CURSOR_LOCATION_LOW,
|
|
||||||
(UINT8) ((Row * MaxColumn + Column) & 0xff)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Program CRTC register via PCI IO.
|
|
||||||
|
|
||||||
@param VgaClassDev device instance object
|
|
||||||
@param Address address
|
|
||||||
@param Data data
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
WriteCrtc (
|
|
||||||
IN VGA_CLASS_DEV *VgaClassDev,
|
|
||||||
IN UINT16 Address,
|
|
||||||
IN UINT8 Data
|
|
||||||
)
|
|
||||||
{
|
|
||||||
VgaClassDev->PciIo->Io.Write (
|
|
||||||
VgaClassDev->PciIo,
|
|
||||||
EfiPciIoWidthUint8,
|
|
||||||
VgaClassDev->VgaMiniPort->CrtcAddressRegisterBar,
|
|
||||||
VgaClassDev->VgaMiniPort->CrtcAddressRegisterOffset,
|
|
||||||
1,
|
|
||||||
&Address
|
|
||||||
);
|
|
||||||
|
|
||||||
VgaClassDev->PciIo->Io.Write (
|
|
||||||
VgaClassDev->PciIo,
|
|
||||||
EfiPciIoWidthUint8,
|
|
||||||
VgaClassDev->VgaMiniPort->CrtcDataRegisterBar,
|
|
||||||
VgaClassDev->VgaMiniPort->CrtcDataRegisterOffset,
|
|
||||||
1,
|
|
||||||
&Data
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Detects if a Unicode char is for Box Drawing text graphics.
|
|
||||||
|
|
||||||
@param Grphic Unicode char to test.
|
|
||||||
@param PcAnsi Optional pointer to return PCANSI equivalent of Graphic.
|
|
||||||
@param Asci Optional pointer to return Ascii equivalent of Graphic.
|
|
||||||
|
|
||||||
@return TRUE if Gpaphic is a supported Unicode Box Drawing character.
|
|
||||||
|
|
||||||
**/
|
|
||||||
BOOLEAN
|
|
||||||
LibIsValidTextGraphics (
|
|
||||||
IN CHAR16 Graphic,
|
|
||||||
OUT CHAR8 *PcAnsi, OPTIONAL
|
|
||||||
OUT CHAR8 *Ascii OPTIONAL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
UNICODE_TO_CHAR *Table;
|
|
||||||
|
|
||||||
if ((((Graphic & 0xff00) != 0x2500) && ((Graphic & 0xff00) != 0x2100))) {
|
|
||||||
//
|
|
||||||
// Unicode drawing code charts are all in the 0x25xx range,
|
|
||||||
// arrows are 0x21xx
|
|
||||||
//
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Table = UnicodeToPcAnsiOrAscii; Table->Unicode != 0x0000; Table++) {
|
|
||||||
if (Graphic == Table->Unicode) {
|
|
||||||
if (PcAnsi) {
|
|
||||||
*PcAnsi = Table->PcAnsi;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Ascii) {
|
|
||||||
*Ascii = Table->Ascii;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Judge whether is an ASCII char.
|
|
||||||
|
|
||||||
@param Ascii character
|
|
||||||
@return whether is an ASCII char.
|
|
||||||
**/
|
|
||||||
BOOLEAN
|
|
||||||
IsValidAscii (
|
|
||||||
IN CHAR16 Ascii
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if ((Ascii >= 0x20) && (Ascii <= 0x7f)) {
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Judge whether is diplaying control character.
|
|
||||||
|
|
||||||
@param c character
|
|
||||||
@return whether is diplaying control character.
|
|
||||||
**/
|
|
||||||
BOOLEAN
|
|
||||||
IsValidEfiCntlChar (
|
|
||||||
IN CHAR16 c
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (c == CHAR_NULL || c == CHAR_BACKSPACE || c == CHAR_LINEFEED || c == CHAR_CARRIAGE_RETURN) {
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
|
Internal include file of the VGA Class Driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2009, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -12,13 +13,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
#ifndef _VGA_CLASS_H
|
#ifndef _VGA_CLASS_H__
|
||||||
#define _VGA_CLASS_H
|
#define _VGA_CLASS_H__
|
||||||
|
|
||||||
#include <PiDxe.h>
|
#include <PiDxe.h>
|
||||||
#include <FrameworkDxe.h>
|
#include <FrameworkDxe.h>
|
||||||
|
|
||||||
#include <Protocol/SimpleTextIn.h>
|
|
||||||
#include <Protocol/SimpleTextOut.h>
|
#include <Protocol/SimpleTextOut.h>
|
||||||
#include <Protocol/PciIo.h>
|
#include <Protocol/PciIo.h>
|
||||||
#include <Protocol/VgaMiniPort.h>
|
#include <Protocol/VgaMiniPort.h>
|
||||||
@ -26,17 +26,21 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/UefiDriverEntryPoint.h>
|
#include <Library/UefiDriverEntryPoint.h>
|
||||||
#include <Library/BaseLib.h>
|
|
||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
#include <Library/BaseMemoryLib.h>
|
|
||||||
#include <Library/MemoryAllocationLib.h>
|
#include <Library/MemoryAllocationLib.h>
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
#include <Library/ReportStatusCodeLib.h>
|
#include <Library/ReportStatusCodeLib.h>
|
||||||
|
|
||||||
|
|
||||||
#include <IndustryStandard/Pci22.h>
|
#include <IndustryStandard/Pci22.h>
|
||||||
#include "ComponentName.h"
|
|
||||||
#include <Protocol/VgaMiniPort.h>
|
//
|
||||||
|
// Structure for tuple containing mapping among uniocde, PC Ansi and ASCII code.
|
||||||
|
//
|
||||||
|
typedef struct {
|
||||||
|
CHAR16 Unicode;
|
||||||
|
CHAR8 PcAnsi;
|
||||||
|
CHAR8 Ascii;
|
||||||
|
} UNICODE_TO_CHAR;
|
||||||
|
|
||||||
//
|
//
|
||||||
// VGA specific registers
|
// VGA specific registers
|
||||||
@ -70,261 +74,381 @@ typedef struct {
|
|||||||
// Global Variables
|
// Global Variables
|
||||||
//
|
//
|
||||||
extern EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding;
|
extern EFI_DRIVER_BINDING_PROTOCOL gVgaClassDriverBinding;
|
||||||
|
extern EFI_COMPONENT_NAME_PROTOCOL gVgaClassComponentName;
|
||||||
|
extern EFI_COMPONENT_NAME2_PROTOCOL gVgaClassComponentName2;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Driver Binding Protocol functions
|
// Driver Binding Protocol functions
|
||||||
//
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
Tests to see if this driver supports a given controller.
|
||||||
|
|
||||||
|
This function implments EFI_DRIVER_BINDING_PROTOCOL.Supported().
|
||||||
|
It Checks if this driver supports the controller specified. Any Controller
|
||||||
|
with VgaMiniPort Protocol and Pci I/O protocol can be supported.
|
||||||
|
|
||||||
|
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
|
@param ControllerHandle Handle of device to test
|
||||||
|
@param RemainingDevicePath Optional parameter use to pick a specific child
|
||||||
|
device to start.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS This driver supports this device.
|
||||||
|
@retval EFI_ALREADY_STARTED This driver is already running on this device.
|
||||||
|
@retval EFI_UNSUPPORTED This driver does not support this device.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassDriverBindingSupported (
|
VgaClassDriverBindingSupported (
|
||||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
IN EFI_HANDLE Controller,
|
IN EFI_HANDLE Controller,
|
||||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Starts the device controller.
|
||||||
|
|
||||||
Routine Description:
|
This function implments EFI_DRIVER_BINDING_PROTOCOL.Start().
|
||||||
|
It starts the device specified by Controller with the driver based on PCI I/O Protocol
|
||||||
|
and VgaMiniPort Protocol. It creates context for device instance and install EFI_SIMPLE_TEXT_OUT_PROTOCOL.
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
|
@param ControllerHandle Handle of device to bind driver to
|
||||||
|
@param RemainingDevicePath Optional parameter use to pick a specific child
|
||||||
|
device to start.
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCCESS The device was started.
|
||||||
|
@retval other Fail to start the device.
|
||||||
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassDriverBindingStart (
|
VgaClassDriverBindingStart (
|
||||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
IN EFI_HANDLE Controller,
|
IN EFI_HANDLE Controller,
|
||||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
|
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Starts the device controller.
|
||||||
|
|
||||||
Routine Description:
|
This function implments EFI_DRIVER_BINDING_PROTOCOL.Stop().
|
||||||
|
It stops this driver on Controller. Support stoping any child handles
|
||||||
|
created by this driver.
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
|
||||||
|
@param ControllerHandle A handle to the device being stopped.
|
||||||
|
@param NumberOfChildren The number of child device handles in ChildHandleBuffer.
|
||||||
|
@param ChildHandleBuffer An array of child handles to be freed.
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCCESS This driver is removed ControllerHandle
|
||||||
|
@retval other This driver was not removed from this device
|
||||||
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassDriverBindingStop (
|
VgaClassDriverBindingStop (
|
||||||
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
IN EFI_DRIVER_BINDING_PROTOCOL *This,
|
||||||
IN EFI_HANDLE Controller,
|
IN EFI_HANDLE Controller,
|
||||||
IN UINTN NumberOfChildren,
|
IN UINTN NumberOfChildren,
|
||||||
IN EFI_HANDLE *ChildHandleBuffer
|
IN EFI_HANDLE *ChildHandleBuffer OPTIONAL
|
||||||
)
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// EFI Component Name Functions
|
||||||
|
//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Retrieves a Unicode string that is the user readable name of the driver.
|
||||||
|
|
||||||
Routine Description:
|
This function retrieves the user readable name of a driver in the form of a
|
||||||
|
Unicode string. If the driver specified by This has a user readable name in
|
||||||
|
the language specified by Language, then a pointer to the driver name is
|
||||||
|
returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
|
||||||
|
by This does not support the language specified by Language,
|
||||||
|
then EFI_UNSUPPORTED is returned.
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
||||||
|
EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||||
|
@param Language A pointer to a Null-terminated ASCII string
|
||||||
|
array indicating the language. This is the
|
||||||
|
language of the driver name 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. Language is specified
|
||||||
|
in RFC 3066 or ISO 639-2 language code format.
|
||||||
|
@param 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.
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCCESS The Unicode string for the Driver specified by
|
||||||
|
This and the language specified by Language was
|
||||||
This - GC_TODO: add argument description
|
returned in DriverName.
|
||||||
Controller - GC_TODO: add argument description
|
@retval EFI_INVALID_PARAMETER Language is NULL.
|
||||||
NumberOfChildren - GC_TODO: add argument description
|
@retval EFI_INVALID_PARAMETER DriverName is NULL.
|
||||||
ChildHandleBuffer - GC_TODO: add argument description
|
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
||||||
|
the language specified by Language.
|
||||||
Returns:
|
|
||||||
|
|
||||||
GC_TODO: add return values
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
;
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
VgaClassComponentNameGetDriverName (
|
||||||
|
IN EFI_COMPONENT_NAME_PROTOCOL *This,
|
||||||
|
IN CHAR8 *Language,
|
||||||
|
OUT CHAR16 **DriverName
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Retrieves a Unicode string that is the user readable name of the controller
|
||||||
|
that is being managed by a driver.
|
||||||
|
|
||||||
|
This function retrieves the user readable name of the controller specified by
|
||||||
|
ControllerHandle and ChildHandle in the form of a Unicode string. If the
|
||||||
|
driver specified by This has a user readable name in the language specified by
|
||||||
|
Language, then a pointer to the controller name is returned in ControllerName,
|
||||||
|
and EFI_SUCCESS is returned. If the driver specified by This is not currently
|
||||||
|
managing the controller specified by ControllerHandle and ChildHandle,
|
||||||
|
then EFI_UNSUPPORTED is returned. If the driver specified by This does not
|
||||||
|
support the language specified by Language, then EFI_UNSUPPORTED is returned.
|
||||||
|
|
||||||
|
@param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
|
||||||
|
EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||||
|
@param 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.
|
||||||
|
@param 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.
|
||||||
|
@param Language A pointer to a Null-terminated ASCII string
|
||||||
|
array indicating the language. This is the
|
||||||
|
language of the driver name 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. Language is specified in
|
||||||
|
RFC 3066 or ISO 639-2 language code format.
|
||||||
|
@param 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.
|
||||||
|
|
||||||
|
@retval 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.
|
||||||
|
@retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
|
||||||
|
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
|
||||||
|
EFI_HANDLE.
|
||||||
|
@retval EFI_INVALID_PARAMETER Language is NULL.
|
||||||
|
@retval EFI_INVALID_PARAMETER ControllerName is NULL.
|
||||||
|
@retval EFI_UNSUPPORTED The driver specified by This is not currently
|
||||||
|
managing the controller specified by
|
||||||
|
ControllerHandle and ChildHandle.
|
||||||
|
@retval EFI_UNSUPPORTED The driver specified by This does not support
|
||||||
|
the language specified by Language.
|
||||||
|
|
||||||
|
**/
|
||||||
|
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
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Simple Text Output Protocol functions
|
// Simple Text Output Protocol functions
|
||||||
//
|
//
|
||||||
|
/**
|
||||||
|
Resets the text output device hardware.
|
||||||
|
|
||||||
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset().
|
||||||
|
It resets the text output device hardware. The cursor position is set to (0, 0),
|
||||||
|
and the screen is cleared to the default background color for the output device.
|
||||||
|
|
||||||
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param ExtendedVerification Indicates that the driver may perform a more exhaustive
|
||||||
|
verification operation of the device during reset.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The text output device was reset.
|
||||||
|
@retval EFI_DEVICE_ERROR The text output device is not functioning correctly and could not be reset.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassReset (
|
VgaClassReset (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||||
IN BOOLEAN ExtendedVerification
|
IN BOOLEAN ExtendedVerification
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Writes a Unicode string to the output device.
|
||||||
|
|
||||||
Routine Description:
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString().
|
||||||
|
It writes a Unicode string to the output device. This is the most basic output mechanism
|
||||||
|
on an output device.
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param String The Null-terminated Unicode string to be displayed on the output device(s).
|
||||||
Arguments:
|
|
||||||
|
|
||||||
This - GC_TODO: add argument description
|
|
||||||
ExtendedVerification - GC_TODO: add argument description
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
GC_TODO: add return values
|
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The string was output to the device.
|
||||||
|
@retval EFI_DEVICE_ERROR The device reported an error while attempting to output the text.
|
||||||
|
@retval EFI_UNSUPPORTED The output device<63>s mode is not currently in a defined text mode.
|
||||||
|
@retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the characters in
|
||||||
|
the Unicode string could not be rendered and were skipped.
|
||||||
**/
|
**/
|
||||||
;
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassOutputString (
|
VgaClassOutputString (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||||
IN CHAR16 *WString
|
IN CHAR16 *String
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Verifies that all characters in a Unicode string can be output to the target device.
|
||||||
|
|
||||||
Routine Description:
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.TestString().
|
||||||
|
It verifies that all characters in a Unicode string can be output to the target device.
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param String The Null-terminated Unicode string to be examined for the output device(s).
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCCESS The device(s) are capable of rendering the output string.
|
||||||
|
@retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be rendered by
|
||||||
This - GC_TODO: add argument description
|
one or more of the output devices mapped by the EFI handle.
|
||||||
WString - GC_TODO: add argument description
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
GC_TODO: add return values
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
;
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassTestString (
|
VgaClassTestString (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||||
IN CHAR16 *WString
|
IN CHAR16 *String
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Clears the output device(s) display to the currently selected background color.
|
||||||
|
|
||||||
Routine Description:
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.ClearScreen().
|
||||||
|
The ClearScreen() function clears the output device(s) display to the currently
|
||||||
|
selected background color. The cursor position is set to (0, 0).
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCESS The operation completed successfully.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
This - GC_TODO: add argument description
|
@retval EFI_UNSUPPORTED The output device is not in a valid text mode.
|
||||||
WString - GC_TODO: add argument description
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
GC_TODO: add return values
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
;
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassClearScreen (
|
VgaClassClearScreen (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Sets the background and foreground colors for theOutputString() and ClearScreen() functions.
|
||||||
|
|
||||||
Routine Description:
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute().
|
||||||
|
It sets the background and foreground colors for the OutputString() and ClearScreen() functions.
|
||||||
|
The color mask can be set even when the device is in an invalid text mode.
|
||||||
|
Devices supporting a different number of text colors are required to emulate the above colors
|
||||||
|
to the best of the device<63>s capabilities.
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param Attribute The attribute to set.
|
||||||
|
Bits 0..3 are the foreground color,
|
||||||
|
and bits 4..6 are the background color.
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCCESS The requested attributes were set.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
This - GC_TODO: add argument description
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
GC_TODO: add return values
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
;
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassSetAttribute (
|
VgaClassSetAttribute (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||||
IN UINTN Attribute
|
IN UINTN Attribute
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Sets the current coordinates of the cursor position.
|
||||||
|
|
||||||
Routine Description:
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetCursorPosition().
|
||||||
|
It sets the current coordinates of the cursor position.
|
||||||
|
The upper left corner of the screen is defined as coordinate (0, 0).
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param Column Column of position to set the cursor to.
|
||||||
|
@param Row Row of position to set the cursor to.
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCCESS The operation completed successfully.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
This - GC_TODO: add argument description
|
@retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the cursor
|
||||||
Attribute - GC_TODO: add argument description
|
position is invalid for the current mode.
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
GC_TODO: add return values
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
;
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassSetCursorPosition (
|
VgaClassSetCursorPosition (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||||
IN UINTN Column,
|
IN UINTN Column,
|
||||||
IN UINTN Row
|
IN UINTN Row
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Makes the cursor visible or invisible.
|
||||||
|
|
||||||
Routine Description:
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.EnableCursor().
|
||||||
|
It makes the cursor visible or invisible.
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param Visible If TRUE, the cursor is set to be visible.
|
||||||
|
If FALSE, the cursor is set to be invisible.
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCESS The operation completed successfully.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request or the
|
||||||
This - GC_TODO: add argument description
|
device does not support changing the cursor mode.
|
||||||
Column - GC_TODO: add argument description
|
@retval EFI_UNSUPPORTED The output device does not support visibility control of the cursor.
|
||||||
Row - GC_TODO: add argument description
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
GC_TODO: add return values
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
;
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassEnableCursor (
|
VgaClassEnableCursor (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||||
IN BOOLEAN Visible
|
IN BOOLEAN Visible
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Returns information for an available text mode that the output device(s) supports.
|
||||||
|
|
||||||
Routine Description:
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode().
|
||||||
|
It returns information for an available text mode that the output device(s) supports.
|
||||||
|
It is required that all output devices support at least 80x25 text mode. This mode is defined to be mode 0.
|
||||||
|
If the output devices support 80x50, that is defined to be mode 1.
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param ModeNumber The mode number to return information on.
|
||||||
|
@param Columns Columen in current mode number
|
||||||
|
@param Rows Row in current mode number.
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCCESS The requested mode information was returned.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
This - GC_TODO: add argument description
|
@retval EFI_UNSUPPORTED The mode number was not valid.
|
||||||
Visible - GC_TODO: add argument description
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
GC_TODO: add return values
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
;
|
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassQueryMode (
|
VgaClassQueryMode (
|
||||||
@ -332,49 +456,29 @@ VgaClassQueryMode (
|
|||||||
IN UINTN ModeNumber,
|
IN UINTN ModeNumber,
|
||||||
OUT UINTN *Columns,
|
OUT UINTN *Columns,
|
||||||
OUT UINTN *Rows
|
OUT UINTN *Rows
|
||||||
)
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Sets the output device(s) to a specified mode.
|
||||||
|
|
||||||
Routine Description:
|
This function implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.QueryMode().
|
||||||
|
It sets the output device(s) to the requested mode.
|
||||||
|
On success the device is in the geometry for the requested mode,
|
||||||
|
and the device has been cleared to the current background color with the cursor at (0,0).
|
||||||
|
|
||||||
GC_TODO: Add function description
|
@param This Pointer to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
||||||
|
@param ModeNumber The text mode to set.
|
||||||
|
|
||||||
Arguments:
|
@retval EFI_SUCCESS The requested text mode was set.
|
||||||
|
@retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
|
||||||
This - GC_TODO: add argument description
|
@retval EFI_UNSUPPORTED The mode number was not valid.
|
||||||
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
VgaClassSetMode (
|
VgaClassSetMode (
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||||
IN UINTN ModeNumber
|
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
|
#endif
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
#/** @file
|
#/** @file
|
||||||
# Component description file for VgaClass module.
|
# VGA Class Driver that managers VGA devices and produces Simple Text Output Protocol.
|
||||||
#
|
#
|
||||||
# This driver produces a VGA console.
|
# Copyright (c) 2006 - 2009, Intel Corporation.
|
||||||
# Copyright (c) 2006, Intel Corporation.
|
|
||||||
#
|
#
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
@ -35,14 +34,12 @@
|
|||||||
|
|
||||||
[Sources.common]
|
[Sources.common]
|
||||||
ComponentName.c
|
ComponentName.c
|
||||||
ComponentName.h
|
|
||||||
VgaClass.h
|
VgaClass.h
|
||||||
VgaClass.c
|
VgaClass.c
|
||||||
|
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
MdeModulePkg/MdeModulePkg.dec
|
|
||||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||||
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
||||||
|
|
||||||
@ -51,18 +48,15 @@
|
|||||||
ReportStatusCodeLib
|
ReportStatusCodeLib
|
||||||
UefiBootServicesTableLib
|
UefiBootServicesTableLib
|
||||||
MemoryAllocationLib
|
MemoryAllocationLib
|
||||||
BaseMemoryLib
|
|
||||||
UefiLib
|
UefiLib
|
||||||
BaseLib
|
|
||||||
UefiDriverEntryPoint
|
UefiDriverEntryPoint
|
||||||
DebugLib
|
DebugLib
|
||||||
|
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiSimpleTextOutProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiSimpleTextOutProtocolGuid # PROTOCOL BY_START
|
||||||
gEfiSimpleTextInProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiVgaMiniPortProtocolGuid # PROTOCOL TO_START
|
||||||
gEfiVgaMiniPortProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiPciIoProtocolGuid # PROTOCOL TO_START
|
||||||
gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
gEfiDevicePathProtocolGuid # PROTOCOL TO_START
|
||||||
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user