From: Bernhard Beschow <shentey@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Hervé Poussineau" <hpoussin@reactos.org>,
"open list:PReP" <qemu-ppc@nongnu.org>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 02/22] hw/rtc/m48t59-isa: QOM'ify IRQ number
Date: Tue, 22 Feb 2022 17:54:53 +0000 [thread overview]
Message-ID: <AFB7748C-3E94-4106-B27C-51B46B0BA826@gmail.com> (raw)
In-Reply-To: <CAFEAcA-MDH48sv6O5taVn=A8BMZHQWPJhkaTQ_YtTnLq3mgGdA@mail.gmail.com>
Am 22. Februar 2022 17:47:56 UTC schrieb Peter Maydell <peter.maydell@linaro.org>:
>On Tue, 22 Feb 2022 at 17:41, Bernhard Beschow <shentey@gmail.com> wrote:
>>
>> Exposing the IRQ number as a QOM property not only allows it to be
>> configurable but also to be printed by standard QOM mechanisms. This allows
>> isabus_dev_print() to be retired eventually.
>>
>> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
>> ---
>> hw/rtc/m48t59-isa.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/rtc/m48t59-isa.c b/hw/rtc/m48t59-isa.c
>> index dc21fb10a5..d1c1d789a5 100644
>> --- a/hw/rtc/m48t59-isa.c
>> +++ b/hw/rtc/m48t59-isa.c
>> @@ -42,6 +42,7 @@ struct M48txxISAState {
>> ISADevice parent_obj;
>> M48t59State state;
>> uint32_t io_base;
>> + uint32_t isairq;
>> MemoryRegion io;
>> };
>>
>> @@ -79,6 +80,7 @@ static void m48txx_isa_toggle_lock(Nvram *obj, int lock)
>> static Property m48t59_isa_properties[] = {
>> DEFINE_PROP_INT32("base-year", M48txxISAState, state.base_year, 0),
>> DEFINE_PROP_UINT32("iobase", M48txxISAState, io_base, 0x74),
>> + DEFINE_PROP_UINT32("irq", M48txxISAState, isairq, 8),
>> DEFINE_PROP_END_OF_LIST(),
>> };
>>
>> @@ -99,7 +101,7 @@ static void m48t59_isa_realize(DeviceState *dev, Error **errp)
>>
>> s->model = u->info.model;
>> s->size = u->info.size;
>> - isa_init_irq(isadev, &s->IRQ, 8);
>> + isa_init_irq(isadev, &s->IRQ, d->isairq);
>> m48t59_realize_common(s, errp);
>> memory_region_init_io(&d->io, OBJECT(dev), &m48t59_io_ops, s, "m48t59", 4);
>> if (d->io_base != 0) {
>> --
>> 2.35.1
>
>If the user creates the device specifying irq=16 then isa_init_irq()
>will assert. Since these devices are creatable by users on the
>commandline, I think the realize method should check that the
>property value is in range (d->isairq < ISA_NUM_IRQS), and report
>a suitable error back if not.
Ah, I missed that! Thanks for pointing out, I will fix it.
Regards,
Bernhard
>
>thanks
>-- PMM
next prev parent reply other threads:[~2022-02-22 17:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 17:37 [PATCH 00/22] isa: Resolve unneeded IRQ attributes from ISADevice Bernhard Beschow
2022-02-22 17:37 ` [PATCH 01/22] hw/rtc/mc146818rtc: QOM'ify IRQ number Bernhard Beschow
2022-02-22 17:37 ` [PATCH 02/22] hw/rtc/m48t59-isa: " Bernhard Beschow
2022-02-22 17:47 ` Peter Maydell
2022-02-22 17:54 ` Bernhard Beschow [this message]
2022-02-22 17:38 ` [PATCH 03/22] hw/input/pckbd: QOM'ify IRQ numbers Bernhard Beschow
2022-02-22 17:38 ` [PATCH 04/22] hw/isa/isa-bus: Remove isabus_dev_print() Bernhard Beschow
2022-02-22 17:38 ` [PATCH 05/22] hw/ppc/pnv: Determine ns16550's IRQ number from QOM property Bernhard Beschow
2022-02-22 17:38 ` [PATCH 06/22] isa: Drop unused attributes from ISADevice Bernhard Beschow
2022-02-22 17:38 ` [PATCH 07/22] hw/audio/cs4231a: Disuse isa_init_irq() Bernhard Beschow
2022-02-22 17:38 ` [PATCH 08/22] hw/audio/gus: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 09/22] hw/audio/sb16: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 10/22] hw/block/fdc-isa: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 11/22] hw/char/parallel: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 12/22] hw/char/serial-isa: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 13/22] hw/ide/isa: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 14/22] hw/input/pckbd: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 15/22] hw/ipmi/isa_ipmi_bt: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 16/22] hw/ipmi/isa_ipmi_kcs: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 17/22] hw/isa/piix4: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 18/22] hw/net/ne2000-isa: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 19/22] hw/rtc/m48t59-isa: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 20/22] hw/tpm/tpm_tis_isa: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 21/22] hw/isa/isa-bus: " Bernhard Beschow
2022-02-22 17:38 ` [PATCH 22/22] isa: Remove unused isa_init_irq() Bernhard Beschow
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=AFB7748C-3E94-4106-B27C-51B46B0BA826@gmail.com \
--to=shentey@gmail.com \
--cc=hpoussin@reactos.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).