blob: c19561662705aacd5f05953beba87a8ccfdf6129 [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 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef __LINUX_PERCPU_H
13#define __LINUX_PERCPU_H
14#include <linux/spinlock.h>
15#include <linux/slab.h>
16#include <linux/smp.h>
17#include <linux/string.h>
18#include <asm/percpu.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080019
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080020#ifndef PERCPU_ENOUGH_ROOM
21#define PERCPU_ENOUGH_ROOM 32768
22#endif
Ben Cheng4b29af02012-03-07 16:14:53 -080023
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024#define get_cpu_var(var) (*({ preempt_disable(); &__get_cpu_var(var); }))
25#define put_cpu_var(var) preempt_enable()
Ben Cheng4b29af02012-03-07 16:14:53 -080026
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080027#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
Ben Cheng4b29af02012-03-07 16:14:53 -080028
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029#define alloc_percpu(type) ((type *)(__alloc_percpu(sizeof(type))))
30#endif