blob: c673bdf400058bd48030cd8ef452716a3ea2a258 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
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 Cheng654325d2012-03-07 21:13:49 -080010 *** 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 Project1dc9e472009-03-03 19:28:35 -080017 ****************************************************************************
18 ****************************************************************************/
19#ifndef _ASM_GENERIC_LOCAL_H
20#define _ASM_GENERIC_LOCAL_H
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#include <linux/percpu.h>
22#include <linux/hardirq.h>
Ben Cheng654325d2012-03-07 21:13:49 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024#include <asm/atomic.h>
25#include <asm/types.h>
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080026typedef struct
27{
Ben Cheng654325d2012-03-07 21:13:49 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029 atomic_long_t a;
30} local_t;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080031#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080032#define local_read(l) atomic_long_read(&(l)->a)
Ben Cheng654325d2012-03-07 21:13:49 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034#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 Cheng654325d2012-03-07 21:13:49 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080040#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 Cheng654325d2012-03-07 21:13:49 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044#define __local_sub(i,l) local_set((l), local_read(l) - (i))
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080045#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 Cheng654325d2012-03-07 21:13:49 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049#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 Project1dc9e472009-03-03 19:28:35 -080052#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v))
Ben Cheng654325d2012-03-07 21:13:49 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080054#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 Project1dc9e472009-03-03 19:28:35 -080057#endif
Ben Cheng654325d2012-03-07 21:13:49 -080058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */