From patchwork Sun Oct 16 09:53:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 120018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 75D9BB70ED for ; Sun, 16 Oct 2011 20:53:49 +1100 (EST) Received: from localhost ([::1]:35455 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFNPc-00051b-Sp for incoming@patchwork.ozlabs.org; Sun, 16 Oct 2011 05:53:45 -0400 Received: from eggs.gnu.org ([140.186.70.92]:39319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFNPG-0004Pd-MO for qemu-devel@nongnu.org; Sun, 16 Oct 2011 05:53:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFNPE-0002tM-Jd for qemu-devel@nongnu.org; Sun, 16 Oct 2011 05:53:22 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:48902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFNPE-0002t2-2Q for qemu-devel@nongnu.org; Sun, 16 Oct 2011 05:53:20 -0400 Received: from moweb001.kundenserver.de (moweb001.kundenserver.de [172.19.20.114]) by fmmailgate02.web.de (Postfix) with ESMTP id 875381B313ED9 for ; Sun, 16 Oct 2011 11:53:18 +0200 (CEST) Received: from mchn199C.mchp.siemens.de ([92.74.54.187]) by smtp.web.de (mrweb001) with ESMTPA (Nemesis) id 0M1FqS-1QvV4M0c4u-00tonO; Sun, 16 Oct 2011 11:53:14 +0200 Message-ID: <4E9AA989.6060100@web.de> Date: Sun, 16 Oct 2011 11:53:13 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Blue Swirl References: <5314c61b734ae064014dee3aca00c5aca537fcb4.1317971994.git.jan.kiszka@siemens.com> In-Reply-To: <5314c61b734ae064014dee3aca00c5aca537fcb4.1317971994.git.jan.kiszka@siemens.com> X-Enigmail-Version: 1.3.2 X-Provags-ID: V02:K0:yEPaKMO3YiMrmKppUkA1v3CS/AQV69HfH1da7Zo3S4N G4ytJOz3Nn/nx+sXOohKoPYuOBEentVbIITCrcPBU7NP1Tj4/b +sLHvogRJR0coqtbMT1KQUdiYb76oP+f3nepGosCkPBH5EVgcr eibefRlxOGMzMhyGrkyDLP+Irf9JRM0pt2O3oo1NgR8iGfdZhS e0Yyunrp+5vX8de7vi0AQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.227 Cc: Anthony Liguori , qemu-devel Subject: [Qemu-devel] [PATCH v3 22/23] monitor: Restrict pic/irq_info to supporting targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka This allows to drop various stubs and move the i8359 into hwlib. Signed-off-by: Jan Kiszka --- Changes in v3: - rebased over current git hw/an5206.c | 10 ---------- hw/arm_pic.c | 11 ----------- hw/cris_pic_cpu.c | 6 ------ hw/etraxfs.h | 1 + hw/lm32_pic.c | 4 ++-- hw/lm32_pic.h | 3 +++ hw/microblaze_pic_cpu.c | 6 ------ hw/s390-virtio.c | 11 ----------- hw/shix.c | 11 ----------- hw/sun4m.c | 4 ++-- hw/sun4m.h | 4 ++++ hw/sun4u.c | 8 -------- hw/xtensa_pic.c | 10 ---------- monitor.c | 21 +++++++++++++++++++++ 14 files changed, 33 insertions(+), 77 deletions(-) diff --git a/hw/an5206.c b/hw/an5206.c index 481ae60..3fe1f00 100644 --- a/hw/an5206.c +++ b/hw/an5206.c @@ -7,7 +7,6 @@ */ #include "hw.h" -#include "pc.h" #include "mcf.h" #include "boards.h" #include "loader.h" @@ -18,15 +17,6 @@ #define AN5206_MBAR_ADDR 0x10000000 #define AN5206_RAMBAR_ADDR 0x20000000 -/* Stub functions for hardware that doesn't exist. */ -void pic_info(Monitor *mon) -{ -} - -void irq_info(Monitor *mon) -{ -} - /* Board init. */ static void an5206_init(ram_addr_t ram_size, diff --git a/hw/arm_pic.c b/hw/arm_pic.c index 41f8d3e..a2e8a73 100644 --- a/hw/arm_pic.c +++ b/hw/arm_pic.c @@ -8,19 +8,8 @@ */ #include "hw.h" -#include "pc.h" #include "arm-misc.h" -/* Stub functions for hardware that doesn't exist. */ -void pic_info(Monitor *mon) -{ -} - -void irq_info(Monitor *mon) -{ -} - - /* Input 0 is IRQ and input 1 is FIQ. */ static void arm_pic_cpu_handler(void *opaque, int irq, int level) { diff --git a/hw/cris_pic_cpu.c b/hw/cris_pic_cpu.c index 7f1e4ab..06ae484 100644 --- a/hw/cris_pic_cpu.c +++ b/hw/cris_pic_cpu.c @@ -24,16 +24,10 @@ #include "sysbus.h" #include "hw.h" -#include "pc.h" #include "etraxfs.h" #define D(x) -void pic_info(Monitor *mon) -{} -void irq_info(Monitor *mon) -{} - static void cris_pic_cpu_handler(void *opaque, int irq, int level) { CPUState *env = (CPUState *)opaque; diff --git a/hw/etraxfs.h b/hw/etraxfs.h index 1554b0b..24e8fd8 100644 --- a/hw/etraxfs.h +++ b/hw/etraxfs.h @@ -22,6 +22,7 @@ * THE SOFTWARE. */ +#include "net.h" #include "etraxfs_dma.h" qemu_irq *cris_pic_init_cpu(CPUState *env); diff --git a/hw/lm32_pic.c b/hw/lm32_pic.c index 02941a7..8dd0050 100644 --- a/hw/lm32_pic.c +++ b/hw/lm32_pic.c @@ -39,7 +39,7 @@ struct LM32PicState { typedef struct LM32PicState LM32PicState; static LM32PicState *pic; -void pic_info(Monitor *mon) +void lm32_do_pic_info(Monitor *mon) { if (pic == NULL) { return; @@ -49,7 +49,7 @@ void pic_info(Monitor *mon) pic->im, pic->ip, pic->irq_state); } -void irq_info(Monitor *mon) +void lm32_irq_info(Monitor *mon) { int i; uint32_t count; diff --git a/hw/lm32_pic.h b/hw/lm32_pic.h index e6479b8..14456f3 100644 --- a/hw/lm32_pic.h +++ b/hw/lm32_pic.h @@ -8,4 +8,7 @@ uint32_t lm32_pic_get_im(DeviceState *d); void lm32_pic_set_ip(DeviceState *d, uint32_t ip); void lm32_pic_set_im(DeviceState *d, uint32_t im); +void lm32_do_pic_info(Monitor *mon); +void lm32_irq_info(Monitor *mon); + #endif /* QEMU_HW_LM32_PIC_H */ diff --git a/hw/microblaze_pic_cpu.c b/hw/microblaze_pic_cpu.c index 9ad48b4..8b5623c 100644 --- a/hw/microblaze_pic_cpu.c +++ b/hw/microblaze_pic_cpu.c @@ -23,16 +23,10 @@ */ #include "hw.h" -#include "pc.h" #include "microblaze_pic_cpu.h" #define D(x) -void pic_info(Monitor *mon) -{} -void irq_info(Monitor *mon) -{} - static void microblaze_pic_cpu_handler(void *opaque, int irq, int level) { CPUState *env = (CPUState *)opaque; diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index acbf026..778cffe 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -62,17 +62,6 @@ static VirtIOS390Bus *s390_bus; static CPUState **ipi_states; -void irq_info(Monitor *mon); -void pic_info(Monitor *mon); - -void irq_info(Monitor *mon) -{ -} - -void pic_info(Monitor *mon) -{ -} - CPUState *s390_cpu_addr2state(uint16_t cpu_addr) { if (cpu_addr >= smp_cpus) { diff --git a/hw/shix.c b/hw/shix.c index 638bf16..dbf4764 100644 --- a/hw/shix.c +++ b/hw/shix.c @@ -28,7 +28,6 @@ More information in target-sh4/README.sh4 */ #include "hw.h" -#include "pc.h" #include "sh.h" #include "sysemu.h" #include "boards.h" @@ -37,16 +36,6 @@ #define BIOS_FILENAME "shix_bios.bin" #define BIOS_ADDRESS 0xA0000000 -void irq_info(Monitor *mon) -{ - /* XXXXX */ -} - -void pic_info(Monitor *mon) -{ - /* XXXXX */ -} - static void shix_init(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, diff --git a/hw/sun4m.c b/hw/sun4m.c index dcaed38..71bf648 100644 --- a/hw/sun4m.c +++ b/hw/sun4m.c @@ -216,13 +216,13 @@ static void nvram_init(M48t59State *nvram, uint8_t *macaddr, static DeviceState *slavio_intctl; -void pic_info(Monitor *mon) +void sun4m_pic_info(Monitor *mon) { if (slavio_intctl) slavio_pic_info(mon, slavio_intctl); } -void irq_info(Monitor *mon) +void sun4m_irq_info(Monitor *mon) { if (slavio_intctl) slavio_irq_info(mon, slavio_intctl); diff --git a/hw/sun4m.h b/hw/sun4m.h index ce97ee5..504c3af 100644 --- a/hw/sun4m.h +++ b/hw/sun4m.h @@ -30,6 +30,10 @@ void slavio_irq_info(Monitor *mon, DeviceState *dev); void sun4c_pic_info(Monitor *mon, void *opaque); void sun4c_irq_info(Monitor *mon, void *opaque); +/* sun4m.c */ +void sun4m_pic_info(Monitor *mon); +void sun4m_irq_info(Monitor *mon); + /* sparc32_dma.c */ #include "sparc32_dma.h" diff --git a/hw/sun4u.c b/hw/sun4u.c index 88c633d..96fc3d0 100644 --- a/hw/sun4u.c +++ b/hw/sun4u.c @@ -243,14 +243,6 @@ static unsigned long sun4u_load_kernel(const char *kernel_filename, return kernel_size; } -void pic_info(Monitor *mon) -{ -} - -void irq_info(Monitor *mon) -{ -} - void cpu_check_irqs(CPUState *env) { uint32_t pil = env->pil_in | diff --git a/hw/xtensa_pic.c b/hw/xtensa_pic.c index e5085ea..aaf7fb9 100644 --- a/hw/xtensa_pic.c +++ b/hw/xtensa_pic.c @@ -26,19 +26,9 @@ */ #include "hw.h" -#include "pc.h" #include "qemu-log.h" #include "qemu-timer.h" -/* Stub functions for hardware that doesn't exist. */ -void pic_info(Monitor *mon) -{ -} - -void irq_info(Monitor *mon) -{ -} - void xtensa_advance_ccount(CPUState *env, uint32_t d) { uint32_t old_ccount = env->sregs[CCOUNT]; diff --git a/monitor.c b/monitor.c index 1a28956..ffda0fe 100644 --- a/monitor.c +++ b/monitor.c @@ -67,6 +67,12 @@ #include "qmp-commands.h" #include "hmp.h" +/* for pic/irq_info */ +#if defined(TARGET_SPARC) +#include "hw/sun4m.h" +#endif +#include "hw/lm32_pic.h" + //#define DEBUG //#define DEBUG_COMPLETION @@ -2798,20 +2804,35 @@ static const mon_cmd_t info_cmds[] = { .help = "show the command line history", .mhandler.info = do_info_history, }, +#if defined(TARGET_I386) || defined(TARGET_PPC) || defined(TARGET_MIPS) || \ + defined(TARGET_LM32) || (defined(TARGET_SPARC) && !defined(TARGET_SPARC64)) { .name = "irq", .args_type = "", .params = "", .help = "show the interrupts statistics (if available)", +#ifdef TARGET_SPARC + .mhandler.info = sun4m_irq_info, +#elif defined(TARGET_LM32) + .mhandler.info = lm32_irq_info, +#else .mhandler.info = irq_info, +#endif }, { .name = "pic", .args_type = "", .params = "", .help = "show i8259 (PIC) state", +#ifdef TARGET_SPARC + .mhandler.info = sun4m_pic_info, +#elif defined(TARGET_LM32) + .mhandler.info = lm32_do_pic_info, +#else .mhandler.info = pic_info, +#endif }, +#endif { .name = "pci", .args_type = "",