mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-28 11:43:56 +00:00
Modules that use udelay() should include "delay.h" explicitly. Tracked-On: #5920 Signed-off-by: Rong Liu <rong2.liu@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
22 lines
357 B
C
22 lines
357 B
C
/*
|
|
* Copyright (C) 2021 Intel Corporation.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <common/ticks.h>
|
|
#include <common/delay.h>
|
|
|
|
void udelay(uint32_t us)
|
|
{
|
|
uint64_t end, delta;
|
|
|
|
/* Calculate number of ticks to wait */
|
|
delta = us_to_ticks(us);
|
|
end = cpu_ticks() + delta;
|
|
|
|
/* Loop until time expired */
|
|
while (cpu_ticks() < end) {
|
|
}
|
|
}
|