TianoCore EDK2 master
Loading...
Searching...
No Matches
X64Entry.c File Reference
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/CpuExceptionHandlerLib.h>
#include <Library/DebugAgentLib.h>
#include "CommonHeader.h"

Go to the source code of this file.

Data Structures

struct  _PAGE_FAULT_CONTEXT
 
struct  _PAGE_FAULT_IDT_TABLE
 

Macros

#define EXCEPTION_VECTOR_NUMBER   0x22
 
#define IA32_PG_P   BIT0
 
#define IA32_PG_RW   BIT1
 
#define IA32_PG_PS   BIT7
 

Typedefs

typedef struct _PAGE_FAULT_CONTEXT PAGE_FAULT_CONTEXT
 
typedef struct _PAGE_FAULT_IDT_TABLE PAGE_FAULT_IDT_TABLE
 

Functions

VOID EFIAPI PageFaultHandlerHook (VOID)
 
VOID HookPageFaultHandler (IN OUT IA32_IDT_GATE_DESCRIPTOR *IdtEntry, IN OUT PAGE_FAULT_CONTEXT *PageFaultContext)
 
VOID AcquirePage (IN OUT PAGE_FAULT_CONTEXT *PageFaultContext, IN OUT UINT64 *Uplink)
 
VOID *EFIAPI PageFaultHandler (VOID)
 
EFI_STATUS EFIAPI _ModuleEntryPoint (SWITCH_32_TO_64_CONTEXT *EntrypointContext, SWITCH_64_TO_32_CONTEXT *ReturnContext)
 

Detailed Description

The X64 entrypoint is used to process capsule in long mode.

Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Incorporated. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file X64Entry.c.

Macro Definition Documentation

◆ EXCEPTION_VECTOR_NUMBER

#define EXCEPTION_VECTOR_NUMBER   0x22

Definition at line 17 of file X64Entry.c.

◆ IA32_PG_P

#define IA32_PG_P   BIT0

Definition at line 19 of file X64Entry.c.

◆ IA32_PG_PS

#define IA32_PG_PS   BIT7

Definition at line 21 of file X64Entry.c.

◆ IA32_PG_RW

#define IA32_PG_RW   BIT1

Definition at line 20 of file X64Entry.c.

Function Documentation

◆ _ModuleEntryPoint()

EFI_STATUS EFIAPI _ModuleEntryPoint ( SWITCH_32_TO_64_CONTEXT *  EntrypointContext,
SWITCH_64_TO_32_CONTEXT *  ReturnContext 
)

The X64 entrypoint is used to process capsule in long mode then return to 32-bit protected mode.

Parameters
EntrypointContextPointer to the context of long mode.
ReturnContextPointer to the context of 32-bit protected mode.
Return values
Thisfunction should never return actually.

Definition at line 221 of file X64Entry.c.

◆ AcquirePage()

VOID AcquirePage ( IN OUT PAGE_FAULT_CONTEXT PageFaultContext,
IN OUT UINT64 *  Uplink 
)

Acquire page for page fault.

Parameters
[in,out]PageFaultContextPointer to page fault context.
[in,out]UplinkPointer to up page table entry.

Definition at line 110 of file X64Entry.c.

◆ HookPageFaultHandler()

VOID HookPageFaultHandler ( IN OUT IA32_IDT_GATE_DESCRIPTOR *  IdtEntry,
IN OUT PAGE_FAULT_CONTEXT PageFaultContext 
)

Hook IDT with our page fault handler so that the on-demand paging works on page fault.

Parameters
[in,out]IdtEntryPointer to IDT entry.
[in,out]PageFaultContextPointer to page fault context.

Definition at line 59 of file X64Entry.c.

◆ PageFaultHandler()

VOID *EFIAPI PageFaultHandler ( VOID  )

The page fault handler that on-demand read >4G memory/MMIO.

Return values
NULLThe page fault is correctly handled.
OriginalHandlerThe page fault is not handled and is passed through to original handler.

Definition at line 150 of file X64Entry.c.

◆ PageFaultHandlerHook()

VOID EFIAPI PageFaultHandlerHook ( VOID  )

Page fault handler.