qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: plagnioj@jcrosoft.com, qemu-devel@nongnu.org, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH 1/1] IBM PowerPC 4xx 32-bit PCI controller emulation
Date: Tue, 02 Dec 2008 14:43:38 -0600	[thread overview]
Message-ID: <1228250618.8128.24.camel@localhost.localdomain> (raw)
In-Reply-To: <49359908.5040407@codemonkey.ws>

On Tue, 2008-12-02 at 14:22 -0600, Anthony Liguori wrote:
> Hollis Blanchard wrote:
> 
> > +#include "pci.h"
> > +#include "pci_host.h"
> > +#include "bswap.h"
> > +
> > +#undef DEBUG
> > +#ifdef DEBUG
> > +#define DPRINTF(fmt, args...) do { printf(fmt, ##args); } while (0)
> > +#else
> > +#define DPRINTF(fmt, args...)
> > +#endif /* DEBUG */
> >   
> 
> This is a GCC-ism that's deprecated.  The proper syntax (C99) is:
> 
> #define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)

Will do.

> > +struct ppc4xx_pci_t {
> > +    struct pci_master_map pmm[PPC44x_PCI_NR_PMMS];
> > +    struct pci_target_map ptm[PPC44x_PCI_NR_PTMS];
> > +
> > +    PCIHostState pci_state;
> > +};
> > +typedef struct ppc4xx_pci_t ppc4xx_pci_t;
> >   
> 
> It would be better to use QEMU style type naming.

I copied this style from ppc405_uc.c, but I will ChangeItLikeThis.

> > +static void pci4xx_cfgaddr_writel(void *opaque, target_phys_addr_t addr,
> > +                                  uint32_t value)
> > +{
> > +    ppc4xx_pci_t *ppc4xx_pci = opaque;
> > +
> > +#ifdef TARGET_WORDS_BIGENDIAN
> > +    value = bswap32(value);
> > +#endif
> >
> >   
> 
> Is this byte swapping correct?

I hate this byte swapping, because as we've discussed at great length in
the past, "TARGET_WORDS_BIGENDIAN" never should have existed.

That said, as far as I can tell it is correct for the current state of
qemu. I changed it to this style due to Aurelien's previous request. As
I noted in the patch description, I can only test on
big-endian/big-endian guest/host.

> > +
> > +    /* XXX register_savevm() */
> >   
> 
> Should be easy enough to add a register_savevm() function, no?

It should be, but since exactly 0 other PPC 4xx devices implement this,
I won't be able to test it. Should I implement it and leave a comment in
there that says "untested"?

-- 
Hollis Blanchard
IBM Linux Technology Center

  reply	other threads:[~2008-12-02 20:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26 19:22 [Qemu-devel] [PATCH] IBM PowerPC 4xx 32-bit PCI controller emulation Hollis Blanchard
2008-12-01 16:13 ` [Qemu-devel] " Hollis Blanchard
2008-12-01 18:15 ` [Qemu-devel] " Blue Swirl
2008-12-01 19:17   ` Hollis Blanchard
2008-12-01 19:59   ` Hollis Blanchard
2008-12-01 20:51     ` Blue Swirl
2008-12-02 20:02   ` [Qemu-devel] [PATCH 1/1] " Hollis Blanchard
2008-12-02 20:22     ` Anthony Liguori
2008-12-02 20:43       ` Hollis Blanchard [this message]
2008-12-02 22:13         ` Aurelien Jarno
2008-12-02 21:30       ` [Qemu-devel] [PATCH] [v3] " Hollis Blanchard
2008-12-02 22:01         ` Anthony Liguori
2008-12-02 23:53         ` Aurelien Jarno

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=1228250618.8128.24.camel@localhost.localdomain \
    --to=hollisb@us.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=aurelien@aurel32.net \
    --cc=plagnioj@jcrosoft.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 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).