summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal
diff options
context:
space:
mode:
authorjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-03 08:52:39 +0000
committerjji4 <jji4@6f19259b-4bc3-4df7-8a09-765794883524>2008-12-03 08:52:39 +0000
commitaa79b0b3799e95bc21e0df32a135cc5a4d749e4b (patch)
treed1ee81cebff21475e8f052aa061716bfedd1f807 /MdeModulePkg/Universal
parent4058e906c15600ee6229335c316cb85fcbd687b3 (diff)
downloadedk2-platforms-aa79b0b3799e95bc21e0df32a135cc5a4d749e4b.tar.xz
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
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r--MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c153
-rw-r--r--MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c28
-rw-r--r--MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c29
-rw-r--r--MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c44
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Ui.c4
-rw-r--r--MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c39
6 files changed, 149 insertions, 148 deletions
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
index ada795b99c..f925daa975 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
@@ -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.
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index 8c6b1bd5f6..a8e4a1a0b2 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -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
//
@@ -119,6 +105,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.
@param This Protocol instance pointer.
diff --git a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c
index b4b078cb57..7b91ae4b63 100644
--- a/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c
+++ b/MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.c
@@ -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.
diff --git a/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c b/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c
index 722c800378..0d899c9260 100644
--- a/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c
+++ b/MdeModulePkg/Universal/PcatSingleSegmentPciCfg2Pei/PciCfg2.c
@@ -24,27 +24,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.
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
@@ -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.
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
index fad0f7f489..cc9652ee17 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Ui.c
@@ -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.
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index bc4e6eb38d..694de8da59 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -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.