]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/DebugSupportDxe/Ipf/PlDebugSupport.h
1. Merger generic functions into one file.
[mirror_edk2.git] / MdeModulePkg / Universal / DebugSupportDxe / Ipf / PlDebugSupport.h
1 /** @file
2 IPF specific debugsupport types, macros, and definitions.
3
4 Copyright (c) 2004 - 2006 Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _PLDEBUG_SUPPORT_H_
16 #define _PLDEBUG_SUPPORT_H_
17
18
19 #include <Uefi.h>
20
21 #include <Protocol/DebugSupport.h>
22 #include <Protocol/LoadedImage.h>
23
24 #include <Library/DebugLib.h>
25 #include <Library/UefiDriverEntryPoint.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/MemoryAllocationLib.h>
28 #include <Library/UefiBootServicesTableLib.h>
29
30 #define DISABLE_INTERRUPTS 0UL
31
32 //
33 // The remaining definitions comprise the protocol members.
34 //
35 #define EFI_ISA IsaIpf
36
37 /**
38 IPF specific DebugSupport driver initialization.
39
40 Must be public because it's referenced from DebugSupport.c
41
42 @retval EFI_SUCCESS Always.
43
44 **/
45 EFI_STATUS
46 PlInitializeDebugSupportDriver (
47 VOID
48 );
49
50 /**
51 Unload handler that is called during UnloadImage() - deallocates pool memory
52 used by the driver. Must be public because it's referenced from DebugSuport.c
53
54 @param ImageHandle The firmware allocated handle for the EFI image.
55
56 @retval EFI_SUCCESS Always.
57
58 **/
59 EFI_STATUS
60 EFIAPI
61 PlUnloadDebugSupportDriver (
62 IN EFI_HANDLE ImageHandle
63 );
64
65 /**
66 C callable function to obtain the current value of IVA.
67
68 @return Current value of IVA.
69
70 **/
71 VOID *
72 GetIva (
73 VOID
74 );
75
76 /**
77 HookStub will be copied from it's loaded location into the IVT when
78 an IVT entry is hooked.
79
80 **/
81 VOID
82 HookStub (
83 VOID
84 );
85
86 /**
87 Chains an interrupt handler.
88
89 **/
90 VOID
91 ChainHandler (
92 VOID
93 );
94
95 /**
96 Unchains an interrupt handler.
97
98 **/
99 VOID
100 UnchainHandler (
101 VOID
102 );
103
104 /**
105 C callable function to enable/disable interrupts.
106
107 @param NewInterruptState New Interrupt State.
108
109 @return Previous state of psr.ic.
110
111 **/
112 UINT64
113 ProgramInterruptFlags (
114 IN UINT64 NewInterruptState
115 );
116
117 /**
118 Flushes instruction cache for specified number of bytes.
119
120 @param StartAddress Cache Start Address.
121 @param SizeInBytes Cache Size.
122
123 **/
124 VOID
125 InstructionCacheFlush (
126 IN VOID *StartAddress,
127 IN UINTN SizeInBytes
128 );
129
130 /**
131 This is a DebugSupport protocol member function, hard
132 coded to support only 1 processor for now.
133
134 @param This The DebugSupport instance
135 @param MaxProcessorIndex The maximuim supported processor index
136
137 @retval EFI_SUCCESS Always returned with **MaxProcessorIndex set to 0.
138
139 **/
140 EFI_STATUS
141 EFIAPI
142 GetMaximumProcessorIndex (
143 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
144 OUT UINTN *MaxProcessorIndex
145 );
146
147 /**
148 DebugSupport protocol member function.
149
150 @param This The DebugSupport instance
151 @param ProcessorIndex Which processor the callback applies to.
152 @param PeriodicCallback Callback function
153
154 @retval EFI_SUCCESS Indicates the callback was registered.
155 @retval others Callback was not registered.
156
157 **/
158 EFI_STATUS
159 EFIAPI
160 RegisterPeriodicCallback (
161 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
162 IN UINTN ProcessorIndex,
163 IN EFI_PERIODIC_CALLBACK PeriodicCallback
164 );
165
166 /**
167 DebugSupport protocol member function.
168
169 @param This The DebugSupport instance
170 @param ProcessorIndex Which processor the callback applies to.
171 @param NewCallback Callback function
172 @param ExceptionType Which exception to hook
173
174 @retval EFI_SUCCESS Indicates the callback was registered.
175 @retval others Callback was not registered.
176
177 **/
178 EFI_STATUS
179 EFIAPI
180 RegisterExceptionCallback (
181 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
182 IN UINTN ProcessorIndex,
183 IN EFI_EXCEPTION_CALLBACK NewCallback,
184 IN EFI_EXCEPTION_TYPE ExceptionType
185 );
186
187 /**
188 DebugSupport protocol member function. Calls assembly routine to flush cache.
189
190 @param This The DebugSupport instance
191 @param ProcessorIndex Which processor the callback applies to.
192 @param Start Physical base of the memory range to be invalidated
193 @param Length mininum number of bytes in instruction cache to invalidate
194
195 @retval EFI_SUCCESS Always returned.
196
197 **/
198 EFI_STATUS
199 EFIAPI
200 InvalidateInstructionCache (
201 IN EFI_DEBUG_SUPPORT_PROTOCOL *This,
202 IN UINTN ProcessorIndex,
203 IN VOID *Start,
204 IN UINTN Length
205 );
206
207 /**
208 C routine that is called for all registered exceptions. This is the main
209 exception dispatcher. Must be public because it's referenced from AsmFuncs.s.
210
211 @param ExceptionType Exception Type
212 @param Context System Context
213 **/
214 VOID
215 CommonHandler (
216 IN EFI_EXCEPTION_TYPE ExceptionType,
217 IN EFI_SYSTEM_CONTEXT Context
218 );
219
220 #endif