apply for doxgen format.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5038 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
UEFI Component Name(2) protocol implementation.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2007, Intel Corporation
|
Copyright (c) 2004 - 2007, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
@ -15,7 +16,8 @@ Module Name:
|
|||||||
|
|
||||||
Abstract:
|
Abstract:
|
||||||
|
|
||||||
--*/
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
|
||||||
#include <PiDxe.h>
|
#include <PiDxe.h>
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
CalculateCrc32 Boot Services as defined in DXE CIS.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
Module Name:
|
||||||
|
|
||||||
@ -15,22 +16,30 @@ Module Name:
|
|||||||
|
|
||||||
Abstract:
|
Abstract:
|
||||||
|
|
||||||
CalculateCrc32 Boot Services as defined in DXE CIS.
|
|
||||||
|
|
||||||
This Boot Services is in the Runtime Driver because this service is
|
This Boot Services is in the Runtime Driver because this service is
|
||||||
also required by SetVirtualAddressMap() when the EFI System Table and
|
also required by SetVirtualAddressMap() when the EFI System Table and
|
||||||
EFI Runtime Services Table are converted from physical address to
|
EFI Runtime Services Table are converted from physical address to
|
||||||
virtual addresses. This requires that the 32-bit CRC be recomputed.
|
virtual addresses. This requires that the 32-bit CRC be recomputed.
|
||||||
|
|
||||||
Revision History:
|
**/
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <PiDxe.h>
|
#include <PiDxe.h>
|
||||||
|
|
||||||
UINT32 mCrcTable[256];
|
UINT32 mCrcTable[256];
|
||||||
|
|
||||||
|
/**
|
||||||
|
Calculate CRC32 for target data.
|
||||||
|
|
||||||
|
@param Len The target data.
|
||||||
|
@param DataSize The target data size.
|
||||||
|
@param CrcOut The CRC32 for target data.
|
||||||
|
|
||||||
|
@retval EFI_SUCCESS The CRC32 for target data is calculated successfully.
|
||||||
|
@retval EFI_INVALID_PARAMETER Some parameter is not valid, so the CRC32 is not
|
||||||
|
calculated.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
RuntimeDriverCalculateCrc32 (
|
RuntimeDriverCalculateCrc32 (
|
||||||
@ -38,25 +47,6 @@ RuntimeDriverCalculateCrc32 (
|
|||||||
IN UINTN DataSize,
|
IN UINTN DataSize,
|
||||||
OUT UINT32 *CrcOut
|
OUT UINT32 *CrcOut
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Calculate CRC32 for target data
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
Data - The target data.
|
|
||||||
DataSize - The target data size.
|
|
||||||
CrcOut - The CRC32 for target data.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
EFI_SUCCESS - The CRC32 for target data is calculated successfully.
|
|
||||||
EFI_INVALID_PARAMETER - Some parameter is not valid, so the CRC32 is not
|
|
||||||
calculated.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINT32 Crc;
|
UINT32 Crc;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
@ -75,26 +65,20 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Reverse bits for 32bit data.
|
||||||
|
|
||||||
|
@param Value The data to be reversed.
|
||||||
|
|
||||||
|
@retrun Data reversed.
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
UINT32
|
UINT32
|
||||||
ReverseBits (
|
ReverseBits (
|
||||||
UINT32 Value
|
UINT32 Value
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Reverse bits for 32bit data.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
Value - the data to be reversed.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
UINT32 data reversed.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
UINT32 NewValue;
|
UINT32 NewValue;
|
||||||
@ -109,25 +93,18 @@ Returns:
|
|||||||
return NewValue;
|
return NewValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Initialize CRC32 table.
|
||||||
|
|
||||||
|
@param None
|
||||||
|
|
||||||
|
@retrun None
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
RuntimeDriverInitializeCrc32Table (
|
RuntimeDriverInitializeCrc32Table (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Initialize CRC32 table.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINTN TableEntry;
|
UINTN TableEntry;
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Runtime Architectural Protocol as defined in the DXE CIS.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
@ -15,8 +16,6 @@ Module Name:
|
|||||||
|
|
||||||
Abstract:
|
Abstract:
|
||||||
|
|
||||||
Runtime Architectural Protocol as defined in the DXE CIS
|
|
||||||
|
|
||||||
This code is used to produce the EFI runtime virtual switch over
|
This code is used to produce the EFI runtime virtual switch over
|
||||||
|
|
||||||
THIS IS VERY DANGEROUS CODE BE VERY CAREFUL IF YOU CHANGE IT
|
THIS IS VERY DANGEROUS CODE BE VERY CAREFUL IF YOU CHANGE IT
|
||||||
@ -49,7 +48,7 @@ Revision History:
|
|||||||
Runtime Arch Protocol definition no longer contains CalculateCrc32. Boot Service
|
Runtime Arch Protocol definition no longer contains CalculateCrc32. Boot Service
|
||||||
Table now contains an item named CalculateCrc32.
|
Table now contains an item named CalculateCrc32.
|
||||||
|
|
||||||
--*/
|
**/
|
||||||
|
|
||||||
#include "Runtime.h"
|
#include "Runtime.h"
|
||||||
|
|
||||||
@ -367,7 +366,7 @@ Returns:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// UEFI don't require System Configuration Tables Conversion.
|
// UEFI don't require System Configuration Tables Conversion.
|
||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
// Convert the runtime fields of the EFI System Table and recompute the CRC-32
|
// Convert the runtime fields of the EFI System Table and recompute the CRC-32
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Runtime Architectural Protocol as defined in the DXE CIS.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
|
||||||
Module Name:
|
Module Name:
|
||||||
|
|
||||||
Runtime.h
|
Runtime.h
|
||||||
|
|
||||||
Abstract:
|
Abstract:
|
||||||
|
|
||||||
Runtime Architectural Protocol as defined in the DXE CIS
|
|
||||||
|
|
||||||
This code is used to produce the EFI runtime architectural protocol.
|
This code is used to produce the EFI runtime architectural protocol.
|
||||||
|
|
||||||
--*/
|
**/
|
||||||
|
|
||||||
#ifndef _RUNTIME_H_
|
#ifndef _RUNTIME_H_
|
||||||
#define _RUNTIME_H_
|
#define _RUNTIME_H_
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
UEFI Component Name(2) protocol implementation for ConPlatform driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
ComponentName.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Include common header file for this module.
|
// Include common header file for this module.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Console Platfrom DXE Driver, install Console protocols.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, Intel Corporation
|
Copyright (c) 2006 - 2007, Intel Corporation. <BR>
|
||||||
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
|
||||||
@ -9,13 +10,7 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
**/
|
||||||
|
|
||||||
ConPlatform.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include <ConPlatform.h>
|
#include <ConPlatform.h>
|
||||||
|
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Header file for Console Platfrom DXE Driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2007, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
ConPlatform.h
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#ifndef CON_MANAGE_H_
|
#ifndef CON_MANAGE_H_
|
||||||
#define CON_MANAGE_H_
|
#define CON_MANAGE_H_
|
||||||
@ -24,11 +19,12 @@ Abstract:
|
|||||||
#include <Protocol/SimpleTextOut.h>
|
#include <Protocol/SimpleTextOut.h>
|
||||||
#include <Guid/GlobalVariable.h>
|
#include <Guid/GlobalVariable.h>
|
||||||
#include <Guid/ConsoleInDevice.h>
|
#include <Guid/ConsoleInDevice.h>
|
||||||
|
#include <Guid/StandardErrorDevice.h>
|
||||||
|
#include <Guid/ConsoleOutDevice.h>
|
||||||
#include <Protocol/DevicePath.h>
|
#include <Protocol/DevicePath.h>
|
||||||
#include <Protocol/SimpleTextIn.h>
|
#include <Protocol/SimpleTextIn.h>
|
||||||
#include <Guid/HotPlugDevice.h>
|
#include <Guid/HotPlugDevice.h>
|
||||||
#include <Guid/StandardErrorDevice.h>
|
|
||||||
#include <Guid/ConsoleOutDevice.h>
|
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/UefiDriverEntryPoint.h>
|
#include <Library/UefiDriverEntryPoint.h>
|
||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
UEFI Component Name(2) protocol implementation for ConSplitter driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
ComponentName.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "ConSplitter.h"
|
#include "ConSplitter.h"
|
||||||
|
|
||||||
@ -510,40 +505,40 @@ ConSplitterAbsolutePointerComponentNameGetControllerName (
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
This - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.
|
||||||
ControllerHandle - The handle of a controller that the driver specified by
|
ControllerHandle - The handle of a controller that the driver specified by
|
||||||
This is managing. This handle specifies the controller
|
This is managing. This handle specifies the controller
|
||||||
whose name is to be returned.
|
whose name is to be returned.
|
||||||
ChildHandle - The handle of the child controller to retrieve the name
|
ChildHandle - The handle of the child controller to retrieve the name
|
||||||
of. This is an optional parameter that may be NULL. It
|
of. This is an optional parameter that may be NULL. It
|
||||||
will be NULL for device drivers. It will also be NULL
|
will be NULL for device drivers. It will also be NULL
|
||||||
for a bus drivers that wish to retrieve the name of the
|
for a bus drivers that wish to retrieve the name of the
|
||||||
bus controller. It will not be NULL for a bus driver
|
bus controller. It will not be NULL for a bus driver
|
||||||
that wishes to retrieve the name of a child controller.
|
that wishes to retrieve the name of a child controller.
|
||||||
Language - A pointer to RFC3066 language identifier.
|
Language - A pointer to RFC3066 language identifier.
|
||||||
This is the language of the controller name
|
This is the language of the controller name
|
||||||
that that the caller is requesting, and it must match one
|
that that the caller is requesting, and it must match one
|
||||||
of the languages specified in SupportedLanguages. The
|
of the languages specified in SupportedLanguages. The
|
||||||
number of languages supported by a driver is up to the
|
number of languages supported by a driver is up to the
|
||||||
driver writer.
|
driver writer.
|
||||||
ControllerName - A pointer to the Unicode string to return. This Unicode
|
ControllerName - A pointer to the Unicode string to return. This Unicode
|
||||||
string is the name of the controller specified by
|
string is the name of the controller specified by
|
||||||
ControllerHandle and ChildHandle in the language
|
ControllerHandle and ChildHandle in the language
|
||||||
specified by Language from the point of view of the
|
specified by Language from the point of view of the
|
||||||
driver specified by This.
|
driver specified by This.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The Unicode string for the user readable name in the
|
EFI_SUCCESS - The Unicode string for the user readable name in the
|
||||||
language specified by Language for the driver
|
language specified by Language for the driver
|
||||||
specified by This was returned in DriverName.
|
specified by This was returned in DriverName.
|
||||||
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.
|
||||||
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
|
EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid
|
||||||
EFI_HANDLE.
|
EFI_HANDLE.
|
||||||
EFI_INVALID_PARAMETER - Language is NULL.
|
EFI_INVALID_PARAMETER - Language is NULL.
|
||||||
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
EFI_INVALID_PARAMETER - ControllerName is NULL.
|
||||||
EFI_UNSUPPORTED - The driver specified by This is not currently
|
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.
|
||||||
EFI_UNSUPPORTED - The driver specified by This does not support the
|
EFI_UNSUPPORTED - The driver specified by This does not support the
|
||||||
language specified by Language.
|
language specified by Language.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Support for ConsoleControl protocol. Support for Graphics output spliter.
|
||||||
|
Support for DevNull Console Out. This console uses memory buffers
|
||||||
|
to represnt the console. It allows a console to start very early and
|
||||||
|
when a new console is added it is synced up with the current console.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
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
|
||||||
@ -9,18 +13,8 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
**/
|
||||||
|
|
||||||
ConSplitterGraphics.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Support for ConsoleControl protocol. Support for Graphics output spliter.
|
|
||||||
Support for DevNull Console Out. This console uses memory buffers
|
|
||||||
to represnt the console. It allows a console to start very early and
|
|
||||||
when a new console is added it is synced up with the current console
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "ConSplitter.h"
|
#include "ConSplitter.h"
|
||||||
|
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
UEFI Component Name(2) protocol implementation for GraphicsConsole driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
ComponentName.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "GraphicsConsole.h"
|
#include "GraphicsConsole.h"
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Header file for GraphicsConsole driver.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
@ -9,16 +10,7 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
**/
|
||||||
|
|
||||||
GraphicsConsole.h
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#ifndef _GRAPHICS_CONSOLE_H
|
#ifndef _GRAPHICS_CONSOLE_H
|
||||||
#define _GRAPHICS_CONSOLE_H
|
#define _GRAPHICS_CONSOLE_H
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Narrow font Data definition for GraphicsConsole driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
LaffStd.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "GraphicsConsole.h"
|
#include "GraphicsConsole.h"
|
||||||
|
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
UEFI Component Name(2) protocol implementation for Terminal driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
ComponentName.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "Terminal.h"
|
#include "Terminal.h"
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Produces Simple Text Input Protocl, Simple Text Input Extended Protocol and
|
||||||
|
Simple Text Output Protocol upon Serial IO Protocol.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
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
|
||||||
@ -9,15 +11,7 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
**/
|
||||||
|
|
||||||
Terminal.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Revision History:
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "Terminal.h"
|
#include "Terminal.h"
|
||||||
@ -26,7 +20,7 @@ STATIC
|
|||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
TerminalFreeNotifyList (
|
TerminalFreeNotifyList (
|
||||||
IN OUT LIST_ENTRY *ListHead
|
IN OUT LIST_ENTRY *ListHead
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Globals
|
// Globals
|
||||||
@ -97,7 +91,7 @@ TERMINAL_DEV gTerminalDevTemplate = {
|
|||||||
{ {0} }
|
{ {0} }
|
||||||
},
|
},
|
||||||
NULL, // ControllerNameTable
|
NULL, // ControllerNameTable
|
||||||
NULL,
|
NULL,
|
||||||
INPUT_STATE_DEFAULT,
|
INPUT_STATE_DEFAULT,
|
||||||
RESET_STATE_DEFAULT,
|
RESET_STATE_DEFAULT,
|
||||||
FALSE,
|
FALSE,
|
||||||
@ -960,15 +954,15 @@ Returns:
|
|||||||
}
|
}
|
||||||
while (!IsListEmpty (ListHead)) {
|
while (!IsListEmpty (ListHead)) {
|
||||||
NotifyNode = CR (
|
NotifyNode = CR (
|
||||||
ListHead->ForwardLink,
|
ListHead->ForwardLink,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
||||||
NotifyEntry,
|
NotifyEntry,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE
|
TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE
|
||||||
);
|
);
|
||||||
RemoveEntryList (ListHead->ForwardLink);
|
RemoveEntryList (ListHead->ForwardLink);
|
||||||
gBS->FreePool (NotifyNode);
|
gBS->FreePool (NotifyNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1344,9 +1338,9 @@ InitializeEfiKeyFiFo (
|
|||||||
/**
|
/**
|
||||||
The user Entry Point for module Terminal. The user code starts with this function.
|
The user Entry Point for module Terminal. The user code starts with this function.
|
||||||
|
|
||||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||||
@param[in] SystemTable A pointer to the EFI System Table.
|
@param[in] SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS The entry point is executed successfully.
|
@retval EFI_SUCCESS The entry point is executed successfully.
|
||||||
@retval other Some error occurs when executing this entry point.
|
@retval other Some error occurs when executing this entry point.
|
||||||
|
|
||||||
|
@ -1,24 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Header file for Terminal driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
terminal.h
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#ifndef _TERMINAL_H
|
#ifndef _TERMINAL_H
|
||||||
#define _TERMINAL_H
|
#define _TERMINAL_H
|
||||||
@ -212,15 +204,15 @@ Routine Description:
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
RegsiteredData - A pointer to a buffer that is filled in with the keystroke
|
RegsiteredData - A pointer to a buffer that is filled in with the keystroke
|
||||||
state data for the key that was registered.
|
state data for the key that was registered.
|
||||||
InputData - A pointer to a buffer that is filled in with the keystroke
|
InputData - A pointer to a buffer that is filled in with the keystroke
|
||||||
state data for the key that was pressed.
|
state data for the key that was pressed.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
TRUE - Key be pressed matches a registered key.
|
TRUE - Key be pressed matches a registered key.
|
||||||
FLASE - Match failed.
|
FLASE - Match failed.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -230,7 +222,7 @@ TerminalConInWaitForKeyEx (
|
|||||||
IN EFI_EVENT Event,
|
IN EFI_EVENT Event,
|
||||||
IN VOID *Context
|
IN VOID *Context
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
//
|
//
|
||||||
// Simple Text Input Ex protocol prototypes
|
// Simple Text Input Ex protocol prototypes
|
||||||
//
|
//
|
||||||
@ -252,7 +244,7 @@ TerminalConInResetEx (
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The device was reset.
|
EFI_SUCCESS - The device was reset.
|
||||||
EFI_DEVICE_ERROR - The device is not functioning properly and could
|
EFI_DEVICE_ERROR - The device is not functioning properly and could
|
||||||
not be reset.
|
not be reset.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
@ -267,20 +259,20 @@ TerminalConInReadKeyStrokeEx (
|
|||||||
/*++
|
/*++
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
be used to test for existance of a keystroke via WaitForEvent () call.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - Protocol instance pointer.
|
This - Protocol instance pointer.
|
||||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||||
state data for the key that was pressed.
|
state data for the key that was pressed.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The keystroke information was returned.
|
EFI_SUCCESS - The keystroke information was returned.
|
||||||
EFI_NOT_READY - There was no keystroke data availiable.
|
EFI_NOT_READY - There was no keystroke data availiable.
|
||||||
EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
||||||
hardware errors.
|
hardware errors.
|
||||||
EFI_INVALID_PARAMETER - KeyData is NULL.
|
EFI_INVALID_PARAMETER - KeyData is NULL.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
;
|
;
|
||||||
@ -298,17 +290,17 @@ TerminalConInSetState (
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - Protocol instance pointer.
|
This - Protocol instance pointer.
|
||||||
KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the
|
KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the
|
||||||
state for the input device.
|
state for the input device.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The device state was set successfully.
|
EFI_SUCCESS - The device state was set successfully.
|
||||||
EFI_DEVICE_ERROR - The device is not functioning correctly and could
|
EFI_DEVICE_ERROR - The device is not functioning correctly and could
|
||||||
not have the setting adjusted.
|
not have the setting adjusted.
|
||||||
EFI_UNSUPPORTED - The device does not have the ability to set its state.
|
EFI_UNSUPPORTED - The device does not have the ability to set its state.
|
||||||
EFI_INVALID_PARAMETER - KeyToggleState is NULL.
|
EFI_INVALID_PARAMETER - KeyToggleState is NULL.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
;
|
;
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -326,18 +318,18 @@ TerminalConInRegisterKeyNotify (
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - Protocol instance pointer.
|
This - Protocol instance pointer.
|
||||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||||
information data for the key that was pressed.
|
information data for the key that was pressed.
|
||||||
KeyNotificationFunction - Points to the function to be called when the key
|
KeyNotificationFunction - Points to the function to be called when the key
|
||||||
sequence is typed specified by KeyData.
|
sequence is typed specified by KeyData.
|
||||||
NotifyHandle - Points to the unique handle assigned to the registered notification.
|
NotifyHandle - Points to the unique handle assigned to the registered notification.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The notification function was registered successfully.
|
EFI_SUCCESS - The notification function was registered successfully.
|
||||||
EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.
|
EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.
|
||||||
EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.
|
EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
;
|
;
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -352,15 +344,15 @@ TerminalConInUnregisterKeyNotify (
|
|||||||
Remove a registered notification function from a particular keystroke.
|
Remove a registered notification function from a particular keystroke.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - Protocol instance pointer.
|
This - Protocol instance pointer.
|
||||||
NotificationHandle - The handle of the notification function being unregistered.
|
NotificationHandle - The handle of the notification function being unregistered.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The notification function was unregistered successfully.
|
EFI_SUCCESS - The notification function was unregistered successfully.
|
||||||
EFI_INVALID_PARAMETER - The NotificationHandle is invalid.
|
EFI_INVALID_PARAMETER - The NotificationHandle is invalid.
|
||||||
EFI_NOT_FOUND - Can not find the matching entry in database.
|
EFI_NOT_FOUND - Can not find the matching entry in database.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
;
|
;
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/**@file
|
/**@file
|
||||||
Implementation for EFI_SIMPLE_TEXT_INPUT_PROTOCOL protocol.
|
Implementation for EFI_SIMPLE_TEXT_INPUT_PROTOCOL protocol.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007 Intel Corporation. <BR>
|
Copyright (c) 2006 - 2007, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
http://opensource.org/licenses/bsd-license.php
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -24,20 +24,20 @@ ReadKeyStrokeWorker (
|
|||||||
/*++
|
/*++
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
be used to test for existance of a keystroke via WaitForEvent () call.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
TerminalDevice - Terminal driver private structure
|
TerminalDevice - Terminal driver private structure
|
||||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||||
state data for the key that was pressed.
|
state data for the key that was pressed.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The keystroke information was returned.
|
EFI_SUCCESS - The keystroke information was returned.
|
||||||
EFI_NOT_READY - There was no keystroke data availiable.
|
EFI_NOT_READY - There was no keystroke data availiable.
|
||||||
EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
||||||
hardware errors.
|
hardware errors.
|
||||||
EFI_INVALID_PARAMETER - KeyData is NULL.
|
EFI_INVALID_PARAMETER - KeyData is NULL.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
@ -47,7 +47,7 @@ ReadKeyStrokeWorker (
|
|||||||
|
|
||||||
if (KeyData == NULL) {
|
if (KeyData == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Initialize *Key to nonsense value.
|
// Initialize *Key to nonsense value.
|
||||||
@ -72,12 +72,12 @@ ReadKeyStrokeWorker (
|
|||||||
//
|
//
|
||||||
for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {
|
for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {
|
||||||
CurrentNotify = CR (
|
CurrentNotify = CR (
|
||||||
Link,
|
Link,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
||||||
NotifyEntry,
|
NotifyEntry,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE
|
TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE
|
||||||
);
|
);
|
||||||
if (IsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
|
if (IsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
|
||||||
CurrentNotify->KeyNotificationFn (KeyData);
|
CurrentNotify->KeyNotificationFn (KeyData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,25 +95,25 @@ TerminalConInReset (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset().
|
Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.Reset().
|
||||||
This driver only perform dependent serial device reset regardless of
|
This driver only perform dependent serial device reset regardless of
|
||||||
the value of ExtendeVerification
|
the value of ExtendeVerification
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This - Indicates the calling context.
|
This - Indicates the calling context.
|
||||||
|
|
||||||
ExtendedVerification - Skip by this driver.
|
ExtendedVerification - Skip by this driver.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The reset operation succeeds.
|
The reset operation succeeds.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
The dependent serial port reset fails.
|
The dependent serial port reset fails.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -158,27 +158,27 @@ TerminalConInReadKeyStroke (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.ReadKeyStroke().
|
Implements EFI_SIMPLE_TEXT_INPUT_PROTOCOL.ReadKeyStroke().
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This - Indicates the calling context.
|
This - Indicates the calling context.
|
||||||
|
|
||||||
Key - A pointer to a buffer that is filled in with the keystroke
|
Key - A pointer to a buffer that is filled in with the keystroke
|
||||||
information for the key that was sent from terminal.
|
information for the key that was sent from terminal.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The keystroke information is returned successfully.
|
The keystroke information is returned successfully.
|
||||||
|
|
||||||
EFI_NOT_READY
|
EFI_NOT_READY
|
||||||
There is no keystroke data available.
|
There is no keystroke data available.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
The dependent serial device encounters error.
|
The dependent serial device encounters error.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
TERMINAL_DEV *TerminalDevice;
|
TERMINAL_DEV *TerminalDevice;
|
||||||
@ -213,24 +213,24 @@ Routine Description:
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
RegsiteredData - A pointer to a buffer that is filled in with the keystroke
|
RegsiteredData - A pointer to a buffer that is filled in with the keystroke
|
||||||
state data for the key that was registered.
|
state data for the key that was registered.
|
||||||
InputData - A pointer to a buffer that is filled in with the keystroke
|
InputData - A pointer to a buffer that is filled in with the keystroke
|
||||||
state data for the key that was pressed.
|
state data for the key that was pressed.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
TRUE - Key be pressed matches a registered key.
|
TRUE - Key be pressed matches a registered key.
|
||||||
FLASE - Match failed.
|
FLASE - Match failed.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
ASSERT (RegsiteredData != NULL && InputData != NULL);
|
ASSERT (RegsiteredData != NULL && InputData != NULL);
|
||||||
|
|
||||||
if ((RegsiteredData->Key.ScanCode != InputData->Key.ScanCode) ||
|
if ((RegsiteredData->Key.ScanCode != InputData->Key.ScanCode) ||
|
||||||
(RegsiteredData->Key.UnicodeChar != InputData->Key.UnicodeChar)) {
|
(RegsiteredData->Key.UnicodeChar != InputData->Key.UnicodeChar)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,24 +243,24 @@ TerminalConInWaitForKeyEx (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Event notification function for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event
|
Event notification function for EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.WaitForKeyEx event
|
||||||
Signal the event if there is key available
|
Signal the event if there is key available
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
Event - Indicates the event that invoke this function.
|
Event - Indicates the event that invoke this function.
|
||||||
|
|
||||||
Context - Indicates the calling context.
|
Context - Indicates the calling context.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
TERMINAL_DEV *TerminalDevice;
|
TERMINAL_DEV *TerminalDevice;
|
||||||
|
|
||||||
TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (Context);
|
TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (Context);
|
||||||
|
|
||||||
TerminalConInWaitForKey (Event, &TerminalDevice->SimpleInput);
|
TerminalConInWaitForKey (Event, &TerminalDevice->SimpleInput);
|
||||||
@ -288,7 +288,7 @@ TerminalConInResetEx (
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The device was reset.
|
EFI_SUCCESS - The device was reset.
|
||||||
EFI_DEVICE_ERROR - The device is not functioning properly and could
|
EFI_DEVICE_ERROR - The device is not functioning properly and could
|
||||||
not be reset.
|
not be reset.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
@ -304,7 +304,7 @@ TerminalConInResetEx (
|
|||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -316,20 +316,20 @@ TerminalConInReadKeyStrokeEx (
|
|||||||
/*++
|
/*++
|
||||||
|
|
||||||
Routine Description:
|
Routine Description:
|
||||||
Reads the next keystroke from the input device. The WaitForKey Event can
|
Reads the next keystroke from the input device. The WaitForKey Event can
|
||||||
be used to test for existance of a keystroke via WaitForEvent () call.
|
be used to test for existance of a keystroke via WaitForEvent () call.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - Protocol instance pointer.
|
This - Protocol instance pointer.
|
||||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||||
state data for the key that was pressed.
|
state data for the key that was pressed.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The keystroke information was returned.
|
EFI_SUCCESS - The keystroke information was returned.
|
||||||
EFI_NOT_READY - There was no keystroke data availiable.
|
EFI_NOT_READY - There was no keystroke data availiable.
|
||||||
EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
EFI_DEVICE_ERROR - The keystroke information was not returned due to
|
||||||
hardware errors.
|
hardware errors.
|
||||||
EFI_INVALID_PARAMETER - KeyData is NULL.
|
EFI_INVALID_PARAMETER - KeyData is NULL.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
@ -337,7 +337,7 @@ TerminalConInReadKeyStrokeEx (
|
|||||||
|
|
||||||
if (KeyData == NULL) {
|
if (KeyData == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This);
|
TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This);
|
||||||
|
|
||||||
@ -358,17 +358,17 @@ TerminalConInSetState (
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - Protocol instance pointer.
|
This - Protocol instance pointer.
|
||||||
KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the
|
KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the
|
||||||
state for the input device.
|
state for the input device.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The device state was set successfully.
|
EFI_SUCCESS - The device state was set successfully.
|
||||||
EFI_DEVICE_ERROR - The device is not functioning correctly and could
|
EFI_DEVICE_ERROR - The device is not functioning correctly and could
|
||||||
not have the setting adjusted.
|
not have the setting adjusted.
|
||||||
EFI_UNSUPPORTED - The device does not have the ability to set its state.
|
EFI_UNSUPPORTED - The device does not have the ability to set its state.
|
||||||
EFI_INVALID_PARAMETER - KeyToggleState is NULL.
|
EFI_INVALID_PARAMETER - KeyToggleState is NULL.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
if (KeyToggleState == NULL) {
|
if (KeyToggleState == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
@ -392,24 +392,24 @@ TerminalConInRegisterKeyNotify (
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - Protocol instance pointer.
|
This - Protocol instance pointer.
|
||||||
KeyData - A pointer to a buffer that is filled in with the keystroke
|
KeyData - A pointer to a buffer that is filled in with the keystroke
|
||||||
information data for the key that was pressed.
|
information data for the key that was pressed.
|
||||||
KeyNotificationFunction - Points to the function to be called when the key
|
KeyNotificationFunction - Points to the function to be called when the key
|
||||||
sequence is typed specified by KeyData.
|
sequence is typed specified by KeyData.
|
||||||
NotifyHandle - Points to the unique handle assigned to the registered notification.
|
NotifyHandle - Points to the unique handle assigned to the registered notification.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The notification function was registered successfully.
|
EFI_SUCCESS - The notification function was registered successfully.
|
||||||
EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.
|
EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.
|
||||||
EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.
|
EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
TERMINAL_DEV *TerminalDevice;
|
TERMINAL_DEV *TerminalDevice;
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY *NewNotify;
|
TERMINAL_CONSOLE_IN_EX_NOTIFY *NewNotify;
|
||||||
LIST_ENTRY *Link;
|
LIST_ENTRY *Link;
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify;
|
||||||
|
|
||||||
if (KeyData == NULL || NotifyHandle == NULL || KeyNotificationFunction == NULL) {
|
if (KeyData == NULL || NotifyHandle == NULL || KeyNotificationFunction == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
@ -422,14 +422,14 @@ TerminalConInRegisterKeyNotify (
|
|||||||
//
|
//
|
||||||
for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {
|
for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {
|
||||||
CurrentNotify = CR (
|
CurrentNotify = CR (
|
||||||
Link,
|
Link,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
||||||
NotifyEntry,
|
NotifyEntry,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE
|
TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE
|
||||||
);
|
);
|
||||||
if (IsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
|
if (IsKeyRegistered (&CurrentNotify->KeyData, KeyData)) {
|
||||||
if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {
|
if (CurrentNotify->KeyNotificationFn == KeyNotificationFunction) {
|
||||||
*NotifyHandle = CurrentNotify->NotifyHandle;
|
*NotifyHandle = CurrentNotify->NotifyHandle;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -437,19 +437,19 @@ TerminalConInRegisterKeyNotify (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Allocate resource to save the notification function
|
// Allocate resource to save the notification function
|
||||||
//
|
//
|
||||||
NewNotify = (TERMINAL_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (TERMINAL_CONSOLE_IN_EX_NOTIFY));
|
NewNotify = (TERMINAL_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (TERMINAL_CONSOLE_IN_EX_NOTIFY));
|
||||||
if (NewNotify == NULL) {
|
if (NewNotify == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewNotify->Signature = TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE;
|
NewNotify->Signature = TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE;
|
||||||
NewNotify->KeyNotificationFn = KeyNotificationFunction;
|
NewNotify->KeyNotificationFn = KeyNotificationFunction;
|
||||||
CopyMem (&NewNotify->KeyData, KeyData, sizeof (KeyData));
|
CopyMem (&NewNotify->KeyData, KeyData, sizeof (KeyData));
|
||||||
InsertTailList (&TerminalDevice->NotifyList, &NewNotify->NotifyEntry);
|
InsertTailList (&TerminalDevice->NotifyList, &NewNotify->NotifyEntry);
|
||||||
//
|
//
|
||||||
// Use gSimpleTextInExNotifyGuid to get a valid EFI_HANDLE
|
// Use gSimpleTextInExNotifyGuid to get a valid EFI_HANDLE
|
||||||
//
|
//
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
&NewNotify->NotifyHandle,
|
&NewNotify->NotifyHandle,
|
||||||
&gSimpleTextInExNotifyGuid,
|
&gSimpleTextInExNotifyGuid,
|
||||||
@ -457,7 +457,7 @@ TerminalConInRegisterKeyNotify (
|
|||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
*NotifyHandle = NewNotify->NotifyHandle;
|
*NotifyHandle = NewNotify->NotifyHandle;
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
@ -474,15 +474,15 @@ TerminalConInUnregisterKeyNotify (
|
|||||||
Remove a registered notification function from a particular keystroke.
|
Remove a registered notification function from a particular keystroke.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - Protocol instance pointer.
|
This - Protocol instance pointer.
|
||||||
NotificationHandle - The handle of the notification function being unregistered.
|
NotificationHandle - The handle of the notification function being unregistered.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_SUCCESS - The notification function was unregistered successfully.
|
EFI_SUCCESS - The notification function was unregistered successfully.
|
||||||
EFI_INVALID_PARAMETER - The NotificationHandle is invalid.
|
EFI_INVALID_PARAMETER - The NotificationHandle is invalid.
|
||||||
EFI_NOT_FOUND - Can not find the matching entry in database.
|
EFI_NOT_FOUND - Can not find the matching entry in database.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
TERMINAL_DEV *TerminalDevice;
|
TERMINAL_DEV *TerminalDevice;
|
||||||
@ -491,8 +491,8 @@ TerminalConInUnregisterKeyNotify (
|
|||||||
|
|
||||||
if (NotificationHandle == NULL) {
|
if (NotificationHandle == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = gBS->OpenProtocol (
|
Status = gBS->OpenProtocol (
|
||||||
NotificationHandle,
|
NotificationHandle,
|
||||||
&gSimpleTextInExNotifyGuid,
|
&gSimpleTextInExNotifyGuid,
|
||||||
@ -509,16 +509,16 @@ TerminalConInUnregisterKeyNotify (
|
|||||||
|
|
||||||
for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {
|
for (Link = TerminalDevice->NotifyList.ForwardLink; Link != &TerminalDevice->NotifyList; Link = Link->ForwardLink) {
|
||||||
CurrentNotify = CR (
|
CurrentNotify = CR (
|
||||||
Link,
|
Link,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
TERMINAL_CONSOLE_IN_EX_NOTIFY,
|
||||||
NotifyEntry,
|
NotifyEntry,
|
||||||
TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE
|
TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE
|
||||||
);
|
);
|
||||||
if (CurrentNotify->NotifyHandle == NotificationHandle) {
|
if (CurrentNotify->NotifyHandle == NotificationHandle) {
|
||||||
//
|
//
|
||||||
// Remove the notification function from NotifyList and free resources
|
// Remove the notification function from NotifyList and free resources
|
||||||
//
|
//
|
||||||
RemoveEntryList (&CurrentNotify->NotifyEntry);
|
RemoveEntryList (&CurrentNotify->NotifyEntry);
|
||||||
Status = gBS->UninstallMultipleProtocolInterfaces (
|
Status = gBS->UninstallMultipleProtocolInterfaces (
|
||||||
CurrentNotify->NotifyHandle,
|
CurrentNotify->NotifyHandle,
|
||||||
&gSimpleTextInExNotifyGuid,
|
&gSimpleTextInExNotifyGuid,
|
||||||
@ -526,12 +526,12 @@ TerminalConInUnregisterKeyNotify (
|
|||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
gBS->FreePool (CurrentNotify);
|
gBS->FreePool (CurrentNotify);
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_NOT_FOUND;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -541,7 +541,7 @@ TranslateRawDataToEfiKey (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Step1: Turn raw data into Unicode (according to different encode).
|
Step1: Turn raw data into Unicode (according to different encode).
|
||||||
Step2: Translate Unicode into key information.
|
Step2: Translate Unicode into key information.
|
||||||
(according to different terminal standard).
|
(according to different terminal standard).
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
@ -579,20 +579,20 @@ TerminalConInWaitForKey (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Event notification function for EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey event
|
Event notification function for EFI_SIMPLE_TEXT_INPUT_PROTOCOL.WaitForKey event
|
||||||
Signal the event if there is key available
|
Signal the event if there is key available
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
Event - Indicates the event that invoke this function.
|
Event - Indicates the event that invoke this function.
|
||||||
|
|
||||||
Context - Indicates the calling context.
|
Context - Indicates the calling context.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@ -613,23 +613,23 @@ TerminalConInCheckForKey (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Check for a pending key in the Efi Key FIFO or Serial device buffer.
|
Check for a pending key in the Efi Key FIFO or Serial device buffer.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This - Indicates the calling context.
|
This - Indicates the calling context.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
There is key pending.
|
There is key pending.
|
||||||
|
|
||||||
EFI_NOT_READY
|
EFI_NOT_READY
|
||||||
There is no key pending.
|
There is no key pending.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -741,7 +741,7 @@ GetOneKeyFromSerial (
|
|||||||
Get one key out of serial buffer.
|
Get one key out of serial buffer.
|
||||||
If serial buffer is empty, return EFI_NOT_READY;
|
If serial buffer is empty, return EFI_NOT_READY;
|
||||||
if reading serial buffer encounter error, returns EFI_DEVICE_ERROR;
|
if reading serial buffer encounter error, returns EFI_DEVICE_ERROR;
|
||||||
if reading serial buffer successfully, put the fetched key to
|
if reading serial buffer successfully, put the fetched key to
|
||||||
the parameter "Input", and return EFI_SUCCESS.
|
the parameter "Input", and return EFI_SUCCESS.
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
@ -1130,33 +1130,33 @@ UnicodeToEfiKey (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Converts a stream of Unicode characters from a terminal input device into EFI Keys that
|
Converts a stream of Unicode characters from a terminal input device into EFI Keys that
|
||||||
can be read through the Simple Input Protocol. The table below shows the keyboard
|
can be read through the Simple Input Protocol. The table below shows the keyboard
|
||||||
input mappings that this function supports. If the ESC sequence listed in one of the
|
input mappings that this function supports. If the ESC sequence listed in one of the
|
||||||
columns is presented, then it is translated into the coorespoding EFI Scan Code. If a
|
columns is presented, then it is translated into the coorespoding EFI Scan Code. If a
|
||||||
matching sequence is not found, then the raw key strokes are converted into EFI Keys.
|
matching sequence is not found, then the raw key strokes are converted into EFI Keys.
|
||||||
|
|
||||||
2 seconds are allowed for an ESC sequence to be completed. If the ESC sequence is not
|
2 seconds are allowed for an ESC sequence to be completed. If the ESC sequence is not
|
||||||
completed in 2 seconds, then the raw key strokes of the partial ESC sequence are
|
completed in 2 seconds, then the raw key strokes of the partial ESC sequence are
|
||||||
converted into EFI Keys.
|
converted into EFI Keys.
|
||||||
|
|
||||||
There is one special input sequence that will force the system to reset.
|
There is one special input sequence that will force the system to reset.
|
||||||
This is ESC R ESC r ESC R.
|
This is ESC R ESC r ESC R.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
TerminaDevice : The terminal device to use to translate raw input into EFI Keys
|
TerminaDevice : The terminal device to use to translate raw input into EFI Keys
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
None
|
None
|
||||||
|
|
||||||
Symbols used in table below
|
Symbols used in table below
|
||||||
===========================
|
===========================
|
||||||
ESC = 0x1B
|
ESC = 0x1B
|
||||||
CSI = 0x9B
|
CSI = 0x9B
|
||||||
DEL = 0x7f
|
DEL = 0x7f
|
||||||
^ = CTRL
|
^ = CTRL
|
||||||
|
|
||||||
+=========+======+===========+==========+==========+
|
+=========+======+===========+==========+==========+
|
||||||
@ -1167,7 +1167,7 @@ Symbols used in table below
|
|||||||
| NULL | 0x00 | | | |
|
| NULL | 0x00 | | | |
|
||||||
| UP | 0x01 | ESC [ A | ESC [ A | ESC [ A |
|
| UP | 0x01 | ESC [ A | ESC [ A | ESC [ A |
|
||||||
| DOWN | 0x02 | ESC [ B | ESC [ B | ESC [ B |
|
| DOWN | 0x02 | ESC [ B | ESC [ B | ESC [ B |
|
||||||
| RIGHT | 0x03 | ESC [ C | ESC [ C | ESC [ C |
|
| RIGHT | 0x03 | ESC [ C | ESC [ C | ESC [ C |
|
||||||
| LEFT | 0x04 | ESC [ D | ESC [ D | ESC [ D |
|
| LEFT | 0x04 | ESC [ D | ESC [ D | ESC [ D |
|
||||||
| HOME | 0x05 | ESC [ H | ESC h | ESC [ H |
|
| HOME | 0x05 | ESC [ H | ESC h | ESC [ H |
|
||||||
| END | 0x06 | ESC [ F | ESC k | ESC [ K |
|
| END | 0x06 | ESC [ F | ESC k | ESC [ K |
|
||||||
@ -1204,7 +1204,7 @@ ESC R ESC r ESC R = Reset System
|
|||||||
UINT16 UnicodeChar;
|
UINT16 UnicodeChar;
|
||||||
EFI_INPUT_KEY Key;
|
EFI_INPUT_KEY Key;
|
||||||
BOOLEAN SetDefaultResetState;
|
BOOLEAN SetDefaultResetState;
|
||||||
|
|
||||||
TimerStatus = gBS->CheckEvent (TerminalDevice->TwoSecondTimeOut);
|
TimerStatus = gBS->CheckEvent (TerminalDevice->TwoSecondTimeOut);
|
||||||
|
|
||||||
if (!EFI_ERROR (TimerStatus)) {
|
if (!EFI_ERROR (TimerStatus)) {
|
||||||
@ -1213,7 +1213,7 @@ ESC R ESC r ESC R = Reset System
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (!IsUnicodeFiFoEmpty(TerminalDevice)) {
|
while (!IsUnicodeFiFoEmpty(TerminalDevice)) {
|
||||||
|
|
||||||
if (TerminalDevice->InputState != INPUT_STATE_DEFAULT) {
|
if (TerminalDevice->InputState != INPUT_STATE_DEFAULT) {
|
||||||
//
|
//
|
||||||
// Check to see if the 2 second timer has expired
|
// Check to see if the 2 second timer has expired
|
||||||
@ -1252,71 +1252,71 @@ ESC R ESC r ESC R = Reset System
|
|||||||
}
|
}
|
||||||
|
|
||||||
Key.ScanCode = SCAN_NULL;
|
Key.ScanCode = SCAN_NULL;
|
||||||
|
|
||||||
if (TerminalDevice->TerminalType == VT100PlusType ||
|
if (TerminalDevice->TerminalType == VT100PlusType ||
|
||||||
TerminalDevice->TerminalType == VTUTF8Type) {
|
TerminalDevice->TerminalType == VTUTF8Type) {
|
||||||
switch (UnicodeChar) {
|
switch (UnicodeChar) {
|
||||||
case '1':
|
case '1':
|
||||||
Key.ScanCode = SCAN_F1;
|
Key.ScanCode = SCAN_F1;
|
||||||
break;
|
break;
|
||||||
case '2':
|
case '2':
|
||||||
Key.ScanCode = SCAN_F2;
|
Key.ScanCode = SCAN_F2;
|
||||||
break;
|
break;
|
||||||
case '3':
|
case '3':
|
||||||
Key.ScanCode = SCAN_F3;
|
Key.ScanCode = SCAN_F3;
|
||||||
break;
|
break;
|
||||||
case '4':
|
case '4':
|
||||||
Key.ScanCode = SCAN_F4;
|
Key.ScanCode = SCAN_F4;
|
||||||
break;
|
break;
|
||||||
case '5':
|
case '5':
|
||||||
Key.ScanCode = SCAN_F5;
|
Key.ScanCode = SCAN_F5;
|
||||||
break;
|
break;
|
||||||
case '6':
|
case '6':
|
||||||
Key.ScanCode = SCAN_F6;
|
Key.ScanCode = SCAN_F6;
|
||||||
break;
|
break;
|
||||||
case '7':
|
case '7':
|
||||||
Key.ScanCode = SCAN_F7;
|
Key.ScanCode = SCAN_F7;
|
||||||
break;
|
break;
|
||||||
case '8':
|
case '8':
|
||||||
Key.ScanCode = SCAN_F8;
|
Key.ScanCode = SCAN_F8;
|
||||||
break;
|
break;
|
||||||
case '9':
|
case '9':
|
||||||
Key.ScanCode = SCAN_F9;
|
Key.ScanCode = SCAN_F9;
|
||||||
break;
|
break;
|
||||||
case '0':
|
case '0':
|
||||||
Key.ScanCode = SCAN_F10;
|
Key.ScanCode = SCAN_F10;
|
||||||
break;
|
break;
|
||||||
case '!':
|
case '!':
|
||||||
Key.ScanCode = SCAN_F11;
|
Key.ScanCode = SCAN_F11;
|
||||||
break;
|
break;
|
||||||
case '@':
|
case '@':
|
||||||
Key.ScanCode = SCAN_F12;
|
Key.ScanCode = SCAN_F12;
|
||||||
break;
|
|
||||||
case 'h':
|
|
||||||
Key.ScanCode = SCAN_HOME;
|
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'h':
|
||||||
Key.ScanCode = SCAN_END;
|
Key.ScanCode = SCAN_HOME;
|
||||||
break;
|
break;
|
||||||
case '+':
|
case 'k':
|
||||||
Key.ScanCode = SCAN_INSERT;
|
Key.ScanCode = SCAN_END;
|
||||||
break;
|
break;
|
||||||
case '-':
|
case '+':
|
||||||
Key.ScanCode = SCAN_DELETE;
|
Key.ScanCode = SCAN_INSERT;
|
||||||
break;
|
break;
|
||||||
case '/':
|
case '-':
|
||||||
Key.ScanCode = SCAN_PAGE_DOWN;
|
Key.ScanCode = SCAN_DELETE;
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '/':
|
||||||
Key.ScanCode = SCAN_PAGE_UP;
|
Key.ScanCode = SCAN_PAGE_DOWN;
|
||||||
break;
|
break;
|
||||||
default :
|
case '?':
|
||||||
|
Key.ScanCode = SCAN_PAGE_UP;
|
||||||
|
break;
|
||||||
|
default :
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (UnicodeChar) {
|
switch (UnicodeChar) {
|
||||||
case 'R':
|
case 'R':
|
||||||
if (TerminalDevice->ResetState == RESET_STATE_DEFAULT) {
|
if (TerminalDevice->ResetState == RESET_STATE_DEFAULT) {
|
||||||
TerminalDevice->ResetState = RESET_STATE_ESC_R;
|
TerminalDevice->ResetState = RESET_STATE_ESC_R;
|
||||||
SetDefaultResetState = FALSE;
|
SetDefaultResetState = FALSE;
|
||||||
@ -1325,14 +1325,14 @@ ESC R ESC r ESC R = Reset System
|
|||||||
}
|
}
|
||||||
Key.ScanCode = SCAN_NULL;
|
Key.ScanCode = SCAN_NULL;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
if (TerminalDevice->ResetState == RESET_STATE_ESC_R) {
|
if (TerminalDevice->ResetState == RESET_STATE_ESC_R) {
|
||||||
TerminalDevice->ResetState = RESET_STATE_ESC_R_ESC_r;
|
TerminalDevice->ResetState = RESET_STATE_ESC_R_ESC_r;
|
||||||
SetDefaultResetState = FALSE;
|
SetDefaultResetState = FALSE;
|
||||||
}
|
}
|
||||||
Key.ScanCode = SCAN_NULL;
|
Key.ScanCode = SCAN_NULL;
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1357,40 +1357,40 @@ ESC R ESC r ESC R = Reset System
|
|||||||
TerminalDevice->ResetState = RESET_STATE_DEFAULT;
|
TerminalDevice->ResetState = RESET_STATE_DEFAULT;
|
||||||
|
|
||||||
Key.ScanCode = SCAN_NULL;
|
Key.ScanCode = SCAN_NULL;
|
||||||
|
|
||||||
if (TerminalDevice->TerminalType == VT100Type) {
|
if (TerminalDevice->TerminalType == VT100Type) {
|
||||||
switch (UnicodeChar) {
|
switch (UnicodeChar) {
|
||||||
case 'P':
|
case 'P':
|
||||||
Key.ScanCode = SCAN_F1;
|
Key.ScanCode = SCAN_F1;
|
||||||
break;
|
break;
|
||||||
case 'Q':
|
case 'Q':
|
||||||
Key.ScanCode = SCAN_F2;
|
Key.ScanCode = SCAN_F2;
|
||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
Key.ScanCode = SCAN_F3;
|
Key.ScanCode = SCAN_F3;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
Key.ScanCode = SCAN_F4;
|
Key.ScanCode = SCAN_F4;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
Key.ScanCode = SCAN_F5;
|
Key.ScanCode = SCAN_F5;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
Key.ScanCode = SCAN_F6;
|
Key.ScanCode = SCAN_F6;
|
||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
Key.ScanCode = SCAN_F7;
|
Key.ScanCode = SCAN_F7;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
Key.ScanCode = SCAN_F8;
|
Key.ScanCode = SCAN_F8;
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
Key.ScanCode = SCAN_F9;
|
Key.ScanCode = SCAN_F9;
|
||||||
break;
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
Key.ScanCode = SCAN_F10;
|
Key.ScanCode = SCAN_F10;
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1408,127 +1408,127 @@ ESC R ESC r ESC R = Reset System
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET:
|
case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET:
|
||||||
|
|
||||||
TerminalDevice->ResetState = RESET_STATE_DEFAULT;
|
TerminalDevice->ResetState = RESET_STATE_DEFAULT;
|
||||||
|
|
||||||
Key.ScanCode = SCAN_NULL;
|
Key.ScanCode = SCAN_NULL;
|
||||||
|
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType ||
|
if (TerminalDevice->TerminalType == PcAnsiType ||
|
||||||
TerminalDevice->TerminalType == VT100Type ||
|
TerminalDevice->TerminalType == VT100Type ||
|
||||||
TerminalDevice->TerminalType == VT100PlusType ||
|
TerminalDevice->TerminalType == VT100PlusType ||
|
||||||
TerminalDevice->TerminalType == VTUTF8Type) {
|
TerminalDevice->TerminalType == VTUTF8Type) {
|
||||||
switch (UnicodeChar) {
|
switch (UnicodeChar) {
|
||||||
case 'A':
|
case 'A':
|
||||||
Key.ScanCode = SCAN_UP;
|
Key.ScanCode = SCAN_UP;
|
||||||
break;
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
Key.ScanCode = SCAN_DOWN;
|
Key.ScanCode = SCAN_DOWN;
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
Key.ScanCode = SCAN_RIGHT;
|
Key.ScanCode = SCAN_RIGHT;
|
||||||
break;
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
Key.ScanCode = SCAN_LEFT;
|
Key.ScanCode = SCAN_LEFT;
|
||||||
break;
|
break;
|
||||||
case 'H':
|
case 'H':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType ||
|
if (TerminalDevice->TerminalType == PcAnsiType ||
|
||||||
TerminalDevice->TerminalType == VT100Type) {
|
TerminalDevice->TerminalType == VT100Type) {
|
||||||
Key.ScanCode = SCAN_HOME;
|
Key.ScanCode = SCAN_HOME;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'F':
|
case 'F':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_END;
|
Key.ScanCode = SCAN_END;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'K':
|
case 'K':
|
||||||
if (TerminalDevice->TerminalType == VT100Type) {
|
if (TerminalDevice->TerminalType == VT100Type) {
|
||||||
Key.ScanCode = SCAN_END;
|
Key.ScanCode = SCAN_END;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
case '@':
|
case '@':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType ||
|
if (TerminalDevice->TerminalType == PcAnsiType ||
|
||||||
TerminalDevice->TerminalType == VT100Type) {
|
TerminalDevice->TerminalType == VT100Type) {
|
||||||
Key.ScanCode = SCAN_INSERT;
|
Key.ScanCode = SCAN_INSERT;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'X':
|
case 'X':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_DELETE;
|
Key.ScanCode = SCAN_DELETE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
if (TerminalDevice->TerminalType == VT100Type) {
|
if (TerminalDevice->TerminalType == VT100Type) {
|
||||||
Key.ScanCode = SCAN_DELETE;
|
Key.ScanCode = SCAN_DELETE;
|
||||||
} else if (TerminalDevice->TerminalType == PcAnsiType) {
|
} else if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F4;
|
Key.ScanCode = SCAN_F4;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_PAGE_UP;
|
Key.ScanCode = SCAN_PAGE_UP;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F10;
|
Key.ScanCode = SCAN_F10;
|
||||||
}
|
}
|
||||||
case '?':
|
case '?':
|
||||||
if (TerminalDevice->TerminalType == VT100Type) {
|
if (TerminalDevice->TerminalType == VT100Type) {
|
||||||
Key.ScanCode = SCAN_PAGE_UP;
|
Key.ScanCode = SCAN_PAGE_UP;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'G':
|
case 'G':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_PAGE_DOWN;
|
Key.ScanCode = SCAN_PAGE_DOWN;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'U':
|
case 'U':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F9;
|
Key.ScanCode = SCAN_F9;
|
||||||
}
|
}
|
||||||
case '/':
|
case '/':
|
||||||
if (TerminalDevice->TerminalType == VT100Type) {
|
if (TerminalDevice->TerminalType == VT100Type) {
|
||||||
Key.ScanCode = SCAN_PAGE_DOWN;
|
Key.ScanCode = SCAN_PAGE_DOWN;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F1;
|
Key.ScanCode = SCAN_F1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'N':
|
case 'N':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F2;
|
Key.ScanCode = SCAN_F2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'O':
|
case 'O':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F3;
|
Key.ScanCode = SCAN_F3;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'Q':
|
case 'Q':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F5;
|
Key.ScanCode = SCAN_F5;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F6;
|
Key.ScanCode = SCAN_F6;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'S':
|
case 'S':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F7;
|
Key.ScanCode = SCAN_F7;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
if (TerminalDevice->TerminalType == PcAnsiType) {
|
if (TerminalDevice->TerminalType == PcAnsiType) {
|
||||||
Key.ScanCode = SCAN_F8;
|
Key.ScanCode = SCAN_F8;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1545,7 +1545,7 @@ ESC R ESC r ESC R = Reset System
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
//
|
//
|
||||||
// Invalid state. This should never happen.
|
// Invalid state. This should never happen.
|
||||||
@ -1564,7 +1564,7 @@ ESC R ESC r ESC R = Reset System
|
|||||||
if (UnicodeChar == CSI) {
|
if (UnicodeChar == CSI) {
|
||||||
TerminalDevice->InputState = INPUT_STATE_CSI;
|
TerminalDevice->InputState = INPUT_STATE_CSI;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TerminalDevice->InputState != INPUT_STATE_DEFAULT) {
|
if (TerminalDevice->InputState != INPUT_STATE_DEFAULT) {
|
||||||
Status = gBS->SetTimer(
|
Status = gBS->SetTimer(
|
||||||
TerminalDevice->TwoSecondTimeOut,
|
TerminalDevice->TwoSecondTimeOut,
|
||||||
|
@ -1,23 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Implementation for EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL protocol.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
TerminalConOut.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "Terminal.h"
|
#include "Terminal.h"
|
||||||
|
|
||||||
@ -28,7 +21,7 @@ Revision History
|
|||||||
//
|
//
|
||||||
//
|
//
|
||||||
STATIC UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = {
|
STATIC UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = {
|
||||||
{ BOXDRAW_HORIZONTAL, 0xc4, L'-' },
|
{ BOXDRAW_HORIZONTAL, 0xc4, L'-' },
|
||||||
{ BOXDRAW_VERTICAL, 0xb3, L'|' },
|
{ BOXDRAW_VERTICAL, 0xb3, L'|' },
|
||||||
{ BOXDRAW_DOWN_RIGHT, 0xda, L'/' },
|
{ BOXDRAW_DOWN_RIGHT, 0xda, L'/' },
|
||||||
{ BOXDRAW_DOWN_LEFT, 0xbf, L'\\' },
|
{ BOXDRAW_DOWN_LEFT, 0xbf, L'\\' },
|
||||||
@ -101,27 +94,27 @@ TerminalConOutReset (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset().
|
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset().
|
||||||
If ExtendeVerification is TRUE, then perform dependent serial device reset,
|
If ExtendeVerification is TRUE, then perform dependent serial device reset,
|
||||||
and set display mode to mode 0.
|
and set display mode to mode 0.
|
||||||
If ExtendedVerification is FALSE, only set display mode to mode 0.
|
If ExtendedVerification is FALSE, only set display mode to mode 0.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This - Indicates the calling context.
|
This - Indicates the calling context.
|
||||||
|
|
||||||
ExtendedVerification - Indicates that the driver may perform a more exhaustive
|
ExtendedVerification - Indicates that the driver may perform a more exhaustive
|
||||||
verification operation of the device during reset.
|
verification operation of the device during reset.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The reset operation succeeds.
|
The reset operation succeeds.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
The terminal is not functioning correctly or the serial port reset fails.
|
The terminal is not functioning correctly or the serial port reset fails.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -172,33 +165,33 @@ TerminalConOutOutputString (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString().
|
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.OutputString().
|
||||||
The Unicode string will be converted to terminal expressible data stream
|
The Unicode string will be converted to terminal expressible data stream
|
||||||
and send to terminal via serial port.
|
and send to terminal via serial port.
|
||||||
|
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This - Indicates the calling context.
|
This - Indicates the calling context.
|
||||||
|
|
||||||
WString - The Null-terminated Unicode string to be displayed on
|
WString - The Null-terminated Unicode string to be displayed on
|
||||||
the terminal screen.
|
the terminal screen.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The string is output successfully.
|
The string is output successfully.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
The serial port fails to send the string out.
|
The serial port fails to send the string out.
|
||||||
|
|
||||||
EFI_WARN_UNKNOWN_GLYPH
|
EFI_WARN_UNKNOWN_GLYPH
|
||||||
Indicates that some of the characters in the Unicode string could not
|
Indicates that some of the characters in the Unicode string could not
|
||||||
be rendered and are skipped.
|
be rendered and are skipped.
|
||||||
|
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
TERMINAL_DEV *TerminalDevice;
|
TERMINAL_DEV *TerminalDevice;
|
||||||
@ -229,7 +222,7 @@ TerminalConOutOutputString (
|
|||||||
// Get current display mode
|
// Get current display mode
|
||||||
//
|
//
|
||||||
Mode = This->Mode;
|
Mode = This->Mode;
|
||||||
|
|
||||||
if (Mode->Mode > 2) {
|
if (Mode->Mode > 2) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
@ -368,28 +361,28 @@ TerminalConOutTestString (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.TestString().
|
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.TestString().
|
||||||
If one of the characters in the *Wstring is
|
If one of the characters in the *Wstring is
|
||||||
neither valid Unicode drawing characters,
|
neither valid Unicode drawing characters,
|
||||||
not ASCII code, then this function will return
|
not ASCII code, then this function will return
|
||||||
EFI_UNSUPPORTED.
|
EFI_UNSUPPORTED.
|
||||||
|
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This - Indicates the calling context.
|
This - Indicates the calling context.
|
||||||
|
|
||||||
WString - The Null-terminated Unicode string to be tested.
|
WString - The Null-terminated Unicode string to be tested.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The terminal is capable of rendering the output string.
|
The terminal is capable of rendering the output string.
|
||||||
|
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
Some of the characters in the Unicode string cannot be rendered.
|
Some of the characters in the Unicode string cannot be rendered.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
TERMINAL_DEV *TerminalDevice;
|
TERMINAL_DEV *TerminalDevice;
|
||||||
@ -430,38 +423,38 @@ TerminalConOutQueryMode (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_OUT_PROTOCOL.QueryMode().
|
Implements EFI_SIMPLE_TEXT_OUT_PROTOCOL.QueryMode().
|
||||||
It returns information for an available text mode
|
It returns information for an available text mode
|
||||||
that the terminal supports.
|
that the terminal supports.
|
||||||
In this driver, we support text mode 80x25 (mode 0),
|
In this driver, we support text mode 80x25 (mode 0),
|
||||||
80x50 (mode 1), 100x31 (mode 2).
|
80x50 (mode 1), 100x31 (mode 2).
|
||||||
|
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
*This
|
*This
|
||||||
Indicates the calling context.
|
Indicates the calling context.
|
||||||
|
|
||||||
ModeNumber
|
ModeNumber
|
||||||
The mode number to return information on.
|
The mode number to return information on.
|
||||||
|
|
||||||
Columns
|
Columns
|
||||||
The returned columns of the requested mode.
|
The returned columns of the requested mode.
|
||||||
|
|
||||||
Rows
|
Rows
|
||||||
The returned rows of the requested mode.
|
The returned rows of the requested mode.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The requested mode information is returned.
|
The requested mode information is returned.
|
||||||
|
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
The mode number is not valid.
|
The mode number is not valid.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
if (This->Mode->MaxMode > 3) {
|
if (This->Mode->MaxMode > 3) {
|
||||||
@ -472,7 +465,7 @@ TerminalConOutQueryMode (
|
|||||||
*Columns = MODE0_COLUMN_COUNT;
|
*Columns = MODE0_COLUMN_COUNT;
|
||||||
*Rows = MODE0_ROW_COUNT;
|
*Rows = MODE0_ROW_COUNT;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
} else if (ModeNumber == 1) {
|
} else if (ModeNumber == 1) {
|
||||||
*Columns = MODE1_COLUMN_COUNT;
|
*Columns = MODE1_COLUMN_COUNT;
|
||||||
*Rows = MODE1_ROW_COUNT;
|
*Rows = MODE1_ROW_COUNT;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
@ -493,30 +486,30 @@ TerminalConOutSetMode (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_OUT.SetMode().
|
Implements EFI_SIMPLE_TEXT_OUT.SetMode().
|
||||||
Set the terminal to a specified display mode.
|
Set the terminal to a specified display mode.
|
||||||
In this driver, we only support mode 0.
|
In this driver, we only support mode 0.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This
|
This
|
||||||
Indicates the calling context.
|
Indicates the calling context.
|
||||||
|
|
||||||
ModeNumber
|
ModeNumber
|
||||||
The text mode to set.
|
The text mode to set.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The requested text mode is set.
|
The requested text mode is set.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
The requested text mode cannot be set because of serial device error.
|
The requested text mode cannot be set because of serial device error.
|
||||||
|
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
The text mode number is not valid.
|
The text mode number is not valid.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -530,7 +523,7 @@ TerminalConOutSetMode (
|
|||||||
if (ModeNumber > 2) {
|
if (ModeNumber > 2) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set the current mode
|
// Set the current mode
|
||||||
//
|
//
|
||||||
@ -565,29 +558,29 @@ TerminalConOutSetAttribute (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute().
|
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetAttribute().
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This
|
This
|
||||||
Indicates the calling context.
|
Indicates the calling context.
|
||||||
|
|
||||||
Attribute
|
Attribute
|
||||||
The attribute to set. Only bit0..6 are valid, all other bits
|
The attribute to set. Only bit0..6 are valid, all other bits
|
||||||
are undefined and must be zero.
|
are undefined and must be zero.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The requested attribute is set.
|
The requested attribute is set.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
The requested attribute cannot be set due to serial port error.
|
The requested attribute cannot be set due to serial port error.
|
||||||
|
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
The attribute requested is not defined by EFI spec.
|
The attribute requested is not defined by EFI spec.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
UINT8 ForegroundControl;
|
UINT8 ForegroundControl;
|
||||||
@ -741,28 +734,28 @@ TerminalConOutClearScreen (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.ClearScreen().
|
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.ClearScreen().
|
||||||
It clears the ANSI terminal's display to the
|
It clears the ANSI terminal's display to the
|
||||||
currently selected background color.
|
currently selected background color.
|
||||||
|
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This
|
This
|
||||||
Indicates the calling context.
|
Indicates the calling context.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The operation completed successfully.
|
The operation completed successfully.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
The terminal screen cannot be cleared due to serial port error.
|
The terminal screen cannot be cleared due to serial port error.
|
||||||
|
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
The terminal is not in a valid display mode.
|
The terminal is not in a valid display mode.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -795,32 +788,32 @@ TerminalConOutSetCursorPosition (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetCursorPosition().
|
Implements EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.SetCursorPosition().
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This
|
This
|
||||||
Indicates the calling context.
|
Indicates the calling context.
|
||||||
|
|
||||||
Column
|
Column
|
||||||
The row to set cursor to.
|
The row to set cursor to.
|
||||||
|
|
||||||
Row
|
Row
|
||||||
The column to set cursor to.
|
The column to set cursor to.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The operation completed successfully.
|
The operation completed successfully.
|
||||||
|
|
||||||
EFI_DEVICE_ERROR
|
EFI_DEVICE_ERROR
|
||||||
The request fails due to serial port error.
|
The request fails due to serial port error.
|
||||||
|
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
The terminal is not in a valid text mode, or the cursor position
|
The terminal is not in a valid text mode, or the cursor position
|
||||||
is invalid for current mode.
|
is invalid for current mode.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;
|
EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;
|
||||||
@ -885,27 +878,27 @@ TerminalConOutEnableCursor (
|
|||||||
)
|
)
|
||||||
/*++
|
/*++
|
||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Implements SIMPLE_TEXT_OUTPUT.EnableCursor().
|
Implements SIMPLE_TEXT_OUTPUT.EnableCursor().
|
||||||
In this driver, the cursor cannot be hidden.
|
In this driver, the cursor cannot be hidden.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
This
|
This
|
||||||
Indicates the calling context.
|
Indicates the calling context.
|
||||||
|
|
||||||
Visible
|
Visible
|
||||||
If TRUE, the cursor is set to be visible,
|
If TRUE, the cursor is set to be visible,
|
||||||
If FALSE, the cursor is set to be invisible.
|
If FALSE, the cursor is set to be invisible.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
The request is valid.
|
The request is valid.
|
||||||
|
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
The terminal does not support cursor hidden.
|
The terminal does not support cursor hidden.
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
if (!Visible) {
|
if (!Visible) {
|
||||||
|
@ -1,23 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Provides misc functions upon ansi.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
ansi.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
--*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "Terminal.h"
|
#include "Terminal.h"
|
||||||
@ -56,7 +49,7 @@ AnsiTestString (
|
|||||||
//
|
//
|
||||||
for (; *WString != CHAR_NULL; WString++) {
|
for (; *WString != CHAR_NULL; WString++) {
|
||||||
|
|
||||||
if ( !(TerminalIsValidAscii (*WString) ||
|
if ( !(TerminalIsValidAscii (*WString) ||
|
||||||
TerminalIsValidEfiCntlChar (*WString) ||
|
TerminalIsValidEfiCntlChar (*WString) ||
|
||||||
TerminalIsValidTextGraphics (*WString, &GraphicChar, NULL) )) {
|
TerminalIsValidTextGraphics (*WString, &GraphicChar, NULL) )) {
|
||||||
|
|
||||||
|
@ -1,23 +1,16 @@
|
|||||||
/*++
|
/**@file
|
||||||
|
Implementation translation among different code tyies.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
vtutf8.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "Terminal.h"
|
#include "Terminal.h"
|
||||||
|
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
UEFI Component Name(2) protocol implementation for DebugPort driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
ComponentName.c
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Abstract:
|
**/
|
||||||
Component name protocol member functions for DebugPort...
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "DebugPort.h"
|
#include "DebugPort.h"
|
||||||
|
|
||||||
|
@ -1,29 +1,19 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Top level C file for debugport driver. Contains initialization function.
|
||||||
|
This driver layers on top of SerialIo.
|
||||||
|
ALL CODE IN THE SERIALIO STACK MUST BE RE-ENTRANT AND CALLABLE FROM
|
||||||
|
INTERRUPT CONTEXT
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
DebugPort.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Top level C file for debugport driver. Contains initialization function.
|
|
||||||
This driver layers on top of SerialIo.
|
|
||||||
|
|
||||||
ALL CODE IN THE SERIALIO STACK MUST BE RE-ENTRANT AND CALLABLE FROM
|
|
||||||
INTERRUPT CONTEXT.
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "DebugPort.h"
|
#include "DebugPort.h"
|
||||||
@ -41,7 +31,7 @@ GetDebugPortVariable (
|
|||||||
Routine Description:
|
Routine Description:
|
||||||
Local worker function to obtain device path information from DebugPort variable.
|
Local worker function to obtain device path information from DebugPort variable.
|
||||||
Records requested settings in DebugPort device structure.
|
Records requested settings in DebugPort device structure.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
DEBUGPORT_DEVICE *DebugPortDevice,
|
DEBUGPORT_DEVICE *DebugPortDevice,
|
||||||
|
|
||||||
@ -145,8 +135,8 @@ InitializeDebugPortDriver (
|
|||||||
Routine Description:
|
Routine Description:
|
||||||
Driver entry point. Reads DebugPort variable to determine what device and settings
|
Driver entry point. Reads DebugPort variable to determine what device and settings
|
||||||
to use as the debug port. Binds exclusively to SerialIo. Reverts to defaults \
|
to use as the debug port. Binds exclusively to SerialIo. Reverts to defaults \
|
||||||
if no variable is found.
|
if no variable is found.
|
||||||
|
|
||||||
Creates debugport and devicepath protocols on new handle.
|
Creates debugport and devicepath protocols on new handle.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
@ -215,13 +205,13 @@ DebugPortSupported (
|
|||||||
Routine Description:
|
Routine Description:
|
||||||
Checks to see that there's not already a DebugPort interface somewhere. If so,
|
Checks to see that there's not already a DebugPort interface somewhere. If so,
|
||||||
fail.
|
fail.
|
||||||
|
|
||||||
If there's a DEBUGPORT variable, the device path must match exactly. If there's
|
If there's a DEBUGPORT variable, the device path must match exactly. If there's
|
||||||
no DEBUGPORT variable, then device path is not checked and does not matter.
|
no DEBUGPORT variable, then device path is not checked and does not matter.
|
||||||
|
|
||||||
Checks to see that there's a serial io interface on the controller handle
|
Checks to see that there's a serial io interface on the controller handle
|
||||||
that can be bound BY_DRIVER | EXCLUSIVE.
|
that can be bound BY_DRIVER | EXCLUSIVE.
|
||||||
|
|
||||||
If all these tests succeed, then we return EFI_SUCCESS, else, EFI_UNSUPPORTED
|
If all these tests succeed, then we return EFI_SUCCESS, else, EFI_UNSUPPORTED
|
||||||
or other error returned by OpenProtocol.
|
or other error returned by OpenProtocol.
|
||||||
|
|
||||||
@ -229,12 +219,12 @@ Arguments:
|
|||||||
This
|
This
|
||||||
ControllerHandle
|
ControllerHandle
|
||||||
RemainingDevicePath
|
RemainingDevicePath
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
EFI_OUT_OF_RESOURCES
|
EFI_OUT_OF_RESOURCES
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -332,7 +322,7 @@ Arguments:
|
|||||||
This
|
This
|
||||||
ControllerHandle
|
ControllerHandle
|
||||||
RemainingDevicePath
|
RemainingDevicePath
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_OUT_OF_RESOURCES
|
EFI_OUT_OF_RESOURCES
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
@ -501,11 +491,11 @@ Routine Description:
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
Per UEFI 2.0 driver model
|
Per UEFI 2.0 driver model
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
EFI_UNSUPPORTED
|
EFI_UNSUPPORTED
|
||||||
EFI_SUCCESS
|
EFI_SUCCESS
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -590,9 +580,9 @@ Routine Description:
|
|||||||
We cannot call SerialIo:SetAttributes because it uses pool services, which use
|
We cannot call SerialIo:SetAttributes because it uses pool services, which use
|
||||||
locks, which affect TPL, so it's not interrupt context safe or re-entrant.
|
locks, which affect TPL, so it's not interrupt context safe or re-entrant.
|
||||||
SerialIo:Reset() calls SetAttributes, so it can't be used either.
|
SerialIo:Reset() calls SetAttributes, so it can't be used either.
|
||||||
|
|
||||||
The port itself should be fine since it was set up during initialization.
|
The port itself should be fine since it was set up during initialization.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This
|
This
|
||||||
|
|
||||||
@ -626,7 +616,7 @@ DebugPortRead (
|
|||||||
Routine Description:
|
Routine Description:
|
||||||
DebugPort protocol member function. Calls SerialIo:Read() after setting
|
DebugPort protocol member function. Calls SerialIo:Read() after setting
|
||||||
if it's different than the last SerialIo access.
|
if it's different than the last SerialIo access.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
IN EFI_DEBUGPORT_PROTOCOL *This
|
IN EFI_DEBUGPORT_PROTOCOL *This
|
||||||
IN UINT32 Timeout,
|
IN UINT32 Timeout,
|
||||||
@ -686,11 +676,11 @@ Routine Description:
|
|||||||
DebugPort protocol member function. Calls SerialIo:Write() Writes 8 bytes at
|
DebugPort protocol member function. Calls SerialIo:Write() Writes 8 bytes at
|
||||||
a time and does a GetControl between 8 byte writes to help insure reads are
|
a time and does a GetControl between 8 byte writes to help insure reads are
|
||||||
interspersed This is poor-man's flow control..
|
interspersed This is poor-man's flow control..
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
This - Pointer to DebugPort protocol
|
This - Pointer to DebugPort protocol
|
||||||
Timeout - Timeout value
|
Timeout - Timeout value
|
||||||
BufferSize - On input, the size of Buffer.
|
BufferSize - On input, the size of Buffer.
|
||||||
On output, the amount of data actually written.
|
On output, the amount of data actually written.
|
||||||
Buffer - Pointer to buffer to write
|
Buffer - Pointer to buffer to write
|
||||||
|
|
||||||
@ -741,7 +731,7 @@ DebugPortPoll (
|
|||||||
Routine Description:
|
Routine Description:
|
||||||
DebugPort protocol member function. Calls SerialIo:Write() after setting
|
DebugPort protocol member function. Calls SerialIo:Write() after setting
|
||||||
if it's different than the last SerialIo access.
|
if it's different than the last SerialIo access.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
IN EFI_DEBUGPORT_PROTOCOL *This
|
IN EFI_DEBUGPORT_PROTOCOL *This
|
||||||
|
|
||||||
@ -785,7 +775,7 @@ Routine Description:
|
|||||||
Unload function that is registered in the LoadImage protocol. It un-installs
|
Unload function that is registered in the LoadImage protocol. It un-installs
|
||||||
protocols produced and deallocates pool used by the driver. Called by the core
|
protocols produced and deallocates pool used by the driver. Called by the core
|
||||||
when unloading the driver.
|
when unloading the driver.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
EFI_HANDLE ImageHandle
|
EFI_HANDLE ImageHandle
|
||||||
|
|
||||||
|
@ -1,21 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Definitions and prototypes for DebugPort driver.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
DebugPort.h
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Abstract:
|
**/
|
||||||
Definitions and prototypes for DebugPort driver
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#ifndef __DEBUGPORT_H__
|
#ifndef __DEBUGPORT_H__
|
||||||
#define __DEBUGPORT_H__
|
#define __DEBUGPORT_H__
|
||||||
|
@ -1,25 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Top level C file for debug support driver. Contains initialization function.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
DebugSupport.c
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Top level C file for debug support driver. Contains initialization function.
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// private header files
|
// private header files
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,25 +1,18 @@
|
|||||||
/*++
|
/** @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.
|
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
EbcExecute.h
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Header file for Virtual Machine support. Contains EBC defines that can
|
Header file for Virtual Machine support. Contains EBC defines that can
|
||||||
be of use to a disassembler for the most part. Also provides function
|
be of use to a disassembler for the most part. Also provides function
|
||||||
prototypes for VM functions.
|
prototypes for VM functions.
|
||||||
|
|
||||||
--*/
|
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 _EBC_EXECUTE_H_
|
#ifndef _EBC_EXECUTE_H_
|
||||||
#define _EBC_EXECUTE_H_
|
#define _EBC_EXECUTE_H_
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Top level module for the EBC virtual machine implementation.
|
||||||
|
Provides auxilliary support routines for the VM. That is, routines
|
||||||
|
that are not particularly related to VM execution of EBC instructions.
|
||||||
|
|
||||||
Copyright (c) 2006, 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
|
||||||
@ -9,17 +12,7 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
**/
|
||||||
|
|
||||||
EbcInt.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Top level module for the EBC virtual machine implementation.
|
|
||||||
Provides auxilliary support routines for the VM. That is, routines
|
|
||||||
that are not particularly related to VM execution of EBC instructions.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "EbcInt.h"
|
#include "EbcInt.h"
|
||||||
#include "EbcExecute.h"
|
#include "EbcExecute.h"
|
||||||
@ -188,28 +181,23 @@ static UINTN mStackNum = 0;
|
|||||||
static EFI_EVENT mEbcPeriodicEvent;
|
static EFI_EVENT mEbcPeriodicEvent;
|
||||||
VM_CONTEXT *mVmPtr = NULL;
|
VM_CONTEXT *mVmPtr = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Initializes the VM EFI interface. Allocates memory for the VM interface
|
||||||
|
and registers the VM protocol.
|
||||||
|
|
||||||
|
@param ImageHandle EFI image handle.
|
||||||
|
@param SystemTable Pointer to the EFI system table.
|
||||||
|
|
||||||
|
@return Standard EFI status code.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
InitializeEbcDriver (
|
InitializeEbcDriver (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Initializes the VM EFI interface. Allocates memory for the VM interface
|
|
||||||
and registers the VM protocol.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
ImageHandle - EFI image handle.
|
|
||||||
SystemTable - Pointer to the EFI system table.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
Standard EFI status code.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
EFI_EBC_PROTOCOL *EbcProtocol;
|
EFI_EBC_PROTOCOL *EbcProtocol;
|
||||||
EFI_EBC_PROTOCOL *OldEbcProtocol;
|
EFI_EBC_PROTOCOL *OldEbcProtocol;
|
||||||
@ -384,6 +372,24 @@ ErrorExit:
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This is the top-level routine plugged into the EBC protocol. Since thunks
|
||||||
|
are very processor-specific, from here we dispatch directly to the very
|
||||||
|
processor-specific routine EbcCreateThunks().
|
||||||
|
|
||||||
|
@param This protocol instance pointer
|
||||||
|
@param ImageHandle handle to the image. The EBC interpreter may use
|
||||||
|
this to keep track of any resource allocations
|
||||||
|
performed in loading and executing the image.
|
||||||
|
@param EbcEntryPoint the entry point for the image (as defined in the
|
||||||
|
file header)
|
||||||
|
@param Thunk pointer to thunk pointer where the address of the
|
||||||
|
created thunk is returned.
|
||||||
|
|
||||||
|
@return EFI_STATUS
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -393,29 +399,6 @@ EbcCreateThunk (
|
|||||||
IN VOID *EbcEntryPoint,
|
IN VOID *EbcEntryPoint,
|
||||||
OUT VOID **Thunk
|
OUT VOID **Thunk
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
This is the top-level routine plugged into the EBC protocol. Since thunks
|
|
||||||
are very processor-specific, from here we dispatch directly to the very
|
|
||||||
processor-specific routine EbcCreateThunks().
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
This - protocol instance pointer
|
|
||||||
ImageHandle - handle to the image. The EBC interpreter may use this to keep
|
|
||||||
track of any resource allocations performed in loading and
|
|
||||||
executing the image.
|
|
||||||
EbcEntryPoint - the entry point for the image (as defined in the file header)
|
|
||||||
Thunk - pointer to thunk pointer where the address of the created
|
|
||||||
thunk is returned.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
EFI_STATUS
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
@ -428,6 +411,18 @@ Returns:
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This EBC debugger protocol service is called by the debug agent
|
||||||
|
|
||||||
|
@param This pointer to the caller's debug support protocol
|
||||||
|
interface
|
||||||
|
@param MaxProcessorIndex pointer to a caller allocated UINTN in which the
|
||||||
|
maximum processor index is returned.
|
||||||
|
|
||||||
|
@return Standard EFI_STATUS
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -435,28 +430,23 @@ EbcDebugGetMaximumProcessorIndex (
|
|||||||
IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
|
IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
|
||||||
OUT UINTN *MaxProcessorIndex
|
OUT UINTN *MaxProcessorIndex
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
This EBC debugger protocol service is called by the debug agent
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
This - pointer to the caller's debug support protocol interface
|
|
||||||
MaxProcessorIndex - pointer to a caller allocated UINTN in which the maximum
|
|
||||||
processor index is returned.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
Standard EFI_STATUS
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
*MaxProcessorIndex = 0;
|
*MaxProcessorIndex = 0;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This protocol service is called by the debug agent to register a function
|
||||||
|
for us to call on a periodic basis.
|
||||||
|
|
||||||
|
@param This pointer to the caller's debug support protocol
|
||||||
|
interface
|
||||||
|
@param PeriodicCallback pointer to the function to call periodically
|
||||||
|
|
||||||
|
@return Always EFI_SUCCESS
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -465,24 +455,6 @@ EbcDebugRegisterPeriodicCallback (
|
|||||||
IN UINTN ProcessorIndex,
|
IN UINTN ProcessorIndex,
|
||||||
IN EFI_PERIODIC_CALLBACK PeriodicCallback
|
IN EFI_PERIODIC_CALLBACK PeriodicCallback
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
This protocol service is called by the debug agent to register a function
|
|
||||||
for us to call on a periodic basis.
|
|
||||||
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
This - pointer to the caller's debug support protocol interface
|
|
||||||
PeriodicCallback - pointer to the function to call periodically
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
Always EFI_SUCCESS
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
if ((mDebugPeriodicCallback == NULL) && (PeriodicCallback == NULL)) {
|
if ((mDebugPeriodicCallback == NULL) && (PeriodicCallback == NULL)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
@ -495,6 +467,18 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This protocol service is called by the debug agent to register a function
|
||||||
|
for us to call when we detect an exception.
|
||||||
|
|
||||||
|
@param This pointer to the caller's debug support protocol
|
||||||
|
interface
|
||||||
|
@param ExceptionCallback pointer to the function to the exception
|
||||||
|
|
||||||
|
@return Always EFI_SUCCESS
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -504,24 +488,6 @@ EbcDebugRegisterExceptionCallback (
|
|||||||
IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
|
IN EFI_EXCEPTION_CALLBACK ExceptionCallback,
|
||||||
IN EFI_EXCEPTION_TYPE ExceptionType
|
IN EFI_EXCEPTION_TYPE ExceptionType
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
This protocol service is called by the debug agent to register a function
|
|
||||||
for us to call when we detect an exception.
|
|
||||||
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
This - pointer to the caller's debug support protocol interface
|
|
||||||
ExceptionCallback - pointer to the function to the exception
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
Always EFI_SUCCESS
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
if ((ExceptionType < 0) || (ExceptionType > MAX_EBC_EXCEPTION)) {
|
if ((ExceptionType < 0) || (ExceptionType > MAX_EBC_EXCEPTION)) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
@ -536,6 +502,15 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This EBC debugger protocol service is called by the debug agent. Required
|
||||||
|
for DebugSupport compliance but is only stubbed out for EBC.
|
||||||
|
|
||||||
|
|
||||||
|
@return EFI_SUCCESS
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -545,45 +520,26 @@ EbcDebugInvalidateInstructionCache (
|
|||||||
IN VOID *Start,
|
IN VOID *Start,
|
||||||
IN UINT64 Length
|
IN UINT64 Length
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
This EBC debugger protocol service is called by the debug agent. Required
|
|
||||||
for DebugSupport compliance but is only stubbed out for EBC.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
EFI_SUCCESS
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
The VM interpreter calls this function when an exception is detected.
|
||||||
|
|
||||||
|
@param VmPtr pointer to a VM context for passing info to the
|
||||||
|
EFI debugger.
|
||||||
|
|
||||||
|
@return EFI_SUCCESS if it returns at all
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EbcDebugSignalException (
|
EbcDebugSignalException (
|
||||||
IN EFI_EXCEPTION_TYPE ExceptionType,
|
IN EFI_EXCEPTION_TYPE ExceptionType,
|
||||||
IN EXCEPTION_FLAGS ExceptionFlags,
|
IN EXCEPTION_FLAGS ExceptionFlags,
|
||||||
IN VM_CONTEXT *VmPtr
|
IN VM_CONTEXT *VmPtr
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
The VM interpreter calls this function when an exception is detected.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
VmPtr - pointer to a VM context for passing info to the EFI debugger.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
EFI_SUCCESS if it returns at all
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
EFI_SYSTEM_CONTEXT_EBC EbcContext;
|
EFI_SYSTEM_CONTEXT_EBC EbcContext;
|
||||||
EFI_SYSTEM_CONTEXT SystemContext;
|
EFI_SYSTEM_CONTEXT SystemContext;
|
||||||
@ -645,26 +601,20 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
To install default Callback function for the VM interpreter.
|
||||||
|
|
||||||
|
@param This pointer to the instance of DebugSupport protocol
|
||||||
|
|
||||||
|
@return None
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
InitializeEbcCallback (
|
InitializeEbcCallback (
|
||||||
IN EFI_DEBUG_SUPPORT_PROTOCOL *This
|
IN EFI_DEBUG_SUPPORT_PROTOCOL *This
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
To install default Callback function for the VM interpreter.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
This - pointer to the instance of DebugSupport protocol
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
INTN Index;
|
INTN Index;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
@ -707,30 +657,24 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
The default Exception Callback for the VM interpreter.
|
||||||
|
In this function, we report status code, and print debug information
|
||||||
|
about EBC_CONTEXT, then dead loop.
|
||||||
|
|
||||||
|
@param InterruptType Interrupt type.
|
||||||
|
@param SystemContext EBC system context.
|
||||||
|
|
||||||
|
@return None
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
VOID
|
VOID
|
||||||
CommonEbcExceptionHandler (
|
CommonEbcExceptionHandler (
|
||||||
IN EFI_EXCEPTION_TYPE InterruptType,
|
IN EFI_EXCEPTION_TYPE InterruptType,
|
||||||
IN EFI_SYSTEM_CONTEXT SystemContext
|
IN EFI_SYSTEM_CONTEXT SystemContext
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
The default Exception Callback for the VM interpreter.
|
|
||||||
In this function, we report status code, and print debug information
|
|
||||||
about EBC_CONTEXT, then dead loop.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
InterruptType - Interrupt type.
|
|
||||||
SystemContext - EBC system context.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
None
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// We deadloop here to make it easy to debug this issue.
|
// We deadloop here to make it easy to debug this issue.
|
||||||
@ -740,6 +684,17 @@ Returns:
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
The periodic callback function for EBC VM interpreter, which is used
|
||||||
|
to support the EFI debug support protocol.
|
||||||
|
|
||||||
|
@param Event The Periodic Callback Event.
|
||||||
|
@param Context It should be the address of VM_CONTEXT pointer.
|
||||||
|
|
||||||
|
@return None.
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
VOID
|
VOID
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -747,23 +702,6 @@ EbcPeriodicNotifyFunction (
|
|||||||
IN EFI_EVENT Event,
|
IN EFI_EVENT Event,
|
||||||
IN VOID *Context
|
IN VOID *Context
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
The periodic callback function for EBC VM interpreter, which is used
|
|
||||||
to support the EFI debug support protocol.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
Event - The Periodic Callback Event.
|
|
||||||
Context - It should be the address of VM_CONTEXT pointer.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
VM_CONTEXT *VmPtr;
|
VM_CONTEXT *VmPtr;
|
||||||
|
|
||||||
@ -776,27 +714,22 @@ Returns:
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
The VM interpreter calls this function on a periodic basis to support
|
||||||
|
the EFI debug support protocol.
|
||||||
|
|
||||||
|
@param VmPtr pointer to a VM context for passing info to the
|
||||||
|
debugger.
|
||||||
|
|
||||||
|
@return Standard EFI status.
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EbcDebugPeriodic (
|
EbcDebugPeriodic (
|
||||||
IN VM_CONTEXT *VmPtr
|
IN VM_CONTEXT *VmPtr
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
The VM interpreter calls this function on a periodic basis to support
|
|
||||||
the EFI debug support protocol.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
VmPtr - pointer to a VM context for passing info to the debugger.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
Standard EFI status.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
EFI_SYSTEM_CONTEXT_EBC EbcContext;
|
EFI_SYSTEM_CONTEXT_EBC EbcContext;
|
||||||
EFI_SYSTEM_CONTEXT SystemContext;
|
EFI_SYSTEM_CONTEXT SystemContext;
|
||||||
@ -842,6 +775,20 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This routine is called by the core when an image is being unloaded from
|
||||||
|
memory. Basically we now have the opportunity to do any necessary cleanup.
|
||||||
|
Typically this will include freeing any memory allocated for thunk-creation.
|
||||||
|
|
||||||
|
@param This protocol instance pointer
|
||||||
|
@param ImageHandle handle to the image being unloaded.
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER the ImageHandle passed in was not found in the
|
||||||
|
internal list of EBC image handles.
|
||||||
|
@retval EFI_STATUS completed successfully
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -849,26 +796,6 @@ EbcUnloadImage (
|
|||||||
IN EFI_EBC_PROTOCOL *This,
|
IN EFI_EBC_PROTOCOL *This,
|
||||||
IN EFI_HANDLE ImageHandle
|
IN EFI_HANDLE ImageHandle
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
This routine is called by the core when an image is being unloaded from
|
|
||||||
memory. Basically we now have the opportunity to do any necessary cleanup.
|
|
||||||
Typically this will include freeing any memory allocated for thunk-creation.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
This - protocol instance pointer
|
|
||||||
ImageHandle - handle to the image being unloaded.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
EFI_INVALID_PARAMETER - the ImageHandle passed in was not found in
|
|
||||||
the internal list of EBC image handles.
|
|
||||||
EFI_STATUS - completed successfully
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
EBC_THUNK_LIST *ThunkList;
|
EBC_THUNK_LIST *ThunkList;
|
||||||
EBC_THUNK_LIST *NextThunkList;
|
EBC_THUNK_LIST *NextThunkList;
|
||||||
@ -922,32 +849,26 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Add a thunk to our list of thunks for a given image handle.
|
||||||
|
Also flush the instruction cache since we've written thunk code
|
||||||
|
to memory that will be executed eventually.
|
||||||
|
|
||||||
|
@param ImageHandle the image handle to which the thunk is tied
|
||||||
|
@param ThunkBuffer the buffer we've created/allocated
|
||||||
|
@param ThunkSize the size of the thunk memory allocated
|
||||||
|
|
||||||
|
@retval EFI_OUT_OF_RESOURCES memory allocation failed
|
||||||
|
@retval EFI_SUCCESS successful completion
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EbcAddImageThunk (
|
EbcAddImageThunk (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
IN VOID *ThunkBuffer,
|
IN VOID *ThunkBuffer,
|
||||||
IN UINT32 ThunkSize
|
IN UINT32 ThunkSize
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Add a thunk to our list of thunks for a given image handle.
|
|
||||||
Also flush the instruction cache since we've written thunk code
|
|
||||||
to memory that will be executed eventually.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
ImageHandle - the image handle to which the thunk is tied
|
|
||||||
ThunkBuffer - the buffer we've created/allocated
|
|
||||||
ThunkSize - the size of the thunk memory allocated
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
EFI_OUT_OF_RESOURCES - memory allocation failed
|
|
||||||
EFI_SUCCESS - successful completion
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
EBC_THUNK_LIST *ThunkList;
|
EBC_THUNK_LIST *ThunkList;
|
||||||
EBC_IMAGE_LIST *ImageList;
|
EBC_IMAGE_LIST *ImageList;
|
||||||
@ -1113,27 +1034,21 @@ FreeEBCStack(
|
|||||||
}
|
}
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Produce an EBC VM test protocol that can be used for regression tests.
|
||||||
|
|
||||||
|
@param IHandle handle on which to install the protocol.
|
||||||
|
|
||||||
|
@retval EFI_OUT_OF_RESOURCES memory allocation failed
|
||||||
|
@retval EFI_SUCCESS successful completion
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
InitEbcVmTestProtocol (
|
InitEbcVmTestProtocol (
|
||||||
IN EFI_HANDLE *IHandle
|
IN EFI_HANDLE *IHandle
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Produce an EBC VM test protocol that can be used for regression tests.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
IHandle - handle on which to install the protocol.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
EFI_OUT_OF_RESOURCES - memory allocation failed
|
|
||||||
EFI_SUCCESS - successful completion
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
EFI_HANDLE Handle;
|
EFI_HANDLE Handle;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
@ -1,24 +1,17 @@
|
|||||||
/*++
|
/** @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.
|
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
EbcInt.h
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Main routines for the EBC interpreter. Includes the initialization and
|
Main routines for the EBC interpreter. Includes the initialization and
|
||||||
main interpreter routines.
|
main interpreter routines.
|
||||||
|
|
||||||
--*/
|
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 _EBC_INT_H_
|
#ifndef _EBC_INT_H_
|
||||||
#define _EBC_INT_H_
|
#define _EBC_INT_H_
|
||||||
|
@ -1,24 +1,17 @@
|
|||||||
/*++
|
/** @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.
|
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
EbcSupport.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
This module contains EBC support routines that are customized based on
|
This module contains EBC support routines that are customized based on
|
||||||
the target processor.
|
the target processor.
|
||||||
|
|
||||||
--*/
|
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.
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
#include "EbcInt.h"
|
#include "EbcInt.h"
|
||||||
#include "EbcExecute.h"
|
#include "EbcExecute.h"
|
||||||
@ -33,6 +26,25 @@ Abstract:
|
|||||||
#define EBC_THUNK_SIZE 32
|
#define EBC_THUNK_SIZE 32
|
||||||
|
|
||||||
#define STACK_REMAIN_SIZE (1024 * 4)
|
#define STACK_REMAIN_SIZE (1024 * 4)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This function is called to execute an EBC CALLEX instruction.
|
||||||
|
The function check the callee's content to see whether it is common native
|
||||||
|
code or a thunk to another piece of EBC code.
|
||||||
|
If the callee is common native code, use EbcLLCAllEXASM to manipulate,
|
||||||
|
otherwise, set the VM->IP to target EBC code directly to avoid another VM
|
||||||
|
be startup which cost time and stack space.
|
||||||
|
|
||||||
|
@parm VmPtr Pointer to a VM context.
|
||||||
|
@parm FuncAddr Callee's address
|
||||||
|
@parm NewStackPointer New stack pointer after the call
|
||||||
|
@parm FramePtr New frame pointer after the call
|
||||||
|
@parm Size The size of call instruction
|
||||||
|
|
||||||
|
@return None.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EbcLLCALLEX (
|
EbcLLCALLEX (
|
||||||
IN VM_CONTEXT *VmPtr,
|
IN VM_CONTEXT *VmPtr,
|
||||||
@ -41,30 +53,6 @@ EbcLLCALLEX (
|
|||||||
IN VOID *FramePtr,
|
IN VOID *FramePtr,
|
||||||
IN UINT8 Size
|
IN UINT8 Size
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
This function is called to execute an EBC CALLEX instruction.
|
|
||||||
The function check the callee's content to see whether it is common native
|
|
||||||
code or a thunk to another piece of EBC code.
|
|
||||||
If the callee is common native code, use EbcLLCAllEXASM to manipulate,
|
|
||||||
otherwise, set the VM->IP to target EBC code directly to avoid another VM
|
|
||||||
be startup which cost time and stack space.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
VmPtr - Pointer to a VM context.
|
|
||||||
FuncAddr - Callee's address
|
|
||||||
NewStackPointer - New stack pointer after the call
|
|
||||||
FramePtr - New frame pointer after the call
|
|
||||||
Size - The size of call instruction
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINTN IsThunk;
|
UINTN IsThunk;
|
||||||
UINTN TargetEbcAddr;
|
UINTN TargetEbcAddr;
|
||||||
@ -134,7 +122,7 @@ Action:
|
|||||||
// The callee is not a thunk to EBC, call native code.
|
// The callee is not a thunk to EBC, call native code.
|
||||||
//
|
//
|
||||||
EbcLLCALLEXNative (FuncAddr, NewStackPointer, FramePtr);
|
EbcLLCALLEXNative (FuncAddr, NewStackPointer, FramePtr);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get return value and advance the IP.
|
// Get return value and advance the IP.
|
||||||
//
|
//
|
||||||
@ -143,6 +131,19 @@ Action:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Begin executing an EBC image. The address of the entry point is passed
|
||||||
|
in via a processor register, so we'll need to make a call to get the
|
||||||
|
value.
|
||||||
|
|
||||||
|
None. Since we're called from a fixed up thunk (which we want to keep
|
||||||
|
small), our only so-called argument is the EBC entry point passed in
|
||||||
|
to us in a processor register.
|
||||||
|
|
||||||
|
@return The value returned by the EBC application we're going to run.
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
EbcInterpret (
|
EbcInterpret (
|
||||||
@ -163,25 +164,6 @@ EbcInterpret (
|
|||||||
IN OUT UINTN Arg15,
|
IN OUT UINTN Arg15,
|
||||||
IN OUT UINTN Arg16
|
IN OUT UINTN Arg16
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Begin executing an EBC image. The address of the entry point is passed
|
|
||||||
in via a processor register, so we'll need to make a call to get the
|
|
||||||
value.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
None. Since we're called from a fixed up thunk (which we want to keep
|
|
||||||
small), our only so-called argument is the EBC entry point passed in
|
|
||||||
to us in a processor register.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
The value returned by the EBC application we're going to run.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Create a new VM context on the stack
|
// Create a new VM context on the stack
|
||||||
@ -298,30 +280,24 @@ Returns:
|
|||||||
return (UINT64) VmContext.R[7];
|
return (UINT64) VmContext.R[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Begin executing an EBC image. The address of the entry point is passed
|
||||||
|
in via a processor register, so we'll need to make a call to get the
|
||||||
|
value.
|
||||||
|
|
||||||
|
@param ImageHandle image handle for the EBC application we're executing
|
||||||
|
@param SystemTable standard system table passed into an driver's entry point
|
||||||
|
|
||||||
|
@return The value returned by the EBC application we're going to run.
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
ExecuteEbcImageEntryPoint (
|
ExecuteEbcImageEntryPoint (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Begin executing an EBC image. The address of the entry point is passed
|
|
||||||
in via a processor register, so we'll need to make a call to get the
|
|
||||||
value.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
ImageHandle - image handle for the EBC application we're executing
|
|
||||||
SystemTable - standard system table passed into an driver's entry point
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
The value returned by the EBC application we're going to run.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Create a new VM context on the stack
|
// Create a new VM context on the stack
|
||||||
@ -373,7 +349,7 @@ Returns:
|
|||||||
VmContext.R[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);
|
VmContext.R[0] = (UINT64)(UINTN) ((UINT8*)VmContext.StackPool + STACK_POOL_SIZE);
|
||||||
VmContext.HighStackBottom = (UINTN)VmContext.R[0];
|
VmContext.HighStackBottom = (UINTN)VmContext.R[0];
|
||||||
VmContext.R[0] -= sizeof (UINTN);
|
VmContext.R[0] -= sizeof (UINTN);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Put a magic value in the stack gap, then adjust down again
|
// Put a magic value in the stack gap, then adjust down again
|
||||||
//
|
//
|
||||||
@ -390,7 +366,7 @@ Returns:
|
|||||||
VmContext.R[0] -= sizeof (UINTN);
|
VmContext.R[0] -= sizeof (UINTN);
|
||||||
*(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) ImageHandle;
|
*(UINTN *) (UINTN) (VmContext.R[0]) = (UINTN) ImageHandle;
|
||||||
|
|
||||||
VmContext.R[0] -= 16;
|
VmContext.R[0] -= 16;
|
||||||
VmContext.StackRetAddr = (UINT64) VmContext.R[0];
|
VmContext.StackRetAddr = (UINT64) VmContext.R[0];
|
||||||
//
|
//
|
||||||
// VM pushes 16-bytes for return address. Simulate that here.
|
// VM pushes 16-bytes for return address. Simulate that here.
|
||||||
@ -407,6 +383,17 @@ Returns:
|
|||||||
return (UINT64) VmContext.R[7];
|
return (UINT64) VmContext.R[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Create an IA32 thunk for the given EBC entry point.
|
||||||
|
|
||||||
|
@param ImageHandle Handle of image for which this thunk is being created
|
||||||
|
@param EbcEntryPoint Address of the EBC code that the thunk is to call
|
||||||
|
@param Thunk Returned thunk we create here
|
||||||
|
|
||||||
|
@return Standard EFI status.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EbcCreateThunks (
|
EbcCreateThunks (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
@ -414,23 +401,6 @@ EbcCreateThunks (
|
|||||||
OUT VOID **Thunk,
|
OUT VOID **Thunk,
|
||||||
IN UINT32 Flags
|
IN UINT32 Flags
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Create an IA32 thunk for the given EBC entry point.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
ImageHandle - Handle of image for which this thunk is being created
|
|
||||||
EbcEntryPoint - Address of the EBC code that the thunk is to call
|
|
||||||
Thunk - Returned thunk we create here
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
Standard EFI status.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINT8 *Ptr;
|
UINT8 *Ptr;
|
||||||
UINT8 *ThunkBase;
|
UINT8 *ThunkBase;
|
||||||
|
@ -1,24 +1,17 @@
|
|||||||
/*++
|
/** @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.
|
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
EbcSupport.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
This module contains EBC support routines that are customized based on
|
This module contains EBC support routines that are customized based on
|
||||||
the target processor.
|
the target processor.
|
||||||
|
|
||||||
--*/
|
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.
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
#include "EbcInt.h"
|
#include "EbcInt.h"
|
||||||
#include "EbcExecute.h"
|
#include "EbcExecute.h"
|
||||||
@ -141,7 +134,7 @@ EbcInterpret (
|
|||||||
// Now adjust the EBC stack pointer down to leave a gap for interpreter
|
// Now adjust the EBC stack pointer down to leave a gap for interpreter
|
||||||
// execution. Then stuff a magic value there.
|
// execution. Then stuff a magic value there.
|
||||||
//
|
//
|
||||||
|
|
||||||
Status = GetEBCStack((EFI_HANDLE)(UINTN)-1, &VmContext.StackPool, &StackIndex);
|
Status = GetEBCStack((EFI_HANDLE)(UINTN)-1, &VmContext.StackPool, &StackIndex);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
@ -151,7 +144,7 @@ EbcInterpret (
|
|||||||
VmContext.HighStackBottom = (UINTN) VmContext.R[0];
|
VmContext.HighStackBottom = (UINTN) VmContext.R[0];
|
||||||
VmContext.R[0] -= sizeof (UINTN);
|
VmContext.R[0] -= sizeof (UINTN);
|
||||||
|
|
||||||
|
|
||||||
PushU64 (&VmContext, (UINT64) VM_STACK_KEY_VALUE);
|
PushU64 (&VmContext, (UINT64) VM_STACK_KEY_VALUE);
|
||||||
VmContext.StackMagicPtr = (UINTN *) VmContext.R[0];
|
VmContext.StackMagicPtr = (UINTN *) VmContext.R[0];
|
||||||
VmContext.LowStackTop = (UINTN) VmContext.R[0];
|
VmContext.LowStackTop = (UINTN) VmContext.R[0];
|
||||||
@ -194,32 +187,27 @@ EbcInterpret (
|
|||||||
return (UINT64) VmContext.R[7];
|
return (UINT64) VmContext.R[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
IPF implementation.
|
||||||
|
Begin executing an EBC image. The address of the entry point is passed
|
||||||
|
in via a processor register, so we'll need to make a call to get the
|
||||||
|
value.
|
||||||
|
|
||||||
|
@param ImageHandle image handle for the EBC application we're
|
||||||
|
executing
|
||||||
|
@param SystemTable standard system table passed into an driver's
|
||||||
|
entry point
|
||||||
|
|
||||||
|
@return The value returned by the EBC application we're going to run.
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
ExecuteEbcImageEntryPoint (
|
ExecuteEbcImageEntryPoint (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
IPF implementation.
|
|
||||||
|
|
||||||
Begin executing an EBC image. The address of the entry point is passed
|
|
||||||
in via a processor register, so we'll need to make a call to get the
|
|
||||||
value.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
ImageHandle - image handle for the EBC application we're executing
|
|
||||||
SystemTable - standard system table passed into an driver's entry point
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
The value returned by the EBC application we're going to run.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Create a new VM context on the stack
|
// Create a new VM context on the stack
|
||||||
@ -256,7 +244,7 @@ Returns:
|
|||||||
// Get the stack pointer. This is the bottom of the upper stack.
|
// Get the stack pointer. This is the bottom of the upper stack.
|
||||||
//
|
//
|
||||||
Addr = EbcLLGetStackPointer ();
|
Addr = EbcLLGetStackPointer ();
|
||||||
|
|
||||||
Status = GetEBCStack(ImageHandle, &VmContext.StackPool, &StackIndex);
|
Status = GetEBCStack(ImageHandle, &VmContext.StackPool, &StackIndex);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
@ -266,7 +254,7 @@ Returns:
|
|||||||
VmContext.HighStackBottom = (UINTN) VmContext.R[0];
|
VmContext.HighStackBottom = (UINTN) VmContext.R[0];
|
||||||
VmContext.R[0] -= sizeof (UINTN);
|
VmContext.R[0] -= sizeof (UINTN);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Allocate stack space for the interpreter. Then put a magic value
|
// Allocate stack space for the interpreter. Then put a magic value
|
||||||
// at the bottom so we can detect stack corruption.
|
// at the bottom so we can detect stack corruption.
|
||||||
@ -320,6 +308,19 @@ Returns:
|
|||||||
return (UINT64) VmContext.R[7];
|
return (UINT64) VmContext.R[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Create thunks for an EBC image entry point, or an EBC protocol service.
|
||||||
|
|
||||||
|
@param ImageHandle Image handle for the EBC image. If not null, then
|
||||||
|
we're creating a thunk for an image entry point.
|
||||||
|
@param EbcEntryPoint Address of the EBC code that the thunk is to call
|
||||||
|
@param Thunk Returned thunk we create here
|
||||||
|
@param Flags Flags indicating options for creating the thunk
|
||||||
|
|
||||||
|
@return Standard EFI status.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EbcCreateThunks (
|
EbcCreateThunks (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
@ -327,25 +328,6 @@ EbcCreateThunks (
|
|||||||
OUT VOID **Thunk,
|
OUT VOID **Thunk,
|
||||||
IN UINT32 Flags
|
IN UINT32 Flags
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Create thunks for an EBC image entry point, or an EBC protocol service.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
ImageHandle - Image handle for the EBC image. If not null, then we're
|
|
||||||
creating a thunk for an image entry point.
|
|
||||||
EbcEntryPoint - Address of the EBC code that the thunk is to call
|
|
||||||
Thunk - Returned thunk we create here
|
|
||||||
Flags - Flags indicating options for creating the thunk
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
Standard EFI status.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINT8 *Ptr;
|
UINT8 *Ptr;
|
||||||
UINT8 *ThunkBase;
|
UINT8 *ThunkBase;
|
||||||
@ -680,6 +662,21 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Given raw bytes of Itanium based code, format them into a bundle and
|
||||||
|
write them out.
|
||||||
|
|
||||||
|
@param MemPtr pointer to memory location to write the bundles to
|
||||||
|
@param Template 5-bit template
|
||||||
|
@param Slot0-2 instruction slot data for the bundle
|
||||||
|
|
||||||
|
@retval EFI_INVALID_PARAMETER Pointer is not aligned
|
||||||
|
@retval No more than 5 bits in template
|
||||||
|
@retval More than 41 bits used in code
|
||||||
|
@retval EFI_SUCCESS All data is written.
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
WriteBundle (
|
WriteBundle (
|
||||||
@ -689,27 +686,6 @@ WriteBundle (
|
|||||||
IN UINT64 Slot1,
|
IN UINT64 Slot1,
|
||||||
IN UINT64 Slot2
|
IN UINT64 Slot2
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Given raw bytes of Itanium based code, format them into a bundle and
|
|
||||||
write them out.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
MemPtr - pointer to memory location to write the bundles to
|
|
||||||
Template - 5-bit template
|
|
||||||
Slot0-2 - instruction slot data for the bundle
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
EFI_INVALID_PARAMETER - Pointer is not aligned
|
|
||||||
- No more than 5 bits in template
|
|
||||||
- More than 41 bits used in code
|
|
||||||
EFI_SUCCESS - All data is written.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINT8 *BPtr;
|
UINT8 *BPtr;
|
||||||
UINT32 Index;
|
UINT32 Index;
|
||||||
@ -760,6 +736,24 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This function is called to execute an EBC CALLEX instruction.
|
||||||
|
The function check the callee's content to see whether it is common native
|
||||||
|
code or a thunk to another piece of EBC code.
|
||||||
|
If the callee is common native code, use EbcLLCAllEXASM to manipulate,
|
||||||
|
otherwise, set the VM->IP to target EBC code directly to avoid another VM
|
||||||
|
be startup which cost time and stack space.
|
||||||
|
|
||||||
|
@param VmPtr Pointer to a VM context.
|
||||||
|
@param FuncAddr Callee's address
|
||||||
|
@param NewStackPointer New stack pointer after the call
|
||||||
|
@param FramePtr New frame pointer after the call
|
||||||
|
@param Size The size of call instruction
|
||||||
|
|
||||||
|
@return None.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EbcLLCALLEX (
|
EbcLLCALLEX (
|
||||||
IN VM_CONTEXT *VmPtr,
|
IN VM_CONTEXT *VmPtr,
|
||||||
@ -768,30 +762,6 @@ EbcLLCALLEX (
|
|||||||
IN VOID *FramePtr,
|
IN VOID *FramePtr,
|
||||||
IN UINT8 Size
|
IN UINT8 Size
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
This function is called to execute an EBC CALLEX instruction.
|
|
||||||
The function check the callee's content to see whether it is common native
|
|
||||||
code or a thunk to another piece of EBC code.
|
|
||||||
If the callee is common native code, use EbcLLCAllEXASM to manipulate,
|
|
||||||
otherwise, set the VM->IP to target EBC code directly to avoid another VM
|
|
||||||
be startup which cost time and stack space.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
VmPtr - Pointer to a VM context.
|
|
||||||
FuncAddr - Callee's address
|
|
||||||
NewStackPointer - New stack pointer after the call
|
|
||||||
FramePtr - New frame pointer after the call
|
|
||||||
Size - The size of call instruction
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINTN IsThunk;
|
UINTN IsThunk;
|
||||||
UINTN TargetEbcAddr;
|
UINTN TargetEbcAddr;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Definition of EBC Support function.
|
||||||
|
|
||||||
Copyright (c) 2006, 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
|
||||||
@ -9,17 +10,7 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
**/
|
||||||
|
|
||||||
EbcSupport.h
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Definition of EBC Support function
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#ifndef _IPF_EBC_SUPPORT_H_
|
#ifndef _IPF_EBC_SUPPORT_H_
|
||||||
#define _IPF_EBC_SUPPORT_H_
|
#define _IPF_EBC_SUPPORT_H_
|
||||||
|
@ -1,24 +1,17 @@
|
|||||||
/*++
|
/** @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.
|
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
EbcSupport.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
This module contains EBC support routines that are customized based on
|
This module contains EBC support routines that are customized based on
|
||||||
the target x64 processor.
|
the target x64 processor.
|
||||||
|
|
||||||
--*/
|
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.
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
#include "EbcInt.h"
|
#include "EbcInt.h"
|
||||||
#include "EbcExecute.h"
|
#include "EbcExecute.h"
|
||||||
@ -45,7 +38,7 @@ PushU64 (
|
|||||||
Routine Description:
|
Routine Description:
|
||||||
|
|
||||||
Push a 64 bit unsigned value to the VM stack.
|
Push a 64 bit unsigned value to the VM stack.
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
VmPtr - The pointer to current VM context.
|
VmPtr - The pointer to current VM context.
|
||||||
@ -54,7 +47,7 @@ Arguments:
|
|||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@ -66,6 +59,19 @@ Returns:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Begin executing an EBC image. The address of the entry point is passed
|
||||||
|
in via a processor register, so we'll need to make a call to get the
|
||||||
|
value.
|
||||||
|
|
||||||
|
This is a thunk function. Microsoft x64 compiler only provide fast_call
|
||||||
|
calling convention, so the first four arguments are passed by rcx, rdx,
|
||||||
|
r8, and r9, while other arguments are passed in stack.
|
||||||
|
|
||||||
|
@return The value returned by the EBC application we're going to run.
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
EbcInterpret (
|
EbcInterpret (
|
||||||
@ -86,25 +92,6 @@ EbcInterpret (
|
|||||||
UINTN Arg15,
|
UINTN Arg15,
|
||||||
UINTN Arg16
|
UINTN Arg16
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Begin executing an EBC image. The address of the entry point is passed
|
|
||||||
in via a processor register, so we'll need to make a call to get the
|
|
||||||
value.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
This is a thunk function. Microsoft x64 compiler only provide fast_call
|
|
||||||
calling convention, so the first four arguments are passed by rcx, rdx,
|
|
||||||
r8, and r9, while other arguments are passed in stack.
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
The value returned by the EBC application we're going to run.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Create a new VM context on the stack
|
// Create a new VM context on the stack
|
||||||
@ -140,7 +127,7 @@ Returns:
|
|||||||
//
|
//
|
||||||
// Adjust the VM's stack pointer down.
|
// Adjust the VM's stack pointer down.
|
||||||
//
|
//
|
||||||
|
|
||||||
Status = GetEBCStack((EFI_HANDLE)(UINTN)-1, &VmContext.StackPool, &StackIndex);
|
Status = GetEBCStack((EFI_HANDLE)(UINTN)-1, &VmContext.StackPool, &StackIndex);
|
||||||
if (EFI_ERROR(Status)) {
|
if (EFI_ERROR(Status)) {
|
||||||
return Status;
|
return Status;
|
||||||
@ -225,30 +212,25 @@ Returns:
|
|||||||
return (UINT64) VmContext.R[7];
|
return (UINT64) VmContext.R[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Begin executing an EBC image. The address of the entry point is passed
|
||||||
|
in via a processor register, so we'll need to make a call to get the
|
||||||
|
value.
|
||||||
|
|
||||||
|
@param ImageHandle image handle for the EBC application we're executing
|
||||||
|
@param SystemTable standard system table passed into an driver's entry
|
||||||
|
point
|
||||||
|
|
||||||
|
@return The value returned by the EBC application we're going to run.
|
||||||
|
|
||||||
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
ExecuteEbcImageEntryPoint (
|
ExecuteEbcImageEntryPoint (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Begin executing an EBC image. The address of the entry point is passed
|
|
||||||
in via a processor register, so we'll need to make a call to get the
|
|
||||||
value.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
ImageHandle - image handle for the EBC application we're executing
|
|
||||||
SystemTable - standard system table passed into an driver's entry point
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
The value returned by the EBC application we're going to run.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Create a new VM context on the stack
|
// Create a new VM context on the stack
|
||||||
@ -344,6 +326,17 @@ Returns:
|
|||||||
return (UINT64) VmContext.R[7];
|
return (UINT64) VmContext.R[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Create an IA32 thunk for the given EBC entry point.
|
||||||
|
|
||||||
|
@param ImageHandle Handle of image for which this thunk is being created
|
||||||
|
@param EbcEntryPoint Address of the EBC code that the thunk is to call
|
||||||
|
@param Thunk Returned thunk we create here
|
||||||
|
|
||||||
|
@return Standard EFI status.
|
||||||
|
|
||||||
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EbcCreateThunks (
|
EbcCreateThunks (
|
||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
@ -351,23 +344,6 @@ EbcCreateThunks (
|
|||||||
OUT VOID **Thunk,
|
OUT VOID **Thunk,
|
||||||
IN UINT32 Flags
|
IN UINT32 Flags
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
Create an IA32 thunk for the given EBC entry point.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
ImageHandle - Handle of image for which this thunk is being created
|
|
||||||
EbcEntryPoint - Address of the EBC code that the thunk is to call
|
|
||||||
Thunk - Returned thunk we create here
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
Standard EFI status.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINT8 *Ptr;
|
UINT8 *Ptr;
|
||||||
UINT8 *ThunkBase;
|
UINT8 *ThunkBase;
|
||||||
@ -496,6 +472,24 @@ Returns:
|
|||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This function is called to execute an EBC CALLEX instruction.
|
||||||
|
The function check the callee's content to see whether it is common native
|
||||||
|
code or a thunk to another piece of EBC code.
|
||||||
|
If the callee is common native code, use EbcLLCAllEXASM to manipulate,
|
||||||
|
otherwise, set the VM->IP to target EBC code directly to avoid another VM
|
||||||
|
be startup which cost time and stack space.
|
||||||
|
|
||||||
|
@param VmPtr Pointer to a VM context.
|
||||||
|
@param FuncAddr Callee's address
|
||||||
|
@param NewStackPointer New stack pointer after the call
|
||||||
|
@param FramePtr New frame pointer after the call
|
||||||
|
@param Size The size of call instruction
|
||||||
|
|
||||||
|
@return None.
|
||||||
|
|
||||||
|
**/
|
||||||
VOID
|
VOID
|
||||||
EbcLLCALLEX (
|
EbcLLCALLEX (
|
||||||
IN VM_CONTEXT *VmPtr,
|
IN VM_CONTEXT *VmPtr,
|
||||||
@ -504,30 +498,6 @@ EbcLLCALLEX (
|
|||||||
IN VOID *FramePtr,
|
IN VOID *FramePtr,
|
||||||
IN UINT8 Size
|
IN UINT8 Size
|
||||||
)
|
)
|
||||||
/*++
|
|
||||||
|
|
||||||
Routine Description:
|
|
||||||
|
|
||||||
This function is called to execute an EBC CALLEX instruction.
|
|
||||||
The function check the callee's content to see whether it is common native
|
|
||||||
code or a thunk to another piece of EBC code.
|
|
||||||
If the callee is common native code, use EbcLLCAllEXASM to manipulate,
|
|
||||||
otherwise, set the VM->IP to target EBC code directly to avoid another VM
|
|
||||||
be startup which cost time and stack space.
|
|
||||||
|
|
||||||
Arguments:
|
|
||||||
|
|
||||||
VmPtr - Pointer to a VM context.
|
|
||||||
FuncAddr - Callee's address
|
|
||||||
NewStackPointer - New stack pointer after the call
|
|
||||||
FramePtr - New frame pointer after the call
|
|
||||||
Size - The size of call instruction
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
--*/
|
|
||||||
{
|
{
|
||||||
UINTN IsThunk;
|
UINTN IsThunk;
|
||||||
UINTN TargetEbcAddr;
|
UINTN TargetEbcAddr;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Produced the Monotonic Counter Services as defined in the DXE CIS.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, 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
|
||||||
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
|
||||||
@ -9,17 +10,8 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name:
|
**/
|
||||||
|
|
||||||
MonotonicCounter.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Produced the Monotonic Counter Services as defined in the DXE CIS
|
|
||||||
|
|
||||||
Revision History:
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "MonotonicCounter.h"
|
#include "MonotonicCounter.h"
|
||||||
|
|
||||||
|
@ -1,23 +1,16 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Header file for MonotonicCounter driver.
|
||||||
|
|
||||||
Copyright (c) 2006, 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
|
||||||
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
|
||||||
http://opensource.org/licenses/bsd-license.php
|
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:
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
MonotonicCounter.h
|
**/
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Produces the Monotonic Counter services as defined in the DXE CIS
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#ifndef _MONOTONIC_COUNTER_DRIVER_H_
|
#ifndef _MONOTONIC_COUNTER_DRIVER_H_
|
||||||
#define _MONOTONIC_COUNTER_DRIVER_H_
|
#define _MONOTONIC_COUNTER_DRIVER_H_
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
This file contains two sets of callback routines for undi3.0 and undi3.1.
|
||||||
|
the callback routines for Undi3.1 have an extra parameter UniqueId which
|
||||||
|
stores the interface context for the NIC that snp is trying to talk.
|
||||||
|
|
||||||
Copyright (c) 2006, 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
|
||||||
@ -8,16 +12,7 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module name:
|
**/
|
||||||
callback.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
This file contains two sets of callback routines for undi3.0 and undi3.1.
|
|
||||||
the callback routines for Undi3.1 have an extra parameter UniqueId which
|
|
||||||
stores the interface context for the NIC that snp is trying to talk..
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "Snp.h"
|
#include "Snp.h"
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Provides Set/Get time operations.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007 Intel Corporation. <BR>
|
Copyright (c) 2006 - 2007, 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
|
||||||
@ -9,15 +10,7 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
Ia32PcRtc.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "PcRtc.h"
|
#include "PcRtc.h"
|
||||||
|
|
||||||
@ -139,9 +132,9 @@ Routine Description:
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
Returns:
|
||||||
--*/
|
--*/
|
||||||
// GC_TODO: ImageHandle - add argument and description to function comment
|
// GC_TODO: ImageHandle - add argument and description to function comment
|
||||||
// GC_TODO: SystemTable - add argument and description to function comment
|
// GC_TODO: SystemTable - add argument and description to function comment
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
RTC Architectural Protocol GUID as defined in DxeCis 0.96.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007 Intel Corporation. <BR>
|
Copyright (c) 2006 - 2007, 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
|
||||||
@ -9,17 +10,7 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
PcRtc.c
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
RTC Architectural Protocol GUID as defined in DxeCis 0.96
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#include "PcRtc.h"
|
#include "PcRtc.h"
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/*++
|
/** @file
|
||||||
|
Header file for real time clock driver.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007 Intel Corporation. <BR>
|
Copyright (c) 2006 - 2007, 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
|
||||||
@ -9,19 +10,8 @@ http://opensource.org/licenses/bsd-license.php
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
Module Name:
|
|
||||||
|
|
||||||
PcRtc.h
|
|
||||||
|
|
||||||
Abstract:
|
|
||||||
|
|
||||||
Include for real time clock driver
|
|
||||||
|
|
||||||
Revision History
|
|
||||||
|
|
||||||
|
|
||||||
--*/
|
|
||||||
|
|
||||||
#ifndef _RTC_H_
|
#ifndef _RTC_H_
|
||||||
#define _RTC_H_
|
#define _RTC_H_
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/**
|
/** @file
|
||||||
|
Installs Single Segment Pci Configuration PPI.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, Intel Corporation
|
Copyright (c) 2006 - 2007, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
@ -27,9 +28,9 @@
|
|||||||
|
|
||||||
@param Address PCI address with
|
@param Address PCI address with
|
||||||
EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.
|
EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.
|
||||||
|
|
||||||
@return The PCI address with PCI_LIB_ADDRESS format.
|
@return The PCI address with PCI_LIB_ADDRESS format.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
UINTN
|
UINTN
|
||||||
@ -69,7 +70,7 @@ PciCfgAddressConvert (
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PciCfg2Read (
|
PciCfg2Read (
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
||||||
@ -103,7 +104,7 @@ PciCfg2Read (
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PciCfg2Write (
|
PciCfg2Write (
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
||||||
@ -143,7 +144,7 @@ PciCfg2Write (
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PciCfg2Modify (
|
PciCfg2Modify (
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
||||||
@ -209,7 +210,7 @@ EFI_PEI_PPI_DESCRIPTOR gPciCfg2PpiList = {
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PciCfg2Read (
|
PciCfg2Read (
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
||||||
@ -260,7 +261,7 @@ PciCfg2Read (
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PciCfg2Write (
|
PciCfg2Write (
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
||||||
@ -317,7 +318,7 @@ PciCfg2Write (
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
PciCfg2Modify (
|
PciCfg2Modify (
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
||||||
|
Reference in New Issue
Block a user