Skip to content

Commit 8a1ab31

Browse files
committed
UAPI: (Scripted) Disintegrate include/asm-generic
Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Michael Kerrisk <mtk.manpages@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Dave Jones <davej@redhat.com>
1 parent f3dfd59 commit 8a1ab31

50 files changed

Lines changed: 1778 additions & 1727 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎include/asm-generic/Kbuild‎

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +0,0 @@
1-
header-y += auxvec.h
2-
header-y += bitsperlong.h
3-
header-y += errno-base.h
4-
header-y += errno.h
5-
header-y += fcntl.h
6-
header-y += int-l64.h
7-
header-y += int-ll64.h
8-
header-y += ioctl.h
9-
header-y += ioctls.h
10-
header-y += ipcbuf.h
11-
header-y += kvm_para.h
12-
header-y += mman-common.h
13-
header-y += mman.h
14-
header-y += msgbuf.h
15-
header-y += param.h
16-
header-y += poll.h
17-
header-y += posix_types.h
18-
header-y += resource.h
19-
header-y += sembuf.h
20-
header-y += setup.h
21-
header-y += shmbuf.h
22-
header-y += shmparam.h
23-
header-y += siginfo.h
24-
header-y += signal-defs.h
25-
header-y += signal.h
26-
header-y += socket.h
27-
header-y += sockios.h
28-
header-y += stat.h
29-
header-y += statfs.h
30-
header-y += swab.h
31-
header-y += termbits.h
32-
header-y += termios.h
33-
header-y += types.h
34-
header-y += ucontext.h
35-
header-y += unistd.h

‎include/asm-generic/bitsperlong.h‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
#ifndef __ASM_GENERIC_BITS_PER_LONG
22
#define __ASM_GENERIC_BITS_PER_LONG
33

4-
/*
5-
* There seems to be no way of detecting this automatically from user
6-
* space, so 64 bit architectures should override this in their
7-
* bitsperlong.h. In particular, an architecture that supports
8-
* both 32 and 64 bit user space must not rely on CONFIG_64BIT
9-
* to decide it, but rather check a compiler provided macro.
10-
*/
11-
#ifndef __BITS_PER_LONG
12-
#define __BITS_PER_LONG 32
13-
#endif
4+
#include <uapi/asm-generic/bitsperlong.h>
145

15-
#ifdef __KERNEL__
166

177
#ifdef CONFIG_64BIT
188
#define BITS_PER_LONG 64
@@ -32,5 +22,4 @@
3222
#define BITS_PER_LONG_LONG 64
3323
#endif
3424

35-
#endif /* __KERNEL__ */
3625
#endif /* __ASM_GENERIC_BITS_PER_LONG */

‎include/asm-generic/int-l64.h‎

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,11 @@
44
* Integer declarations for architectures which use "long"
55
* for 64-bit types.
66
*/
7-
87
#ifndef _ASM_GENERIC_INT_L64_H
98
#define _ASM_GENERIC_INT_L64_H
109

11-
#include <asm/bitsperlong.h>
12-
13-
#ifndef __ASSEMBLY__
14-
/*
15-
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
16-
* header files exported to user space
17-
*/
18-
19-
typedef __signed__ char __s8;
20-
typedef unsigned char __u8;
10+
#include <uapi/asm-generic/int-l64.h>
2111

22-
typedef __signed__ short __s16;
23-
typedef unsigned short __u16;
24-
25-
typedef __signed__ int __s32;
26-
typedef unsigned int __u32;
27-
28-
typedef __signed__ long __s64;
29-
typedef unsigned long __u64;
30-
31-
#endif /* __ASSEMBLY__ */
32-
33-
#ifdef __KERNEL__
3412

3513
#ifndef __ASSEMBLY__
3614

@@ -68,6 +46,4 @@ typedef unsigned long u64;
6846

6947
#endif /* __ASSEMBLY__ */
7048

71-
#endif /* __KERNEL__ */
72-
7349
#endif /* _ASM_GENERIC_INT_L64_H */

‎include/asm-generic/int-ll64.h‎

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,11 @@
44
* Integer declarations for architectures which use "long long"
55
* for 64-bit types.
66
*/
7-
87
#ifndef _ASM_GENERIC_INT_LL64_H
98
#define _ASM_GENERIC_INT_LL64_H
109

11-
#include <asm/bitsperlong.h>
12-
13-
#ifndef __ASSEMBLY__
14-
/*
15-
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
16-
* header files exported to user space
17-
*/
18-
19-
typedef __signed__ char __s8;
20-
typedef unsigned char __u8;
10+
#include <uapi/asm-generic/int-ll64.h>
2111

