Home | History | Annotate | Download | only in Runtime
      1 /*++
      2 
      3 Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>
      4 This program and the accompanying materials
      5 are licensed and made available under the terms and conditions of the BSD License
      6 which accompanies this distribution.  The full text of the license may be found at
      7 http://opensource.org/licenses/bsd-license.php
      8 
      9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     11 
     12 Module Name:
     13 
     14   Runtime.h
     15 
     16 Abstract:
     17 
     18   Runtime Architectural Protocol as defined in DXE CIS.
     19 
     20 
     21   This code is used to produce the EFI runtime services that are callable
     22   only in physical mode.
     23 
     24   This driver must add SetVirtualAddressMap () and ConvertPointer () to
     25   the EFI system table. This driver is not responcible for CRCing the
     26   EFI system table.
     27 
     28   This driver will add EFI_RUNTIME_ARCH_PROTOCOL_GUID protocol with a
     29   pointer to the Runtime Arch Protocol instance structure. The protocol
     30   member functions are used by the DXE core to export information needed
     31   by this driver to produce the runtime transition of runtime drivers from
     32   physical mode calling to virtual mode calling.
     33 
     34 --*/
     35 
     36 #ifndef _ARCH_PROTOCOL_RUNTIME_H_
     37 #define _ARCH_PROTOCOL_RUNTIME_H_
     38 
     39 #include "LinkedList.h"
     40 
     41 //
     42 // Global ID for the Runtime Architectural Protocol
     43 //
     44 #define EFI_RUNTIME_ARCH_PROTOCOL_GUID \
     45   { 0xb7dfb4e1, 0x52f, 0x449f, {0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33} }
     46 
     47 EFI_FORWARD_DECLARATION (EFI_RUNTIME_ARCH_PROTOCOL);
     48 
     49 struct _EFI_RUNTIME_IMAGE_ENTRY {
     50   VOID                    *ImageBase;
     51   UINT64                  ImageSize;
     52   VOID                    *RelocationData;
     53   EFI_HANDLE              Handle;
     54   EFI_LIST_ENTRY          Link;
     55 };
     56 
     57 struct _EFI_RUNTIME_EVENT_ENTRY {
     58   UINT32                  Type;
     59   EFI_TPL                 NotifyTpl;
     60   EFI_EVENT_NOTIFY        NotifyFunction;
     61   VOID                    *NotifyContext;
     62   EFI_EVENT               *Event;
     63   EFI_LIST_ENTRY          Link;
     64 };
     65 
     66 //
     67 // Interface stucture for the Runtime Architectural Protocol
     68 //
     69 struct _EFI_RUNTIME_ARCH_PROTOCOL {
     70   EFI_LIST_ENTRY          ImageHead;
     71   EFI_LIST_ENTRY          EventHead;
     72   UINTN                   MemoryDescriptorSize;
     73   UINT32                  MemoryDesciptorVersion;
     74   UINTN                   MemoryMapSize;
     75   EFI_MEMORY_DESCRIPTOR   *MemoryMapPhysical;
     76   EFI_MEMORY_DESCRIPTOR   *MemoryMapVirtual;
     77   BOOLEAN                 VirtualMode;
     78   BOOLEAN                 AtRuntime;
     79 };
     80 /*++
     81 
     82 Protocol Description:
     83 
     84   Allows the runtime functionality of the DXE Foundation to be contained in a
     85   separate driver. It also provides hooks for the DXE Foundation to export
     86   information that is needed at runtime. As such, this protocol allows the DXE
     87   Foundation to manage runtime drivers and events. This protocol also implies
     88   that the runtime services required to transition to virtual mode,
     89   SetVirtualAddressMap() and ConvertPointer(), have been registered into the
     90   EFI Runtime Table in the EFI System Partition.  This protocol must be produced
     91   by a runtime DXE driver and may only be consumed by the DXE Foundation.
     92 
     93 Parameters:
     94 
     95   ImageHead               - A list of type EFI_RUNTIME_IMAGE_ENTRY.
     96   EventHead               - A list of type EFI_RUNTIME_EVENT_ENTRY.
     97   MemoryDescriptorSize    - Size of a memory descriptor that is return by
     98                             GetMemoryMap().
     99   MemoryDescriptorVersion - Version of a memory descriptor that is return by
    100                             GetMemoryMap().
    101   MemoryMapSize           - Size of the memory map in bytes contained in
    102                             MemoryMapPhysical and MemoryMapVirtual.
    103   MemoryMapPhysical       - Pointer to a runtime buffer that contains a copy of the
    104                             memory map returned via GetMemoryMap().
    105   MemoryMapVirtual        - Pointer to MemoryMapPhysical that is updated to virtual mode
    106                             after SetVirtualAddressMap().
    107   VirtualMode             - Boolean that is TRUE if SetVirtualAddressMap() has been called.
    108   AtRuntime               - Boolean that is TRUE if ExitBootServices () has been called.
    109 
    110 --*/
    111 
    112 extern EFI_GUID gEfiRuntimeArchProtocolGuid;
    113 
    114 #endif
    115