Update RuntimeLib.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1482 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
yshang1 2006-09-06 09:18:14 +00:00
parent b4648de2bc
commit e8a3bee036
5 changed files with 55 additions and 68 deletions

View File

@ -13,10 +13,6 @@ Module Name:
RuntimeLib.c RuntimeLib.c
Abstract:
Light weight lib to support Tiano drivers.
--*/ --*/
#include <RuntimeLibInternal.h> #include <RuntimeLibInternal.h>
@ -24,13 +20,15 @@ Abstract:
// //
// Driver Lib Module Globals // Driver Lib Module Globals
// //
STATIC EFI_EVENT mRuntimeNotifyEvent;
STATIC EFI_EVENT mEfiVirtualNotifyEvent;
STATIC BOOLEAN mEfiGoneVirtual = FALSE;
STATIC BOOLEAN mEfiAtRuntime = FALSE;
EFI_RUNTIME_SERVICES *mRT = NULL; STATIC EFI_EVENT mRuntimeNotifyEvent;
STATIC EFI_EVENT mEfiVirtualNotifyEvent;
STATIC BOOLEAN mEfiGoneVirtual = FALSE;
STATIC BOOLEAN mEfiAtRuntime = FALSE;
EFI_RUNTIME_SERVICES *mRT;
STATIC
VOID VOID
EFIAPI EFIAPI
RuntimeDriverExitBootServices ( RuntimeDriverExitBootServices (
@ -65,6 +63,11 @@ Returns:
ChildNotifyEventHandler (Event, NULL); ChildNotifyEventHandler (Event, NULL);
} }
//
// Clear out BootService globals
//
gBS = NULL;
mEfiAtRuntime = TRUE; mEfiAtRuntime = TRUE;
} }
@ -108,13 +111,8 @@ Returns:
// //
// Update global for Runtime Services Table and IO // Update global for Runtime Services Table and IO
// //
EfiConvertInternalPointer ((VOID **) &mRT); EfiConvertPointer (0, (VOID **) &mRT);
//
// Clear out BootService globals
//
gBS = NULL;
gST = NULL;
mEfiGoneVirtual = TRUE; mEfiGoneVirtual = TRUE;
} }
@ -219,6 +217,7 @@ Returns:
} }
BOOLEAN BOOLEAN
EFIAPI
EfiAtRuntime ( EfiAtRuntime (
VOID VOID
) )
@ -239,6 +238,7 @@ Returns:
} }
BOOLEAN BOOLEAN
EFIAPI
EfiGoneVirtual ( EfiGoneVirtual (
VOID VOID
) )

View File

