Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys c99 initializers for struct execsw
details: https://anonhg.NetBSD.org/src/rev/320ebf08deb7
branches: trunk
changeset: 327410:320ebf08deb7
user: christos <christos%NetBSD.org@localhost>
date: Fri Mar 07 01:33:43 2014 +0000
description:
c99 initializers for struct execsw
diffstat:
sys/compat/aoutm68k/aoutm68k_mod.c | 34 +++++++-------
sys/compat/freebsd/freebsd_mod.c | 52 ++++++++++++---------
sys/compat/ibcs2/ibcs2_mod.c | 78 ++++++++++++++++++--------------
sys/compat/linux/common/linux_mod.c | 76 ++++++++++++++++++-------------
sys/compat/linux32/common/linux32_mod.c | 28 ++++++-----
sys/compat/m68k4k/m68k4k_exec.c | 34 +++++++-------
sys/compat/netbsd32/netbsd32_mod.c | 52 ++++++++++++---------
sys/compat/osf1/osf1_mod.c | 38 ++++++++-------
sys/compat/sunos/sunos_mod.c | 34 +++++++-------
sys/compat/sunos32/sunos32_mod.c | 34 +++++++-------
sys/compat/svr4/svr4_mod.c | 52 ++++++++++++---------
sys/compat/svr4_32/svr4_32_mod.c | 28 ++++++-----
sys/compat/ultrix/ultrix_mod.c | 28 ++++++-----
sys/compat/vax1k/vax1k_exec.c | 34 +++++++-------
sys/kern/exec_aout.c | 34 +++++++-------
sys/kern/exec_ecoff.c | 26 +++++-----
sys/kern/exec_elf32.c | 52 ++++++++++++---------
sys/kern/exec_elf64.c | 52 ++++++++++++---------
sys/kern/exec_script.c | 34 +++++++-------
19 files changed, 439 insertions(+), 361 deletions(-)
diffs (truncated from 1285 to 300 lines):
diff -r 8b029edbbaee -r 320ebf08deb7 sys/compat/aoutm68k/aoutm68k_mod.c
--- a/sys/compat/aoutm68k/aoutm68k_mod.c Fri Mar 07 01:27:14 2014 +0000
+++ b/sys/compat/aoutm68k/aoutm68k_mod.c Fri Mar 07 01:33:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aoutm68k_mod.c,v 1.2 2013/09/19 18:50:35 christos Exp $ */
+/* $NetBSD: aoutm68k_mod.c,v 1.3 2014/03/07 01:33:43 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aoutm68k_mod.c,v 1.2 2013/09/19 18:50:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aoutm68k_mod.c,v 1.3 2014/03/07 01:33:43 christos Exp $");
#include <sys/param.h>
#include <sys/module.h>
@@ -42,17 +42,19 @@
MODULE(MODULE_CLASS_EXEC, compat_aoutm68k, "exec_aout");
-static struct execsw aoutm68k_execsw[] = {
- { sizeof(struct exec),
- exec_aout_makecmds,
- { NULL },
- &emul_netbsd_aoutm68k,
- EXECSW_PRIO_FIRST, /* before exec_aout */
- 0,
- copyargs,
- NULL,
- coredump_netbsd,
- exec_setup_stack },
+static struct execsw aoutm68k_execsw = {
+ .es_hdrsz = sizeof(struct exec),
+ .es_makecmds = exec_aout_makecmds,
+ .u = {
+ .elf_probe_func = NULL,
+ },
+ .es_emul = &emul_netbsd_aoutm68k,
+ .es_prio = EXECSW_PRIO_FIRST, /* before exec_aout */
+ .es_arglen = 0,
+ .es_copyargs = copyargs,
+ .es_setregs = NULL,
+ .es_coredump = coredump_netbsd,
+ .es_setup_stack = exec_setup_stack,
};
static int
@@ -61,12 +63,10 @@
switch (cmd) {
case MODULE_CMD_INIT:
- return exec_add(aoutm68k_execsw,
- __arraycount(aoutm68k_execsw));
+ return exec_add(&aoutm68k_execsw, 1);
case MODULE_CMD_FINI:
- return exec_remove(aoutm68k_execsw,
- __arraycount(aoutm68k_execsw));
+ return exec_remove(&aoutm68k_execsw, 1);
default:
return ENOTTY;
diff -r 8b029edbbaee -r 320ebf08deb7 sys/compat/freebsd/freebsd_mod.c
--- a/sys/compat/freebsd/freebsd_mod.c Fri Mar 07 01:27:14 2014 +0000
+++ b/sys/compat/freebsd/freebsd_mod.c Fri Mar 07 01:33:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: freebsd_mod.c,v 1.3 2013/09/19 18:50:35 christos Exp $ */
+/* $NetBSD: freebsd_mod.c,v 1.4 2014/03/07 01:33:43 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: freebsd_mod.c,v 1.3 2013/09/19 18:50:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_mod.c,v 1.4 2014/03/07 01:33:43 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_execfmt.h"
@@ -65,29 +65,37 @@
static struct execsw freebsd_execsw[] = {
#ifdef EXEC_ELF32
/* FreeBSD Elf32 (probe not 64-bit safe) */
- { sizeof (Elf32_Ehdr),
- exec_elf32_makecmds,
- { freebsd_elf32_probe },
- &emul_freebsd,
- EXECSW_PRIO_ANY,
- ELF32_AUXSIZE,
- elf32_copyargs,
- NULL,
- coredump_elf32,
- exec_setup_stack },
+ {
+ .es_hdrsz = sizeof (Elf32_Ehdr),
+ .es_makecmds = exec_elf32_makecmds,
+ .u = {
+ .elf_probe_func = freebsd_elf32_probe,
+ },
+ .es_emul = &emul_freebsd,
+ .es_prio = EXECSW_PRIO_ANY,
+ .es_arglen = ELF32_AUXSIZE,
+ .es_copyargs = elf32_copyargs,
+ .es_setregs = NULL,
+ .es_coredump = coredump_elf32,
+ .es_setup_stack = exec_setup_stack,
+ },
#endif
#ifdef EXEC_AOUT
/* FreeBSD a.out (native word size) */
- { FREEBSD_AOUT_HDR_SIZE,
- exec_freebsd_aout_makecmds,
- { NULL },
- &emul_freebsd,
- EXECSW_PRIO_ANY,
- 0,
- copyargs,
- NULL,
- coredump_netbsd,
- exec_setup_stack },
+ {
+ .es_hdrsz = FREEBSD_AOUT_HDR_SIZE,
+ .es_makecmds = exec_freebsd_aout_makecmds,
+ .u = {
+ .elf_probe_function = NULL,
+ },
+ .es_emul = &emul_freebsd,
+ .es_prio = EXECSW_PRIO_ANY,
+ .es_arglen = 0,
+ .es_copyargs = copyargs,
+ .se_setregs = NULL,
+ .es_coredump = coredump_netbsd,
+ .es_setup_stack = exec_setup_stack,
+ },
#endif
};
diff -r 8b029edbbaee -r 320ebf08deb7 sys/compat/ibcs2/ibcs2_mod.c
--- a/sys/compat/ibcs2/ibcs2_mod.c Fri Mar 07 01:27:14 2014 +0000
+++ b/sys/compat/ibcs2/ibcs2_mod.c Fri Mar 07 01:33:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ibcs2_mod.c,v 1.2 2013/09/19 18:50:35 christos Exp $ */
+/* $NetBSD: ibcs2_mod.c,v 1.3 2014/03/07 01:33:43 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_mod.c,v 1.2 2013/09/19 18:50:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_mod.c,v 1.3 2014/03/07 01:33:43 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_execfmt.h"
@@ -63,39 +63,49 @@
static struct execsw ibcs2_execsw[] = {
#ifdef EXEC_ELF32
- { sizeof (Elf32_Ehdr),
- exec_elf32_makecmds,
- { ibcs2_elf32_probe },
- &emul_ibcs2,
- EXECSW_PRIO_ANY,
- ELF32_AUXSIZE,
- elf32_copyargs,
- NULL,
- coredump_elf32,
- exec_setup_stack },
+ {
+ .es_hdrsz = sizeof (Elf32_Ehdr),
+ .es_makecmds = exec_elf32_makecmds,
+ .u = {
+ .coff_probe_func = ibcs2_elf32_probe,
+ },
+ .es_emul = &emul_ibcs2,
+ .es_prio = EXECSW_PRIO_ANY,
+ .es_arglen = ELF32_AUXSIZE,
+ .es_copyargs = elf32_copyargs,
+ .es_setregs = NULL,
+ .es_coredump = coredump_elf32,
+ .es_setup_stack = exec_setup_stack,
+ },
#endif
- { COFF_HDR_SIZE,
- exec_ibcs2_coff_makecmds,
- { NULL },
- &emul_ibcs2,
- EXECSW_PRIO_ANY,
- 0,
- copyargs,
- NULL,
- coredump_netbsd,
- ibcs2_exec_setup_stack },
-
- { XOUT_HDR_SIZE,
- exec_ibcs2_xout_makecmds,
- { NULL },
- &emul_ibcs2,
- EXECSW_PRIO_ANY,
- 0,
- copyargs,
- NULL,
- coredump_netbsd,
- ibcs2_exec_setup_stack },
-
+ {
+ .es_hdrsz = COFF_HDR_SIZE,
+ .es_makecmds = exec_ibcs2_coff_makecmds,
+ .u = {
+ .elf_probe_func = NULL,
+ },
+ .es_emul = &emul_ibcs2,
+ .es_prio = EXECSW_PRIO_ANY,
+ .es_arglen = 0,
+ .es_copyargs = copyargs,
+ .es_setregs = NULL,
+ .es_coredump = coredump_netbsd,
+ .es_setup_stack = ibcs2_exec_setup_stack,
+ },
+ {
+ .es_hdrsz = XOUT_HDR_SIZE,
+ .es_makecmds = exec_ibcs2_xout_makecmds,
+ .u = {
+ .elf_probe_func = NULL,
+ },
+ .es_emul = &emul_ibcs2,
+ .es_prio = EXECSW_PRIO_ANY,
+ .es_arglen = 0,
+ .es_copyargs = copyargs,
+ .es_setregs = NULL,
+ .es_coredump = coredump_netbsd,
+ .es_setup_stack = ibcs2_exec_setup_stack
+ },
};
static int
diff -r 8b029edbbaee -r 320ebf08deb7 sys/compat/linux/common/linux_mod.c
--- a/sys/compat/linux/common/linux_mod.c Fri Mar 07 01:27:14 2014 +0000
+++ b/sys/compat/linux/common/linux_mod.c Fri Mar 07 01:33:43 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_mod.c,v 1.3 2013/09/19 18:50:35 christos Exp $ */
+/* $NetBSD: linux_mod.c,v 1.4 2014/03/07 01:33:43 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.3 2013/09/19 18:50:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_mod.c,v 1.4 2014/03/07 01:33:43 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_execfmt.h"
@@ -69,39 +69,51 @@
static struct execsw linux_execsw[] = {
#if defined(EXEC_ELF32) && ELFSIZE == 32
- { sizeof (Elf32_Ehdr),
- exec_elf32_makecmds,
- { linux_elf32_probe },
- &emul_linux,
- EXECSW_PRIO_ANY,
- LINUX_ELF_AUX_ARGSIZ,
- linux_elf32_copyargs,
- NULL,
- coredump_elf32,
- linux_exec_setup_stack },
+ {
+ .es_hdrsz = sizeof (Elf32_Ehdr),
+ .es_makecmds = exec_elf32_makecmds,
+ .u = {
+ .elf_probe_func = linux_elf32_probe,
+ },
+ .es_emul = &emul_linux,
+ .es_prio = EXECSW_PRIO_ANY,
+ .es_arglen = LINUX_ELF_AUX_ARGSIZ,
+ .es_copyargs = linux_elf32_copyargs,
+ .es_setregs = NULL,
+ .es_coredump = coredump_elf32,
+ .es_setup_stack = linux_exec_setup_stack,
+ },
#elif defined(EXEC_ELF64)
- { sizeof (Elf64_Ehdr),
- exec_elf64_makecmds,
- { linux_elf64_probe },
- &emul_linux,
- EXECSW_PRIO_ANY,
- LINUX_ELF_AUX_ARGSIZ,
- linux_elf64_copyargs,
- NULL,
- coredump_elf64,
- linux_exec_setup_stack },
+ {
+ .es_hdrsz = sizeof (Elf64_Ehdr),
+ .es_makecmds = exec_elf64_makecmds,
Home |
Main Index |
Thread Index |
Old Index