summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-01-17 07:21:23 +0000
committerkib <kib@FreeBSD.org>2012-01-17 07:21:23 +0000
commit6633d0628b91a64a71e56407ac9accf998056bd2 (patch)
tree1aaa077fb6435947f8f59cc0504b0efad2fc5764
parent8c28719b6da390c06d440d3c6850d22a7237c981 (diff)
downloadFreeBSD-src-6633d0628b91a64a71e56407ac9accf998056bd2.zip
FreeBSD-src-6633d0628b91a64a71e56407ac9accf998056bd2.tar.gz
Add macro IS_BSP() to check whether the current CPU is BSP.
MFC after: 1 week
-rw-r--r--sys/amd64/include/pcpu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h
index c4b0c44..d07dbac 100644
--- a/sys/amd64/include/pcpu.h
+++ b/sys/amd64/include/pcpu.h
@@ -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"
OpenPOWER on IntegriCloud