diff options
author | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
---|---|---|
committer | raywu <raywu0301@gmail.com> | 2018-06-15 00:00:50 +0800 |
commit | b7c51c9cf4864df6aabb99a1ae843becd577237c (patch) | |
tree | eebe9b0d0ca03062955223097e57da84dd618b9a /EDK/Foundation/Core/Dxe/ArchProtocol/Runtime | |
download | zprj-master.tar.xz |
Diffstat (limited to 'EDK/Foundation/Core/Dxe/ArchProtocol/Runtime')
-rw-r--r-- | EDK/Foundation/Core/Dxe/ArchProtocol/Runtime/Runtime.c | 29 | ||||
-rw-r--r-- | EDK/Foundation/Core/Dxe/ArchProtocol/Runtime/Runtime.h | 114 |
2 files changed, 143 insertions, 0 deletions
diff --git a/EDK/Foundation/Core/Dxe/ArchProtocol/Runtime/Runtime.c b/EDK/Foundation/Core/Dxe/ArchProtocol/Runtime/Runtime.c new file mode 100644 index 0000000..4f58708 --- /dev/null +++ b/EDK/Foundation/Core/Dxe/ArchProtocol/Runtime/Runtime.c @@ -0,0 +1,29 @@ +/*++ + +Copyright (c) 2004, 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: + + Runtime.c + +Abstract: + + Runtime Architectural Protocol as defined in Tiano + + This code is used to produce the EFI 1.0 runtime virtual switch over + +--*/ + +#include "Tiano.h" +#include EFI_ARCH_PROTOCOL_DEFINITION (Runtime) + +EFI_GUID gEfiRuntimeArchProtocolGuid = EFI_RUNTIME_ARCH_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiRuntimeArchProtocolGuid, "Runtime", "Runtime Arch Protocol"); diff --git a/EDK/Foundation/Core/Dxe/ArchProtocol/Runtime/Runtime.h b/EDK/Foundation/Core/Dxe/ArchProtocol/Runtime/Runtime.h new file mode 100644 index 0000000..28f0b41 --- /dev/null +++ b/EDK/Foundation/Core/Dxe/ArchProtocol/Runtime/Runtime.h @@ -0,0 +1,114 @@ +/*++ + +Copyright (c) 2004 - 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: + + Runtime.h + +Abstract: + + Runtime Architectural Protocol as defined in DXE CIS. + + + This code is used to produce the EFI runtime services that are callable + only in physical mode. + + This driver must add SetVirtualAddressMap () and ConvertPointer () to + the EFI system table. This driver is not responcible for CRCing the + EFI system table. + + This driver will add EFI_RUNTIME_ARCH_PROTOCOL_GUID protocol with a + pointer to the Runtime Arch Protocol instance structure. The protocol + member functions are used by the DXE core to export information needed + by this driver to produce the runtime transition of runtime drivers from + physical mode calling to virtual mode calling. + +--*/ + +#ifndef _ARCH_PROTOCOL_RUNTIME_H_ +#define _ARCH_PROTOCOL_RUNTIME_H_ + +#include "LinkedList.h" + +// +// Global ID for the Runtime Architectural Protocol +// +#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \ + { 0xb7dfb4e1, 0x52f, 0x449f, 0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33 } + +EFI_FORWARD_DECLARATION (EFI_RUNTIME_ARCH_PROTOCOL); + +typedef struct _EFI_RUNTIME_IMAGE_ENTRY { + VOID *ImageBase; + UINT64 ImageSize; + VOID *RelocationData; + EFI_HANDLE Handle; + EFI_LIST_ENTRY Link; +} EFI_RUNTIME_IMAGE_ENTRY; + +typedef struct _EFI_RUNTIME_EVENT_ENTRY { + UINT32 Type; + EFI_TPL NotifyTpl; + EFI_EVENT_NOTIFY NotifyFunction; + VOID *NotifyContext; + EFI_EVENT *Event; + EFI_LIST_ENTRY Link; +} EFI_RUNTIME_EVENT_ENTRY; + +// +// Interface stucture for the Runtime Architectural Protocol +// +typedef struct _EFI_RUNTIME_ARCH_PROTOCOL { + EFI_LIST_ENTRY ImageHead; + EFI_LIST_ENTRY EventHead; + UINTN MemoryDescriptorSize; + UINT32 MemoryDesciptorVersion; + UINTN MemoryMapSize; + EFI_MEMORY_DESCRIPTOR *MemoryMapPhysical; + EFI_MEMORY_DESCRIPTOR *MemoryMapVirtual; + BOOLEAN VirtualMode; + BOOLEAN AtRuntime; +} EFI_RUNTIME_ARCH_PROTOCOL; +/*++ + +Protocol Description: + + Allows the runtime functionality of the DXE Foundation to be contained in a + separate driver. It also provides hooks for the DXE Foundation to export + information that is needed at runtime. As such, this protocol allows the DXE + Foundation to manage runtime drivers and events. This protocol also implies + that the runtime services required to transition to virtual mode, + SetVirtualAddressMap() and ConvertPointer(), have been registered into the + EFI Runtime Table in the EFI System Partition. This protocol must be produced + by a runtime DXE driver and may only be consumed by the DXE Foundation. + +Parameters: + + ImageHead - A list of type EFI_RUNTIME_IMAGE_ENTRY. + EventHead - A list of type EFI_RUNTIME_EVENT_ENTRY. + MemoryDescriptorSize - Size of a memory descriptor that is return by + GetMemoryMap(). + MemoryDescriptorVersion - Version of a memory descriptor that is return by + GetMemoryMap(). + MemoryMapSize - Size of the memory map in bytes contained in + MemoryMapPhysical and MemoryMapVirtual. + MemoryMapPhysical - Pointer to a runtime buffer that contains a copy of the + memory map returned via GetMemoryMap(). + MemoryMapVirtual - Pointer to MemoryMapPhysical that is updated to virtual mode + after SetVirtualAddressMap(). + VirtualMode - Boolean that is TRUE if SetVirtualAddressMap() has been called. + AtRuntime - Boolean that is TRUE if ExitBootServices () has been called. + +--*/ + +extern EFI_GUID gEfiRuntimeArchProtocolGuid; + +#endif
\ No newline at end of file |