Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 May 2009 19:29:06 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r191976 - in stable/7/sys: . boot/sparc64/loader contrib/pf dev/ath/ath_hal dev/cxgb
Message-ID:  <200905101929.n4AJT6Hk066606@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sun May 10 19:29:06 2009
New Revision: 191976
URL: http://svn.freebsd.org/changeset/base/191976

Log:
  MFC: r191071
  
  Fix masking of TTE bits; the TD_*_MASK macros need shifting via the
  corresponding TD_*_SHIFT.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/boot/sparc64/loader/main.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/boot/sparc64/loader/main.c
==============================================================================
--- stable/7/sys/boot/sparc64/loader/main.c	Sun May 10 19:27:05 2009	(r191975)
+++ stable/7/sys/boot/sparc64/loader/main.c	Sun May 10 19:29:06 2009	(r191976)
@@ -434,9 +434,10 @@ dtlb_va_to_pa_sun4u(vm_offset_t va)
 			continue;
 		reg = dtlb_get_data_sun4u(i);
 		wrpr(pstate, pstate, 0);
+		reg >>= TD_PA_SHIFT;
 		if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
-			return ((reg & TD_PA_CH_MASK) >> TD_PA_SHIFT);
-		return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT);
+			return (reg & TD_PA_CH_MASK);
+		return (reg & TD_PA_SF_MASK);
 	}
 	wrpr(pstate, pstate, 0);
 	return (-1);
@@ -456,9 +457,10 @@ itlb_va_to_pa_sun4u(vm_offset_t va)
 			continue;
 		reg = itlb_get_data_sun4u(i);
 		wrpr(pstate, pstate, 0);
+		reg >>= TD_PA_SHIFT;
 		if (cpu_impl >= CPU_IMPL_ULTRASPARCIII)
-			return ((reg & TD_PA_CH_MASK) >> TD_PA_SHIFT);
-		return ((reg & TD_PA_SF_MASK) >> TD_PA_SHIFT);
+			return (reg & TD_PA_CH_MASK);
+		return (reg & TD_PA_SF_MASK);
 	}
 	wrpr(pstate, pstate, 0);
 	return (-1);
@@ -846,7 +848,7 @@ pmap_print_tte_sun4u(tte_t tag, tte_t tt
 {
 
 	printf("%s %s ",
-	    page_sizes[(tte & TD_SIZE_MASK) >> TD_SIZE_SHIFT],
+	    page_sizes[(tte >> TD_SIZE_SHIFT) & TD_SIZE_MASK],
 	    tag & TD_G ? "G" : " ");
 	printf(tte & TD_W ? "W " : "  ");
 	printf(tte & TD_P ? "\e[33mP\e[0m " : "  ");



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