Author: kib
Date: Tue Jan 17 07:21:23 2012
New Revision: 230260
URL: http://svn.freebsd.org/changeset/base/230260

Log:
  Add macro IS_BSP() to check whether the current CPU is BSP.
  
  MFC after:    1 week

Modified:
  head/sys/amd64/include/pcpu.h

Modified: head/sys/amd64/include/pcpu.h
==============================================================================
--- head/sys/amd64/include/pcpu.h       Tue Jan 17 07:01:22 2012        
(r230259)
+++ head/sys/amd64/include/pcpu.h       Tue Jan 17 07:21:23 2012        
(r230260)
@@ -226,6 +226,8 @@ __curthread(void)
 }
 #define        curthread               (__curthread())
 
+#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"
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to