All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 4/5] serial: convert isa to qdev
Date: Fri, 18 Sep 2009 17:04:38 +0200	[thread overview]
Message-ID: <877hvw47ll.fsf@pike.pond.sub.org> (raw)
In-Reply-To: <1253132744-10492-5-git-send-email-kraxel@redhat.com> (Gerd Hoffmann's message of "Wed\, 16 Sep 2009 22\:25\:43 +0200")

Gerd Hoffmann <kraxel@redhat.com> writes:

> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/mips_malta.c |    4 +-
>  hw/mips_r4k.c   |    6 +---
>  hw/pc.c         |    6 +---
>  hw/pc.h         |    1 +
>  hw/ppc_prep.c   |    3 +-
>  hw/serial.c     |   77 +++++++++++++++++++++++++++++++++++++++++++++++-------
>  hw/sun4u.c      |    6 +---
>  7 files changed, 75 insertions(+), 28 deletions(-)

Stupid question: how did you figure out which serials are ISA?

[...]
> diff --git a/hw/pc.h b/hw/pc.h
> index c9cdd4a..b547d17 100644
> --- a/hw/pc.h
> +++ b/hw/pc.h
> @@ -12,6 +12,7 @@ SerialState *serial_init(int base, qemu_irq irq, int baudbase,
>  SerialState *serial_mm_init (target_phys_addr_t base, int it_shift,
>                               qemu_irq irq, int baudbase,
>                               CharDriverState *chr, int ioregister);
> +SerialState *serial_isa_init(int index, CharDriverState *chr);
>  
>  /* parallel.c */
>  
> diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
> index 32f987c..3f57cbb 100644
> --- a/hw/ppc_prep.c
> +++ b/hw/ppc_prep.c
> @@ -684,7 +684,8 @@ static void ppc_prep_init (ram_addr_t ram_size,
>      //    pit = pit_init(0x40, i8259[0]);
>      rtc_init(2000);
>  
> -    serial_init(0x3f8, i8259[4], 115200, serial_hds[0]);
> +    if (serial_hds[0])
> +        serial_isa_init(0, serial_hds[0]);
>      nb_nics1 = nb_nics;
>      if (nb_nics1 > NE2000_NB_MAX)
>          nb_nics1 = NE2000_NB_MAX;

Why the new conditional?  Bug fix perhaps?

> diff --git a/hw/serial.c b/hw/serial.c
> index 1f4ce77..81021e9 100644
> --- a/hw/serial.c
> +++ b/hw/serial.c
[...]
> @@ -733,7 +735,37 @@ static void serial_init_core(SerialState *s, qemu_irq irq, int baudbase,
>                            serial_event, s);
>  }
>  
> -/* If fd is zero, it means that the serial device uses the console */
> +static int serial_isa_initfn(ISADevice *dev)
> +{
> +    ISASerialState *isa = DO_UPCAST(ISASerialState, dev, dev);
> +    SerialState *s = &isa->state;
> +
> +    s->baudbase = 115200;

The initial baudbase.  Used to be defined as argument to serial_init(),
but all arguments were 115200.  Okay.

> +    isa_init_irq(dev, &s->irq, isa->isairq);
> +    serial_init_core(s);
> +    vmstate_register(isa->iobase, &vmstate_serial, s);
> +
> +    register_ioport_write(isa->iobase, 8, 1, serial_ioport_write, s);
> +    register_ioport_read(isa->iobase, 8, 1, serial_ioport_read, s);
> +    return 0;
> +}
> +
[...]

  reply	other threads:[~2009-09-18 15:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-16 20:25 [Qemu-devel] [PATCH 0/5] isa: more qdev conversions Gerd Hoffmann
2009-09-16 20:25 ` [Qemu-devel] [PATCH 1/5] floppy: add drive properties Gerd Hoffmann
2009-09-18 14:34   ` Markus Armbruster
2009-09-16 20:25 ` [Qemu-devel] [PATCH 2/5] floppy: move dma setup + drive connect to fdctrl_init_common() Gerd Hoffmann
2009-09-18 14:48   ` Markus Armbruster
2009-09-18 14:58     ` Gerd Hoffmann
2009-09-16 20:25 ` [Qemu-devel] [PATCH 3/5] qdev: don't crash on unset drive properties Gerd Hoffmann
2009-09-16 20:25 ` [Qemu-devel] [PATCH 4/5] serial: convert isa to qdev Gerd Hoffmann
2009-09-18 15:04   ` Markus Armbruster [this message]
2009-09-18 15:18     ` Gerd Hoffmann
2009-09-16 20:25 ` [Qemu-devel] [PATCH 5/5] parallel: " Gerd Hoffmann
2009-09-18 15:10   ` Markus Armbruster
2009-09-18 15:11 ` [Qemu-devel] [PATCH 0/5] isa: more qdev conversions Markus Armbruster
  -- strict thread matches above, loose matches on Subject: below --
2009-09-22 11:53 Gerd Hoffmann
2009-09-22 11:53 ` [Qemu-devel] [PATCH 4/5] serial: convert isa to qdev Gerd Hoffmann
2009-09-23 20:42   ` Markus Armbruster

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=877hvw47ll.fsf@pike.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --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.