mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
- Rename DPCPU_SUM to DPCPU_VARSUM to better reflect the fact it operates on
member variables of a DPCPU struct. - Add DPCPU_SUM which sums a DPCPU variable. Sponsored by: FreeBSD Foundation MFC after: 3 days
This commit is contained in:
parent
b6ef82a03b
commit
07de7d5fb5
1 changed files with 13 additions and 1 deletions
|
|
@ -109,7 +109,19 @@ extern uintptr_t dpcpu_off[];
|
|||
/*
|
||||
* Utility macros.
|
||||
*/
|
||||
#define DPCPU_SUM(n, var) __extension__ \
|
||||
#define DPCPU_SUM(n) __extension__ \
|
||||
({ \
|
||||
u_int _i; \
|
||||
__typeof(DPCPU_PTR(n)) sum; \
|
||||
\
|
||||
sum = 0; \
|
||||
CPU_FOREACH(_i) { \
|
||||
sum += DPCPU_ID_PTR(_i, n); \
|
||||
} \
|
||||
sum; \
|
||||
})
|
||||
|
||||
#define DPCPU_VARSUM(n, var) __extension__ \
|
||||
({ \
|
||||
u_int _i; \
|
||||
__typeof((DPCPU_PTR(n))->var) sum; \
|
||||
|
|
|
|||
Loading…
Reference in a new issue