summaryrefslogtreecommitdiff
path: root/drivers/misc/slp_global_lock.h
blob: db4d585a01c54b0f97e1bc74f89ba9e82f52a739 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 *
 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
 *
 * A copy of the licence is included with the program, and can also be obtained from Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef __SLP_GLOBAL_LOCK_H__
#define __SLP_GLOBAL_LOCK_H__

#include <linux/ioctl.h>

#define SGL_IOC_BASE	0x32
#define SGL_MAJOR	224

struct sgl_attribute {
	unsigned int key;
	unsigned int timeout_ms;
};

struct sgl_user_data {
	unsigned int key;
	unsigned int data1;
	unsigned int data2;
	unsigned int locked;
};

typedef enum {
	_SGL_INIT_LOCK = 1,
	_SGL_DESTROY_LOCK,
	_SGL_LOCK_LOCK,
	_SGL_UNLOCK_LOCK,
	_SGL_SET_DATA,
	_SGL_GET_DATA,
	_SGL_DUMP_LOCKS,
} _sgl_ioctls;

#define SGL_IOC_INIT_LOCK			_IOW(SGL_IOC_BASE, _SGL_INIT_LOCK, struct sgl_attribute *)
#define SGL_IOC_DESTROY_LOCK		_IOW(SGL_IOC_BASE, _SGL_DESTROY_LOCK, unsigned int)
#define SGL_IOC_LOCK_LOCK			_IOW(SGL_IOC_BASE, _SGL_LOCK_LOCK, unsigned int)
#define SGL_IOC_UNLOCK_LOCK			_IOW(SGL_IOC_BASE, _SGL_UNLOCK_LOCK, unsigned int)
#define SGL_IOC_SET_DATA			_IOW(SGL_IOC_BASE, _SGL_SET_DATA, struct sgl_user_data *)
#define SGL_IOC_GET_DATA			_IOW(SGL_IOC_BASE, _SGL_GET_DATA, struct sgl_user_data *)
#define SGL_IOC_DUMP_LOCKS			_IOW(SGL_IOC_BASE, _SGL_DUMP_LOCKS, void *)

#endif /* __SLP_GLOBAL_LOCK_H__ */