All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	qemu-block@nongnu.org,
	"Stefan Berger" <stefanb@linux.vnet.ibm.com>,
	qemu-trivial@nongnu.org,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Corey Minyard" <minyard@acm.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"John Snow" <jsnow@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Max Reitz" <mreitz@redhat.com>,
	qemu-ppc@nongnu.org, "Igor Mammedov" <imammedo@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PATCH 06/10] hw/isa: Add the ISA_IRQ_PAR_DEFAULT definition
Date: Sun, 11 Oct 2020 21:32:25 +0200	[thread overview]
Message-ID: <20201011193229.3210774-7-f4bug@amsat.org> (raw)
In-Reply-To: <20201011193229.3210774-1-f4bug@amsat.org>

The parallel port uses IRQ #7 by default. Add this
default definition to the IsaIrqNumber enum.

Avoid magic values in the code, replace them by the
newly introduced definition.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/isa/isa.h | 1 +
 hw/char/parallel.c   | 2 +-
 hw/sparc64/sun4u.c   | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h
index 214a6730598..081fa446152 100644
--- a/include/hw/isa/isa.h
+++ b/include/hw/isa/isa.h
@@ -13,6 +13,7 @@ enum IsaIrqNumber {
     ISA_IRQ_SER_DEFAULT =  4,
     ISA_IRQ_TPM_DEFAULT =  5,
     ISA_IRQ_FDC_DEFAULT =  6,
+    ISA_IRQ_PAR_DEFAULT =  7,
     ISA_NUM_IRQS        = 16
 };
 
diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index 8b418abf719..9e0d80ec0d0 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -636,7 +636,7 @@ bool parallel_mm_init(MemoryRegion *address_space,
 static Property parallel_isa_properties[] = {
     DEFINE_PROP_UINT32("index", ISAParallelState, index,   -1),
     DEFINE_PROP_UINT32("iobase", ISAParallelState, iobase,  -1),
-    DEFINE_PROP_UINT32("irq",   ISAParallelState, isairq,  7),
+    DEFINE_PROP_UINT32("irq",   ISAParallelState, isairq,  ISA_IRQ_PAR_DEFAULT),
     DEFINE_PROP_CHR("chardev",  ISAParallelState, state.chr),
     DEFINE_PROP_END_OF_LIST(),
 };
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index 458dc215e6f..c5b3e838ac2 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -611,7 +611,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
     pci_realize_and_unref(ebus, pci_busA, &error_fatal);
 
     /* Wire up "well-known" ISA IRQs to PBM legacy obio IRQs */
-    qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", 7,
+    qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_PAR_DEFAULT,
         qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_LPT_IRQ));
     qdev_connect_gpio_out_named(DEVICE(ebus), "isa-irq", ISA_IRQ_FDC_DEFAULT,
         qdev_get_gpio_in_named(DEVICE(sabre), "pbm-irq", OBIO_FDD_IRQ));
-- 
2.26.2



  parent reply	other threads:[~2020-10-11 19:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 19:32 [PATCH 00/10] hw/isa: Introduce definitions for default IRQ values Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 01/10] hw/isa: Introduce IsaIrqNumber enum Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 02/10] hw/isa: Add the ISA_IRQ_KBD_DEFAULT definition Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 03/10] hw/isa: Add the ISA_IRQ_SER_DEFAULT definition Philippe Mathieu-Daudé
2020-10-13  7:14   ` Gerd Hoffmann
2020-10-11 19:32 ` [PATCH 04/10] hw/isa: Add the ISA_IRQ_TPM_DEFAULT definition Philippe Mathieu-Daudé
2020-10-11 20:28   ` Stefan Berger
2020-10-11 21:07     ` Philippe Mathieu-Daudé
2020-10-13  7:20   ` Gerd Hoffmann
2020-10-13  8:26     ` Philippe Mathieu-Daudé
2020-10-13 14:23       ` Stefan Berger
2020-10-11 19:32 ` [PATCH 05/10] hw/isa: Add the ISA_IRQ_FDC_DEFAULT definition Philippe Mathieu-Daudé
2020-10-12 14:17   ` John Snow
2020-10-11 19:32 ` Philippe Mathieu-Daudé [this message]
2020-10-11 19:32 ` [PATCH 07/10] hw/isa: Add the ISA_IRQ_RTC_DEFAULT definition Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 08/10] hw/isa: Add the ISA_IRQ_NET_DEFAULT definition Philippe Mathieu-Daudé
2020-10-13  7:23   ` Gerd Hoffmann
2020-10-13  8:27     ` Philippe Mathieu-Daudé
2020-10-13 14:20     ` Stefan Berger
2020-10-11 19:32 ` [PATCH 09/10] hw/isa: Add the ISA_IRQ_MOU_DEFAULT definition Philippe Mathieu-Daudé
2020-10-11 19:32 ` [PATCH 10/10] hw/isa: Add the ISA_IRQ_IDE_DEFAULT definition Philippe Mathieu-Daudé
2020-10-12 14:16   ` John Snow
2020-10-13  7:25   ` Gerd Hoffmann

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=20201011193229.3210774-7-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=ehabkost@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=imammedo@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=minyard@acm.org \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanb@linux.vnet.ibm.com \
    --cc=thuth@redhat.com \
    /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.