aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-07-20 02:56:12 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-07-20 02:56:12 +0000
commit3ebc124838799d79bb81993028066939255edfbf (patch)
tree442882c197085f1177ad99039e6387b24c60e44a /sys/sys
parent382f95d332eb42a6a06ef585d2855b536978a48d (diff)
downloadsrc-3ebc124838799d79bb81993028066939255edfbf.tar.gz
src-3ebc124838799d79bb81993028066939255edfbf.zip
Infrastructure tweaks to allow having both an Elf32 and an Elf64 executable
handler in the kernel at the same time. Also, allow for the exec_new_vmspace() code to build a different sized vmspace depending on the executable environment. This is a big help for execing i386 binaries on ia64. The ELF exec code grows the ability to map partial pages when there is a page size difference, eg: emulating 4K pages on 8K or 16K hardware pages. Flesh out the i386 emulation support for ia64. At this point, the only binary that I know of that fails is cvsup, because the cvsup runtime tries to execute code in pages not marked executable. Obtained from: dfr (mostly, many tweaks from me).
Notes
Notes: svn path=/head/; revision=100384
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/elf_generic.h1
-rw-r--r--sys/sys/imgact.h3
-rw-r--r--sys/sys/imgact_elf.h24
-rw-r--r--sys/sys/sysent.h5
4 files changed, 22 insertions, 11 deletions
diff --git a/sys/sys/elf_generic.h b/sys/sys/elf_generic.h
index cf8da57832ed..cc0c471ad90c 100644
--- a/sys/sys/elf_generic.h
+++ b/sys/sys/elf_generic.h
@@ -50,6 +50,7 @@
#error "Unknown byte order"
#endif
+#define __elfN(x) __CONCAT(__CONCAT(__CONCAT(elf,__ELF_WORD_SIZE),_),x)
#define __ElfN(x) __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x)
#define __ELFN(x) __CONCAT(__CONCAT(__CONCAT(ELF,__ELF_WORD_SIZE),_),x)
#define __ElfType(x) typedef __ElfN(x) __CONCAT(Elf_,x)
diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h
index 6d599648b63b..819ae13547f7 100644
--- a/sys/sys/imgact.h
+++ b/sys/sys/imgact.h
@@ -67,7 +67,8 @@ struct image_params {
#ifdef _KERNEL
int exec_check_permissions(struct image_params *);
int exec_extract_strings(struct image_params *);
-int exec_new_vmspace(struct image_params *);
+int exec_new_vmspace(struct image_params *, vm_offset_t, vm_offset_t,
+ vm_offset_t);
int exec_shell_imgact(struct image_params *);
#endif
diff --git a/sys/sys/imgact_elf.h b/sys/sys/imgact_elf.h
index ecaf40d7dd69..1cc301487e18 100644
--- a/sys/sys/imgact_elf.h
+++ b/sys/sys/imgact_elf.h
@@ -37,6 +37,8 @@
#define AUXARGS_ENTRY(pos, id, val) {suword(pos++, id); suword(pos++, val);}
+struct thread;
+
#if ELF_TARG_CLASS == ELFCLASS32
/*
@@ -57,6 +59,7 @@ typedef struct {
typedef struct {
int brand;
+ int machine;
const char *compat_3_brand; /* pre Binutils 2.10 method (FBSD 3) */
const char *emul_path;
const char *interp_path;
@@ -65,9 +68,11 @@ typedef struct {
#define MAX_BRANDS 8
-int elf_brand_inuse(Elf32_Brandinfo *entry);
-int elf_insert_brand_entry(Elf32_Brandinfo *entry);
-int elf_remove_brand_entry(Elf32_Brandinfo *entry);
+int elf32_brand_inuse(Elf32_Brandinfo *entry);
+int elf32_insert_brand_entry(Elf32_Brandinfo *entry);
+int elf32_remove_brand_entry(Elf32_Brandinfo *entry);
+int elf32_freebsd_fixup(register_t **, struct image_params *);
+int elf32_coredump(struct thread *, struct vnode *, off_t);
#else /* !(ELF_TARG_CLASS == ELFCLASS32) */
@@ -89,6 +94,7 @@ typedef struct {
typedef struct {
int brand;
+ int machine;
const char *compat_3_brand; /* pre Binutils 2.10 method (FBSD 3) */
const char *emul_path;
const char *interp_path;
@@ -97,16 +103,14 @@ typedef struct {
#define MAX_BRANDS 8
-int elf_brand_inuse(Elf64_Brandinfo *entry);
-int elf_insert_brand_entry(Elf64_Brandinfo *entry);
-int elf_remove_brand_entry(Elf64_Brandinfo *entry);
+int elf64_brand_inuse(Elf64_Brandinfo *entry);
+int elf64_insert_brand_entry(Elf64_Brandinfo *entry);
+int elf64_remove_brand_entry(Elf64_Brandinfo *entry);
+int elf64_freebsd_fixup(register_t **, struct image_params *);
+int elf64_coredump(struct thread *, struct vnode *, off_t);
#endif /* ELF_TARG_CLASS == ELFCLASS32 */
-struct thread;
-
-int elf_coredump(struct thread *, struct vnode *, off_t);
-
#endif /* _KERNEL */
#endif /* !_SYS_IMGACT_ELF_H_ */
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index 19c9bc07b478..7271ccf947a1 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -79,6 +79,11 @@ struct sysentvec {
/* function to dump core, or NULL */
int (*sv_imgact_try)(struct image_params *);
int sv_minsigstksz; /* minimum signal stack size */
+ int sv_pagesize; /* pagesize override */
+ vm_offset_t sv_maxuser; /* VM_MAXUSER_ADDRESS override */
+ vm_offset_t sv_usrstack; /* USRSTACK override */
+ register_t *(*sv_copyout_strings)(struct image_params *);
+ void (*sv_setregs)(struct thread *, u_long, u_long, u_long);
};
#ifdef _KERNEL