From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 10/43] hw/arm/armv7m: Remove unused armv7m_init() function
Date: Fri, 15 Jun 2018 15:24:48 +0100 [thread overview]
Message-ID: <20180615142521.19143-11-peter.maydell@linaro.org> (raw)
In-Reply-To: <20180615142521.19143-1-peter.maydell@linaro.org>
Remove the now-unused armv7m_init() function. This was a legacy from
before we properly QOMified ARMv7M, and it has some flaws:
* it combines work that needs to be done by an SoC object (creating
and initializing the TYPE_ARMV7M object) with work that needs to
be done by the board model (setting the system up to load the ELF
file specified with -kernel)
* TYPE_ARMV7M creation failure is fatal, but an SoC object wants to
arrange to propagate the failure outward
* it uses allocate-and-create via qdev_create() whereas the current
preferred style for SoC objects is to do creation in-place
Board and SoC models can instead do the two jobs this function
was doing themselves, in the right places and with whatever their
preferred style/error handling is.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20180601144328.23817-3-peter.maydell@linaro.org
---
include/hw/arm/arm.h | 8 ++------
hw/arm/armv7m.c | 21 ---------------------
2 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h
index 70fa2287e2c..ffed39252d8 100644
--- a/include/hw/arm/arm.h
+++ b/include/hw/arm/arm.h
@@ -23,9 +23,6 @@ typedef enum {
ARM_ENDIANNESS_BE32,
} arm_endianness;
-/* armv7m.c */
-DeviceState *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
- const char *kernel_filename, const char *cpu_type);
/**
* armv7m_load_kernel:
* @cpu: CPU
@@ -33,9 +30,8 @@ DeviceState *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
* @mem_size: mem_size: maximum image size to load
*
* Load the guest image for an ARMv7M system. This must be called by
- * any ARMv7M board, either directly or via armv7m_init(). (This is
- * necessary to ensure that the CPU resets correctly on system reset,
- * as well as for kernel loading.)
+ * any ARMv7M board. (This is necessary to ensure that the CPU resets
+ * correctly on system reset, as well as for kernel loading.)
*/
void armv7m_load_kernel(ARMCPU *cpu, const char *kernel_filename, int mem_size);
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
index f123cc7d3d2..a4ab7d20696 100644
--- a/hw/arm/armv7m.c
+++ b/hw/arm/armv7m.c
@@ -261,27 +261,6 @@ static void armv7m_reset(void *opaque)
cpu_reset(CPU(cpu));
}
-/* Init CPU and memory for a v7-M based board.
- mem_size is in bytes.
- Returns the ARMv7M device. */
-
-DeviceState *armv7m_init(MemoryRegion *system_memory, int mem_size, int num_irq,
- const char *kernel_filename, const char *cpu_type)
-{
- DeviceState *armv7m;
-
- armv7m = qdev_create(NULL, TYPE_ARMV7M);
- qdev_prop_set_uint32(armv7m, "num-irq", num_irq);
- qdev_prop_set_string(armv7m, "cpu-type", cpu_type);
- object_property_set_link(OBJECT(armv7m), OBJECT(get_system_memory()),
- "memory", &error_abort);
- /* This will exit with an error if the user passed us a bad cpu_type */
- qdev_init_nofail(armv7m);
-
- armv7m_load_kernel(ARM_CPU(first_cpu), kernel_filename, mem_size);
- return armv7m;
-}
-
void armv7m_load_kernel(ARMCPU *cpu, const char *kernel_filename, int mem_size)
{
int image_size;
--
2.17.1
next prev parent reply other threads:[~2018-06-15 14:25 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 14:24 [Qemu-devel] [PULL 00/43] target-arm queue Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 01/43] arm_gicv3_kvm: kvm_dist_get/put_priority: skip the registers banked by GICR_IPRIORITYR Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 02/43] hw/arm/mps2-tz: Put ethernet controller behind PPC Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 03/43] hw/sh/sh7750: Convert away from old_mmio Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 04/43] hw/m68k/mcf5206: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 05/43] hw/block/pflash_cfi02: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 06/43] hw/watchdog/wdt_i6300esb: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 07/43] hw/input/pckbd: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 08/43] hw/char/parallel: " Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 09/43] stellaris: Stop using armv7m_init() Peter Maydell
2018-06-15 14:24 ` Peter Maydell [this message]
2018-06-15 14:24 ` [Qemu-devel] [PULL 11/43] arm: Don't crash if user tries to use a Cortex-M CPU without an NVIC Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 12/43] hw/core/or-irq: Support more than 16 inputs to an OR gate Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 13/43] cpu-defs.h: Document CPUIOTLBEntry 'addr' field Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 14/43] cputlb: Pass cpu_transaction_failed() the correct physaddr Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 15/43] CODING_STYLE: Define our preferred form for multiline comments Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 16/43] bswap: Add new stn_*_p() and ldn_*_p() memory access functions Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 17/43] exec.c: Don't accidentally sign-extend 4-byte loads in subpage_read() Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 18/43] exec.c: Use stn_p() and ldn_p() instead of explicit switches Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 19/43] target/arm: Extend vec_reg_offset to larger sizes Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 20/43] target/arm: Implement SVE Permute - Unpredicated Group Peter Maydell
2018-06-15 14:24 ` [Qemu-devel] [PULL 21/43] target/arm: Implement SVE Permute - Predicates Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 22/43] target/arm: Implement SVE Permute - Interleaving Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 23/43] target/arm: Implement SVE compress active elements Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 24/43] target/arm: Implement SVE conditionally broadcast/extract element Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 25/43] target/arm: Implement SVE copy to vector (predicated) Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 26/43] target/arm: Implement SVE reverse within elements Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 27/43] target/arm: Implement SVE vector splice (predicated) Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 28/43] target/arm: Implement SVE Select Vectors Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 29/43] target/arm: Implement SVE Integer Compare - " Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 30/43] target/arm: Implement SVE Integer Compare - Immediate Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 31/43] target/arm: Implement SVE Partition Break Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 32/43] target/arm: Implement SVE Predicate Count Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 33/43] target/arm: Implement SVE Integer Compare - Scalars Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 34/43] target/arm: Implement FDUP/DUP Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 35/43] target/arm: Implement SVE Integer Wide Immediate - Unpredicated Group Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 36/43] target/arm: Implement SVE Floating Point Arithmetic " Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 37/43] aspeed_scu: Implement RNG register Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 38/43] m25p80: add support for two bytes WRSR for Macronix chips Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 39/43] iommu: Add IOMMU index concept to IOMMU API Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 40/43] iommu: Add IOMMU index argument to notifier APIs Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 41/43] iommu: Add IOMMU index argument to translate method Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 42/43] exec.c: Handle IOMMUs in address_space_translate_for_iotlb() Peter Maydell
2018-06-15 14:25 ` [Qemu-devel] [PULL 43/43] target/arm: Allow ARMv6-M Thumb2 instructions Peter Maydell
2018-06-15 15:30 ` [Qemu-devel] [PULL 00/43] target-arm queue Peter Maydell
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=20180615142521.19143-11-peter.maydell@linaro.org \
--to=peter.maydell@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).