Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Aug 2013 21:09:05 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254384 - head/sys/i386/i386
Message-ID:  <201308152109.r7FL95Ik014843@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu Aug 15 21:09:05 2013
New Revision: 254384
URL: http://svnweb.freebsd.org/changeset/base/254384

Log:
  Simplify check for CMPXCHG8B instruction.  Note CMPXCHG8B instruction is
  always available for Rise mP6 processors although it is not set by CPUID.

Modified:
  head/sys/i386/i386/initcpu.c
  head/sys/i386/i386/machdep.c

Modified: head/sys/i386/i386/initcpu.c
==============================================================================
--- head/sys/i386/i386/initcpu.c	Thu Aug 15 21:06:38 2013	(r254383)
+++ head/sys/i386/i386/initcpu.c	Thu Aug 15 21:09:05 2013	(r254384)
@@ -424,6 +424,19 @@ init_6x86(void)
 
 #ifdef I586_CPU
 /*
+ * Rise mP6
+ */
+static void
+init_rise(void)
+{
+
+	/*
+	 * The CMPXCHG8B instruction is always available but hidden.
+	 */
+	cpu_feature |= CPUID_CX8;
+}
+
+/*
  * IDT WinChip C6/2/2A/2B/3
  *
  * http://www.centtech.com/winchip_bios_writers_guide_v4_0.pdf
@@ -690,6 +703,9 @@ initializecpu(void)
 		case CPU_VENDOR_TRANSMETA:
 			init_transmeta();
 			break;
+		case CPU_VENDOR_RISE:
+			init_rise();
+			break;
 		}
 		break;
 #endif

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Thu Aug 15 21:06:38 2013	(r254383)
+++ head/sys/i386/i386/machdep.c	Thu Aug 15 21:09:05 2013	(r254384)
@@ -1557,8 +1557,7 @@ static void
 cpu_probe_cmpxchg8b(void)
 {
 
-	if ((cpu_feature & CPUID_CX8) != 0 ||
-	    cpu_vendor_id == CPU_VENDOR_RISE) {
+	if ((cpu_feature & CPUID_CX8) != 0) {
 		atomic_load_acq_64 = atomic_load_acq_64_i586;
 		atomic_store_rel_64 = atomic_store_rel_64_i586;
 	}



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