tizen 2.4 release
[kernel/linux-3.0.git] / drivers / misc / slp_global_lock.h
1 /*
2  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
3  *
4  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6  *
7  * A copy of the licence is included with the program, and can also be obtained from Free Software
8  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9  */
10
11 #ifndef __SLP_GLOBAL_LOCK_H__
12 #define __SLP_GLOBAL_LOCK_H__
13
14 #include <linux/ioctl.h>
15
16 #define SGL_IOC_BASE    0x32
17 #define SGL_MAJOR       224
18
19 struct sgl_attribute {
20         unsigned int key;
21         unsigned int timeout_ms;
22 };
23
24 struct sgl_user_data {
25         unsigned int key;
26         unsigned int data1;
27         unsigned int data2;
28         unsigned int locked;
29 };
30
31 typedef enum {
32         _SGL_INIT_LOCK = 1,
33         _SGL_DESTROY_LOCK,
34         _SGL_LOCK_LOCK,
35         _SGL_UNLOCK_LOCK,
36         _SGL_SET_DATA,
37         _SGL_GET_DATA,
38         _SGL_DUMP_LOCKS,
39 } _sgl_ioctls;
40
41 #define SGL_IOC_INIT_LOCK                       _IOW(SGL_IOC_BASE, _SGL_INIT_LOCK, struct sgl_attribute *)
42 #define SGL_IOC_DESTROY_LOCK            _IOW(SGL_IOC_BASE, _SGL_DESTROY_LOCK, unsigned int)
43 #define SGL_IOC_LOCK_LOCK                       _IOW(SGL_IOC_BASE, _SGL_LOCK_LOCK, unsigned int)
44 #define SGL_IOC_UNLOCK_LOCK                     _IOW(SGL_IOC_BASE, _SGL_UNLOCK_LOCK, unsigned int)
45 #define SGL_IOC_SET_DATA                        _IOW(SGL_IOC_BASE, _SGL_SET_DATA, struct sgl_user_data *)
46 #define SGL_IOC_GET_DATA                        _IOW(SGL_IOC_BASE, _SGL_GET_DATA, struct sgl_user_data *)
47 #define SGL_IOC_DUMP_LOCKS                      _IOW(SGL_IOC_BASE, _SGL_DUMP_LOCKS, void *)
48
49 #endif /* __SLP_GLOBAL_LOCK_H__ */