diff options
author | lstewart <lstewart@FreeBSD.org> | 2010-07-13 08:05:48 +0000 |
---|---|---|
committer | lstewart <lstewart@FreeBSD.org> | 2010-07-13 08:05:48 +0000 |
commit | 383d2961c57c681a0a2de2cde6ac411db44e3c89 (patch) | |
tree | 0497870ef45ddd9159fe4eceeeacb86f74905e1a /sys/sys/pcpu.h | |
parent | 42577db2a73a5073333d3b76f81c570a56ed1e3f (diff) | |
download | FreeBSD-src-383d2961c57c681a0a2de2cde6ac411db44e3c89.zip FreeBSD-src-383d2961c57c681a0a2de2cde6ac411db44e3c89.tar.gz |
Macro to simplify zeroing DPCPU variables.
Sponsored by: FreeBSD Foundation
MFC after: 3 days
Diffstat (limited to 'sys/sys/pcpu.h')
-rw-r--r-- | sys/sys/pcpu.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index c157807..a563ae7 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -133,6 +133,15 @@ extern uintptr_t dpcpu_off[]; sum; \ }) +#define DPCPU_ZERO(n) do { \ + u_int _i; \ + \ + CPU_FOREACH(_i) { \ + bzero(DPCPU_ID_PTR(_i, n), \ + sizeof(__typeof(DPCPU_PTR(n)))); \ + } \ +} while(0) + /* * XXXUPS remove as soon as we have per cpu variable * linker sets and can define rm_queue in _rm_lock.h |