1 Star 0 Fork 109

panchenbo / qemu

forked from src-openEuler / qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
target-arm-Fix-some-compile-errors.patch 2.69 KB
一键复制 编辑 原始数据 按行查看 历史
KuhnChen 提交于 2022-02-15 14:40 . target/arm: Fix some compile errors
From 6a5a391c9c6f6c0cd105ce3495acc10868bad884 Mon Sep 17 00:00:00 2001
From: Dongxu Sun <sundongxu3@huawei.com>
Date: Tue, 15 Feb 2022 14:40:48 +0800
Subject: [PATCH] target/arm: Fix some compile errors
fix compile errors like:
"implicit declaration of function 'kvm_arm_cpu_feature_supported'";
"undefined reference to 'kvm_arm_get_one_reg'"
"undefined reference to 'kvm_arm_set_one_reg'"
"'kvmval' may be used uninitialized"
"'oldval' may be used uninitialized"
Signed-off-by: Dongxu Sun <sundongxu3@huawei.com>
---
target/arm/helper.c | 4 ++--
target/arm/kvm_arm.h | 23 ++++++++++++++++++++---
2 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 1dd5d64d96..80737a8d7b 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -168,8 +168,8 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync)
if (kvm_sync) {
if (is_id_reg(ri)) {
/* Only sync if we can sync to KVM successfully. */
- uint64_t oldval;
- uint64_t kvmval;
+ uint64_t oldval = 0;
+ uint64_t kvmval = 0;
if (kvm_arm_get_one_reg(cpu, cpu->cpreg_indexes[i], &oldval)) {
continue;
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
index 82145607ec..8b644b3924 100644
--- a/target/arm/kvm_arm.h
+++ b/target/arm/kvm_arm.h
@@ -377,6 +377,9 @@ void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa);
int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level);
+int kvm_arm_get_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *target);
+int kvm_arm_set_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *source);
+
#else
/*
@@ -403,6 +406,11 @@ static inline bool kvm_arm_steal_time_supported(void)
return false;
}
+static inline bool kvm_arm_cpu_feature_supported(void)
+{
+ return false;
+}
+
/*
* These functions should never actually be called without KVM support.
*/
@@ -451,6 +459,18 @@ static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map)
g_assert_not_reached();
}
+static inline int kvm_arm_get_one_reg(ARMCPU *cpu, uint64_t regidx,
+ uint64_t *target)
+{
+ g_assert_not_reached();
+}
+
+static inline int kvm_arm_set_one_reg(ARMCPU *cpu, uint64_t regidx,
+ uint64_t *source)
+{
+ g_assert_not_reached();
+}
+
#endif
static inline const char *gic_class_name(void)
@@ -535,7 +555,4 @@ static inline const char *its_class_name(void)
}
}
-int kvm_arm_get_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *target);
-int kvm_arm_set_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *source);
-
#endif
--
2.27.0
1
https://gitee.com/panchenbo/qemu.git
git@gitee.com:panchenbo/qemu.git
panchenbo
qemu
qemu
master

搜索帮助