All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Huang <wei@redhat.com>
To: qemu-arm@nongnu.org
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [Qemu-arm] [PATCH 2/2] armv7m: Use stub functions if CONFIG_ARM_V7M is not defined
Date: Thu, 27 Apr 2017 12:38:47 -0500	[thread overview]
Message-ID: <1493314727-6951-3-git-send-email-wei@redhat.com> (raw)
In-Reply-To: <1493314727-6951-1-git-send-email-wei@redhat.com>

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

diff --git a/target/arm/Makefile.objs b/target/arm/Makefile.objs
index 847fb52..328367d 100644
--- a/target/arm/Makefile.objs
+++ b/target/arm/Makefile.objs
@@ -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
diff --git a/target/arm/armv7m-stub.c b/target/arm/armv7m-stub.c
new file mode 100644
index 0000000..1be3874
--- /dev/null
+++ b/target/arm/armv7m-stub.c
@@ -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;
+}
-- 
1.8.3.1


WARNING: multiple messages have this Message-ID (diff)
From: Wei Huang <wei@redhat.com>
To: qemu-arm@nongnu.org
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/2] armv7m: Use stub functions if CONFIG_ARM_V7M is not defined
Date: Thu, 27 Apr 2017 12:38:47 -0500	[thread overview]
Message-ID: <1493314727-6951-3-git-send-email-wei@redhat.com> (raw)
In-Reply-To: <1493314727-6951-1-git-send-email-wei@redhat.com>

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

diff --git a/target/arm/Makefile.objs b/target/arm/Makefile.objs
index 847fb52..328367d 100644
--- a/target/arm/Makefile.objs
+++ b/target/arm/Makefile.objs
@@ -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
diff --git a/target/arm/armv7m-stub.c b/target/arm/armv7m-stub.c
new file mode 100644
index 0000000..1be3874
--- /dev/null
+++ b/target/arm/armv7m-stub.c
@@ -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;
+}
-- 
1.8.3.1

  parent reply	other threads:[~2017-04-27 17:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27 17:38 [Qemu-arm] [PATCH 0/2] Fix compilation dependency issues of CONFIG_ARM_V7M Wei Huang
2017-04-27 17:38 ` [Qemu-devel] " Wei Huang
2017-04-27 17:38 ` [Qemu-arm] [PATCH 1/2] armv7m: Make armv7m SoC compilation dependent on CONFIG_ARM_V7M Wei Huang
2017-04-27 17:38   ` [Qemu-devel] " Wei Huang
2017-04-27 17:38 ` Wei Huang [this message]
2017-04-27 17:38   ` [Qemu-devel] [PATCH 2/2] armv7m: Use stub functions if CONFIG_ARM_V7M is not defined Wei Huang
2017-04-27 17:51 ` [Qemu-devel] [PATCH 0/2] Fix compilation dependency issues of CONFIG_ARM_V7M no-reply
2017-04-27 17:51   ` no-reply
2017-04-27 21:13 ` [Qemu-arm] " Peter Maydell
2017-04-27 21:13   ` [Qemu-devel] " Peter Maydell
2017-04-28  0:10   ` [Qemu-arm] " Wei Huang
2017-04-28  0:10     ` Wei Huang
2017-04-28 12:09     ` [Qemu-arm] " Peter Maydell
2017-04-28 12:09       ` Peter Maydell
2017-04-28 13:58       ` [Qemu-arm] " Wei Huang
2017-04-28 13:58         ` Wei Huang
2017-06-02 15:00         ` Peter Maydell
2017-06-02 15:49           ` Alex Bennée
2017-06-02 15:55             ` Peter Maydell
2017-06-02 16:12               ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1493314727-6951-3-git-send-email-wei@redhat.com \
    --to=wei@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.