/* Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid" */
EFI_STATUS EFIAPI AmlGetEisaIdFromString(IN CONST CHAR8 *EisaIdStr, OUT UINT32 *EisaIdInt)
/* Cf. ACPI 6.4 specification, s19.3.4 "ASL Macros": "Eisaid" */
EFI_STATUS EFIAPI AmlGetEisaIdFromString(IN CONST CHAR8 *EisaIdStr, OUT UINT32 *EisaIdInt)
{
  if ((EisaIdStr == NULL)         ||
      (!IsValidPnpId (EisaIdStr)) ||
      (EisaIdInt == NULL))
  {
    ASSERT (0);
    return EFI_INVALID_PARAMETER;
  }
  *EisaIdInt = SwapBytes32 (
                 ((EisaIdStr[0] - 0x40) << 26)       |
                 ((EisaIdStr[1] - 0x40) << 21)       |
                 ((EisaIdStr[2] - 0x40) << 16)       |
                 (HexFromAscii (EisaIdStr[3]) << 12) |
                 (HexFromAscii (EisaIdStr[4]) << 8)  |
                 (HexFromAscii (EisaIdStr[5]) << 4)  |
                 (HexFromAscii (EisaIdStr[6]))
                 );
  return EFI_SUCCESS;
}