2008-04-10 10:49:28 +02:00
|
|
|
/** @file
|
|
|
|
Runtime Architectural Protocol as defined in the DXE CIS.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-28 04:43:46 +02:00
|
|
|
This code is used to produce the EFI runtime architectural protocol.
|
|
|
|
|
2008-04-10 10:49:28 +02:00
|
|
|
Copyright (c) 2006, Intel Corporation. <BR>
|
2007-10-17 08:55:15 +02:00
|
|
|
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
|
2008-04-10 10:49:28 +02:00
|
|
|
|
2007-10-17 08:55:15 +02:00
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-04-10 10:49:28 +02:00
|
|
|
**/
|
2007-07-19 10:36:30 +02:00
|
|
|
|
|
|
|
#ifndef _RUNTIME_H_
|
|
|
|
#define _RUNTIME_H_
|
|
|
|
|
2009-07-12 01:11:21 +02:00
|
|
|
#include <PiDxe.h>
|
2007-07-19 10:36:30 +02:00
|
|
|
#include <Protocol/LoadedImage.h>
|
|
|
|
#include <Protocol/Runtime.h>
|
|
|
|
#include <Library/BaseLib.h>
|
|
|
|
#include <Library/UefiDriverEntryPoint.h>
|
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/ReportStatusCodeLib.h>
|
|
|
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
|
|
|
#include <Library/UefiBootServicesTableLib.h>
|
2008-12-07 23:49:44 +01:00
|
|
|
#include <Library/UefiLib.h>
|
2007-07-19 10:36:30 +02:00
|
|
|
#include <Library/CacheMaintenanceLib.h>
|
|
|
|
#include <Library/PeCoffLib.h>
|
|
|
|
#include <Library/PcdLib.h>
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Function Prototypes
|
|
|
|
//
|
2008-07-14 07:43:37 +02:00
|
|
|
/**
|
2008-07-28 04:43:46 +02:00
|
|
|
Calculate CRC32 for target data.
|
2008-07-14 07:43:37 +02:00
|
|
|
|
|
|
|
@param Data 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.
|
|
|
|
|
|
|
|
**/
|
2007-07-19 10:36:30 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
RuntimeDriverCalculateCrc32 (
|
|
|
|
IN VOID *Data,
|
|
|
|
IN UINTN DataSize,
|
|
|
|
OUT UINT32 *CrcOut
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
/**
|
|
|
|
Determines the new virtual address that is to be used on subsequent memory accesses.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
@param DebugDisposition Supplies type information for the pointer being converted.
|
|
|
|
@param ConvertAddress A pointer to a pointer that is to be fixed to be the value needed
|
|
|
|
for the new virtual address mappings being applied.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
@retval EFI_SUCCESS The pointer pointed to by Address was modified.
|
|
|
|
@retval EFI_NOT_FOUND The pointer pointed to by Address was not found to be part
|
|
|
|
of the current memory map. This is normally fatal.
|
|
|
|
@retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
**/
|
2007-07-19 10:36:30 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
RuntimeDriverConvertPointer (
|
|
|
|
IN UINTN DebugDisposition,
|
|
|
|
IN OUT VOID **ConvertAddress
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
/**
|
|
|
|
Changes the runtime addressing mode of EFI firmware from physical to virtual.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-28 04:43:46 +02:00
|
|
|
@param MemoryMapSize The size in bytes of VirtualMap.
|
|
|
|
@param DescriptorSize The size in bytes of an entry in the VirtualMap.
|
|
|
|
@param DescriptorVersion The version of the structure entries in VirtualMap.
|
|
|
|
@param VirtualMap An array of memory descriptors which contain new virtual
|
2008-07-14 07:43:37 +02:00
|
|
|
address mapping information for all runtime ranges.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
@retval EFI_SUCCESS The virtual address map has been applied.
|
|
|
|
@retval EFI_UNSUPPORTED EFI firmware is not at runtime, or the EFI firmware is already in
|
|
|
|
virtual address mapped mode.
|
|
|
|
@retval EFI_INVALID_PARAMETER DescriptorSize or DescriptorVersion is invalid.
|
|
|
|
@retval EFI_NO_MAPPING A virtual address was not supplied for a range in the memory
|
|
|
|
map that requires a mapping.
|
|
|
|
@retval EFI_NOT_FOUND A virtual address was supplied for an address that is not found
|
|
|
|
in the memory map.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
**/
|
2007-07-19 10:36:30 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
RuntimeDriverSetVirtualAddressMap (
|
|
|
|
IN UINTN MemoryMapSize,
|
|
|
|
IN UINTN DescriptorSize,
|
|
|
|
IN UINT32 DescriptorVersion,
|
|
|
|
IN EFI_MEMORY_DESCRIPTOR *VirtualMap
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
/**
|
|
|
|
Initialize CRC32 table.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
**/
|
2007-07-19 10:36:30 +02:00
|
|
|
VOID
|
|
|
|
RuntimeDriverInitializeCrc32Table (
|
|
|
|
VOID
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
/**
|
|
|
|
Install Runtime AP. This code includes the EfiRuntimeLib, but it only
|
|
|
|
functions at RT in physical mode.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-28 04:43:46 +02:00
|
|
|
@param ImageHandle Image handle of this driver.
|
|
|
|
@param SystemTable Pointer to the EFI System Table.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-28 04:43:46 +02:00
|
|
|
@retval EFI_SUCEESS Runtime Driver Architectural Protocol Installed
|
|
|
|
@return Other value if gBS->InstallMultipleProtocolInterfaces fails. Check
|
2008-07-14 07:43:37 +02:00
|
|
|
gBS->InstallMultipleProtocolInterfaces for details.
|
2007-07-19 10:36:30 +02:00
|
|
|
|
2008-07-14 07:43:37 +02:00
|
|
|
**/
|
2007-07-19 10:36:30 +02:00
|
|
|
EFI_STATUS
|
|
|
|
EFIAPI
|
|
|
|
RuntimeDriverInitialize (
|
|
|
|
IN EFI_HANDLE ImageHandle,
|
|
|
|
IN EFI_SYSTEM_TABLE *SystemTable
|
2008-09-04 11:37:28 +02:00
|
|
|
);
|
2007-07-19 10:36:30 +02:00
|
|
|
|
|
|
|
#endif
|