Go to the source code of this file.
◆ ArchInitializeContext()
Definition at line 85 of file arch.c.
88{
90
91
93 {
94
95 Context->ContextFlags &= ~BL_CONTEXT_PAGING_ON;
97 }
100 {
101
103
104
105 Context->ContextFlags &= ~BL_CONTEXT_PAGING_ON;
107
108
110 }
111 else
112 {
113
115 }
116
117
119}
#define BL_APPLICATION_FLAG_CONVERTED_FROM_EFI
ULONG BlpApplicationFlags
BL_LIBRARY_PARAMETERS BlpLibraryParameters
#define BL_CONTEXT_INTERRUPTS_ON
#define STATUS_NOT_SUPPORTED
__INTRIN_INLINE unsigned long __readcr4(void)
__INTRIN_INLINE void __writecr4(unsigned int Data)
Referenced by ArchInitializeContexts().
◆ ArchInitializeContexts()
Definition at line 122 of file arch.c.
125{
128
129
131
132
135
136
139 {
140
143 }
144
145
148 {
149
151 {
154 }
155
156
159 }
160
161
162 return EfiStatus;
163}
#define NT_SUCCESS(StatCode)
PBL_ARCH_CONTEXT CurrentExecutionContext
NTSTATUS ArchInitializeContext(_In_ PBL_ARCH_CONTEXT Context)
VOID ArchSwitchContext(_In_ PBL_ARCH_CONTEXT NewContext, _In_ PBL_ARCH_CONTEXT OldContext)
BL_ARCH_CONTEXT ApplicationExecutionContext
BL_ARCH_CONTEXT FirmwareExecutionContext
Referenced by BlpArchInitialize().
◆ ArchSwitchContext()
Definition at line 39 of file arch.c.
43{
44
46 {
47
49
50
52 {
53
55 }
56
57
59 }
60 else
61 {
62
64 {
66 }
67
68
70 {
71
73 {
74
76 }
77
78
80 }
81 }
82}
#define BL_CONTEXT_PAGING_ON
_In_ FLT_SET_CONTEXT_OPERATION _In_ PFLT_CONTEXT NewContext
_In_ FLT_SET_CONTEXT_OPERATION _In_ PFLT_CONTEXT _Outptr_opt_result_maybenull_ PFLT_CONTEXT * OldContext
void __cdecl _disable(void)
void __cdecl _enable(void)
__INTRIN_INLINE unsigned long __readcr0(void)
__INTRIN_INLINE void __writecr0(unsigned int Data)
Referenced by ArchInitializeContexts(), and BlpArchSwitchContext().
◆ ArchTrapNoProcess()
Definition at line 23 of file arch.c.
26{
27
28#if defined(__GNUC__)
30#elif defined (_MSC_VER)
31 _asm { iret };
32#else
33#error wtf are you using
34#endif
36}
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
Referenced by BlpArchInitialize().
◆ BlpArchEnableTranslation()
Definition at line 189 of file arch.c.
192{
194
195
198 {
199
201 {
202
204 Context->ContextFlags &= ~BL_CONTEXT_INTERRUPTS_ON;
205 }
206
207
209 {
210
212 }
213
214
216
217
219 }
220}
Referenced by MmDefInitializeTranslation().
◆ BlpArchInitialize()
Definition at line 235 of file arch.c.
238{
243
244
246
247
248 if (Phase != 0)
249 {
250
253
254
256 __asm__ __volatile__ (
"mov %%cs,%0\n\t" :
"=r" (CodeSegment));
257#elif defined (_MSC_VER)
258 _asm { mov CodeSegment,
cs };
259#else
260#error wtf are you using
261#endif
262
263
266 IdtBase[3].
Access = 0x8E00u;
269 IdtBase[0x2C].
Selector = CodeSegment;
270 IdtBase[0x2C].
Access = 0x8E00u;
273 IdtBase[0x2D].
Selector = CodeSegment;
274 IdtBase[0x2D].
Access = 0x8E00u;
276
277
280
281
282#if defined(__GNUC__)
283 __asm__ __volatile__ (
"fninit");
284#elif defined (_MSC_VER)
285 _asm { fninit };
286#else
287#error wtf are you using
288#endif
289 }
290 else
291 {
292
293 if ((
__readmsr(0x10) >> 32) & 0xFFC00000)
294 {
296 }
297
298
300 }
301
302
304}
NTSTATUS ArchInitializeContexts(VOID)
VOID DECLSPEC_NORETURN ArchTrapNoProcess(VOID)
PPC_QUAL void __writemsr(const unsigned long Value)
PPC_QUAL unsigned long long __readmsr()
__INTRIN_INLINE void __lidt(void *Source)
__INTRIN_INLINE void __sidt(void *Destination)
◆ BlpArchSwitchContext()
Definition at line 166 of file arch.c.
169{
171
172
175 {
177 }
178
179
181 {
182
185 }
186}
◆ ApplicationExecutionContext
◆ CurrentExecutionContext
◆ FirmwareExecutionContext