1*f7c14bbaSAndroid Build Coastguard Worker /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ 2*f7c14bbaSAndroid Build Coastguard Worker #ifndef _TOOLS_LINUX_RING_BUFFER_H_ 3*f7c14bbaSAndroid Build Coastguard Worker #define _TOOLS_LINUX_RING_BUFFER_H_ 4*f7c14bbaSAndroid Build Coastguard Worker 5*f7c14bbaSAndroid Build Coastguard Worker #include <linux/compiler.h> 6*f7c14bbaSAndroid Build Coastguard Worker ring_buffer_read_head(struct perf_event_mmap_page * base)7*f7c14bbaSAndroid Build Coastguard Workerstatic inline __u64 ring_buffer_read_head(struct perf_event_mmap_page *base) 8*f7c14bbaSAndroid Build Coastguard Worker { 9*f7c14bbaSAndroid Build Coastguard Worker return smp_load_acquire(&base->data_head); 10*f7c14bbaSAndroid Build Coastguard Worker } 11*f7c14bbaSAndroid Build Coastguard Worker ring_buffer_write_tail(struct perf_event_mmap_page * base,__u64 tail)12*f7c14bbaSAndroid Build Coastguard Workerstatic inline void ring_buffer_write_tail(struct perf_event_mmap_page *base, 13*f7c14bbaSAndroid Build Coastguard Worker __u64 tail) 14*f7c14bbaSAndroid Build Coastguard Worker { 15*f7c14bbaSAndroid Build Coastguard Worker smp_store_release(&base->data_tail, tail); 16*f7c14bbaSAndroid Build Coastguard Worker } 17*f7c14bbaSAndroid Build Coastguard Worker 18*f7c14bbaSAndroid Build Coastguard Worker #endif /* _TOOLS_LINUX_RING_BUFFER_H_ */ 19