summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.h
blob: 3803a9daddc939a11d01614b01e1b6500c531100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*++

Copyright (c) 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 the DXE CIS

  This code is used to produce the EFI runtime virtual switch over

--*/

#ifndef _RUNTIME_H_
#define _RUNTIME_H_

//
// Data structures
//
typedef struct {
  LIST_ENTRY            Link;
  BOOLEAN               Valid;
  EFI_PHYSICAL_ADDRESS  ImageBase;
  UINTN                 ImageSize;  // In no. of pages
  VOID                  *RelocationData;
} RUNTIME_IMAGE_RELOCATION_DATA;

typedef struct {
  LIST_ENTRY          Link;
  IN UINT32           Type;
  IN EFI_TPL          NotifyTpl;
  IN EFI_EVENT_NOTIFY NotifyFunction;
  IN VOID             *NotifyContext;
  IN EFI_EVENT        Event;
} RUNTIME_NOTIFY_EVENT_DATA;

//
// Function Prototypes
//
VOID
RelocatePeImageForRuntime (
  RUNTIME_IMAGE_RELOCATION_DATA  *Image
  )
;

EFI_STATUS
PeHotRelocateImageEx (
  IN UINT16      *Reloc,
  IN OUT CHAR8   *Fixup,
  IN OUT CHAR8   **FixupData,
  IN UINT64      Adjust
  )
;

EFI_STATUS
EFIAPI
RuntimeDriverCalculateCrc32 (
  IN  VOID    *Data,
  IN  UINTN   DataSize,
  OUT UINT32  *CrcOut
  )
;

EFI_STATUS
EFIAPI
RuntimeDriverRegisterImage (
  IN  EFI_RUNTIME_ARCH_PROTOCOL         *This,
  IN  EFI_PHYSICAL_ADDRESS              ImageBase,
  IN  UINTN                             ImageSize,
  IN  VOID                              *RelocationData
  )
;

EFI_STATUS
EFIAPI
RuntimeDriverRegisterEvent (
  IN EFI_RUNTIME_ARCH_PROTOCOL          *This,
  IN UINT32                             Type,
  IN EFI_TPL                            NotifyTpl,
  IN EFI_EVENT_NOTIFY                   NotifyFunction,
  IN VOID                               *NotifyContext,
  IN EFI_EVENT                          *Event
  )
;

EFI_STATUS
EFIAPI
RuntimeDriverConvertPointer (
  IN     UINTN  DebugDisposition,
  IN OUT VOID   **ConvertAddress
  )
;

VOID
RuntimeDriverInitializeCrc32Table (
  VOID
  )
;

EFI_STATUS
EFIAPI
RuntimeDriverInitialize (
  IN EFI_HANDLE                            ImageHandle,
  IN EFI_SYSTEM_TABLE                      *SystemTable
  )
;


//
// Cache Flush Routine.
//
EFI_STATUS
FlushCpuCache (
  IN EFI_PHYSICAL_ADDRESS          Start,
  IN UINT64                        Length
  )
;

#endif