* Dual LGPL v2.1/GPL v2 license.
*/
-#include <linux/pipe_fs_i.h>
-#include <linux/rcupdate.h>
-#include <linux/cpumask.h>
-#include <linux/module.h>
-#include <linux/bitops.h>
-#include <linux/splice.h>
-#include <linux/string.h>
-#include <linux/timer.h>
-#include <linux/sched.h>
-#include <linux/cache.h>
-#include <linux/time.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/stat.h>
-#include <linux/cpu.h>
-#include <linux/fs.h>
-
-#include <asm/atomic.h>
-#include <asm/local.h>
+#include <urcu/compiler.h>
+#include <urcu/uatomic.h>
/* Internal helpers */
-#include "../../wrapper/ringbuffer/frontend_internal.h"
+#include "frontend_internal.h"
/* Buffer creation/removal and setup operations */
#define for_each_channel_cpu(cpu, chan) \
for ((cpu) = -1; \
({ (cpu) = cpumask_next(cpu, (chan)->backend.cpumask); \
- smp_read_barrier_depends(); (cpu) < nr_cpu_ids; });)
+ cmm_smp_read_barrier_depends(); (cpu) < nr_cpu_ids; });)
extern struct lib_ring_buffer *channel_get_ring_buffer(
const struct lib_ring_buffer_config *config,
unsigned long lib_ring_buffer_get_consumed(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf)
{
- return atomic_long_read(&buf->consumed);
+ return uatomic_read(&buf->consumed);
}
/*
int lib_ring_buffer_is_finalized(const struct lib_ring_buffer_config *config,
struct lib_ring_buffer *buf)
{
- int finalized = ACCESS_ONCE(buf->finalized);
+ int finalized = CMM_ACCESS_ONCE(buf->finalized);
/*
* Read finalized before counters.
*/
- smp_rmb();
+ cmm_smp_rmb();
return finalized;
}
static inline
int lib_ring_buffer_channel_is_disabled(const struct channel *chan)
{
- return atomic_read(&chan->record_disabled);
+ return uatomic_read(&chan->record_disabled);
}
static inline