Commit 71613c3b871c5a9f27cc48f124251bcd3aa23be1

Authored by Al Viro
1 parent 3c456bfc4b

get rid of pt_regs argument of ->load_binary()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 12 changed files with 25 additions and 20 deletions Side-by-side Diff

arch/alpha/kernel/binfmt_loader.c
... ... @@ -5,7 +5,7 @@
5 5 #include <linux/binfmts.h>
6 6 #include <linux/a.out.h>
7 7  
8   -static int load_binary(struct linux_binprm *bprm, struct pt_regs *regs)
  8 +static int load_binary(struct linux_binprm *bprm)
9 9 {
10 10 struct exec *eh = (struct exec *)bprm->buf;
11 11 unsigned long loader;
arch/x86/ia32/ia32_aout.c
... ... @@ -35,7 +35,7 @@
35 35 #undef WARN_OLD
36 36 #undef CORE_DUMP /* definitely broken */
37 37  
38   -static int load_aout_binary(struct linux_binprm *, struct pt_regs *regs);
  38 +static int load_aout_binary(struct linux_binprm *);
39 39 static int load_aout_library(struct file *);
40 40  
41 41 #ifdef CORE_DUMP
42 42  
... ... @@ -260,9 +260,10 @@
260 260 * These are the functions used to load a.out style executables and shared
261 261 * libraries. There is no binary dependent code anywhere else.
262 262 */
263   -static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
  263 +static int load_aout_binary(struct linux_binprm *bprm)
264 264 {
265 265 unsigned long error, fd_offset, rlim;
  266 + struct pt_regs *regs = current_pt_regs();
266 267 struct exec ex;
267 268 int retval;
268 269  
... ... @@ -30,7 +30,7 @@
30 30 #include <asm/cacheflush.h>
31 31 #include <asm/a.out-core.h>
32 32  
33   -static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
  33 +static int load_aout_binary(struct linux_binprm *);
34 34 static int load_aout_library(struct file*);
35 35  
36 36 #ifdef CONFIG_COREDUMP
37 37  
... ... @@ -201,8 +201,9 @@
201 201 * libraries. There is no binary dependent code anywhere else.
202 202 */
203 203  
204   -static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
  204 +static int load_aout_binary(struct linux_binprm * bprm)
205 205 {
  206 + struct pt_regs *regs = current_pt_regs();
206 207 struct exec ex;
207 208 unsigned long error;
208 209 unsigned long fd_offset;
... ... @@ -44,7 +44,7 @@
44 44 #define user_siginfo_t siginfo_t
45 45 #endif
46 46  
47   -static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs);
  47 +static int load_elf_binary(struct linux_binprm *bprm);
48 48 static int load_elf_library(struct file *);
49 49 static unsigned long elf_map(struct file *, unsigned long, struct elf_phdr *,
50 50 int, int, unsigned long);
... ... @@ -558,7 +558,7 @@
558 558 #endif
559 559 }
560 560  
561   -static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
  561 +static int load_elf_binary(struct linux_binprm *bprm)
562 562 {
563 563 struct file *interpreter = NULL; /* to shut gcc up */
564 564 unsigned long load_addr = 0, load_bias = 0;
... ... @@ -575,6 +575,7 @@
575 575 unsigned long reloc_func_desc __maybe_unused = 0;
576 576 int executable_stack = EXSTACK_DEFAULT;
577 577 unsigned long def_flags = 0;
  578 + struct pt_regs *regs = current_pt_regs();
578 579 struct {
579 580 struct elfhdr elf_ex;
580 581 struct elfhdr interp_elf_ex;
fs/binfmt_elf_fdpic.c
... ... @@ -56,7 +56,7 @@
56 56  
57 57 MODULE_LICENSE("GPL");
58 58  
59   -static int load_elf_fdpic_binary(struct linux_binprm *, struct pt_regs *);
  59 +static int load_elf_fdpic_binary(struct linux_binprm *);
60 60 static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *, struct file *);
61 61 static int elf_fdpic_map_file(struct elf_fdpic_params *, struct file *,
62 62 struct mm_struct *, const char *);
63 63  
... ... @@ -164,10 +164,10 @@
164 164 /*
165 165 * load an fdpic binary into various bits of memory
166 166 */
167   -static int load_elf_fdpic_binary(struct linux_binprm *bprm,
168   - struct pt_regs *regs)
  167 +static int load_elf_fdpic_binary(struct linux_binprm *bprm)
169 168 {
170 169 struct elf_fdpic_params exec_params, interp_params;
  170 + struct pt_regs *regs = current_pt_regs();
171 171 struct elf_phdr *phdr;
172 172 unsigned long stack_size, entryaddr;
173 173 #ifdef ELF_FDPIC_PLAT_INIT
... ... @@ -22,7 +22,7 @@
22 22 #define EM86_INTERP "/usr/bin/em86"
23 23 #define EM86_I_NAME "em86"
24 24  
25   -static int load_em86(struct linux_binprm *bprm,struct pt_regs *regs)
  25 +static int load_em86(struct linux_binprm *bprm)
26 26 {
27 27 char *interp, *i_name, *i_arg;
28 28 struct file * file;
... ... @@ -88,7 +88,7 @@
88 88 static int load_flat_shared_library(int id, struct lib_info *p);
89 89 #endif
90 90  
91   -static int load_flat_binary(struct linux_binprm *, struct pt_regs * regs);
  91 +static int load_flat_binary(struct linux_binprm *);
92 92 static int flat_core_dump(struct coredump_params *cprm);
93 93  
94 94 static struct linux_binfmt flat_format = {
95 95  
... ... @@ -858,9 +858,10 @@
858 858 * libraries. There is no binary dependent code anywhere else.
859 859 */
860 860  
861   -static int load_flat_binary(struct linux_binprm * bprm, struct pt_regs * regs)
  861 +static int load_flat_binary(struct linux_binprm * bprm)
862 862 {
863 863 struct lib_info libinfo;
  864 + struct pt_regs *regs = current_pt_regs();
864 865 unsigned long p = bprm->p;
865 866 unsigned long stack_len;
866 867 unsigned long start_addr;
... ... @@ -104,7 +104,7 @@
104 104 /*
105 105 * the loader itself
106 106 */
107   -static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
  107 +static int load_misc_binary(struct linux_binprm *bprm)
108 108 {
109 109 Node *fmt;
110 110 struct file * interp_file = NULL;
... ... @@ -14,7 +14,7 @@
14 14 #include <linux/err.h>
15 15 #include <linux/fs.h>
16 16  
17   -static int load_script(struct linux_binprm *bprm,struct pt_regs *regs)
  17 +static int load_script(struct linux_binprm *bprm)
18 18 {
19 19 const char *i_arg, *i_name;
20 20 char *cp;
... ... @@ -35,7 +35,7 @@
35 35  
36 36 #include <linux/elf.h>
37 37  
38   -static int load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs);
  38 +static int load_som_binary(struct linux_binprm * bprm);
39 39 static int load_som_library(struct file *);
40 40  
41 41 /*
42 42  
... ... @@ -180,13 +180,14 @@
180 180 */
181 181  
182 182 static int
183   -load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
  183 +load_som_binary(struct linux_binprm * bprm)
184 184 {
185 185 int retval;
186 186 unsigned int size;
187 187 unsigned long som_entry;
188 188 struct som_hdr *som_ex;
189 189 struct som_exec_auxhdr *hpuxhdr;
  190 + struct pt_regs *regs = current_pt_regs();
190 191  
191 192 /* Get the exec-header */
192 193 som_ex = (struct som_hdr *) bprm->buf;
... ... @@ -1374,13 +1374,13 @@
1374 1374 for (try=0; try<2; try++) {
1375 1375 read_lock(&binfmt_lock);
1376 1376 list_for_each_entry(fmt, &formats, lh) {
1377   - int (*fn)(struct linux_binprm *, struct pt_regs *) = fmt->load_binary;
  1377 + int (*fn)(struct linux_binprm *) = fmt->load_binary;
1378 1378 if (!fn)
1379 1379 continue;
1380 1380 if (!try_module_get(fmt->module))
1381 1381 continue;
1382 1382 read_unlock(&binfmt_lock);
1383   - retval = fn(bprm, current_pt_regs());
  1383 + retval = fn(bprm);
1384 1384 /*
1385 1385 * Restore the depth counter to its starting value
1386 1386 * in this call, so we don't have to rely on every
include/linux/binfmts.h
... ... @@ -72,7 +72,7 @@
72 72 struct linux_binfmt {
73 73 struct list_head lh;
74 74 struct module *module;
75   - int (*load_binary)(struct linux_binprm *, struct pt_regs * regs);
  75 + int (*load_binary)(struct linux_binprm *);
76 76 int (*load_shlib)(struct file *);
77 77 int (*core_dump)(struct coredump_params *cprm);
78 78 unsigned long min_coredump; /* minimal dump size */