Files
acrn-hypervisor/hypervisor/include/arch/riscv/asm/per_cpu.h
hangliu1 b5306f2a74 enable common code compile
enable riscv common file compile and add PAGE_SIZE
definition to make riscv compile pass.

Tracked-On: #8801
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>
2025-09-19 15:04:55 +08:00

30 lines
619 B
C

/*
* Copyright (C) 2025 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*
* Authors:
* Haicheng Li <haicheng.li@intel.com>
*/
#ifndef RISCV_PERCPU_H
#define RISCV_PERCPU_H
#include <common/notify.h>
#include <types.h>
#include <board_info.h>
#include <asm/page.h>
struct per_cpu_region {
struct smp_call_info_data smp_call_info;
} __aligned(PAGE_SIZE); /* per_cpu_region size aligned with PAGE_SIZE */
extern struct per_cpu_region per_cpu_data[MAX_PCPU_NUM];
/*
* get percpu data for pcpu_id.
*/
#define per_cpu(name, pcpu_id) \
(per_cpu_data[(pcpu_id)].name)
#endif /* RISCV_PERCPU_H */