Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144369
b: refs/heads/master
c: 74641f5
h: refs/heads/master
i:
  144367: a054394
v: v3
  • Loading branch information
Ivan Kokshaysky authored and Linus Torvalds committed May 2, 2009
1 parent 87dccd2 commit ddf8acf
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 77b4cf5cb0c9d6010a18030a0e0a8d2aaf6b43ec
refs/heads/master: 74641f584da8eccf30becfbb5507ab457187db22
6 changes: 5 additions & 1 deletion trunk/arch/alpha/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror -Wno-sign-compare

obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
irq_alpha.o signal.o setup.o ptrace.o time.o \
alpha_ksyms.o systbls.o err_common.o io.o binfmt_loader.o
alpha_ksyms.o systbls.o err_common.o io.o

obj-$(CONFIG_VGA_HOSE) += console.o
obj-$(CONFIG_SMP) += smp.o
Expand Down Expand Up @@ -43,6 +43,10 @@ else
# Misc support
obj-$(CONFIG_ALPHA_SRM) += srmcons.o

ifdef CONFIG_BINFMT_AOUT
obj-y += binfmt_loader.o
endif

# Core logic support
obj-$(CONFIG_ALPHA_APECS) += core_apecs.o
obj-$(CONFIG_ALPHA_CIA) += core_cia.o
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/kernel/binfmt_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ static struct linux_binfmt loader_format = {

static int __init init_loader_binfmt(void)
{
return register_binfmt(&loader_format);
return insert_binfmt(&loader_format);
}
arch_initcall(init_loader_binfmt);
7 changes: 4 additions & 3 deletions trunk/fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,18 @@ int suid_dumpable = 0;
static LIST_HEAD(formats);
static DEFINE_RWLOCK(binfmt_lock);

int register_binfmt(struct linux_binfmt * fmt)
int __register_binfmt(struct linux_binfmt * fmt, int insert)
{
if (!fmt)
return -EINVAL;
write_lock(&binfmt_lock);
list_add(&fmt->lh, &formats);
insert ? list_add(&fmt->lh, &formats) :
list_add_tail(&fmt->lh, &formats);
write_unlock(&binfmt_lock);
return 0;
}

EXPORT_SYMBOL(register_binfmt);
EXPORT_SYMBOL(__register_binfmt);

void unregister_binfmt(struct linux_binfmt * fmt)
{
Expand Down
14 changes: 13 additions & 1 deletion trunk/include/linux/binfmts.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,19 @@ struct linux_binfmt {
int hasvdso;
};

extern int register_binfmt(struct linux_binfmt *);
extern int __register_binfmt(struct linux_binfmt *fmt, int insert);

/* Registration of default binfmt handlers */
static inline int register_binfmt(struct linux_binfmt *fmt)
{
return __register_binfmt(fmt, 0);
}
/* Same as above, but adds a new binfmt at the top of the list */
static inline int insert_binfmt(struct linux_binfmt *fmt)
{
return __register_binfmt(fmt, 1);
}

extern void unregister_binfmt(struct linux_binfmt *);

extern int prepare_binprm(struct linux_binprm *);
Expand Down

0 comments on commit ddf8acf

Please sign in to comment.