/* Reads and returns the current value of performance counter specified by Index. This function is only available on IA-32 and X64. */
UINT64 EFIAPI AsmReadPmc(IN UINT32 Index)
/* Reads and returns the current value of performance counter specified by Index. This function is only available on IA-32 and X64. */
UINT64 EFIAPI AsmReadPmc(IN UINT32 Index)
{
  UINT32  LowData;
  UINT32  HiData;
  __asm__ __volatile__ (
    "rdpmc"
    : "=a" (LowData),
      "=d" (HiData)
    : "c"  (Index)
  );
  return (((UINT64)HiData) << 32) | LowData;
}