22-
typedef __signed__ short __s16;
23-
typedef unsigned short __u16;
24-
25-
typedef __signed__ int __s32;
26-
typedef unsigned int __u32;
27-
28-
#ifdef __GNUC__
29-
__extension__ typedef __signed__ long long __s64;
30-
__extension__ typedef unsigned long long __u64;
31-
#else
32-
typedef __signed__ long long __s64;
33-
typedef unsigned long long __u64;
34-
#endif
35-
36-
#endif /* __ASSEMBLY__ */
37-
38-
#ifdef __KERNEL__
3912

4013
#ifndef __ASSEMBLY__
4114

@@ -73,6 +46,4 @@ typedef unsigned long long u64;
7346

7447
#endif /* __ASSEMBLY__ */
7548

76-
#endif /* __KERNEL__ */
77-
7849
#endif /* _ASM_GENERIC_INT_LL64_H */

‎include/asm-generic/ioctl.h‎

Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,12 @@
11
#ifndef _ASM_GENERIC_IOCTL_H
22
#define _ASM_GENERIC_IOCTL_H
33

4-
/* ioctl command encoding: 32 bits total, command in lower 16 bits,
5-
* size of the parameter structure in the lower 14 bits of the
6-
* upper 16 bits.
7-
* Encoding the size of the parameter structure in the ioctl request
8-
* is useful for catching programs compiled with old versions
9-
* and to avoid overwriting user space outside the user buffer area.
10-
* The highest 2 bits are reserved for indicating the ``access mode''.
11-
* NOTE: This limits the max parameter size to 16kB -1 !
12-
*/
4+
#include <uapi/asm-generic/ioctl.h>
135

14-
/*
15-
* The following is for compatibility across the various Linux
16-
* platforms. The generic ioctl numbering scheme doesn't really enforce
17-
* a type field. De facto, however, the top 8 bits of the lower 16
18-
* bits are indeed used as a type field, so we might just as well make
19-
* this explicit here. Please be sure to use the decoding macros
20-
* below from now on.
21-
*/
22-
#define _IOC_NRBITS 8
23-
#define _IOC_TYPEBITS 8
24-
25-
/*
26-
* Let any architecture override either of the following before
27-
* including this file.
28-
*/
29-
30-
#ifndef _IOC_SIZEBITS
31-
# define _IOC_SIZEBITS 14
32-
#endif
33-
34-
#ifndef _IOC_DIRBITS
35-
# define _IOC_DIRBITS 2
36-
#endif
37-
38-
#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
39-
#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
40-
#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
41-
#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
42-
43-
#define _IOC_NRSHIFT 0
44-
#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
45-
#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
46-
#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
47-
48-
/*
49-
* Direction bits, which any architecture can choose to override
50-
* before including this file.
51-
*/
52-
53-
#ifndef _IOC_NONE
54-
# define _IOC_NONE 0U
55-
#endif
56-
57-
#ifndef _IOC_WRITE
58-
# define _IOC_WRITE 1U
59-
#endif
60-
61-
#ifndef _IOC_READ
62-
# define _IOC_READ 2U
63-
#endif
64-
65-
#define _IOC(dir,type,nr,size) \
66-
(((dir) << _IOC_DIRSHIFT) | \
67-
((type) << _IOC_TYPESHIFT) | \
68-
((nr) << _IOC_NRSHIFT) | \
69-
((size) << _IOC_SIZESHIFT))
70-
71-
#ifdef __KERNEL__
726
/* provoke compile error for invalid uses of size argument */
737
extern unsigned int __invalid_size_argument_for_IOC;
748
#define _IOC_TYPECHECK(t) \
759
((sizeof(t) == sizeof(t[1]) && \
7610
sizeof(t) < (1 << _IOC_SIZEBITS)) ? \
7711
sizeof(t) : __invalid_size_argument_for_IOC)
78-
#else
79-
#define _IOC_TYPECHECK(t) (sizeof(t))
80-
#endif
81-
82-
/* used to create numbers */
83-
#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
84-
#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
85-
#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
86-
#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
87-
#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
88-
#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
89-
#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
90-
91-
/* used to decode ioctl numbers.. */
92-
#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
93-
#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
94-
#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
95-
#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
96-
97-
/* ...and for the drivers/sound files... */
98-
99-
#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
100-
#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
101-
#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
102-
#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
103-
#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
104-
10512
#endif /* _ASM_GENERIC_IOCTL_H */

‎include/asm-generic/kvm_para.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#ifndef _ASM_GENERIC_KVM_PARA_H
22
#define _ASM_GENERIC_KVM_PARA_H
33

