From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Yongjun Subject: [PATCH] mm: fix some compile errors on x86 arch Date: Thu, 17 Dec 2009 18:01:50 +0800 Message-ID: <4B2A018E.2010407@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This patch fixed the following compile errors on x86 arch: p2m.c: In function =A1=AEp2m_change_type_global=A1=AF: p2m.c:2211: error: =A1=AEi4=A1=AF undeclared (first use in this function) mem_sharing.c: In function =A1=AEmem_sharing_hash_delete=A1=AF: mem_sharing.c:217: error: format =A1=AE%lx=A1=AF expects type =A1=AElong = unsigned int=A1=AF, but argument 2 has type =A1=AEshr_handle_t=A1=AF Signed-off-by: Wei Yongjun diff -r 1b81d0607af9 xen/arch/x86/mm/mem_sharing.c --- a/xen/arch/x86/mm/mem_sharing.c Thu Dec 17 06:27:57 2009 +0000 +++ b/xen/arch/x86/mm/mem_sharing.c Thu Dec 17 17:55:24 2009 +0800 @@ -214,7 +214,7 @@ pprev =3D &e->next; e =3D e->next; } - printk("Could not find shr entry for handle %lx\n", handle); + printk("Could not find shr entry for handle %llx\n", handle); BUG(); }=20 =20 diff -r 1b81d0607af9 xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Thu Dec 17 06:27:57 2009 +0000 +++ b/xen/arch/x86/mm/p2m.c Thu Dec 17 17:55:24 2009 +0800 @@ -2208,7 +2208,11 @@ mfn =3D l2e_get_pfn(l2e[i2]); /* Do not use get_gpfn_from_mfn because it may retur= n=20 SHARED_M2P_ENTRY */ - gfn =3D (i2 + (i3 + (i4 * L3_PAGETABLE_ENTRIES)) + gfn =3D (i2 + (i3 +#if CONFIG_PAGING_LEVELS >=3D 4 + + (i4 * L3_PAGETABLE_ENTRIES) +#endif + ) * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIE= S;=20 flags =3D p2m_type_to_flags(nt); l1e_content =3D l1e_from_pfn(mfn, flags | _PAGE_PSE)= ; @@ -2226,7 +2230,11 @@ if ( p2m_flags_to_type(flags) !=3D ot ) continue; mfn =3D l1e_get_pfn(l1e[i1]); - gfn =3D i1 + (i2 + (i3 + (i4 * L3_PAGETABLE_ENTRIES)= ) + gfn =3D i1 + (i2 + (i3 +#if CONFIG_PAGING_LEVELS >=3D 4 + + (i4 * L3_PAGETABLE_ENTRIES) +#endif + ) * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIE= S;=20 /* create a new 1le entry with the new type */ flags =3D p2m_type_to_flags(nt);