From: Samuel Thibault Subject: [PATCH] minios: fix p2m on x86 Date: Sat, 7 Feb 2009 03:47:42 +0100 Message-ID: <20090207024742.GI11308@const.famille.thibault.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline 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 minios: fix p2m on x86 15675:bf85b467ee89 Fixed p2m on x86_64, but instead broke it on x86. Signed-off-by: Samuel Thibault diff -r 8df3c145923f extras/mini-os/arch/x86/mm.c --- a/extras/mini-os/arch/x86/mm.c Mon Jan 19 17:40:28 2009 +0000 +++ b/extras/mini-os/arch/x86/mm.c Sat Feb 07 03:44:41 2009 +0100 @@ -550,9 +550,15 @@ void arch_init_p2m(unsigned long max_pfn) { +#ifdef __x86_64__ #define L1_P2M_SHIFT 9 #define L2_P2M_SHIFT 18 #define L3_P2M_SHIFT 27 +#else +#define L1_P2M_SHIFT 10 +#define L2_P2M_SHIFT 20 +#define L3_P2M_SHIFT 30 +#endif #define L1_P2M_ENTRIES (1 << L1_P2M_SHIFT) #define L2_P2M_ENTRIES (1 << (L2_P2M_SHIFT - L1_P2M_SHIFT)) #define L3_P2M_ENTRIES (1 << (L3_P2M_SHIFT - L2_P2M_SHIFT))