4-
#ifdef __KERNEL__
4+
#include <uapi/asm-generic/kvm_para.h>
5+
56

67
/*
78
* This function is used by architectures that support kvm to avoid issuing
@@ -17,6 +18,4 @@ static inline unsigned int kvm_arch_para_features(void)
1718
return 0;
1819
}
1920

20-
#endif /* _KERNEL__ */
21-
2221
#endif

‎include/asm-generic/param.h‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,10 @@
11
#ifndef __ASM_GENERIC_PARAM_H
22
#define __ASM_GENERIC_PARAM_H
33

4-
#ifndef HZ
5-
#define HZ 100
6-
#endif
4+
#include <uapi/asm-generic/param.h>
75

8-
#ifndef EXEC_PAGESIZE
9-
#define EXEC_PAGESIZE 4096
10-
#endif
11-
12-
#ifndef NOGROUP
13-
#define NOGROUP (-1)
14-
#endif
15-
16-
#define MAXHOSTNAMELEN 64 /* max length of hostname */
17-
18-
#ifdef __KERNEL__
196
# undef HZ
207
# define HZ CONFIG_HZ /* Internal kernel timer frequency */
218
# define USER_HZ 100 /* some user interfaces are */
229
# define CLOCKS_PER_SEC (USER_HZ) /* in "ticks" like times() */
23-
#endif
24-
2510
#endif /* __ASM_GENERIC_PARAM_H */

‎include/asm-generic/resource.h‎

Lines changed: 1 addition & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,8 @@
11
#ifndef _ASM_GENERIC_RESOURCE_H
22
#define _ASM_GENERIC_RESOURCE_H
33

4-
/*
5-
* Resource limit IDs
6-
*
7-
* ( Compatibility detail: there are architectures that have
8-
* a different rlimit ID order in the 5-9 range and want
9-
* to keep that order for binary compatibility. The reasons
10-
* are historic and all new rlimits are identical across all
11-
* arches. If an arch has such special order for some rlimits
12-
* then it defines them prior including asm-generic/resource.h. )
13-
*/
14-
15-
#define RLIMIT_CPU 0 /* CPU time in sec */
16-
#define RLIMIT_FSIZE 1 /* Maximum filesize */
17-
#define RLIMIT_DATA 2 /* max data size */
18-
#define RLIMIT_STACK 3 /* max stack size */
19-
#define RLIMIT_CORE 4 /* max core file size */
20-
21-
#ifndef RLIMIT_RSS
22-
# define RLIMIT_RSS 5 /* max resident set size */
23-
#endif
24-
25-
#ifndef RLIMIT_NPROC
26-
# define RLIMIT_NPROC 6 /* max number of processes */
27-
#endif
28-
29-
#ifndef RLIMIT_NOFILE
30-
# define RLIMIT_NOFILE 7 /* max number of open files */
31-
#endif
4+
#include <uapi/asm-generic/resource.h>
325

33-
#ifndef RLIMIT_MEMLOCK
34-
# define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */
35-
#endif
36-
37-
#ifndef RLIMIT_AS
38-
# define RLIMIT_AS 9 /* address space limit */
39-
#endif
40-
41-
#define RLIMIT_LOCKS 10 /* maximum file locks held */
42-
#define RLIMIT_SIGPENDING 11 /* max number of pending signals */
43-
#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */
44-
#define RLIMIT_NICE 13 /* max nice prio allowed to raise to
45-
0-39 for nice level 19 .. -20 */
46-
#define RLIMIT_RTPRIO 14 /* maximum realtime priority */
47-
#define RLIMIT_RTTIME 15 /* timeout for RT tasks in us */
48-
#define RLIM_NLIMITS 16
49-
50-
/*
51-
* SuS says limits have to be unsigned.
52-
* Which makes a ton more sense anyway.
53-
*
54-
* Some architectures override this (for compatibility reasons):
55-
*/
56-
#ifndef RLIM_INFINITY
57-
# define RLIM_INFINITY (~0UL)
58-
#endif
59-
60-
/*
61-
* RLIMIT_STACK default maximum - some architectures override it:
62-
*/
63-
#ifndef _STK_LIM_MAX
64-
# define _STK_LIM_MAX RLIM_INFINITY
65-
#endif
66-
67-
#ifdef __KERNEL__
686

697
/*
708
* boot-time rlimit defaults for the init task:
@@ -89,6 +27,4 @@
8927
[RLIMIT_RTTIME] = { RLIM_INFINITY, RLIM_INFINITY }, \
9028
}
9129

92-
#endif /* __KERNEL__ */
93-
9430
#endif

0 commit comments

Comments
 (0)