Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Mar 2011 06:04:13 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r219657 - projects/altix/sys/boot/ia64/common
Message-ID:  <201103150604.p2F64DNV023234@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Tue Mar 15 06:04:13 2011
New Revision: 219657
URL: http://svn.freebsd.org/changeset/base/219657

Log:
  Round the size, not the top address. This makes the code less
  sensitive to compiler bugs (32-bit truncation).

Modified:
  projects/altix/sys/boot/ia64/common/exec.c

Modified: projects/altix/sys/boot/ia64/common/exec.c
==============================================================================
--- projects/altix/sys/boot/ia64/common/exec.c	Tue Mar 15 01:06:27 2011	(r219656)
+++ projects/altix/sys/boot/ia64/common/exec.c	Tue Mar 15 06:04:13 2011	(r219657)
@@ -160,8 +160,8 @@ mmu_setup_paged(vm_offset_t pbvm_top)
 	    PTE_AR_RW);
 
 	/* Wire as much of the PBVM we can. This must be a power of 2. */
-	pbvm_top = (pbvm_top + IA64_PBVM_PAGE_MASK) & ~IA64_PBVM_PAGE_MASK;
 	sz = pbvm_top - IA64_PBVM_BASE;
+	sz = (sz + IA64_PBVM_PAGE_MASK) & ~IA64_PBVM_PAGE_MASK;
 	while (sz & (sz - 1))
 		sz -= IA64_PBVM_PAGE_SIZE;
 	mmu_wire(IA64_PBVM_BASE, ia64_pgtbl[0], sz, PTE_AR_RWX);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103150604.p2F64DNV023234>