svn commit: r333053 - in stable/11/sys: i386/include x86/x86

Konstantin Belousov kib at FreeBSD.org
Fri Apr 27 08:56:18 UTC 2018


Author: kib
Date: Fri Apr 27 08:56:17 2018
New Revision: 333053
URL: https://svnweb.freebsd.org/changeset/base/333053

Log:
  MFC r332970:
  Use IS_BSP() macro.
  
  MFC r332989 (by lwhsu):
  Add i386 IS_BSP().

Modified:
  stable/11/sys/i386/include/pcpu.h
  stable/11/sys/x86/x86/mca.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/i386/include/pcpu.h
==============================================================================
--- stable/11/sys/i386/include/pcpu.h	Fri Apr 27 05:37:35 2018	(r333052)
+++ stable/11/sys/i386/include/pcpu.h	Fri Apr 27 08:56:17 2018	(r333053)
@@ -242,6 +242,8 @@ __curpcb(void)
 }
 #define	curpcb		(__curpcb())
 
+#define	IS_BSP()	(PCPU_GET(cpuid) == 0)
+
 #else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */
 
 #error "this file needs to be ported to your compiler"

Modified: stable/11/sys/x86/x86/mca.c
==============================================================================
--- stable/11/sys/x86/x86/mca.c	Fri Apr 27 05:37:35 2018	(r333052)
+++ stable/11/sys/x86/x86/mca.c	Fri Apr 27 08:56:17 2018	(r333053)
@@ -1040,7 +1040,7 @@ _mca_init(int boot)
 		if (mcg_cap & MCG_CAP_CTL_P)
 			/* Enable MCA features. */
 			wrmsr(MSR_MCG_CTL, MCG_CTL_ENABLE);
-		if (PCPU_GET(cpuid) == 0 && boot)
+		if (IS_BSP() && boot)
 			mca_setup(mcg_cap);
 
 		/*


More information about the svn-src-all mailing list