Files
slimbootloader/BootloaderCorePkg/Library/BootloaderCoreLib/BootloaderArch.c
T
Maurice Ma d3c42e575d Fix GCC build issue in x64 (#620)
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>
2020-04-02 07:28:57 -07:00

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)));
}