mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-14 10:31:59 +00:00
add wait_sync_change and arch_get_pcpu_num implementation for riscv. MAX_PCPU_NUM comes from board_info.h generated by config tool. v2->v3: remove riscv cpu.c include asm/cpu.h v1->v2: implement arch_get_num_available_cpus(); Tracked-On: #8801 signed-off-by: Haicheng Li <haicheng.li@intel.com> Co-developed-by: hangliu1 <hang1.liu@intel.com> Signed-off-by: hangliu1 <hang1.liu@intel.com> Reviewed-by: Wang, Yu1 <yu1.wang@intel.com> Reviewed-by: Liu, Yifan1 <yifan1.liu@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
27 lines
413 B
C
27 lines
413 B
C
/*
|
|
* Copyright (C) 2018-2022 Intel Corporation.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*
|
|
* Authors:
|
|
* Haicheng Li <haicheng.li@intel.com>
|
|
*
|
|
*/
|
|
|
|
|
|
#include <types.h>
|
|
#include <cpu.h>
|
|
|
|
/* wait until *sync == wake_sync */
|
|
void wait_sync_change(volatile const uint64_t *sync, uint64_t wake_sync)
|
|
{
|
|
while ((*sync) != wake_sync) {
|
|
cpu_relax();
|
|
}
|
|
}
|
|
|
|
uint16_t arch_get_pcpu_num(void)
|
|
{
|
|
return NR_CPUS;
|
|
}
|