From: Anthony Liguori <anthony@codemonkey.ws>
To: malc <av1474@comtv.ru>
Cc: Michael Tsirkin <mstirkin@redhat.com>,
qemu-devel@nongnu.org, Alex Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH 07/15] ac97: convert to new PCI API
Date: Tue, 09 Feb 2010 16:52:28 -0600 [thread overview]
Message-ID: <4B71E72C.8050702@codemonkey.ws> (raw)
In-Reply-To: <alpine.LNX.2.00.1002100143480.14423@linmac>
On 02/09/2010 04:45 PM, malc wrote:
> On Tue, 9 Feb 2010, Anthony Liguori wrote:
>
>
>> - fixed bug with size of registered ioport regions
>>
>> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
>> ---
>> hw/ac97.c | 146 +++++++++++++++++++++++++------------------------------------
>> 1 files changed, 60 insertions(+), 86 deletions(-)
>>
>> diff --git a/hw/ac97.c b/hw/ac97.c
>> index 4319bc8..9fdf591 100644
>> --- a/hw/ac97.c
>> +++ b/hw/ac97.c
>> @@ -223,7 +223,7 @@ static void fetch_bd (AC97LinkState *s, AC97BusMasterRegs *r)
>> {
>> uint8_t b[8];
>>
>> - cpu_physical_memory_read (r->bdbar + r->civ * 8, b, 8);
>> + pci_memory_read (&s->dev, r->bdbar + r->civ * 8, b, 8);
>> r->bd_valid = 1;
>> r->bd.addr = le32_to_cpu (*(uint32_t *)&b[0])& ~3;
>> r->bd.ctl_len = le32_to_cpu (*(uint32_t *)&b[4]);
>> @@ -569,50 +569,35 @@ static void mixer_reset (AC97LinkState *s)
>>
>> /**
>> * Native audio mixer
>> - * I/O Reads
>> */
>> -static uint32_t nam_readb (void *opaque, uint32_t addr)
>> -{
>> - AC97LinkState *s = opaque;
>> - dolog ("U nam readb %#x\n", addr);
>> - s->cas = 0;
>> - return ~0U;
>> -}
>>
>> -static uint32_t nam_readw (void *opaque, uint32_t addr)
>> +static uint32_t nam_read (PCIDevice *dev, pcibus_t addr, int size)
>> {
>> - AC97LinkState *s = opaque;
>> - uint32_t val = ~0U;
>> - uint32_t index = addr - s->base[0];
>> - s->cas = 0;
>> - val = mixer_load (s, index);
>> - return val;
>> -}
>> + AC97LinkState *s = DO_UPCAST (AC97LinkState, dev, dev);
>> + uint32_t value;
>> +
>> + if (size == 2) {
>> + value = mixer_load (s, addr);
>> + } else {
>> + dolog ("U nam read[%d] %#" FMT_PCIBUS "\n", size, addr);
>> + s->cas = 0;
>> + value = ~0U;
>> + }
>>
>>
> Yeah right, and then PCI SIG adds qword accessors and all hell breaks
> loose, this interface sucks..
>
We already have this problem with the current interface.
The options to address would be to always return/accept a uint64_t or to
deal with a void *. The later interface has non-obvious byte order
semantics.
I avoided the former to avoid complaints about possibly introducing a
performance regression with passing larger data types. I don't believe
that it would be a problem though.
Regards,
Anthony Liguori
> [..snip..]
>
>
next prev parent reply other threads:[~2010-02-09 22:52 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-09 22:01 [Qemu-devel] [PATCH 0/15][RFC] New PCI interfaces Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 01/15] pci: add new bus functions Anthony Liguori
2010-02-10 8:09 ` Isaku Yamahata
2010-02-10 8:57 ` [Qemu-devel] " Michael S. Tsirkin
2010-02-09 22:01 ` [Qemu-devel] [PATCH 02/15] rtl8139: convert to new PCI interfaces Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 03/15] lsi53c895a: convert to new pci interfaces Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 04/15] e1000: convert to new pci interface Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 05/15] wdt_i6300esb: fix io type leakage Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 06/15] wdt_i6300esb: convert to new pci inteface Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 07/15] ac97: convert to new PCI API Anthony Liguori
2010-02-09 22:45 ` malc
2010-02-09 22:52 ` Anthony Liguori [this message]
2010-02-09 23:06 ` malc
2010-02-09 23:10 ` Anthony Liguori
2010-02-09 23:36 ` malc
2010-02-09 23:52 ` Anthony Liguori
2010-02-10 0:24 ` malc
2010-02-11 14:20 ` Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 08/15] es1370: convert to new pci interface Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 09/15] eepro100: " Anthony Liguori
2010-02-10 6:32 ` Stefan Weil
2010-02-10 9:49 ` [Qemu-devel] " Michael S. Tsirkin
2010-02-10 10:43 ` Markus Armbruster
2010-02-10 10:48 ` Michael S. Tsirkin
2010-02-10 14:13 ` [Qemu-devel] " Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 10/15] virtio-pci: " Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 11/15] pci: add pci_register_msix_region Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 12/15] ne2000: convert to new pci interface Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 13/15] pcnet: " Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 14/15] usb-uhci: " Anthony Liguori
2010-02-09 22:01 ` [Qemu-devel] [PATCH 15/15] pci: byte swap as PCI interface layer Anthony Liguori
2010-02-10 9:31 ` [Qemu-devel] Re: [PATCH 0/15][RFC] New PCI interfaces Michael S. Tsirkin
2010-02-10 18:34 ` [Qemu-devel] " Blue Swirl
2010-02-10 19:29 ` Anthony Liguori
2010-02-10 20:41 ` Richard Henderson
2010-02-10 21:13 ` Anthony Liguori
2010-02-12 17:40 ` Blue Swirl
2010-03-01 2:51 ` Paul Brook
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=4B71E72C.8050702@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=agraf@suse.de \
--cc=av1474@comtv.ru \
--cc=mstirkin@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 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).