The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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 | *** |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 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 | *** |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _ASM_GENERIC_LOCAL_H |
| 20 | #define _ASM_GENERIC_LOCAL_H |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 21 | #include <linux/percpu.h> |
| 22 | #include <linux/hardirq.h> |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 23 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 24 | #include <asm/atomic.h> |
| 25 | #include <asm/types.h> |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 26 | typedef struct |
| 27 | { |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 28 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 29 | atomic_long_t a; |
| 30 | } local_t; |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 31 | #define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) } |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 32 | #define local_read(l) atomic_long_read(&(l)->a) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 33 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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)) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 38 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 39 | #define local_sub(i,l) atomic_long_sub((i),(&(l)->a)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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)) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 43 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 44 | #define __local_sub(i,l) local_set((l), local_read(l) - (i)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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)) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 48 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 52 | #define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v)) |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 53 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 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)) |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 57 | #endif |
Ben Cheng | 654325d | 2012-03-07 21:13:49 -0800 | [diff] [blame] | 58 | /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ |