mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-25 10:49:06 +08:00
AF_XDP: add xsk.{c,h} to Makefile and fix build
This patch makes sure we build AF_XDP-related code as part of libbpf. This also required copying few uapi/linux headers and adding few used definitions in include headers. Signed-off-by: Andrii Nakryiko <andriin@fb.com>
This commit is contained in:
committed by
Andrii Nakryiko
parent
7a431904c8
commit
cb658e9724
@@ -2,40 +2,7 @@
|
||||
#ifndef _TOOLS_LINUX_RING_BUFFER_H_
|
||||
#define _TOOLS_LINUX_RING_BUFFER_H_
|
||||
|
||||
#define READ_ONCE(x) (*(volatile typeof(x) *)&x)
|
||||
#define WRITE_ONCE(x, v) (*(volatile typeof(x) *)&x) = (v)
|
||||
|
||||
#define barrier() asm volatile("" ::: "memory")
|
||||
|
||||
#if defined(__x86_64__)
|
||||
# define smp_store_release(p, v) \
|
||||
do { \
|
||||
barrier(); \
|
||||
WRITE_ONCE(*p, v); \
|
||||
} while (0)
|
||||
|
||||
# define smp_load_acquire(p) \
|
||||
({ \
|
||||
typeof(*p) ___p = READ_ONCE(*p); \
|
||||
barrier(); \
|
||||
___p; \
|
||||
})
|
||||
#else
|
||||
# define smp_mb() __sync_synchronize()
|
||||
|
||||
# define smp_store_release(p, v) \
|
||||
do { \
|
||||
smp_mb(); \
|
||||
WRITE_ONCE(*p, v); \
|
||||
} while (0)
|
||||
|
||||
# define smp_load_acquire(p) \
|
||||
({ \
|
||||
typeof(*p) ___p = READ_ONCE(*p); \
|
||||
smp_mb(); \
|
||||
___p; \
|
||||
})
|
||||
#endif /* defined(__x86_64__) */
|
||||
#include <linux/compiler.h>
|
||||
|
||||
static inline __u64 ring_buffer_read_head(struct perf_event_mmap_page *base)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user