diff options
author | H. J. Lu <hjl@lucon.org> | 2005-09-06 18:16:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:21 -0400 |
commit | 36d57ac4a818cb4aa3edbdf63ad2ebc31106f925 (patch) | |
tree | 445eda00ee5974a65e21152cd240fb604c6d112d /include/linux | |
parent | 32605a18152b246df483fadc1c23854addde8755 (diff) |
[PATCH] auxiliary vector cleanups
The size of auxiliary vector is fixed at 42 in linux/sched.h. But it isn't
very obvious when looking at linux/elf.h. This patch adds AT_VECTOR_SIZE
so that we can change it if necessary when a new vector is added.
Because of include file ordering problems, doing this necessitated the
extraction of the AT_* symbols into a standalone header file.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/auxvec.h | 31 | ||||
-rw-r--r-- | include/linux/elf.h | 24 | ||||
-rw-r--r-- | include/linux/sched.h | 4 |
3 files changed, 35 insertions, 24 deletions
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h new file mode 100644 index 000000000000..9a7b374c9fb4 --- /dev/null +++ b/include/linux/auxvec.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef _LINUX_AUXVEC_H | ||
2 | #define _LINUX_AUXVEC_H | ||
3 | |||
4 | #include <asm/auxvec.h> | ||
5 | |||
6 | /* Symbolic values for the entries in the auxiliary table | ||
7 | put on the initial stack */ | ||
8 | #define AT_NULL 0 /* end of vector */ | ||
9 | #define AT_IGNORE 1 /* entry should be ignored */ | ||
10 | #define AT_EXECFD 2 /* file descriptor of program */ | ||
11 | #define AT_PHDR 3 /* program headers for program */ | ||
12 | #define AT_PHENT 4 /* size of program header entry */ | ||
13 | #define AT_PHNUM 5 /* number of program headers */ | ||
14 | #define AT_PAGESZ 6 /* system page size */ | ||
15 | #define AT_BASE 7 /* base address of interpreter */ | ||
16 | #define AT_FLAGS 8 /* flags */ | ||
17 | #define AT_ENTRY 9 /* entry point of program */ | ||
18 | #define AT_NOTELF 10 /* program is not ELF */ | ||
19 | #define AT_UID 11 /* real uid */ | ||
20 | #define AT_EUID 12 /* effective uid */ | ||
21 | #define AT_GID 13 /* real gid */ | ||
22 | #define AT_EGID 14 /* effective gid */ | ||
23 | #define AT_PLATFORM 15 /* string identifying CPU for optimizations */ | ||
24 | #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ | ||
25 | #define AT_CLKTCK 17 /* frequency at which times() increments */ | ||
26 | |||
27 | #define AT_SECURE 23 /* secure mode boolean */ | ||
28 | |||
29 | #define AT_VECTOR_SIZE 42 /* Size of auxiliary table. */ | ||
30 | |||
31 | #endif /* _LINUX_AUXVEC_H */ | ||
diff --git a/include/linux/elf.h b/include/linux/elf.h index f5b3ba5a317d..ff955dbf510d 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_ELF_H | 2 | #define _LINUX_ELF_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/auxvec.h> | ||
5 | #include <asm/elf.h> | 6 | #include <asm/elf.h> |
6 | 7 | ||
7 | #ifndef elf_read_implies_exec | 8 | #ifndef elf_read_implies_exec |
@@ -158,29 +159,6 @@ typedef __s64 Elf64_Sxword; | |||
158 | #define ELF64_ST_BIND(x) ELF_ST_BIND(x) | 159 | #define ELF64_ST_BIND(x) ELF_ST_BIND(x) |
159 | #define ELF64_ST_TYPE(x) ELF_ST_TYPE(x) | 160 | #define ELF64_ST_TYPE(x) ELF_ST_TYPE(x) |
160 | 161 | ||
161 | /* Symbolic values for the entries in the auxiliary table | ||
162 | put on the initial stack */ | ||
163 | #define AT_NULL 0 /* end of vector */ | ||
164 | #define AT_IGNORE 1 /* entry should be ignored */ | ||
165 | #define AT_EXECFD 2 /* file descriptor of program */ | ||
166 | #define AT_PHDR 3 /* program headers for program */ | ||
167 | #define AT_PHENT 4 /* size of program header entry */ | ||
168 | #define AT_PHNUM 5 /* number of program headers */ | ||
169 | #define AT_PAGESZ 6 /* system page size */ | ||
170 | #define AT_BASE 7 /* base address of interpreter */ | ||
171 | #define AT_FLAGS 8 /* flags */ | ||
172 | #define AT_ENTRY 9 /* entry point of program */ | ||
173 | #define AT_NOTELF 10 /* program is not ELF */ | ||
174 | #define AT_UID 11 /* real uid */ | ||
175 | #define AT_EUID 12 /* effective uid */ | ||
176 | #define AT_GID 13 /* real gid */ | ||
177 | #define AT_EGID 14 /* effective gid */ | ||
178 | #define AT_PLATFORM 15 /* string identifying CPU for optimizations */ | ||
179 | #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ | ||
180 | #define AT_CLKTCK 17 /* frequency at which times() increments */ | ||
181 | |||
182 | #define AT_SECURE 23 /* secure mode boolean */ | ||
183 | |||
184 | typedef struct dynamic{ | 162 | typedef struct dynamic{ |
185 | Elf32_Sword d_tag; | 163 | Elf32_Sword d_tag; |
186 | union{ | 164 | union{ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5fb31bede103..b5a22ea80045 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -35,6 +35,8 @@ | |||
35 | #include <linux/topology.h> | 35 | #include <linux/topology.h> |
36 | #include <linux/seccomp.h> | 36 | #include <linux/seccomp.h> |
37 | 37 | ||
38 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ | ||
39 | |||
38 | struct exec_domain; | 40 | struct exec_domain; |
39 | 41 | ||
40 | /* | 42 | /* |
@@ -261,7 +263,7 @@ struct mm_struct { | |||
261 | mm_counter_t _rss; | 263 | mm_counter_t _rss; |
262 | mm_counter_t _anon_rss; | 264 | mm_counter_t _anon_rss; |
263 | 265 | ||
264 | unsigned long saved_auxv[42]; /* for /proc/PID/auxv */ | 266 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
265 | 267 | ||
266 | unsigned dumpable:2; | 268 | unsigned dumpable:2; |
267 | cpumask_t cpu_vm_mask; | 269 | cpumask_t cpu_vm_mask; |