streamlining.
[~madcoder/pwqr.git] / kernel / pwqr.h
1 /*
2  * Copyright (C) 2012   Pierre Habouzit <pierre.habouzit@intersec.com>
3  * Copyright (C) 2012   Intersec SAS
4  *
5  * This file implements the Linux Pthread Workqueue Regulator, and is part
6  * of the linux kernel.
7  *
8  * The Linux Kernel is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * The Linux Kernel is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15  * License for more details.
16  *
17  * You should have received a copy of the GNU General Public License version 2
18  * along with The Linux Kernel.  If not, see <http://www.gnu.org/licenses/>.
19  */
20
21 #ifndef _LINUX_PWQR_H
22 #define _LINUX_PWQR_H
23 #include <linux/ioctl.h>
24
25 #ifdef __KERNEL__
26 #include <linux/fcntl.h>
27 #else
28 #include <fcntl.h>
29 #endif
30
31 #define PWQR_DEVICE_NAME        "pwq"
32 #define PWQR_IO                 '}'
33
34 struct pwqr_ioc_wait {
35         int     pwqr_ticket;
36         void   *pwqr_uaddr;
37 };
38
39 #define PWQR_CTL_GET_CONC       _IO (PWQR_IO, 0)
40 #define PWQR_CTL_SET_CONC       _IO (PWQR_IO, 1)
41 #define PWQR_CTL_REGISTER       _IO (PWQR_IO, 2)
42 #define PWQR_CTL_UNREGISTER     _IO (PWQR_IO, 3)
43 #define PWQR_CTL_WAKE           _IO (PWQR_IO, 4)
44 #define PWQR_CTL_WAKE_OC        _IO (PWQR_IO, 5)
45 #define PWQR_CTL_WAIT           _IOW(PWQR_IO, 6, struct pwqr_ioc_wait)
46 #define PWQR_CTL_PARK           _IO (PWQR_IO, 7)
47
48 #define PWQR_FL_NONBLOCK        O_NONBLOCK
49 #define PWQR_FL_CLOEXEC         O_CLOEXEC
50 #define PWQR_FL__FCTNL_FLAGS    (PWQR_FL_NONBLOCK | PWQR_FL_CLOEXEC)
51 #define PWQR_FL__SET            (PWQR_FL__FCTNL_FLAGS)
52
53 #endif