diff options
author | kib <kib@FreeBSD.org> | 2008-09-24 10:14:37 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-09-24 10:14:37 +0000 |
commit | c50080867468c7354bdcffe03f0917bb5813f5b7 (patch) | |
tree | 6f64cce43a5cbd519a28e6d8cdd1f045953d31aa /sys/amd64 | |
parent | c01b2f07c60be4c69749ddba8fb198994cca96b5 (diff) | |
download | FreeBSD-src-c50080867468c7354bdcffe03f0917bb5813f5b7.zip FreeBSD-src-c50080867468c7354bdcffe03f0917bb5813f5b7.tar.gz |
Change the static struct sysentvec and struct Elf_Brandinfo initializers
to the C99 style. At least, it is easier to read sysent definitions
that way, and search for the actual instances of sigcode etc.
Explicitely initialize sysentvec.sv_maxssiz that was missed in most
sysvecs.
No objection from: jhb
MFC after: 1 month
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/elf_machdep.c | 89 | ||||
-rw-r--r-- | sys/amd64/linux32/linux32_sysvec.c | 98 |
2 files changed, 94 insertions, 93 deletions
diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c index fdef5e3..ec1afc7 100644 --- a/sys/amd64/amd64/elf_machdep.c +++ b/sys/amd64/amd64/elf_machdep.c @@ -46,59 +46,60 @@ __FBSDID("$FreeBSD$"); #include <machine/md_var.h> struct sysentvec elf64_freebsd_sysvec = { - SYS_MAXSYSCALL, - sysent, - 0, - 0, - NULL, - 0, - NULL, - NULL, - __elfN(freebsd_fixup), - sendsig, - sigcode, - &szsigcode, - NULL, - "FreeBSD ELF64", - __elfN(coredump), - NULL, - MINSIGSTKSZ, - PAGE_SIZE, - VM_MIN_ADDRESS, - VM_MAXUSER_ADDRESS, - USRSTACK, - PS_STRINGS, - VM_PROT_ALL, - exec_copyout_strings, - exec_setregs, - NULL + .sv_size = SYS_MAXSYSCALL, + .sv_table = sysent, + .sv_mask = 0, + .sv_sigsize = 0, + .sv_sigtbl = NULL, + .sv_errsize = 0, + .sv_errtbl = NULL, + .sv_transtrap = NULL, + .sv_fixup = __elfN(freebsd_fixup), + .sv_sendsig = sendsig, + .sv_sigcode = sigcode, + .sv_szsigcode = &szsigcode, + .sv_prepsyscall = NULL, + .sv_name = "FreeBSD ELF64", + .sv_coredump = __elfN(coredump), + .sv_imgact_try = NULL, + .sv_minsigstksz = MINSIGSTKSZ, + .sv_pagesize = PAGE_SIZE, + .sv_minuser = VM_MIN_ADDRESS, + .sv_maxuser = VM_MAXUSER_ADDRESS, + .sv_usrstack = USRSTACK, + .sv_psstrings = PS_STRINGS, + .sv_stackprot = VM_PROT_ALL, + .sv_copyout_strings = exec_copyout_strings, + .sv_setregs = exec_setregs, + .sv_fixlimit = NULL, + .sv_maxssiz = NULL }; static Elf64_Brandinfo freebsd_brand_info = { - ELFOSABI_FREEBSD, - EM_X86_64, - "FreeBSD", - NULL, - "/libexec/ld-elf.so.1", - &elf64_freebsd_sysvec, - NULL, - BI_CAN_EXEC_DYN, - }; + .brand = ELFOSABI_FREEBSD, + .machine = EM_X86_64, + .compat_3_brand = "FreeBSD", + .emul_path = NULL, + .interp_path = "/libexec/ld-elf.so.1", + .sysvec = &elf64_freebsd_sysvec, + .interp_newpath = NULL, + .flags = BI_CAN_EXEC_DYN, +}; SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t) elf64_insert_brand_entry, &freebsd_brand_info); static Elf64_Brandinfo freebsd_brand_oinfo = { - ELFOSABI_FREEBSD, - EM_X86_64, - "FreeBSD", - NULL, - "/usr/libexec/ld-elf.so.1", - &elf64_freebsd_sysvec, - NULL, - BI_CAN_EXEC_DYN, - }; + .brand = ELFOSABI_FREEBSD, + .machine = EM_X86_64, + .compat_3_brand = "FreeBSD", + .emul_path = NULL, + .interp_path = "/usr/libexec/ld-elf.so.1", + .sysvec = &elf64_freebsd_sysvec, + .interp_newpath = NULL, + .flags = BI_CAN_EXEC_DYN, +}; SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t) elf64_insert_brand_entry, diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 3848fb0..5676ddd 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -1000,62 +1000,62 @@ linux32_fixlimit(struct rlimit *rl, int which) } struct sysentvec elf_linux_sysvec = { - LINUX_SYS_MAXSYSCALL, - linux_sysent, - 0, - LINUX_SIGTBLSZ, - bsd_to_linux_signal, - ELAST + 1, - bsd_to_linux_errno, - translate_traps, - elf_linux_fixup, - linux_sendsig, - linux_sigcode, - &linux_szsigcode, - linux_prepsyscall, - "Linux ELF32", - elf32_coredump, - exec_linux_imgact_try, - LINUX_MINSIGSTKSZ, - PAGE_SIZE, - VM_MIN_ADDRESS, - LINUX32_USRSTACK, - LINUX32_USRSTACK, - LINUX32_PS_STRINGS, - VM_PROT_ALL, - linux_copyout_strings, - exec_linux_setregs, - linux32_fixlimit, - &linux32_maxssiz, + .sv_size = LINUX_SYS_MAXSYSCALL, + .sv_table = linux_sysent, + .sv_mask = 0, + .sv_sigsize = LINUX_SIGTBLSZ, + .sv_sigtbl = bsd_to_linux_signal, + .sv_errsize = ELAST + 1, + .sv_errtbl = bsd_to_linux_errno, + .sv_transtrap = translate_traps, + .sv_fixup = elf_linux_fixup, + .sv_sendsig = linux_sendsig, + .sv_sigcode = linux_sigcode, + .sv_szsigcode = &linux_szsigcode, + .sv_prepsyscall = linux_prepsyscall, + .sv_name = "Linux ELF32", + .sv_coredump = elf32_coredump, + .sv_imgact_try = exec_linux_imgact_try, + .sv_minsigstksz = LINUX_MINSIGSTKSZ, + .sv_pagesize = PAGE_SIZE, + .sv_minuser = VM_MIN_ADDRESS, + .sv_maxuser = LINUX32_USRSTACK, + .sv_usrstack = LINUX32_USRSTACK, + .sv_psstrings = LINUX32_PS_STRINGS, + .sv_stackprot = VM_PROT_ALL, + .sv_copyout_strings = linux_copyout_strings, + .sv_setregs = exec_linux_setregs, + .sv_fixlimit = linux32_fixlimit, + .sv_maxssiz = &linux32_maxssiz, }; static Elf32_Brandinfo linux_brand = { - ELFOSABI_LINUX, - EM_386, - "Linux", - "/compat/linux", - "/lib/ld-linux.so.1", - &elf_linux_sysvec, - NULL, - BI_CAN_EXEC_DYN, - }; + .brand = ELFOSABI_LINUX, + .machine = EM_386, + .compat_3_brand = "Linux", + .emul_path = "/compat/linux", + .interp_path = "/lib/ld-linux.so.1", + .sysvec = &elf_linux_sysvec, + .interp_newpath = NULL, + .flags = BI_CAN_EXEC_DYN, +}; static Elf32_Brandinfo linux_glibc2brand = { - ELFOSABI_LINUX, - EM_386, - "Linux", - "/compat/linux", - "/lib/ld-linux.so.2", - &elf_linux_sysvec, - NULL, - BI_CAN_EXEC_DYN, - }; + .brand = ELFOSABI_LINUX, + .machine = EM_386, + .compat_3_brand = "Linux", + .emul_path = "/compat/linux", + .interp_path = "/lib/ld-linux.so.2", + .sysvec = &elf_linux_sysvec, + .interp_newpath = NULL, + .flags = BI_CAN_EXEC_DYN, +}; Elf32_Brandinfo *linux_brandlist[] = { - &linux_brand, - &linux_glibc2brand, - NULL - }; + &linux_brand, + &linux_glibc2brand, + NULL +}; static int linux_elf_modevent(module_t mod, int type, void *data) |