Global variables have been moved backward ahead of functions.
Only a few cases were left due to its module structure. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6816 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -14,82 +14,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#include "GraphicsConsole.h"
|
||||
|
||||
/**
|
||||
Gets Graphics Console devcie's foreground color and background color.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param Foreground Returned text foreground color.
|
||||
@param Background Returned text background color.
|
||||
|
||||
@retval EFI_SUCCESS It returned always.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetTextColors (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,
|
||||
OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background
|
||||
);
|
||||
|
||||
/**
|
||||
Draw Unicode string on the Graphice Console device's screen.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param UnicodeWeight One Unicode string to be displayed.
|
||||
@param Count The count of Unicode string.
|
||||
|
||||
@retval EFI_OUT_OF_RESOURCES If no memory resource to use.
|
||||
@retval EFI_UNSUPPORTED If no Graphics Output protocol and UGA Draw
|
||||
protocol exist.
|
||||
@retval EFI_SUCCESS Drawing Unicode string implemented successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
DrawUnicodeWeightAtCursorN (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *UnicodeWeight,
|
||||
IN UINTN Count
|
||||
);
|
||||
|
||||
/**
|
||||
Erase the cursor on the screen.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
|
||||
@retval EFI_SUCCESS The cursor is erased successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EraseCursor (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
|
||||
);
|
||||
|
||||
/**
|
||||
Check if the current specific mode supported the user defined resolution
|
||||
for the Graphice Console devcie based on Graphics Output Protocol.
|
||||
|
||||
If yes, set the graphic devcice's current mode to this specific mode.
|
||||
|
||||
@param GraphicsOutput Graphics Output Protocol instance pointer.
|
||||
@param HorizontalResolution User defined horizontal resolution
|
||||
@param VerticalResolution User defined vertical resolution.
|
||||
@param CurrentModeNumber Current specific mode to be check.
|
||||
|
||||
@retval EFI_SUCCESS The mode is supported.
|
||||
@retval EFI_UNSUPPORTED The specific mode is out of range of graphics
|
||||
devcie supported.
|
||||
@retval other The specific mode does not support user defined
|
||||
resolution or failed to set the current mode to the
|
||||
specific mode on graphics device.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CheckModeSupported (
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
|
||||
IN UINT32 HorizontalResolution,
|
||||
IN UINT32 VerticalResolution,
|
||||
OUT UINT32 *CurrentModeNumber
|
||||
);
|
||||
|
||||
//
|
||||
// Graphics Console Devcie Private Data template
|
||||
@@ -175,6 +99,83 @@ EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding = {
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
Gets Graphics Console devcie's foreground color and background color.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param Foreground Returned text foreground color.
|
||||
@param Background Returned text background color.
|
||||
|
||||
@retval EFI_SUCCESS It returned always.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
GetTextColors (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,
|
||||
OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background
|
||||
);
|
||||
|
||||
/**
|
||||
Draw Unicode string on the Graphice Console device's screen.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
@param UnicodeWeight One Unicode string to be displayed.
|
||||
@param Count The count of Unicode string.
|
||||
|
||||
@retval EFI_OUT_OF_RESOURCES If no memory resource to use.
|
||||
@retval EFI_UNSUPPORTED If no Graphics Output protocol and UGA Draw
|
||||
protocol exist.
|
||||
@retval EFI_SUCCESS Drawing Unicode string implemented successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
DrawUnicodeWeightAtCursorN (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *UnicodeWeight,
|
||||
IN UINTN Count
|
||||
);
|
||||
|
||||
/**
|
||||
Erase the cursor on the screen.
|
||||
|
||||
@param This Protocol instance pointer.
|
||||
|
||||
@retval EFI_SUCCESS The cursor is erased successfully.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EraseCursor (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
|
||||
);
|
||||
|
||||
/**
|
||||
Check if the current specific mode supported the user defined resolution
|
||||
for the Graphice Console devcie based on Graphics Output Protocol.
|
||||
|
||||
If yes, set the graphic devcice's current mode to this specific mode.
|
||||
|
||||
@param GraphicsOutput Graphics Output Protocol instance pointer.
|
||||
@param HorizontalResolution User defined horizontal resolution
|
||||
@param VerticalResolution User defined vertical resolution.
|
||||
@param CurrentModeNumber Current specific mode to be check.
|
||||
|
||||
@retval EFI_SUCCESS The mode is supported.
|
||||
@retval EFI_UNSUPPORTED The specific mode is out of range of graphics
|
||||
devcie supported.
|
||||
@retval other The specific mode does not support user defined
|
||||
resolution or failed to set the current mode to the
|
||||
specific mode on graphics device.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
CheckModeSupported (
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
|
||||
IN UINT32 HorizontalResolution,
|
||||
IN UINT32 VerticalResolution,
|
||||
OUT UINT32 *CurrentModeNumber
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Test to see if Graphics Console could be supported on the Controller.
|
||||
|
@@ -16,20 +16,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
#include "Terminal.h"
|
||||
|
||||
/**
|
||||
Free notify functions list.
|
||||
|
||||
@param ListHead The list head
|
||||
|
||||
@retval EFI_SUCCESS Free the notify list successfully.
|
||||
@retval EFI_INVALID_PARAMETER ListHead is NULL.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
TerminalFreeNotifyList (
|
||||
IN OUT LIST_ENTRY *ListHead
|
||||
);
|
||||
|
||||
//
|
||||
// Globals
|
||||
//
|
||||
@@ -118,6 +104,20 @@ TERMINAL_DEV mTerminalDevTemplate = {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Free notify functions list.
|
||||
|
||||
@param ListHead The list head
|
||||
|
||||
@retval EFI_SUCCESS Free the notify list successfully.
|
||||
@retval EFI_INVALID_PARAMETER ListHead is NULL.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
TerminalFreeNotifyList (
|
||||
IN OUT LIST_ENTRY *ListHead
|
||||
);
|
||||
|
||||
/**
|
||||
Test to see if this driver supports Controller.
|
||||
|
||||
|
@@ -35,6 +35,21 @@ typedef struct {
|
||||
VOID (*RegisteredCallback) ();
|
||||
} IVT_ENTRY;
|
||||
|
||||
IVT_ENTRY IvtEntryTable[NUM_IVT_ENTRIES];
|
||||
|
||||
//
|
||||
// IPF context record is overallocated by 512 bytes to guarantee a 512 byte alignment exists
|
||||
// within the buffer and still have a large enough buffer to hold a whole IPF context record.
|
||||
//
|
||||
UINT8 IpfContextBuf[sizeof (EFI_SYSTEM_CONTEXT_IPF) + 512];
|
||||
|
||||
//
|
||||
// The PatchSaveBuffer is used to store the original bundles from the IVT where it is patched
|
||||
// with the common handler.
|
||||
//
|
||||
UINT8 PatchSaveBuffer[0x400];
|
||||
UINTN ExternalInterruptCount;
|
||||
|
||||
/**
|
||||
This is the worker function that uninstalls and removes all handlers.
|
||||
|
||||
@@ -117,20 +132,6 @@ GetHandlerEntryPoint (
|
||||
VOID **EntryPoint
|
||||
);
|
||||
|
||||
IVT_ENTRY IvtEntryTable[NUM_IVT_ENTRIES];
|
||||
|
||||
//
|
||||
// IPF context record is overallocated by 512 bytes to guarantee a 512 byte alignment exists
|
||||
// within the buffer and still have a large enough buffer to hold a whole IPF context record.
|
||||
//
|
||||
UINT8 IpfContextBuf[sizeof (EFI_SYSTEM_CONTEXT_IPF) + 512];
|
||||
|
||||
//
|
||||
// The PatchSaveBuffer is used to store the original bundles from the IVT where it is patched
|
||||
// with the common handler.
|
||||
//
|
||||
UINT8 PatchSaveBuffer[0x400];
|
||||
UINTN ExternalInterruptCount;
|
||||
|
||||
/**
|
||||
IPF specific DebugSupport driver initialization.
|
||||
|
@@ -23,27 +23,6 @@
|
||||
|
||||
#include <IndustryStandard/Pci.h>
|
||||
|
||||
/**
|
||||
Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.
|
||||
|
||||
@param Address PCI address with
|
||||
EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.
|
||||
|
||||
@return The PCI address with PCI_LIB_ADDRESS format.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
PciCfgAddressConvert (
|
||||
EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *Address
|
||||
)
|
||||
{
|
||||
if (Address->ExtendedRegister == 0) {
|
||||
return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->Register);
|
||||
}
|
||||
|
||||
return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);
|
||||
}
|
||||
|
||||
/**
|
||||
Reads from a given location in the PCI configuration space.
|
||||
|
||||
@@ -184,6 +163,29 @@ EFI_PEI_PPI_DESCRIPTOR gPciCfg2PpiList = {
|
||||
&gPciCfg2Ppi
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.
|
||||
|
||||
@param Address PCI address with
|
||||
EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.
|
||||
|
||||
@return The PCI address with PCI_LIB_ADDRESS format.
|
||||
|
||||
**/
|
||||
UINTN
|
||||
PciCfgAddressConvert (
|
||||
EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS *Address
|
||||
)
|
||||
{
|
||||
if (Address->ExtendedRegister == 0) {
|
||||
return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->Register);
|
||||
}
|
||||
|
||||
return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Reads from a given location in the PCI configuration space.
|
||||
|
||||
|
@@ -117,6 +117,7 @@ SCREEN_OPERATION_T0_CONTROL_FLAG gScreenOperationToControlFlag[] = {
|
||||
};
|
||||
|
||||
BOOLEAN mInputError;
|
||||
BOOLEAN GetLineByWidthFinished = FALSE;
|
||||
|
||||
|
||||
/**
|
||||
@@ -1075,9 +1076,6 @@ GetWidth (
|
||||
return Width;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN GetLineByWidthFinished = FALSE;
|
||||
|
||||
/**
|
||||
Will copy LineWidth amount of a string in the OutputString buffer and return the
|
||||
number of CHAR16 characters that were copied into the OutputString buffer.
|
||||
|
@@ -21,6 +21,25 @@ VARIABLE_MODULE_GLOBAL *mVariableModuleGlobal;
|
||||
EFI_EVENT mVirtualAddressChangeEvent = NULL;
|
||||
EFI_HANDLE mHandle = NULL;
|
||||
|
||||
//
|
||||
// The current Hii implementation accesses this variable a larg # of times on every boot.
|
||||
// Other common variables are only accessed a single time. This is why this cache algorithm
|
||||
// only targets a single variable. Probably to get an performance improvement out of
|
||||
// a Cache you would need a cache that improves the search performance for a variable.
|
||||
//
|
||||
VARIABLE_CACHE_ENTRY mVariableCache[] = {
|
||||
{
|
||||
&gEfiGlobalVariableGuid,
|
||||
L"Lang",
|
||||
0x00000000,
|
||||
0x00,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED VARIABLE_INFO_ENTRY *gVariableInfo = NULL;
|
||||
|
||||
|
||||
|
||||
//
|
||||
// This is a temperary function which will be removed
|
||||
@@ -53,9 +72,6 @@ ReleaseLockOnlyAtBootTime (
|
||||
}
|
||||
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED VARIABLE_INFO_ENTRY *gVariableInfo = NULL;
|
||||
|
||||
|
||||
/**
|
||||
Routine used to track statistical information about variable usage.
|
||||
The data is stored in the EFI system table so it can be accessed later.
|
||||
@@ -774,23 +790,6 @@ Returns:
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// The current Hii implementation accesses this variable a larg # of times on every boot.
|
||||
// Other common variables are only accessed a single time. This is why this cache algorithm
|
||||
// only targets a single variable. Probably to get an performance improvement out of
|
||||
// a Cache you would need a cache that improves the search performance for a variable.
|
||||
//
|
||||
VARIABLE_CACHE_ENTRY mVariableCache[] = {
|
||||
{
|
||||
&gEfiGlobalVariableGuid,
|
||||
L"Lang",
|
||||
0x00000000,
|
||||
0x00,
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Update the Cache with Variable information. These are the same
|
||||
arguments as the EFI Variable services.
|
||||
|
Reference in New Issue
Block a user