/* Clear the port interrupt and error status. It will also clear HBA interrupt status. */
VOID AhciClearPortStatus(IN UINTN AhciBar, IN UINT8 Port)
/* Clear the port interrupt and error status. It will also clear HBA interrupt status. */
VOID AhciClearPortStatus(IN UINTN AhciBar, IN UINT8 Port)
{
  UINT32  Offset;
  Offset = AHCI_PORT_START + Port * AHCI_PORT_REG_WIDTH + AHCI_PORT_SERR;
  AhciWriteReg (AhciBar, Offset, AhciReadReg (AhciBar, Offset));
  Offset = AHCI_PORT_START + Port * AHCI_PORT_REG_WIDTH + AHCI_PORT_IS;
  AhciWriteReg (AhciBar, Offset, AhciReadReg (AhciBar, Offset));
  AhciWriteReg (AhciBar, AHCI_IS_OFFSET, AhciReadReg (AhciBar, AHCI_IS_OFFSET));
}