aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/memory.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-01-06 08:20:11 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-01-06 08:20:11 +0000
commitc65d37be54debe7d43d9fba62d2c146d95155fbb (patch)
tree1b5400d746b562864bedc15e69eeaf0e970f05d8 /xen/common/memory.c
parentbf3f5a47a09bfac278c08679bd142869e55df19d (diff)
downloadxen-c65d37be54debe7d43d9fba62d2c146d95155fbb.tar.gz
xen-c65d37be54debe7d43d9fba62d2c146d95155fbb.tar.bz2
xen-c65d37be54debe7d43d9fba62d2c146d95155fbb.zip
[IA64] Fix ia64 build
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Diffstat (limited to 'xen/common/memory.c')
-rw-r--r--xen/common/memory.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/xen/common/memory.c b/xen/common/memory.c
index acd131e994..329483756a 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -22,7 +22,9 @@
#include <xen/tmem.h>
#include <asm/current.h>
#include <asm/hardirq.h>
-#include <asm/p2m.h>
+#ifdef CONFIG_X86
+# include <asm/p2m.h>
+#endif
#include <xen/numa.h>
#include <public/memory.h>
#include <xsm/xsm.h>
@@ -152,10 +154,16 @@ out:
int guest_remove_page(struct domain *d, unsigned long gmfn)
{
struct page_info *page;
+#ifdef CONFIG_X86
p2m_type_t p2mt;
+#endif
unsigned long mfn;
+#ifdef CONFIG_X86
mfn = mfn_x(gfn_to_mfn(d, gmfn, &p2mt));
+#else
+ mfn = gmfn_to_mfn(d, gmfn);
+#endif
if ( unlikely(!mfn_valid(mfn)) )
{
gdprintk(XENLOG_INFO, "Domain %u page number %lx invalid\n",
@@ -164,6 +172,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
}
page = mfn_to_page(mfn);
+#ifdef CONFIG_X86
/* If gmfn is shared, just drop the guest reference (which may or may not
* free the page) */
if(p2m_is_shared(p2mt))
@@ -173,6 +182,7 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
return 1;
}
+#endif /* CONFIG_X86 */
if ( unlikely(!get_page(page, d)) )
{
gdprintk(XENLOG_INFO, "Bad page free for domain %u\n", d->domain_id);
@@ -330,6 +340,7 @@ static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
for ( k = 0; k < (1UL << exch.in.extent_order); k++ )
{
+#ifdef CONFIG_X86
p2m_type_t p2mt;
/* Shared pages cannot be exchanged */
@@ -339,6 +350,9 @@ static long memory_exchange(XEN_GUEST_HANDLE(xen_memory_exchange_t) arg)
rc = -ENOMEM;
goto fail;
}
+#else /* !CONFIG_X86 */
+ mfn = gmfn_to_mfn(d, gmfn + k);
+#endif
if ( unlikely(!mfn_valid(mfn)) )
{
rc = -EINVAL;