hv:Change phys_cpu_num to static

-- change phys_cpu_num to static
-- add get_pcpu_nums() and is_pcpu_active() APIs
-- replace phys_cpu_num with get_pcpu_nums() except cpu.c

Tracked-On: #1842
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Mingqiang Chi
2018-12-26 13:54:05 +08:00
committed by wenlingz
parent 59e2de4805
commit 682824de6d
16 changed files with 57 additions and 35 deletions

View File

@@ -106,8 +106,7 @@ uint32_t sbuf_put(struct shared_buf *sbuf, uint8_t *data)
int32_t sbuf_share_setup(uint16_t pcpu_id, uint32_t sbuf_id, uint64_t *hva)
{
if ((pcpu_id >= phys_cpu_num) ||
(sbuf_id >= ACRN_SBUF_ID_MAX)) {
if ((pcpu_id >= get_pcpu_nums()) || (sbuf_id >= ACRN_SBUF_ID_MAX)) {
return -EINVAL;
}