diff options
author | kib <kib@FreeBSD.org> | 2012-01-17 07:21:23 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-01-17 07:21:23 +0000 |
commit | 6633d0628b91a64a71e56407ac9accf998056bd2 (patch) | |
tree | 1aaa077fb6435947f8f59cc0504b0efad2fc5764 /sys/amd64 | |
parent | 8c28719b6da390c06d440d3c6850d22a7237c981 (diff) | |
download | FreeBSD-src-6633d0628b91a64a71e56407ac9accf998056bd2.zip FreeBSD-src-6633d0628b91a64a71e56407ac9accf998056bd2.tar.gz |
Add macro IS_BSP() to check whether the current CPU is BSP.
MFC after: 1 week
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/include/pcpu.h | 2 |
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" |