From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5863] More consistent PAGE_xxx defines, avoid conflicting with system PAGE_xxx
Date: Wed, 03 Dec 2008 16:29:48 +0000 [thread overview]
Message-ID: <E1L7ubk-0004UP-CV@cvs.savannah.gnu.org> (raw)
Revision: 5863
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5863
Author: blueswir1
Date: 2008-12-03 16:29:47 +0000 (Wed, 03 Dec 2008)
Log Message:
-----------
More consistent PAGE_xxx defines, avoid conflicting with system PAGE_xxx
Modified Paths:
--------------
trunk/hw/iommu.c
Modified: trunk/hw/iommu.c
===================================================================
--- trunk/hw/iommu.c 2008-12-02 23:53:50 UTC (rev 5862)
+++ trunk/hw/iommu.c 2008-12-03 16:29:47 UTC (rev 5863)
@@ -109,9 +109,9 @@
#define IOPTE_VALID 0x00000002 /* IOPTE is valid */
#define IOPTE_WAZ 0x00000001 /* Write as zeros */
-#define PAGE_SHIFT 12
-#define PAGE_SIZE (1 << PAGE_SHIFT)
-#define PAGE_MASK (PAGE_SIZE - 1)
+#define IOMMU_PAGE_SHIFT 12
+#define IOMMU_PAGE_SIZE (1 << IOMMU_PAGE_SHIFT)
+#define IOMMU_PAGE_MASK ~(IOMMU_PAGE_SIZE - 1)
typedef struct IOMMUState {
uint32_t regs[IOMMU_NREGS];
@@ -242,7 +242,7 @@
iopte = s->regs[IOMMU_BASE] << 4;
addr &= ~s->iostart;
- iopte += (addr >> (PAGE_SHIFT - 2)) & ~3;
+ iopte += (addr >> (IOMMU_PAGE_SHIFT - 2)) & ~3;
cpu_physical_memory_read(iopte, (uint8_t *)&ret, 4);
tswap32s(&ret);
DPRINTF("get flags addr " TARGET_FMT_plx " => pte " TARGET_FMT_plx
@@ -258,7 +258,7 @@
target_phys_addr_t pa;
tmppte = pte;
- pa = ((pte & IOPTE_PAGE) << 4) + (addr & PAGE_MASK);
+ pa = ((pte & IOPTE_PAGE) << 4) + (addr & ~IOMMU_PAGE_MASK);
DPRINTF("xlate dva " TARGET_FMT_plx " => pa " TARGET_FMT_plx
" (iopte = %x)\n", addr, pa, tmppte);
@@ -285,8 +285,8 @@
target_phys_addr_t page, phys_addr;
while (len > 0) {
- page = addr & TARGET_PAGE_MASK;
- l = (page + TARGET_PAGE_SIZE) - addr;
+ page = addr & IOMMU_PAGE_MASK;
+ l = (page + IOMMU_PAGE_SIZE) - addr;
if (l > len)
l = len;
flags = iommu_page_get_flags(opaque, page);
reply other threads:[~2008-12-03 16:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1L7ubk-0004UP-CV@cvs.savannah.gnu.org \
--to=blauwirbel@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).