/* Reads and returns the current value of GS. This function is only available on IA-32 and X64. */
UINT16 EFIAPI AsmReadGs(VOID)
/* Reads and returns the current value of GS. This function is only available on IA-32 and X64. */
UINT16 EFIAPI AsmReadGs(VOID)
{
  UINT16  Data;
  __asm__ __volatile__ (
    "mov  %%gs, %0"
    :"=a" (Data)
  );
  return Data;
}