/* Reads and returns the current value of the EFLAGS register. This function is only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on X64. */
UINTN EFIAPI AsmReadEflags(VOID)
/* Reads and returns the current value of the EFLAGS register. This function is only available on IA-32 and X64. This returns a 32-bit value on IA-32 and a 64-bit value on X64. */
UINTN EFIAPI AsmReadEflags(VOID)
{
  UINTN  Eflags;
  __asm__ __volatile__ (
    "pushfl     \n\t"
    "popl %0        "
    : "=r" (Eflags)
  );
  return Eflags;
}