1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _ASM_GENERIC_LOCAL_H
20#define _ASM_GENERIC_LOCAL_H
21#include <linux/percpu.h>
22#include <linux/hardirq.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#include <asm/atomic.h>
25#include <asm/types.h>
26typedef struct
27{
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 atomic_long_t a;
30} local_t;
31#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
32#define local_read(l) atomic_long_read(&(l)->a)
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#define local_set(l,i) atomic_long_set((&(l)->a),(i))
35#define local_inc(l) atomic_long_inc(&(l)->a)
36#define local_dec(l) atomic_long_dec(&(l)->a)
37#define local_add(i,l) atomic_long_add((i),(&(l)->a))
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
40#define __local_inc(l) local_set((l), local_read(l) + 1)
41#define __local_dec(l) local_set((l), local_read(l) - 1)
42#define __local_add(i,l) local_set((l), local_read(l) + (i))
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define __local_sub(i,l) local_set((l), local_read(l) - (i))
45#define cpu_local_read(v) local_read(&__get_cpu_var(v))
46#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i))
47#define cpu_local_inc(v) local_inc(&__get_cpu_var(v))
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define cpu_local_dec(v) local_dec(&__get_cpu_var(v))
50#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v))
51#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v))
52#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v))
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v))
55#define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v))
56#define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v))
57#endif
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59