1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef _LINUX_PERSONALITY_H
13#define _LINUX_PERSONALITY_H
14
15struct exec_domain;
16struct pt_regs;
17
18enum {
19 ADDR_NO_RANDOMIZE = 0x0040000,
20 FDPIC_FUNCPTRS = 0x0080000,
21 MMAP_PAGE_ZERO = 0x0100000,
22 ADDR_COMPAT_LAYOUT = 0x0200000,
23 READ_IMPLIES_EXEC = 0x0400000,
24 ADDR_LIMIT_32BIT = 0x0800000,
25 SHORT_INODE = 0x1000000,
26 WHOLE_SECONDS = 0x2000000,
27 STICKY_TIMEOUTS = 0x4000000,
28 ADDR_LIMIT_3GB = 0x8000000,
29};
30
31#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE)
32
33enum {
34 PER_LINUX = 0x0000,
35 PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
36 PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
37 PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
38 PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
39 PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
40 WHOLE_SECONDS | SHORT_INODE,
41 PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
42 PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
43 PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
44 PER_BSD = 0x0006,
45 PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
46 PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
47 PER_LINUX32 = 0x0008,
48 PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
49 PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,
50 PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,
51 PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,
52 PER_RISCOS = 0x000c,
53 PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
54 PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
55 PER_OSF4 = 0x000f,
56 PER_HPUX = 0x0010,
57 PER_MASK = 0x00ff,
58};
59
60typedef void (*handler_t)(int, struct pt_regs *);
61
62struct exec_domain {
63 const char *name;
64 handler_t handler;
65 unsigned char pers_low;
66 unsigned char pers_high;
67 unsigned long *signal_map;
68 unsigned long *signal_invmap;
69 struct map_segment *err_map;
70 struct map_segment *socktype_map;
71 struct map_segment *sockopt_map;
72 struct map_segment *af_map;
73 struct module *module;
74 struct exec_domain *next;
75};
76
77#define personality(pers) (pers & PER_MASK)
78
79#define get_personality (current->personality)
80
81#define set_personality(pers)   ((current->personality == pers) ? 0 : __set_personality(pers))
82
83#endif
84