GNU Linux-libre 4.14.266-gnu1
[releases.git] / arch / tile / include / uapi / asm / hardwall.h
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  * Copyright 2010 Tilera Corporation. All Rights Reserved.
4  *
5  *   This program is free software; you can redistribute it and/or
6  *   modify it under the terms of the GNU General Public License
7  *   as published by the Free Software Foundation, version 2.
8  *
9  *   This program is distributed in the hope that it will be useful, but
10  *   WITHOUT ANY WARRANTY; without even the implied warranty of
11  *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12  *   NON INFRINGEMENT.  See the GNU General Public License for
13  *   more details.
14  *
15  * Provide methods for access control of per-cpu resources like
16  * UDN, IDN, or IPI.
17  */
18
19 #ifndef _UAPI_ASM_TILE_HARDWALL_H
20 #define _UAPI_ASM_TILE_HARDWALL_H
21
22 #include <arch/chip.h>
23 #include <linux/ioctl.h>
24
25 #define HARDWALL_IOCTL_BASE 0xa2
26
27 /*
28  * The HARDWALL_CREATE() ioctl is a macro with a "size" argument.
29  * The resulting ioctl value is passed to the kernel in conjunction
30  * with a pointer to a standard kernel bitmask of cpus.
31  * For network resources (UDN or IDN) the bitmask must physically
32  * represent a rectangular configuration on the chip.
33  * The "size" is the number of bytes of cpu mask data.
34  */
35 #define _HARDWALL_CREATE 1
36 #define HARDWALL_CREATE(size) \
37   _IOC(_IOC_READ, HARDWALL_IOCTL_BASE, _HARDWALL_CREATE, (size))
38
39 #define _HARDWALL_ACTIVATE 2
40 #define HARDWALL_ACTIVATE \
41   _IO(HARDWALL_IOCTL_BASE, _HARDWALL_ACTIVATE)
42
43 #define _HARDWALL_DEACTIVATE 3
44 #define HARDWALL_DEACTIVATE \
45  _IO(HARDWALL_IOCTL_BASE, _HARDWALL_DEACTIVATE)
46
47 #define _HARDWALL_GET_ID 4
48 #define HARDWALL_GET_ID \
49  _IO(HARDWALL_IOCTL_BASE, _HARDWALL_GET_ID)
50
51
52 #endif /* _UAPI_ASM_TILE_HARDWALL_H */