blob: 713bafa052e8458e08b0963eb34ac57b98099252 [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 Cheng94a85f62012-03-06 15:45:52 -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 __LINUX_SEQLOCK_H
20#define __LINUX_SEQLOCK_H
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#include <linux/spinlock.h>
22#include <linux/preempt.h>
Ben Cheng94a85f62012-03-06 15:45:52 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024typedef struct {
25 unsigned sequence;
26 spinlock_t lock;
27} seqlock_t;
Ben Cheng94a85f62012-03-06 15:45:52 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029#define __SEQLOCK_UNLOCKED(lockname) { 0, __SPIN_LOCK_UNLOCKED(lockname) }
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080030#define SEQLOCK_UNLOCKED __SEQLOCK_UNLOCKED(old_style_seqlock_init)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080031#define seqlock_init(x) do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); } while (0)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080032#define DEFINE_SEQLOCK(x) seqlock_t x = __SEQLOCK_UNLOCKED(x)
Ben Cheng94a85f62012-03-06 15:45:52 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34typedef struct seqcount {
35 unsigned sequence;
36} seqcount_t;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080037#define SEQCNT_ZERO { 0 }
Ben Cheng94a85f62012-03-06 15:45:52 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#define seqcount_init(x) do { *(x) = (seqcount_t) SEQCNT_ZERO; } while (0)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080040#define write_seqlock_irqsave(lock, flags) do { local_irq_save(flags); write_seqlock(lock); } while (0)
41#define write_seqlock_irq(lock) do { local_irq_disable(); write_seqlock(lock); } while (0)
42#define write_seqlock_bh(lock) do { local_bh_disable(); write_seqlock(lock); } while (0)
Ben Cheng94a85f62012-03-06 15:45:52 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044#define write_sequnlock_irqrestore(lock, flags) do { write_sequnlock(lock); local_irq_restore(flags); } while(0)
45#define write_sequnlock_irq(lock) do { write_sequnlock(lock); local_irq_enable(); } while(0)
46#define write_sequnlock_bh(lock) do { write_sequnlock(lock); local_bh_enable(); } while(0)
47#define read_seqbegin_irqsave(lock, flags) ({ local_irq_save(flags); read_seqbegin(lock); })
Ben Cheng94a85f62012-03-06 15:45:52 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049#define read_seqretry_irqrestore(lock, iv, flags) ({ int ret = read_seqretry(lock, iv); local_irq_restore(flags); ret; })
50#endif