You've already forked slimbootloader
mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-03-06 15:26:20 -08:00
d3c42e575d
Due to missing normal function implementations in some x64 code, GCC optimized many code off from the final image which caused synbol patching issue later on. This patch fixed this. Signed-off-by: Maurice Ma <maurice.ma@intel.com>
45 lines
855 B
C
45 lines
855 B
C
/** @file
|
|
|
|
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#include <PiPei.h>
|
|
#include <Library/PcdLib.h>
|
|
#include <Library/BootloaderCoreLib.h>
|
|
|
|
/**
|
|
This function sets the Loader global data pointer.
|
|
|
|
@param[in] LoaderData Loader data pointer.
|
|
|
|
**/
|
|
VOID
|
|
EFIAPI
|
|
SetLoaderGlobalDataPointer (
|
|
IN LOADER_GLOBAL_DATA *LoaderData
|
|
)
|
|
{
|
|
IA32_DESCRIPTOR Idtr;
|
|
|
|
AsmReadIdtr (&Idtr);
|
|
(* (UINTN *) (Idtr.Base - sizeof (UINT64))) = (UINTN)LoaderData;
|
|
}
|
|
|
|
/**
|
|
This function gets the Loader global data pointer.
|
|
|
|
**/
|
|
LOADER_GLOBAL_DATA *
|
|
EFIAPI
|
|
GetLoaderGlobalDataPointer (
|
|
VOID
|
|
)
|
|
{
|
|
IA32_DESCRIPTOR Idtr;
|
|
|
|
AsmReadIdtr (&Idtr);
|
|
return (LOADER_GLOBAL_DATA *) (* (UINTN *) (Idtr.Base - sizeof (UINT64)));
|
|
}
|