/* Flushed the cache line specified by LinearAddress, and returns LinearAddress. This function is only available on IA-32 and X64. */
VOID* EFIAPI AsmFlushCacheLine(IN VOID *LinearAddress)
/* Flushed the cache line specified by LinearAddress, and returns LinearAddress. This function is only available on IA-32 and X64. */
VOID* EFIAPI AsmFlushCacheLine(IN VOID *LinearAddress)
{
  UINT32  RegEdx;
  AsmCpuid (0x01, NULL, NULL, NULL, &RegEdx);
  if ((RegEdx & BIT19) == 0) {
    __asm__ __volatile__ ("wbinvd":::"memory");
    return LinearAddress;
  }
  __asm__ __volatile__ (
    "clflush (%0)"
    : "+a" (LinearAddress)
    :
    : "memory"
  );
  return LinearAddress;
}