OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [binfmts.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
#ifndef _LINUX_BINFMTS_H
2
#define _LINUX_BINFMTS_H
3
 
4
#include <linux/ptrace.h>
5
 
6
/*
7
 * MAX_ARG_PAGES defines the number of pages allocated for arguments
8
 * and envelope for the new program. 32 should suffice, this gives
9
 * a maximum env+arg of 128kB w/4KB pages!
10
 */
11
#define MAX_ARG_PAGES 32
12
 
13
/*
14
 * This structure is used to hold the arguments that are used when loading binaries.
15
 */
16
struct linux_binprm{
17
        char buf[128];
18
#ifndef NO_MM
19
        unsigned long page[MAX_ARG_PAGES];
20
#else /* !NO_MM */
21
        char ** envp, **argv;
22
#endif /* !NO_MM */
23
        unsigned long p;
24
        int sh_bang;
25
        struct inode * inode;
26
        int e_uid, e_gid;
27
        int argc, envc;
28
        char * filename;        /* Name of binary */
29
        unsigned long loader, exec;
30
        int dont_iput;          /* binfmt handler has put inode */
31
};
32
 
33
/*
34
 * This structure defines the functions that are used to load the binary formats that
35
 * linux accepts.
36
 */
37
struct linux_binfmt {
38
        struct linux_binfmt * next;
39
        long *use_count;
40
        int (*load_binary)(struct linux_binprm *, struct  pt_regs * regs);
41
        int (*load_shlib)(int fd);
42
        int (*core_dump)(long signr, struct pt_regs * regs);
43
};
44
 
45
extern int register_binfmt(struct linux_binfmt *);
46
extern int unregister_binfmt(struct linux_binfmt *);
47
 
48
extern int read_exec(struct inode *inode, unsigned long offset,
49
        char * addr, unsigned long count, int to_kmem);
50
 
51
extern int open_inode(struct inode * inode, int mode);
52
 
53
extern int init_flat_binfmt(void);
54
extern int init_elf_binfmt(void);
55
extern int init_aout_binfmt(void);
56
extern int init_script_binfmt(void);
57
extern int init_java_binfmt(void);
58
 
59
extern int prepare_binprm(struct linux_binprm *);
60
extern void remove_arg_zero(struct linux_binprm *);
61
extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
62
extern int flush_old_exec(struct linux_binprm * bprm);
63
extern unsigned long setup_arg_pages(unsigned long p, struct linux_binprm * bprm);
64
extern unsigned long copy_strings(int argc,char ** argv,unsigned long *page,
65
                unsigned long p, int from_kmem);
66
 
67
/* this eventually goes away */
68
#define change_ldt(a,b) setup_arg_pages(a,b)
69
 
70
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.