/* This function may only be called from the entry point function of the driver, and only after PcdQ35SmramAtDefaultSmbase has been determined to be TRUE.  */
VOID SmbaseInstallFirstSmiHandler(VOID)
/* This function may only be called from the entry point function of the driver, and only after PcdQ35SmramAtDefaultSmbase has been determined to be TRUE.  */
VOID SmbaseInstallFirstSmiHandler(VOID)
{
  FIRST_SMI_HANDLER_CONTEXT  *Context;
  CopyMem (
    (VOID *)(UINTN)(SMM_DEFAULT_SMBASE + SMM_HANDLER_OFFSET),
    mFirstSmiHandler,
    mFirstSmiHandlerSize
    );
  Context             = (VOID *)(UINTN)SMM_DEFAULT_SMBASE;
  Context->ApicIdGate = MAX_UINT64;
}