From: Matt Parker <mtparkr@gmail.com>
To: "open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] audio: intel-hda: do not use old_mmio accesses
Date: Wed, 23 Aug 2017 21:13:59 +0100 [thread overview]
Message-ID: <CAOOZdTgBfYoCxYZd0RTxcDsVb5kLDAvL1iLA14S2+0DHsA-jag@mail.gmail.com> (raw)
In-Reply-To: <20170823193703.10808-1-mtparkr@gmail.com>
I've just noticed the suggested changes from the v1 patch regarding
using MAKE_64BIT_MASK.
This patch is can be ignored for now.
On 23 August 2017 at 20:37, Matt Parker <mtparkr@gmail.com> wrote:
> intel-hda is currently using the old_mmio accessors for io.
> This updates the device to use .read and .write accessors instead.
>
> Signed-off-by: Matt Parker <mtparkr@gmail.com>
> ---
> hw/audio/intel-hda.c | 57 +++++++++-------------------------------------------
> 1 file changed, 10 insertions(+), 47 deletions(-)
>
> diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c
> index 06acc98f7b..95e3e460fb 100644
> --- a/hw/audio/intel-hda.c
> +++ b/hw/audio/intel-hda.c
> @@ -1043,66 +1043,29 @@ static void intel_hda_regs_reset(IntelHDAState *d)
>
> /* --------------------------------------------------------------------- */
>
> -static void intel_hda_mmio_writeb(void *opaque, hwaddr addr, uint32_t val)
> +static void intel_hda_mmio_write(void *opaque, hwaddr addr, uint64_t val,
> + unsigned size)
> {
> IntelHDAState *d = opaque;
> const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
>
> - intel_hda_reg_write(d, reg, val, 0xff);
> + intel_hda_reg_write(d, reg, val, (1UL << (size * 8)) - 1);
> }
>
> -static void intel_hda_mmio_writew(void *opaque, hwaddr addr, uint32_t val)
> +static uint64_t intel_hda_mmio_read(void *opaque, hwaddr addr, unsigned size)
> {
> IntelHDAState *d = opaque;
> const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
>
> - intel_hda_reg_write(d, reg, val, 0xffff);
> -}
> -
> -static void intel_hda_mmio_writel(void *opaque, hwaddr addr, uint32_t val)
> -{
> - IntelHDAState *d = opaque;
> - const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
> -
> - intel_hda_reg_write(d, reg, val, 0xffffffff);
> -}
> -
> -static uint32_t intel_hda_mmio_readb(void *opaque, hwaddr addr)
> -{
> - IntelHDAState *d = opaque;
> - const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
> -
> - return intel_hda_reg_read(d, reg, 0xff);
> -}
> -
> -static uint32_t intel_hda_mmio_readw(void *opaque, hwaddr addr)
> -{
> - IntelHDAState *d = opaque;
> - const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
> -
> - return intel_hda_reg_read(d, reg, 0xffff);
> -}
> -
> -static uint32_t intel_hda_mmio_readl(void *opaque, hwaddr addr)
> -{
> - IntelHDAState *d = opaque;
> - const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
> -
> - return intel_hda_reg_read(d, reg, 0xffffffff);
> + return intel_hda_reg_read(d, reg, (1UL << (size * 8)) - 1);
> }
>
> static const MemoryRegionOps intel_hda_mmio_ops = {
> - .old_mmio = {
> - .read = {
> - intel_hda_mmio_readb,
> - intel_hda_mmio_readw,
> - intel_hda_mmio_readl,
> - },
> - .write = {
> - intel_hda_mmio_writeb,
> - intel_hda_mmio_writew,
> - intel_hda_mmio_writel,
> - },
> + .read = intel_hda_mmio_read,
> + .write = intel_hda_mmio_write,
> + .impl = {
> + .min_access_size = 1,
> + .max_access_size = 4,
> },
> .endianness = DEVICE_NATIVE_ENDIAN,
> };
> --
> 2.13.2
>
next prev parent reply other threads:[~2017-08-23 20:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-23 19:37 [Qemu-devel] [PATCH v2] audio: intel-hda: do not use old_mmio accesses Matt Parker
2017-08-23 20:13 ` Matt Parker [this message]
2017-08-24 8:15 ` 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=CAOOZdTgBfYoCxYZd0RTxcDsVb5kLDAvL1iLA14S2+0DHsA-jag@mail.gmail.com \
--to=mtparkr@gmail.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).