TianoCore EDK2 master
Loading...
Searching...
No Matches
SetIdtEntry.c File Reference
#include "ScriptExecute.h"

Go to the source code of this file.

Macros

#define EXTRA_PAGE_TABLE_PAGES   8
 
#define IA32_PG_P   BIT0
 
#define IA32_PG_RW   BIT1
 
#define IA32_PG_PS   BIT7
 

Functions

VOID EFIAPI PageFaultHandlerHook (VOID)
 
VOID HookPageFaultHandler (IN IA32_IDT_GATE_DESCRIPTOR *IdtEntry)
 
BOOLEAN IsLongModeWakingVector (IN ACPI_S3_CONTEXT *AcpiS3Context)
 
VOID SetIdtEntry (IN ACPI_S3_CONTEXT *AcpiS3Context)
 
VOID AcquirePage (IN OUT UINT64 *Uplink)
 
BOOLEAN EFIAPI PageFaultHandler (VOID)
 

Variables

UINT64 mPhyMask
 
VOID * mOriginalHandler
 
UINTN mPageFaultBuffer
 
UINTN mPageFaultIndex = 0
 
UINT64 * mPageFaultUplink [EXTRA_PAGE_TABLE_PAGES]
 

Detailed Description

Set a IDT entry for debug purpose

Set a IDT entry for interrupt vector 3 for debug purpose for x64 platform

Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
Copyright (c) 2017, AMD Incorporated. All rights reserved.

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

Definition in file SetIdtEntry.c.

Macro Definition Documentation

◆ EXTRA_PAGE_TABLE_PAGES

#define EXTRA_PAGE_TABLE_PAGES   8

Definition at line 18 of file SetIdtEntry.c.

◆ IA32_PG_P

#define IA32_PG_P   BIT0

Definition at line 20 of file SetIdtEntry.c.

◆ IA32_PG_PS

#define IA32_PG_PS   BIT7

Definition at line 22 of file SetIdtEntry.c.

◆ IA32_PG_RW

#define IA32_PG_RW   BIT1

Definition at line 21 of file SetIdtEntry.c.

Function Documentation

◆ AcquirePage()

VOID AcquirePage ( IN OUT UINT64 *  Uplink)

Acquire page for page fault.

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

Definition at line 194 of file SetIdtEntry.c.

◆ HookPageFaultHandler()

VOID HookPageFaultHandler ( IN IA32_IDT_GATE_DESCRIPTOR *  IdtEntry)

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

Parameters
IdtEntrya pointer to IDT entry

Definition at line 50 of file SetIdtEntry.c.

◆ IsLongModeWakingVector()

BOOLEAN IsLongModeWakingVector ( IN ACPI_S3_CONTEXT AcpiS3Context)

The function will check if current waking vector is long mode.

Parameters
AcpiS3Contexta pointer to a structure of ACPI_S3_CONTEXT
Return values
TRUECurrent context need long mode waking vector.
FALSECurrent context need not long mode waking vector.

Definition at line 100 of file SetIdtEntry.c.

◆ PageFaultHandler()

BOOLEAN EFIAPI PageFaultHandler ( VOID  )

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

Return values
TRUEThe page fault is correctly handled.
FALSEThe page fault is not handled and is passed through to original handler.

Definition at line 230 of file SetIdtEntry.c.

◆ PageFaultHandlerHook()

VOID EFIAPI PageFaultHandlerHook ( VOID  )

Page fault handler.

◆ SetIdtEntry()

VOID SetIdtEntry ( IN ACPI_S3_CONTEXT AcpiS3Context)

Set a IDT entry for interrupt vector 3 for debug purpose.

Parameters
AcpiS3Contexta pointer to a structure of ACPI_S3_CONTEXT

Definition at line 137 of file SetIdtEntry.c.

Variable Documentation

◆ mOriginalHandler

VOID* mOriginalHandler

Definition at line 25 of file SetIdtEntry.c.

◆ mPageFaultBuffer

UINTN mPageFaultBuffer

Definition at line 26 of file SetIdtEntry.c.

◆ mPageFaultIndex

UINTN mPageFaultIndex = 0

Definition at line 27 of file SetIdtEntry.c.

◆ mPageFaultUplink

UINT64* mPageFaultUplink[EXTRA_PAGE_TABLE_PAGES]

Definition at line 31 of file SetIdtEntry.c.

◆ mPhyMask

UINT64 mPhyMask

Definition at line 24 of file SetIdtEntry.c.