From: Alexander Graf <agraf@suse.de>
To: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 3/9] intel-hda: use specific endian ld/st_phys
Date: Tue, 5 Jul 2011 18:28:04 +0200 [thread overview]
Message-ID: <1309883290-17595-4-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1309883290-17595-1-git-send-email-agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
hw/intel-hda.c | 21 ++++-----------------
1 files changed, 4 insertions(+), 17 deletions(-)
diff --git a/hw/intel-hda.c b/hw/intel-hda.c
index 0ffffce..5a2bc3a 100644
--- a/hw/intel-hda.c
+++ b/hw/intel-hda.c
@@ -224,19 +224,6 @@ static target_phys_addr_t intel_hda_addr(uint32_t lbase, uint32_t ubase)
return addr;
}
-static void stl_phys_le(target_phys_addr_t addr, uint32_t value)
-{
- uint32_t value_le = cpu_to_le32(value);
- cpu_physical_memory_write(addr, (uint8_t*)(&value_le), sizeof(value_le));
-}
-
-static uint32_t ldl_phys_le(target_phys_addr_t addr)
-{
- uint32_t value_le;
- cpu_physical_memory_read(addr, (uint8_t*)(&value_le), sizeof(value_le));
- return le32_to_cpu(value_le);
-}
-
static void intel_hda_update_int_sts(IntelHDAState *d)
{
uint32_t sts = 0;
@@ -341,7 +328,7 @@ static void intel_hda_corb_run(IntelHDAState *d)
rp = (d->corb_rp + 1) & 0xff;
addr = intel_hda_addr(d->corb_lbase, d->corb_ubase);
- verb = ldl_phys_le(addr + 4*rp);
+ verb = ldl_le_phys(addr + 4*rp);
d->corb_rp = rp;
dprint(d, 2, "%s: [rp 0x%x] verb 0x%08x\n", __FUNCTION__, rp, verb);
@@ -373,8 +360,8 @@ static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t res
ex = (solicited ? 0 : (1 << 4)) | dev->cad;
wp = (d->rirb_wp + 1) & 0xff;
addr = intel_hda_addr(d->rirb_lbase, d->rirb_ubase);
- stl_phys_le(addr + 8*wp, response);
- stl_phys_le(addr + 8*wp + 4, ex);
+ stl_le_phys(addr + 8*wp, response);
+ stl_le_phys(addr + 8*wp + 4, ex);
d->rirb_wp = wp;
dprint(d, 2, "%s: [wp 0x%x] response 0x%x, extra 0x%x\n",
@@ -461,7 +448,7 @@ static bool intel_hda_xfer(HDACodecDevice *dev, uint32_t stnr, bool output,
}
if (d->dp_lbase & 0x01) {
addr = intel_hda_addr(d->dp_lbase & ~0x01, d->dp_ubase);
- stl_phys_le(addr + 8*s, st->lpib);
+ stl_le_phys(addr + 8*s, st->lpib);
}
dprint(d, 3, "dma: --\n");
--
1.7.3.4
next prev parent reply other threads:[~2011-07-05 16:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 16:28 [Qemu-devel] [PATCH 0/9] Don't use ld./st._phys in hw/ Alexander Graf
2011-07-05 16:28 ` [Qemu-devel] [PATCH 1/9] exec: add endian specific phys ld/st functions Alexander Graf
2011-07-05 21:48 ` Blue Swirl
2011-07-05 21:55 ` Alexander Graf
2011-07-05 22:05 ` Blue Swirl
2011-07-05 22:13 ` Alexander Graf
2011-07-05 22:22 ` Blue Swirl
2011-07-05 22:40 ` Alexander Graf
2011-07-06 10:24 ` Paolo Bonzini
2011-07-06 11:34 ` Alexander Graf
2011-07-06 13:03 ` Hannes Reinecke
2011-07-06 13:18 ` Alexander Graf
2011-07-06 13:30 ` Paolo Bonzini
2011-07-05 16:28 ` [Qemu-devel] [PATCH 2/9] hpet: use specific endian ld/st_phys Alexander Graf
2011-07-05 16:28 ` Alexander Graf [this message]
2011-07-05 16:28 ` [Qemu-devel] [PATCH 4/9] msi: " Alexander Graf
2011-07-05 16:28 ` [Qemu-devel] [PATCH 5/9] msix: " Alexander Graf
2011-07-05 16:28 ` [Qemu-devel] [PATCH 6/9] pl080: " Alexander Graf
2011-07-12 20:46 ` Peter Maydell
2011-07-05 16:28 ` [Qemu-devel] [PATCH 7/9] ppc405_uc: " Alexander Graf
2011-07-05 16:28 ` [Qemu-devel] [PATCH 8/9] s390-virtio: " Alexander Graf
2011-07-05 16:28 ` [Qemu-devel] [PATCH 9/9] spapr: " Alexander Graf
2011-07-05 21:53 ` [Qemu-devel] [PATCH 0/9] Don't use ld./st._phys in hw/ Blue Swirl
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=1309883290-17595-4-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--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).