@ -13,15 +13,12 @@ Module Name:
RuntimeService.c RuntimeService.c
Abstract:
Light weight lib to support Tiano drivers.
--*/ --*/
#include <RuntimeLibInternal.h> #include <RuntimeLibInternal.h>
VOID VOID
EFIAPI
EfiResetSystem ( EfiResetSystem (
IN EFI_RESET_TYPE ResetType, IN EFI_RESET_TYPE ResetType,
IN EFI_STATUS ResetStatus, IN EFI_STATUS ResetStatus,
@ -56,6 +53,7 @@ Returns:
// runtime service in the EFI system table. // runtime service in the EFI system table.
// //
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetTime ( EfiGetTime (
OUT EFI_TIME *Time, OUT EFI_TIME *Time,
OUT EFI_TIME_CAPABILITIES *Capabilities OUT EFI_TIME_CAPABILITIES *Capabilities
@ -83,6 +81,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiSetTime ( EfiSetTime (
IN EFI_TIME *Time IN EFI_TIME *Time
) )
@ -106,6 +105,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetWakeupTime ( EfiGetWakeupTime (
OUT BOOLEAN *Enabled, OUT BOOLEAN *Enabled,
OUT BOOLEAN *Pending, OUT BOOLEAN *Pending,
@ -133,6 +133,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiSetWakeupTime ( EfiSetWakeupTime (
IN BOOLEAN Enable, IN BOOLEAN Enable,
IN EFI_TIME *Time IN EFI_TIME *Time
@ -162,6 +163,7 @@ Returns:
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetVariable ( EfiGetVariable (
IN CHAR16 *VariableName, IN CHAR16 *VariableName,
IN EFI_GUID * VendorGuid, IN EFI_GUID * VendorGuid,
@ -196,6 +198,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetNextVariableName ( EfiGetNextVariableName (
IN OUT UINTN *VariableNameSize, IN OUT UINTN *VariableNameSize,
IN OUT CHAR16 *VariableName, IN OUT CHAR16 *VariableName,
@ -228,6 +231,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiSetVariable ( EfiSetVariable (
IN CHAR16 *VariableName, IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
@ -260,6 +264,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetNextHighMonotonicCount ( EfiGetNextHighMonotonicCount (
OUT UINT32 *HighCount OUT UINT32 *HighCount
) )
@ -283,6 +288,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiConvertPointer ( EfiConvertPointer (
IN UINTN DebugDisposition, IN UINTN DebugDisposition,
IN OUT VOID *Address IN OUT VOID *Address
@ -309,30 +315,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EfiConvertInternalPointer ( EFIAPI
IN OUT VOID *Address
)
/*++
Routine Description:
Call EfiConvertPointer() to convert internal pointer.
Arguments:
Address - A pointer to a pointer that is to be fixed to be the value needed
for the new virtual address mappings being applied.
Returns:
Status code
--*/
{
return EfiConvertPointer (0x0, Address);
}
EFI_STATUS
EfiConvertList ( EfiConvertList (
IN UINTN DebugDisposition, IN UINTN DebugDisposition,
IN OUT LIST_ENTRY *ListHead IN OUT LIST_ENTRY *ListHead
@ -421,6 +404,7 @@ EfiSetVirtualAddressMap (
EFI_STATUS EFI_STATUS
EFIAPI
EfiUpdateCapsule ( EfiUpdateCapsule (
IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
IN UINTN CapsuleCount, IN UINTN CapsuleCount,
@ -439,6 +423,7 @@ EfiUpdateCapsule (
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiQueryCapsuleCapabilities ( EfiQueryCapsuleCapabilities (
IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
IN UINTN CapsuleCount, IN UINTN CapsuleCount,
@ -460,6 +445,7 @@ EfiQueryCapsuleCapabilities (
EFI_STATUS EFI_STATUS
EFIAPI
EfiQueryVariableInfo ( EfiQueryVariableInfo (
IN UINT32 Attributes, IN UINT32 Attributes,
OUT UINT64 *MaximumVariableStorageSize, OUT UINT64 *MaximumVariableStorageSize,

View File

@ -13,10 +13,6 @@ Module Name:
RuntimeLib.c RuntimeLib.c
Abstract:
Light weight lib to support Tiano drivers.
--*/ --*/
#include <SalApi.h> #include <SalApi.h>
@ -26,13 +22,12 @@ Abstract:
// Driver Lib Module Globals // Driver Lib Module Globals
// //
STATIC EFI_EVENT mRuntimeNotifyEvent; STATIC EFI_EVENT mRuntimeNotifyEvent;
STATIC EFI_EVENT mEfiVirtualNotifyEvent; STATIC EFI_EVENT mEfiVirtualNotifyEvent;
STATIC EFI_PLABEL mPlabel;
STATIC EFI_PLABEL mPlabel;
STATIC EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *mEsalBootService; STATIC EXTENDED_SAL_BOOT_SERVICE_PROTOCOL *mEsalBootService;
EFI_RUNTIME_SERVICES *mRT = NULL; EFI_RUNTIME_SERVICES *mRT;
STATIC STATIC
VOID VOID
@ -66,6 +61,11 @@ Returns:
ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index]; ChildNotifyEventHandler = _gDriverExitBootServicesEvent[Index];
ChildNotifyEventHandler (Event, NULL); ChildNotifyEventHandler (Event, NULL);
} }
//
// Clear out BootService globals
//
gBS = NULL;
} }
STATIC STATIC
@ -107,13 +107,6 @@ Returns:
mRT->ConvertPointer (EFI_IPF_GP_POINTER, (VOID **) &mPlabel.GP); mRT->ConvertPointer (EFI_IPF_GP_POINTER, (VOID **) &mPlabel.GP);
SetEsalVirtualEntryPoint (mPlabel.EntryPoint, mPlabel.GP); SetEsalVirtualEntryPoint (mPlabel.EntryPoint, mPlabel.GP);
//
// Clear out BootService globals
//
gBS = NULL;
gST = NULL;
mRT = NULL;
} }
EFI_STATUS EFI_STATUS
@ -236,6 +229,7 @@ Returns:
} }
BOOLEAN BOOLEAN
EFIAPI
EfiAtRuntime ( EfiAtRuntime (
VOID VOID
) )
@ -261,6 +255,7 @@ Returns:
} }
BOOLEAN BOOLEAN
EFIAPI
EfiGoneVirtual ( EfiGoneVirtual (
VOID VOID
) )
@ -284,3 +279,4 @@ Returns:
return (BOOLEAN) (ReturnReg.r9 == 1); return (BOOLEAN) (ReturnReg.r9 == 1);
} }

View File

@ -13,15 +13,12 @@ Module Name:
RuntimeService.c RuntimeService.c
Abstract:
Light weight lib to support Tiano drivers.
--*/ --*/
#include <RuntimeLibInternal.h> #include <RuntimeLibInternal.h>
VOID VOID
EFIAPI
EfiResetSystem ( EfiResetSystem (
IN EFI_RESET_TYPE ResetType, IN EFI_RESET_TYPE ResetType,
IN EFI_STATUS ResetStatus, IN EFI_STATUS ResetStatus,
@ -69,6 +66,7 @@ Returns:
// runtime service in the EFI system table. // runtime service in the EFI system table.
// //
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetTime ( EfiGetTime (
OUT EFI_TIME *Time, OUT EFI_TIME *Time,
OUT EFI_TIME_CAPABILITIES *Capabilities OUT EFI_TIME_CAPABILITIES *Capabilities
@ -100,6 +98,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiSetTime ( EfiSetTime (
IN EFI_TIME *Time IN EFI_TIME *Time
) )
@ -128,6 +127,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetWakeupTime ( EfiGetWakeupTime (
OUT BOOLEAN *Enabled, OUT BOOLEAN *Enabled,
OUT BOOLEAN *Pending, OUT BOOLEAN *Pending,
@ -160,6 +160,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiSetWakeupTime ( EfiSetWakeupTime (
IN BOOLEAN Enable, IN BOOLEAN Enable,
IN EFI_TIME *Time IN EFI_TIME *Time
@ -191,6 +192,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetVariable ( EfiGetVariable (
IN CHAR16 *VariableName, IN CHAR16 *VariableName,
IN EFI_GUID * VendorGuid, IN EFI_GUID * VendorGuid,
@ -239,6 +241,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetNextVariableName ( EfiGetNextVariableName (
IN OUT UINTN *VariableNameSize, IN OUT UINTN *VariableNameSize,
IN OUT CHAR16 *VariableName, IN OUT CHAR16 *VariableName,
@ -285,6 +288,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiSetVariable ( EfiSetVariable (
IN CHAR16 *VariableName, IN CHAR16 *VariableName,
IN EFI_GUID *VendorGuid, IN EFI_GUID *VendorGuid,
@ -331,6 +335,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiGetNextHighMonotonicCount ( EfiGetNextHighMonotonicCount (
OUT UINT32 *HighCount OUT UINT32 *HighCount
) )
@ -359,6 +364,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiConvertPointer ( EfiConvertPointer (
IN UINTN DebugDisposition, IN UINTN DebugDisposition,
IN OUT VOID *Address IN OUT VOID *Address
@ -385,6 +391,7 @@ Returns:
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiConvertList ( EfiConvertList (
IN UINTN DebugDisposition, IN UINTN DebugDisposition,
IN OUT LIST_ENTRY *ListHead IN OUT LIST_ENTRY *ListHead
@ -483,6 +490,7 @@ EfiSetVirtualAddressMap (
EFI_STATUS EFI_STATUS
EFIAPI
EfiUpdateCapsule ( EfiUpdateCapsule (
IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
IN UINTN CapsuleCount, IN UINTN CapsuleCount,
@ -493,6 +501,7 @@ EfiUpdateCapsule (
} }
EFI_STATUS EFI_STATUS
EFIAPI
EfiQueryCapsuleCapabilities ( EfiQueryCapsuleCapabilities (
IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray, IN UEFI_CAPSULE_HEADER **CapsuleHeaderArray,
IN UINTN CapsuleCount, IN UINTN CapsuleCount,
@ -505,6 +514,7 @@ EfiQueryCapsuleCapabilities (
EFI_STATUS EFI_STATUS
EFIAPI
EfiQueryVariableInfo ( EfiQueryVariableInfo (
IN UINT32 Attributes, IN UINT32 Attributes,
OUT UINT64 *MaximumVariableStorageSize, OUT UINT64 *MaximumVariableStorageSize,

View File

@ -20,11 +20,6 @@ Abstract:
#ifndef __RUNTIMELIBINTERNAL_H__ #ifndef __RUNTIMELIBINTERNAL_H__
#define __RUNTIMELIBINTERNAL_H__ #define __RUNTIMELIBINTERNAL_H__
EFI_STATUS
EfiConvertInternalPointer (
IN OUT VOID *Address
);
extern EFI_RUNTIME_SERVICES *mRT; extern EFI_RUNTIME_SERVICES *mRT;
#endif //__RUNTIMELIBINTERNAL_H__ #endif //__RUNTIMELIBINTERNAL_H__