diff options
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | 2018-06-11 23:29:09 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-18 15:08:56 +0200 |
commit | 320d07eb995137e8a63dc7393ed425f16c191871 (patch) | |
tree | 0b76acc9a3d3a0585ec7ac0d3e39786d1bb2394e | |
parent | mpmc_ptr_ring: Fix some style details (diff) | |
download | wireguard-monolithic-historical-320d07eb995137e8a63dc7393ed425f16c191871.tar.xz wireguard-monolithic-historical-320d07eb995137e8a63dc7393ed425f16c191871.zip |
mpmc_ptr_ring: Include all necessary headers
mpmc_ptr_ring.h should include the headers that it needs explicitly.
This commit adds the following:
- <asm/barrier.h>: smp_rmb, smp_wmb, smp_mb__before_atomic
- <linux/atomic.h>: atomic_t, atomic_read, atomic_set, atomic_cmpxchg, atomic_inc
- <linux/cache.h>: ____cacheline_aligned_in_smp
- <linux/compiler.h>: READ_ONCE, WRITE_ONCE
- <linux/errno.h>: ENOMEM
- <linux/log2.h>: is_power_of_2
- <linux/processor.h>: cpu_relax
- <linux/slab.h>: kcalloc, kfree
- <linux/stddef.h>: NULL
I'm not sure if all of them are really needed because I wasn't about to
provoke a compile error due to the missing includes.
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
-rw-r--r-- | src/mpmc_ptr_ring.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mpmc_ptr_ring.h b/src/mpmc_ptr_ring.h index cbcfca4..258a16f 100644 --- a/src/mpmc_ptr_ring.h +++ b/src/mpmc_ptr_ring.h @@ -38,6 +38,17 @@ * [1]: https://github.com/concurrencykit/ck/blob/master/include/ck_ring.h */ +#include <asm/barrier.h> +#include <linux/atomic.h> +#include <linux/cache.h> +#include <linux/compiler.h> +#include <linux/errno.h> +#include <linux/log2.h> +#include <linux/processor.h> +#include <linux/slab.h> +#include <linux/stddef.h> + + struct mpmc_ptr_ring { /* Read-mostly data */ void **queue; |