summaryrefslogtreecommitdiff
path: root/UnixPkg/UnixUgaDxe
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2013-07-29 21:09:55 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2013-07-29 21:09:55 +0000
commit5d71a30480bdf7081f72485d6bf48361c244c4d7 (patch)
treeeaa76ec905c5a488d86edb9dcc5c4c7a79958258 /UnixPkg/UnixUgaDxe
parentbf6ee6c7c33cf280cdfb2fd0e6b66a712b7aa4a1 (diff)
downloadedk2-5d71a30480bdf7081f72485d6bf48361c244c4d7.zip
edk2-5d71a30480bdf7081f72485d6bf48361c244c4d7.tar.gz
edk2-5d71a30480bdf7081f72485d6bf48361c244c4d7.tar.bz2
UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg)
For now the UnixPkg/Deprecated.txt file is retained to indicate that EmulatorPkg should be used instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14518 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UnixPkg/UnixUgaDxe')
-rw-r--r--UnixPkg/UnixUgaDxe/ComponentName.c198
-rw-r--r--UnixPkg/UnixUgaDxe/EntryPoint.c49
-rw-r--r--UnixPkg/UnixUgaDxe/UnixUga.h332
-rw-r--r--UnixPkg/UnixUgaDxe/UnixUga.inf73
-rw-r--r--UnixPkg/UnixUgaDxe/UnixUgaDriver.c300
-rw-r--r--UnixPkg/UnixUgaDxe/UnixUgaInput.c418
-rw-r--r--UnixPkg/UnixUgaDxe/UnixUgaScreen.c454
7 files changed, 0 insertions, 1824 deletions
diff --git a/UnixPkg/UnixUgaDxe/ComponentName.c b/UnixPkg/UnixUgaDxe/ComponentName.c
deleted file mode 100644
index 4ba081b..0000000
--- a/UnixPkg/UnixUgaDxe/ComponentName.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*++
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-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.
-
-Module Name:
-
- ComponentName.c
-
-Abstract:
-
---*/
-
-#include "UnixUga.h"
-
-//
-// EFI Component Name Functions
-//
-EFI_STATUS
-EFIAPI
-UnixUgaComponentNameGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- );
-
-EFI_STATUS
-EFIAPI
-UnixUgaComponentNameGetControllerName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- );
-
-//
-// EFI Component Name Protocol
-//
-EFI_COMPONENT_NAME_PROTOCOL gUnixUgaComponentName = {
- UnixUgaComponentNameGetDriverName,
- UnixUgaComponentNameGetControllerName,
- "eng"
-};
-
-EFI_UNICODE_STRING_TABLE mUnixUgaDriverNameTable[] = {
- { "eng", L"Unix Universal Graphics Adapter Driver" },
- { NULL , NULL }
-};
-
-EFI_STATUS
-EFIAPI
-UnixUgaComponentNameGetDriverName (
- 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,
- gUnixUgaComponentName.SupportedLanguages,
- mUnixUgaDriverNameTable,
- DriverName
- );
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaComponentNameGetControllerName (
- 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.
-
---*/
-{
- EFI_STATUS Status;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- UGA_PRIVATE_DATA *Private;
-
- //
- // This is a device driver, so ChildHandle must be NULL.
- //
- if (ChildHandle != NULL) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Make sure this driver is currently managing ControllerHandle
- //
- Status = EfiTestManagedDevice (
- ControllerHandle,
- gUnixUgaDriverBinding.DriverBindingHandle,
- &gEfiUnixIoProtocolGuid
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
- //
- // Get our context back
- //
- Status = gBS->OpenProtocol (
- ControllerHandle,
- &gEfiUgaDrawProtocolGuid,
- (VOID **)&UgaDraw,
- gUnixUgaDriverBinding.DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (UgaDraw);
-
- return LookupUnicodeString (
- Language,
- gUnixUgaComponentName.SupportedLanguages,
- Private->ControllerNameTable,
- ControllerName
- );
-}
diff --git a/UnixPkg/UnixUgaDxe/EntryPoint.c b/UnixPkg/UnixUgaDxe/EntryPoint.c
deleted file mode 100644
index 857f475..0000000
--- a/UnixPkg/UnixUgaDxe/EntryPoint.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/**@file
- Entry Point Source file.
-
- This file contains the user entry point
-
- Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
- 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.
-**/
-
-#include "UnixUga.h"
-
-/**
- The user Entry Point for module UnixUga. 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
-InitializeUnixUga(
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = EfiLibInstallAllDriverProtocols (
- ImageHandle,
- SystemTable,
- &gUnixUgaDriverBinding,
- ImageHandle,
- &gUnixUgaComponentName,
- NULL,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
-
- return Status;
-}
diff --git a/UnixPkg/UnixUgaDxe/UnixUga.h b/UnixPkg/UnixUgaDxe/UnixUga.h
deleted file mode 100644
index e1e61f7..0000000
--- a/UnixPkg/UnixUgaDxe/UnixUga.h
+++ /dev/null
@@ -1,332 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-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.
-
-Module Name:
-
- UnixUga.h
-
-Abstract:
-
- Private data for the Uga driver that is bound to the Unix Thunk protocol
-
---*/
-
-#ifndef _UNIX_UGA_H_
-#define _UNIX_UGA_H_
-
-#include "PiDxe.h"
-#include <Guid/EventGroup.h>
-#include <Protocol/SimpleTextIn.h>
-#include <Protocol/SimplePointer.h>
-#include <Protocol/UgaDraw.h>
-#include "Protocol/UnixUgaIo.h"
-#include <Library/DebugLib.h>
-#include <Library/BaseLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include "UnixDxe.h"
-
-extern EFI_DRIVER_BINDING_PROTOCOL gUnixUgaDriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL gUnixUgaComponentName;
-
-#define UNIX_UGA_CLASS_NAME L"UnixUgaWindow"
-
-#define UGA_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('S', 'g', 'o', 'N')
-typedef struct {
- UINT64 Signature;
-
- EFI_HANDLE Handle;
- EFI_UGA_DRAW_PROTOCOL UgaDraw;
- EFI_SIMPLE_TEXT_INPUT_PROTOCOL SimpleTextIn;
- EFI_SIMPLE_POINTER_PROTOCOL SimplePointer;
-
- EFI_UNIX_THUNK_PROTOCOL *UnixThunk;
-
- EFI_UNICODE_STRING_TABLE *ControllerNameTable;
-
- //
- // UGA Private Data for GetMode ()
- //
- UINT32 HorizontalResolution;
- UINT32 VerticalResolution;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
-
- EFI_SIMPLE_POINTER_MODE PointerMode;
-
- //
- // UGA Private Data knowing when to start hardware
- //
- BOOLEAN HardwareNeedsStarting;
-
- CHAR16 *WindowName;
-
- EFI_UNIX_UGA_IO_PROTOCOL *UgaIo;
-
-} UGA_PRIVATE_DATA;
-
-#define UGA_DRAW_PRIVATE_DATA_FROM_THIS(a) \
- CR(a, UGA_PRIVATE_DATA, UgaDraw, UGA_PRIVATE_DATA_SIGNATURE)
-
-#define UGA_PRIVATE_DATA_FROM_TEXT_IN_THIS(a) \
- CR(a, UGA_PRIVATE_DATA, SimpleTextIn, UGA_PRIVATE_DATA_SIGNATURE)
-
-#define UGA_PRIVATE_DATA_FROM_POINTER_THIS(a) \
- CR(a, UGA_PRIVATE_DATA, SimplePointer, UGA_PRIVATE_DATA_SIGNATURE)
-
-//
-// Global Protocol Variables
-//
-extern EFI_DRIVER_BINDING_PROTOCOL gUnixUgaDriverBinding;
-extern EFI_COMPONENT_NAME_PROTOCOL gUnixUgaComponentName;
-
-//
-// Uga Hardware abstraction internal worker functions
-//
-EFI_STATUS
-UnixUgaSupported (
- IN EFI_UNIX_IO_PROTOCOL *UnixIo
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- UnixIo - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixUgaConstructor (
- IN UGA_PRIVATE_DATA *Private
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Private - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixUgaDestructor (
- IN UGA_PRIVATE_DATA *Private
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Private - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-//
-// EFI 1.1 driver model prototypes for Win UNIX UGA
-//
-
-EFI_STATUS
-EFIAPI
-UnixUgaInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- ImageHandle - TODO: add argument description
- SystemTable - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-UnixUgaDriverBindingSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- Handle - TODO: add argument description
- RemainingDevicePath - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-UnixUgaDriverBindingStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- Handle - TODO: add argument description
- RemainingDevicePath - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-EFIAPI
-UnixUgaDriverBindingStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- Handle - TODO: add argument description
- NumberOfChildren - TODO: add argument description
- ChildHandleBuffer - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UgaPrivateAddQ (
- IN UGA_PRIVATE_DATA *Private,
- IN EFI_INPUT_KEY Key
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Private - TODO: add argument description
- Key - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixUgaInitializeSimpleTextInForWindow (
- IN UGA_PRIVATE_DATA *Private
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Private - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-
-EFI_STATUS
-UnixUgaInitializeSimplePointerForWindow (
- IN UGA_PRIVATE_DATA *Private
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Private - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-;
-#endif
diff --git a/UnixPkg/UnixUgaDxe/UnixUga.inf b/UnixPkg/UnixUgaDxe/UnixUga.inf
deleted file mode 100644
index 5cba658..0000000
--- a/UnixPkg/UnixUgaDxe/UnixUga.inf
+++ /dev/null
@@ -1,73 +0,0 @@
-## @file
-# Uga driver
-#
-# UGA is short hand for Universal Graphics Abstraction protocol.
-# This file is a verision of UgaIo the uses UnixThunk system calls as an IO
-# abstraction. For a PCI device UnixIo would be replaced with
-# a PCI IO abstraction that abstracted a specific PCI device.
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-#
-# 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.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = UnixUga
- FILE_GUID = f33cad86-8985-11db-8040-0040d02b1835
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = InitializeUnixUga
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-# DRIVER_BINDING = gUnixUgaDriverBinding
-# COMPONENT_NAME = gUnixUgaComponentName
-#
-
-[Sources]
- ComponentName.c
- UnixUgaScreen.c
- UnixUgaDriver.c
- UnixUgaInput.c
- UnixUga.h
- EntryPoint.c
-
-
-[Packages]
- MdePkg/MdePkg.dec
- UnixPkg/UnixPkg.dec
-
-
-[LibraryClasses]
- UefiBootServicesTableLib
- MemoryAllocationLib
- BaseMemoryLib
- UefiLib
- UefiDriverEntryPoint
- BaseLib
- DebugLib
-
-
-[Guids]
- gEfiEventExitBootServicesGuid # SOMETIMES_CONSUMED Create Event: EVENT_GROUP_GUID
- gEfiUnixUgaGuid # ALWAYS_CONSUMED
-
-
-[Protocols]
- gEfiSimpleTextInProtocolGuid # PROTOCOL BY_START
- gEfiSimplePointerProtocolGuid # PROTOCOL BY_START
- gEfiUnixUgaIoProtocolGuid # PROTOCOL BY_START
- gEfiUgaDrawProtocolGuid # PROTOCOL BY_START
- gEfiUnixIoProtocolGuid # PROTOCOL TO_START
-
diff --git a/UnixPkg/UnixUgaDxe/UnixUgaDriver.c b/UnixPkg/UnixUgaDxe/UnixUgaDriver.c
deleted file mode 100644
index 99aa115..0000000
--- a/UnixPkg/UnixUgaDxe/UnixUgaDriver.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/*++
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-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.
-
-Module Name:
-
- UnixUgaDriver.c
-
-Abstract:
-
- This file implements the EFI 1.1 Device Driver model requirements for UGA
-
- UGA is short hand for Universal Graphics Abstraction protocol.
-
- This file is a verision of UgaIo the uses UnixThunk system calls as an IO
- abstraction. For a PCI device UnixIo would be replaced with
- a PCI IO abstraction that abstracted a specific PCI device.
-
---*/
-
-#include "UnixUga.h"
-
-EFI_DRIVER_BINDING_PROTOCOL gUnixUgaDriverBinding = {
- UnixUgaDriverBindingSupported,
- UnixUgaDriverBindingStart,
- UnixUgaDriverBindingStop,
- 0xa,
- NULL,
- NULL
-};
-
-
-EFI_STATUS
-EFIAPI
-UnixUgaDriverBindingSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
- None
-
---*/
-// TODO: This - add argument and description to function comment
-// TODO: Handle - add argument and description to function comment
-// TODO: RemainingDevicePath - add argument and description to function comment
-{
- EFI_STATUS Status;
- EFI_UNIX_IO_PROTOCOL *UnixIo;
-
- //
- // Open the IO Abstraction(s) needed to perform the supported test
- //
- Status = gBS->OpenProtocol (
- Handle,
- &gEfiUnixIoProtocolGuid,
- (VOID **)&UnixIo,
- This->DriverBindingHandle,
- Handle,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = UnixUgaSupported (UnixIo);
-
- //
- // Close the I/O Abstraction(s) used to perform the supported test
- //
- gBS->CloseProtocol (
- Handle,
- &gEfiUnixIoProtocolGuid,
- This->DriverBindingHandle,
- Handle
- );
-
- return Status;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaDriverBindingStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
- None
-
---*/
-// TODO: This - add argument and description to function comment
-// TODO: Handle - add argument and description to function comment
-// TODO: RemainingDevicePath - add argument and description to function comment
-// TODO: EFI_UNSUPPORTED - add return value to function comment
-{
- EFI_UNIX_IO_PROTOCOL *UnixIo;
- EFI_STATUS Status;
- UGA_PRIVATE_DATA *Private;
-
- //
- // Grab the protocols we need
- //
- Status = gBS->OpenProtocol (
- Handle,
- &gEfiUnixIoProtocolGuid,
- (VOID **)&UnixIo,
- This->DriverBindingHandle,
- Handle,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
-
- //
- // Allocate Private context data for SGO inteface.
- //
- Private = NULL;
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- sizeof (UGA_PRIVATE_DATA),
- (VOID **)&Private
- );
- if (EFI_ERROR (Status)) {
- goto Done;
- }
- //
- // Set up context record
- //
- Private->Signature = UGA_PRIVATE_DATA_SIGNATURE;
- Private->Handle = Handle;
- Private->UnixThunk = UnixIo->UnixThunk;
-
- Private->ControllerNameTable = NULL;
-
- AddUnicodeString (
- "eng",
- gUnixUgaComponentName.SupportedLanguages,
- &Private->ControllerNameTable,
- UnixIo->EnvString
- );
-
- Private->WindowName = UnixIo->EnvString;
-
- Status = UnixUgaConstructor (Private);
- if (EFI_ERROR (Status)) {
- goto Done;
- }
- //
- // Publish the Uga interface to the world
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &Private->Handle,
- &gEfiUgaDrawProtocolGuid,
- &Private->UgaDraw,
- &gEfiSimpleTextInProtocolGuid,
- &Private->SimpleTextIn,
- &gEfiSimplePointerProtocolGuid,
- &Private->SimplePointer,
- NULL
- );
-
-Done:
- if (EFI_ERROR (Status)) {
-
- gBS->CloseProtocol (
- Handle,
- &gEfiUnixIoProtocolGuid,
- This->DriverBindingHandle,
- Handle
- );
-
- if (Private != NULL) {
- //
- // On Error Free back private data
- //
- if (Private->ControllerNameTable != NULL) {
- FreeUnicodeStringTable (Private->ControllerNameTable);
- }
-
- gBS->FreePool (Private);
- }
- }
-
- return Status;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaDriverBindingStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Handle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
- None
-
---*/
-// TODO: This - add argument and description to function comment
-// TODO: Handle - add argument and description to function comment
-// TODO: NumberOfChildren - add argument and description to function comment
-// TODO: ChildHandleBuffer - add argument and description to function comment
-// TODO: EFI_NOT_STARTED - add return value to function comment
-// TODO: EFI_DEVICE_ERROR - add return value to function comment
-{
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- EFI_STATUS Status;
- UGA_PRIVATE_DATA *Private;
-
- Status = gBS->OpenProtocol (
- Handle,
- &gEfiUgaDrawProtocolGuid,
- (VOID **)&UgaDraw,
- This->DriverBindingHandle,
- Handle,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- //
- // If the UGA interface does not exist the driver is not started
- //
- return EFI_NOT_STARTED;
- }
-
- //
- // Get our private context information
- //
- Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (UgaDraw);
-
- //
- // Remove the SGO interface from the system
- //
- Status = gBS->UninstallMultipleProtocolInterfaces (
- Private->Handle,
- &gEfiUgaDrawProtocolGuid,
- &Private->UgaDraw,
- &gEfiSimpleTextInProtocolGuid,
- &Private->SimpleTextIn,
- &gEfiSimplePointerProtocolGuid,
- &Private->SimplePointer,
- NULL
- );
- if (!EFI_ERROR (Status)) {
- //
- // Shutdown the hardware
- //
- Status = UnixUgaDestructor (Private);
- if (EFI_ERROR (Status)) {
- return EFI_DEVICE_ERROR;
- }
-
- gBS->CloseProtocol (
- Handle,
- &gEfiUnixIoProtocolGuid,
- This->DriverBindingHandle,
- Handle
- );
-
- //
- // Free our instance data
- //
- FreeUnicodeStringTable (Private->ControllerNameTable);
-
- gBS->FreePool (Private);
-
- }
-
- return Status;
-}
-
diff --git a/UnixPkg/UnixUgaDxe/UnixUgaInput.c b/UnixPkg/UnixUgaDxe/UnixUgaInput.c
deleted file mode 100644
index be38379..0000000
--- a/UnixPkg/UnixUgaDxe/UnixUgaInput.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/*++
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-Portions copyright (c) 2010, Apple, Inc. All rights reserved.<BR>
-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.
-
-Module Name:
-
- UnixUgaInput.c
-
-Abstract:
-
- This file produces the Simple Text In for an Uga window.
-
- This stuff is linked at the hip to the Window, since the window
- processing is done in a thread kicked off in UnixUgaImplementation.c
-
- Since the window information is processed in an other thread we need
- a keyboard Queue to pass data about. The Simple Text In code just
- takes data off the Queue. The WinProc message loop takes keyboard input
- and places it in the Queue.
-
---*/
-
-#include "UnixUga.h"
-
-//
-// Simple Text In implementation.
-//
-
-EFI_STATUS
-EFIAPI
-UnixUgaSimpleTextInReset (
- IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- ExtendedVerification - TODO: add argument description
-
-Returns:
-
- EFI_SUCCESS - TODO: Add description for return value
-
---*/
-{
- UGA_PRIVATE_DATA *Private;
- EFI_KEY_DATA Key;
- EFI_TPL OldTpl;
-
- Private = UGA_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
- if (Private->UgaIo == NULL) {
- return EFI_SUCCESS;
- }
-
- //
- // Enter critical section
- //
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- //
- // A reset is draining the Queue
- //
- while (Private->UgaIo->UgaGetKey (Private->UgaIo, &Key) == EFI_SUCCESS)
- ;
-
- //
- // Leave critical section and return
- //
- gBS->RestoreTPL (OldTpl);
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaSimpleTextInReadKeyStroke (
- IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
- OUT EFI_INPUT_KEY *Key
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- Key - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
- UGA_PRIVATE_DATA *Private;
- EFI_STATUS Status;
- EFI_TPL OldTpl;
- EFI_KEY_DATA KeyData;
-
- Private = UGA_PRIVATE_DATA_FROM_TEXT_IN_THIS (This);
- if (Private->UgaIo == NULL) {
- return EFI_NOT_READY;
- }
-
- //
- // Enter critical section
- //
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- Status = Private->UgaIo->UgaGetKey(Private->UgaIo, &KeyData);
- CopyMem (Key, &KeyData, sizeof (EFI_INPUT_KEY));
-
- //
- // Leave critical section and return
- //
- gBS->RestoreTPL (OldTpl);
-
- return Status;
-}
-
-VOID
-EFIAPI
-UnixUgaSimpleTextInWaitForKey (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Event - TODO: add argument description
- Context - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
- UGA_PRIVATE_DATA *Private;
- EFI_STATUS Status;
- EFI_TPL OldTpl;
-
- Private = (UGA_PRIVATE_DATA *) Context;
- if (Private->UgaIo == NULL) {
- return;
- }
-
- //
- // Enter critical section
- //
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- Status = Private->UgaIo->UgaCheckKey(Private->UgaIo);
- if (!EFI_ERROR (Status)) {
- //
- // If a there is a key in the queue signal our event.
- //
- gBS->SignalEvent (Event);
- }
- //
- // Leave critical section and return
- //
- gBS->RestoreTPL (OldTpl);
-}
-
-//
-// Simple Pointer implementation.
-//
-
-EFI_STATUS
-EFIAPI
-UnixUgaSimplePointerReset (
- IN EFI_SIMPLE_POINTER_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- ExtendedVerification - TODO: add argument description
-
-Returns:
-
- EFI_SUCCESS - TODO: Add description for return value
-
---*/
-{
- UGA_PRIVATE_DATA *Private;
- EFI_SIMPLE_POINTER_STATE State;
- EFI_TPL OldTpl;
-
- Private = UGA_PRIVATE_DATA_FROM_POINTER_THIS (This);
- if (Private->UgaIo == NULL) {
- return EFI_SUCCESS;
- }
-
- //
- // Enter critical section
- //
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- //
- // A reset is draining the Queue
- //
- while (Private->UgaIo->UgaGetPointerState(Private->UgaIo, &State) == EFI_SUCCESS)
- ;
-
- //
- // Leave critical section and return
- //
- gBS->RestoreTPL (OldTpl);
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaSimplePointerGetState (
- IN EFI_SIMPLE_POINTER_PROTOCOL *This,
- IN OUT EFI_SIMPLE_POINTER_STATE *State
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- This - TODO: add argument description
- Key - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
- UGA_PRIVATE_DATA *Private;
- EFI_STATUS Status;
- EFI_TPL OldTpl;
-
- Private = UGA_PRIVATE_DATA_FROM_POINTER_THIS (This);
- if (Private->UgaIo == NULL) {
- return EFI_NOT_READY;
- }
-
- //
- // Enter critical section
- //
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- Status = Private->UgaIo->UgaGetPointerState(Private->UgaIo, State);
- //
- // Leave critical section and return
- //
- gBS->RestoreTPL (OldTpl);
-
- return Status;
-}
-
-VOID
-EFIAPI
-UnixUgaSimplePointerWaitForInput (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Event - TODO: add argument description
- Context - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
- UGA_PRIVATE_DATA *Private;
- EFI_STATUS Status;
- EFI_TPL OldTpl;
-
- Private = (UGA_PRIVATE_DATA *) Context;
- if (Private->UgaIo == NULL) {
- return;
- }
-
- //
- // Enter critical section
- //
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- Status = Private->UgaIo->UgaCheckPointer(Private->UgaIo);
- if (!EFI_ERROR (Status)) {
- //
- // If the pointer state has changed, signal our event.
- //
- gBS->SignalEvent (Event);
- }
- //
- // Leave critical section and return
- //
- gBS->RestoreTPL (OldTpl);
-}
-
-EFI_STATUS
-UnixUgaInitializeSimpleTextInForWindow (
- IN UGA_PRIVATE_DATA *Private
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Private - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
- EFI_STATUS Status;
-
- //
- // Initialize Simple Text In protoocol
- //
- Private->SimpleTextIn.Reset = UnixUgaSimpleTextInReset;
- Private->SimpleTextIn.ReadKeyStroke = UnixUgaSimpleTextInReadKeyStroke;
-
- Status = gBS->CreateEvent (
- EVT_NOTIFY_WAIT,
- TPL_NOTIFY,
- UnixUgaSimpleTextInWaitForKey,
- Private,
- &Private->SimpleTextIn.WaitForKey
- );
-
- return Status;
-}
-
-EFI_STATUS
-UnixUgaInitializeSimplePointerForWindow (
- IN UGA_PRIVATE_DATA *Private
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Private - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
- EFI_STATUS Status;
-
- //
- // Initialize Simple Pointer protoocol
- //
- Private->PointerMode.ResolutionX = 1;
- Private->PointerMode.ResolutionY = 1;
- Private->PointerMode.LeftButton = TRUE;
- Private->PointerMode.RightButton = TRUE;
-
- Private->SimplePointer.Reset = UnixUgaSimplePointerReset;
- Private->SimplePointer.GetState = UnixUgaSimplePointerGetState;
- Private->SimplePointer.Mode = &Private->PointerMode;
-
- Status = gBS->CreateEvent (
- EVT_NOTIFY_WAIT,
- TPL_NOTIFY,
- UnixUgaSimplePointerWaitForInput,
- Private,
- &Private->SimplePointer.WaitForInput
- );
-
- return Status;
-}
diff --git a/UnixPkg/UnixUgaDxe/UnixUgaScreen.c b/UnixPkg/UnixUgaDxe/UnixUgaScreen.c
deleted file mode 100644
index 470a788..0000000
--- a/UnixPkg/UnixUgaDxe/UnixUgaScreen.c
+++ /dev/null
@@ -1,454 +0,0 @@
-/*++
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-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.
-
-Module Name:
-
- UnixUgaScreen.c
-
-Abstract:
-
- This file produces the graphics abstration of UGA. It is called by
- UnixUgaDriver.c file which deals with the EFI 1.1 driver model.
- This file just does graphics.
-
---*/
-
-#include "UnixUga.h"
-
-EFI_UNIX_THUNK_PROTOCOL *mUnix;
-EFI_EVENT mUgaScreenExitBootServicesEvent;
-
-EFI_STATUS
-UnixUgaStartWindow (
- IN UGA_PRIVATE_DATA *Private,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- IN UINT32 ColorDepth,
- IN UINT32 RefreshRate
- );
-
-VOID
-EFIAPI
-KillNtUgaThread (
- IN EFI_EVENT Event,
- IN VOID *Context
- );
-
-//
-// UGA Protocol Member Functions
-//
-
-EFI_STATUS
-EFIAPI
-UnixUgaGetMode (
- EFI_UGA_DRAW_PROTOCOL *This,
- UINT32 *HorizontalResolution,
- UINT32 *VerticalResolution,
- UINT32 *ColorDepth,
- UINT32 *RefreshRate
- )
-/*++
-
- Routine Description:
- Return the current video mode information.
-
- Arguments:
- This - Protocol instance pointer.
- HorizontalResolution - Current video horizontal resolution in pixels
- VerticalResolution - Current video Vertical resolution in pixels
- ColorDepth - Current video color depth in bits per pixel
- RefreshRate - Current video refresh rate in Hz.
-
- Returns:
- EFI_SUCCESS - Mode information returned.
- EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
- EFI_INVALID_PARAMETER - One of the input args was NULL.
-
---*/
-// TODO: ADD IN/OUT description here
-{
- UGA_PRIVATE_DATA *Private;
-
- Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (This);
-
- if (Private->HardwareNeedsStarting) {
- return EFI_NOT_STARTED;
- }
-
- if ((HorizontalResolution == NULL) ||
- (VerticalResolution == NULL) ||
- (ColorDepth == NULL) ||
- (RefreshRate == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- *HorizontalResolution = Private->HorizontalResolution;
- *VerticalResolution = Private->VerticalResolution;
- *ColorDepth = Private->ColorDepth;
- *RefreshRate = Private->RefreshRate;
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaSetMode (
- EFI_UGA_DRAW_PROTOCOL *This,
- UINT32 HorizontalResolution,
- UINT32 VerticalResolution,
- UINT32 ColorDepth,
- UINT32 RefreshRate
- )
-/*++
-
- Routine Description:
- Return the current video mode information.
-
- Arguments:
- This - Protocol instance pointer.
- HorizontalResolution - Current video horizontal resolution in pixels
- VerticalResolution - Current video Vertical resolution in pixels
- ColorDepth - Current video color depth in bits per pixel
- RefreshRate - Current video refresh rate in Hz.
-
- Returns:
- EFI_SUCCESS - Mode information returned.
- EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
- EFI_INVALID_PARAMETER - One of the input args was NULL.
-
---*/
-// TODO: EFI_DEVICE_ERROR - add return value to function comment
-// TODO: EFI_DEVICE_ERROR - add return value to function comment
-// TODO: ADD IN/OUT description here
-{
- EFI_STATUS Status;
- UGA_PRIVATE_DATA *Private;
- EFI_UGA_PIXEL Fill;
-
- Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (This);
-
- if (Private->HardwareNeedsStarting) {
- Status = UnixUgaStartWindow (
- Private,
- HorizontalResolution,
- VerticalResolution,
- ColorDepth,
- RefreshRate
- );
- if (EFI_ERROR (Status)) {
- return EFI_DEVICE_ERROR;
- }
-
- Private->HardwareNeedsStarting = FALSE;
- }
- Status = Private->UgaIo->UgaSize(Private->UgaIo,
- HorizontalResolution,
- VerticalResolution);
-
- Private->HorizontalResolution = HorizontalResolution;
- Private->VerticalResolution = VerticalResolution;
- Private->ColorDepth = ColorDepth;
- Private->RefreshRate = RefreshRate;
-
- Fill.Red = 0x7f;
- Fill.Green = 0x7F;
- Fill.Blue = 0x7f;
- This->Blt (
- This,
- &Fill,
- EfiUgaVideoFill,
- 0,
- 0,
- 0,
- 0,
- HorizontalResolution,
- VerticalResolution,
- HorizontalResolution * sizeof (EFI_UGA_PIXEL)
- );
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-UnixUgaBlt (
- IN EFI_UGA_DRAW_PROTOCOL *This,
- IN EFI_UGA_PIXEL *BltBuffer, OPTIONAL
- IN EFI_UGA_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- )
-/*++
-
- Routine Description:
- Blt pixels from the rectangle (Width X Height) formed by the BltBuffer
- onto the graphics screen starting a location (X, Y). (0, 0) is defined as
- the upper left hand side of the screen. (X, Y) can be outside of the
- current screen geometry and the BltBuffer will be cliped when it is
- displayed. X and Y can be negative or positive. If Width or Height is
- bigger than the current video screen the image will be clipped.
-
- Arguments:
- This - Protocol instance pointer.
- X - X location on graphics screen.
- Y - Y location on the graphics screen.
- Width - Width of BltBuffer.
- Height - Hight of BltBuffer
- BltOperation - Operation to perform on BltBuffer and video memory
- BltBuffer - Buffer containing data to blt into video buffer. This
- buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
- SourceX - If the BltOperation is a EfiCopyBlt this is the source
- of the copy. For other BLT operations this argument is not
- used.
- SourceX - If the BltOperation is a EfiCopyBlt this is the source
- of the copy. For other BLT operations this argument is not
- used.
-
- Returns:
- EFI_SUCCESS - The palette is updated with PaletteArray.
- EFI_INVALID_PARAMETER - BltOperation is not valid.
- EFI_DEVICE_ERROR - A hardware error occured writting to the video
- buffer.
-
---*/
-// TODO: SourceY - add argument and description to function comment
-// TODO: DestinationX - add argument and description to function comment
-// TODO: DestinationY - add argument and description to function comment
-// TODO: Delta - add argument and description to function comment
-{
- UGA_PRIVATE_DATA *Private;
- EFI_TPL OriginalTPL;
- EFI_STATUS Status;
- UGA_BLT_ARGS UgaBltArgs;
-
- Private = UGA_DRAW_PRIVATE_DATA_FROM_THIS (This);
-
- if ((BltOperation < 0) || (BltOperation >= EfiUgaBltMax)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if (Width == 0 || Height == 0) {
- return EFI_INVALID_PARAMETER;
- }
- //
- // If Delta is zero, then the entire BltBuffer is being used, so Delta
- // is the number of bytes in each row of BltBuffer. Since BltBuffer is Width pixels size,
- // the number of bytes in each row can be computed.
- //
- if (Delta == 0) {
- Delta = Width * sizeof (EFI_UGA_PIXEL);
- }
-
- //
- // We have to raise to TPL Notify, so we make an atomic write the frame buffer.
- // We would not want a timer based event (Cursor, ...) to come in while we are
- // doing this operation.
- //
- OriginalTPL = gBS->RaiseTPL (TPL_NOTIFY);
-
- //
- // Pack UGA Draw protocol parameters to UGA_BLT_ARGS structure to adapt to
- // UgaBlt() API of Unix UGA IO protocol.
- //
- UgaBltArgs.DestinationX = DestinationX;
- UgaBltArgs.DestinationY = DestinationY;
- UgaBltArgs.Height = Height;
- UgaBltArgs.Width = Width;
- UgaBltArgs.SourceX = SourceX;
- UgaBltArgs.SourceY = SourceY;
- UgaBltArgs.Delta = Delta;
- Status = Private->UgaIo->UgaBlt (Private->UgaIo,
- BltBuffer,
- BltOperation,
- &UgaBltArgs
- );
-
- gBS->RestoreTPL (OriginalTPL);
-
- return Status;
-}
-
-
-//
-// Construction and Destruction functions
-//
-
-EFI_STATUS
-UnixUgaSupported (
- IN EFI_UNIX_IO_PROTOCOL *UnixIo
- )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
- None
-
---*/
-// TODO: UnixIo - add argument and description to function comment
-// TODO: EFI_UNSUPPORTED - add return value to function comment
-// TODO: EFI_SUCCESS - add return value to function comment
-{
- //
- // Check to see if the IO abstraction represents a device type we support.
- //
- // This would be replaced a check of PCI subsystem ID, etc.
- //
- if (!CompareGuid (UnixIo->TypeGuid, &gEfiUnixUgaGuid)) {
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-UnixUgaStartWindow (
- IN UGA_PRIVATE_DATA *Private,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- IN UINT32 ColorDepth,
- IN UINT32 RefreshRate
- )
-/*++
-
-Routine Description:
-
- TODO: Add function description
-
-Arguments:
-
- Private - TODO: add argument description
- HorizontalResolution - TODO: add argument description
- VerticalResolution - TODO: add argument description
- ColorDepth - TODO: add argument description
- RefreshRate - TODO: add argument description
-
-Returns:
-
- TODO: add return values
-
---*/
-{
- EFI_STATUS Status;
-
- mUnix = Private->UnixThunk;
-
- Private->HorizontalResolution = HorizontalResolution;
- Private->VerticalResolution = VerticalResolution;
-
- //
- // Register to be notified on exit boot services so we can destroy the window.
- //
- Status = gBS->CreateEvent (
- EVT_SIGNAL_EXIT_BOOT_SERVICES,
- TPL_CALLBACK,
- KillNtUgaThread,
- Private,
- &mUgaScreenExitBootServicesEvent
- );
-
- Status = Private->UnixThunk->UgaCreate(&Private->UgaIo, Private->WindowName);
- return Status;
-}
-
-EFI_STATUS
-UnixUgaConstructor (
- UGA_PRIVATE_DATA *Private
- )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
- None
-
---*/
-// TODO: Private - add argument and description to function comment
-// TODO: EFI_SUCCESS - add return value to function comment
-{
-
- Private->UgaDraw.GetMode = UnixUgaGetMode;
- Private->UgaDraw.SetMode = UnixUgaSetMode;
- Private->UgaDraw.Blt = UnixUgaBlt;
-
- Private->HardwareNeedsStarting = TRUE;
- Private->UgaIo = NULL;
-
- UnixUgaInitializeSimpleTextInForWindow (Private);
-
- UnixUgaInitializeSimplePointerForWindow (Private);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-UnixUgaDestructor (
- UGA_PRIVATE_DATA *Private
- )
-/*++
-
-Routine Description:
-
-Arguments:
-
-Returns:
-
- None
-
---*/
-// TODO: Private - add argument and description to function comment
-// TODO: EFI_SUCCESS - add return value to function comment
-{
- if (!Private->HardwareNeedsStarting) {
- Private->UgaIo->UgaClose(Private->UgaIo);
- Private->UgaIo = NULL;
- }
-
- return EFI_SUCCESS;
-}
-
-VOID
-EFIAPI
-KillNtUgaThread (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-/*++
-
-Routine Description:
-
- This is the UGA screen's callback notification function for exit-boot-services.
- All we do here is call UnixUgaDestructor().
-
-Arguments:
-
- Event - not used
- Context - pointer to the Private structure.
-
-Returns:
-
- None.
-
---*/
-{
- EFI_STATUS Status;
- Status = UnixUgaDestructor (Context);
-}