@@ -4,6 +4,7 @@ obj-$(CONFIG_KVM) += kvm.o
obj-$(call land,$(CONFIG_KVM),$(call lnot,$(TARGET_AARCH64))) += kvm32.o
obj-$(call land,$(CONFIG_KVM),$(TARGET_AARCH64)) += kvm64.o
obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
+obj-$(call lnot,$(CONFIG_ARM_V7M)) += armv7m-stub.o
obj-y += translate.o op_helper.o helper.o cpu.o
obj-y += neon_helper.o iwmmxt_helper.o
obj-y += gdbstub.o
new file mode 100644
@@ -0,0 +1,43 @@
+/*
+ * ARMv7M stubs
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "cpu.h"
+#include "hw/arm/armv7m.h"
+
+void armv7m_nvic_acknowledge_irq(void *opaque)
+{
+ NVICState *s = (NVICState *)opaque;
+
+ cpu_abort(CPU(s->cpu), "No NVIC avaialable to acknowledge IRQ\n");
+}
+
+void armv7m_nvic_set_pending(void *opaque, int irq)
+{
+ NVICState *s = (NVICState *)opaque;
+
+ cpu_abort(CPU(s->cpu), "No NVIC avaialable to set IRQ pending\n");
+}
+
+int armv7m_nvic_complete_irq(void *opaque, int irq)
+{
+ NVICState *s = (NVICState *)opaque;
+
+ cpu_abort(CPU(s->cpu), "No NVIC avaialable to complete IRQ\n");
+
+ return 0;
+}
+
+bool armv7m_nvic_can_take_pending_exception(void *opaque)
+{
+ NVICState *s = (NVICState *)opaque;
+
+ cpu_abort(CPU(s->cpu), "No NVIC avaialable to check pending exception\n");
+
+ return false;
+}
M-profile CPUs relies on NVIC controller which won't be compiled if CONFIG_ARM_V7M is not defined. To solve the problem, this patch defines four NVIC stub functions. These functions are called when CONFIG_ARM_V7M is not defined. Signed-off-by: Wei Huang <wei@redhat.com> --- target/arm/Makefile.objs | 1 + target/arm/armv7m-stub.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 target/arm/armv7m-stub.c