Module Name: src
Committed By: rmind
Date: Sun Oct 25 01:14:04 UTC 2009
Modified Files:
src/sys/compat/linux/common: linux_exec.c
src/sys/compat/linux32/common: linux32_exec.c
src/sys/compat/netbsd32: netbsd32_netbsd.c
src/sys/kern: kern_exec.c
Log Message:
Initialise struct emul members by name (it is readable now and one can search
them in the tree).
To generate a diff of this commit:
cvs rdiff -u -r1.112 -r1.113 src/sys/compat/linux/common/linux_exec.c
cvs rdiff -u -r1.18 -r1.19 src/sys/compat/linux32/common/linux32_exec.c
cvs rdiff -u -r1.158 -r1.159 src/sys/compat/netbsd32/netbsd32_netbsd.c
cvs rdiff -u -r1.290 -r1.291 src/sys/kern/kern_exec.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux/common/linux_exec.c
diff -u src/sys/compat/linux/common/linux_exec.c:1.112 src/sys/compat/linux/common/linux_exec.c:1.113
--- src/sys/compat/linux/common/linux_exec.c:1.112 Sun Mar 15 15:55:51 2009
+++ src/sys/compat/linux/common/linux_exec.c Sun Oct 25 01:14:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_exec.c,v 1.112 2009/03/15 15:55:51 cegger Exp $ */
+/* $NetBSD: linux_exec.c,v 1.113 2009/10/25 01:14:03 rmind Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998, 2000, 2007, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.112 2009/03/15 15:55:51 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.113 2009/10/25 01:14:03 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -90,42 +90,40 @@
struct uvm_object *emul_linux_object;
struct emul emul_linux = {
- "linux",
- "/emul/linux",
+ .e_name = "linux",
+ .e_path = "/emul/linux",
#ifndef __HAVE_MINIMAL_EMUL
- 0,
- (const int *)native_to_linux_errno,
- LINUX_SYS_syscall,
- LINUX_SYS_NSYSENT,
+ .e_flags = 0,
+ .e_errno = (const int *)native_to_linux_errno,
+ .e_nosys = LINUX_SYS_syscall,
+ .e_nsysent = LINUX_SYS_NSYSENT,
#endif
- linux_sysent,
- linux_syscallnames,
- linux_sendsig,
- linux_trapsignal,
- NULL,
- linux_sigcode,
- linux_esigcode,
- &emul_linux_object,
- linux_setregs,
- linux_e_proc_exec,
- linux_e_proc_fork,
- linux_e_proc_exit,
- NULL,
- NULL,
+ .e_sysent = linux_sysent,
+ .e_syscallnames = linux_syscallnames,
+ .e_sendsig = linux_sendsig,
+ .e_trapsignal = linux_trapsignal,
+ .e_tracesig = NULL,
+ .e_sigcode = linux_sigcode,
+ .e_esigcode = linux_esigcode,
+ .e_sigobject = &emul_linux_object,
+ .e_setregs = linux_setregs,
+ .e_proc_exec = linux_e_proc_exec,
+ .e_proc_fork = linux_e_proc_fork,
+ .e_proc_exit = linux_e_proc_exit,
+ .e_lwp_fork = NULL,
+ .e_lwp_exit = NULL,
#ifdef __HAVE_SYSCALL_INTERN
- linux_syscall_intern,
+ .e_syscall_intern = linux_syscall_intern,
#else
#error Implement __HAVE_SYSCALL_INTERN for this platform
#endif
- NULL,
- NULL,
-
- uvm_default_mapaddr,
-
- linux_usertrap,
- NULL, /* e_sa */
- 0,
- NULL, /* e_startlwp */
+ .e_sysctlovly = NULL,
+ .e_fault = NULL,
+ .e_vm_default_addr = uvm_default_mapaddr,
+ .e_usertrap = linux_usertrap,
+ .e_sa = NULL,
+ .e_ucsize = 0,
+ .e_startlwp = NULL
};
static void
Index: src/sys/compat/linux32/common/linux32_exec.c
diff -u src/sys/compat/linux32/common/linux32_exec.c:1.18 src/sys/compat/linux32/common/linux32_exec.c:1.19
--- src/sys/compat/linux32/common/linux32_exec.c:1.18 Sat Mar 14 21:04:18 2009
+++ src/sys/compat/linux32/common/linux32_exec.c Sun Oct 25 01:14:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: linux32_exec.c,v 1.18 2009/03/14 21:04:18 dsl Exp $ */
+/* $NetBSD: linux32_exec.c,v 1.19 2009/10/25 01:14:03 rmind Exp $ */
/*-
* Copyright (c) 1994-2007 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_exec.c,v 1.18 2009/03/14 21:04:18 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_exec.c,v 1.19 2009/10/25 01:14:03 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -90,36 +90,36 @@
struct uvm_object *emul_linux32_object;
struct emul emul_linux32 = {
- "linux32",
- "/emul/linux32",
+ .e_name = "linux32",
+ .e_path = "/emul/linux32",
#ifndef __HAVE_MINIMAL_EMUL
- 0,
- NULL,
- LINUX32_SYS_syscall,
- LINUX32_SYS_NSYSENT,
+ .e_flags = 0,
+ .e_errno = NULL,
+ .e_nosys = LINUX32_SYS_syscall,
+ .e_nsysent = LINUX32_SYS_NSYSENT,
#endif
- linux32_sysent,
- linux32_syscallnames,
- linux32_sendsig,
- trapsignal,
- NULL,
- linux32_sigcode,
- linux32_esigcode,
- &emul_linux32_object,
- linux32_setregs,
- linux32_e_proc_exec,
- linux32_e_proc_fork,
- linux32_e_proc_exit,
- NULL,
- NULL,
- linux32_syscall_intern,
- NULL,
- NULL,
- netbsd32_vm_default_addr,
- NULL,
- NULL,
- 0,
- NULL
+ .e_sysent = linux32_sysent,
+ .e_syscallnames = linux32_syscallnames,
+ .e_sendsig = linux32_sendsig,
+ .e_trapsignal = trapsignal,
+ .e_tracesig = NULL,
+ .e_sigcode = linux32_sigcode,
+ .e_esigcode = linux32_esigcode,
+ .e_sigobject = &emul_linux32_object,
+ .e_setregs = linux32_setregs,
+ .e_proc_exec = linux32_e_proc_exec,
+ .e_proc_fork = linux32_e_proc_fork,
+ .e_proc_exit = linux32_e_proc_exit,
+ .e_lwp_fork = NULL,
+ .e_lwp_exit = NULL,
+ .e_syscall_intern = linux32_syscall_intern,
+ .e_sysctlovly = NULL,
+ .e_fault = NULL,
+ .e_vm_default_addr = netbsd32_vm_default_addr,
+ .e_usertrap = NULL,
+ .e_sa = NULL,
+ .e_ucsize = 0,
+ .e_startlwp = NULL
};
static void
Index: src/sys/compat/netbsd32/netbsd32_netbsd.c
diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.158 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.159
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.158 Sun Aug 9 22:49:01 2009
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c Sun Oct 25 01:14:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_netbsd.c,v 1.158 2009/08/09 22:49:01 haad Exp $ */
+/* $NetBSD: netbsd32_netbsd.c,v 1.159 2009/10/25 01:14:03 rmind Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.158 2009/08/09 22:49:01 haad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.159 2009/10/25 01:14:03 rmind Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@@ -133,55 +133,54 @@
};
struct emul emul_netbsd32 = {
- "netbsd32",
- "/emul/netbsd32",
+ .e_name = "netbsd32",
+ .e_path = "/emul/netbsd32",
#ifndef __HAVE_MINIMAL_EMUL
- 0,
- NULL,
- NETBSD32_SYS_netbsd32_syscall,
- NETBSD32_SYS_NSYSENT,
+ .e_flags = 0,
+ .e_errno = NULL,
+ .e_nosys = NETBSD32_SYS_netbsd32_syscall,
+ .e_nsysent = NETBSD32_SYS_NSYSENT,
#endif
- netbsd32_sysent,
+ .e_sysent = netbsd32_sysent,
#ifdef SYSCALL_DEBUG
- netbsd32_syscallnames,
+ .e_syscallnames = netbsd32_syscallnames,
#else
- NULL,
+ .e_syscallnames = NULL,
#endif
- netbsd32_sendsig,
- trapsignal,
- NULL,
+ .e_sendsig = netbsd32_sendsig,
+ .e_trapsignal = trapsignal,
+ .e_tracesig = NULL,
#ifdef COMPAT_16
- netbsd32_sigcode,
- netbsd32_esigcode,
- &emul_netbsd32_object,
+ .e_sigcode = netbsd32_sigcode,
+ .e_esigcode = netbsd32_esigcode,
+ .e_sigobject = &emul_netbsd32_object,
#else
- NULL,
- NULL,
- NULL,
+ .e_sigcode = NULL,
+ .e_esigcode = NULL,
+ .e_sigobject = NULL,
#endif
- netbsd32_setregs,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ .e_setregs = netbsd32_setregs,
+ .e_proc_exec = NULL,
+ .e_proc_fork = NULL,
+ .e_proc_exit = NULL,
+ .e_lwp_fork = NULL,
+ .e_lwp_exit = NULL,
#ifdef __HAVE_SYSCALL_INTERN
- netbsd32_syscall_intern,
+ .e_syscall_intern = netbsd32_syscall_intern,
#else
- syscall,
+ .e_syscall = syscall,
#endif
- &netbsd32_sysctl_root,
- NULL,
-
- netbsd32_vm_default_addr,
- NULL,
+ .e_sysctlovly = &netbsd32_sysctl_root,
+ .e_fault = NULL,
+ .e_vm_default_addr = netbsd32_vm_default_addr,
+ .e_usertrap = NULL,
#ifdef COMPAT_40
- &saemul_netbsd32,
+ .e_sa = &saemul_netbsd32,
#else
- NULL,
+ .e_sa = NULL,
#endif
- sizeof(ucontext32_t),
- startlwp32,
+ .e_ucsize = sizeof(ucontext32_t),
+ .e_startlwp = startlwp32
};
/*
Index: src/sys/kern/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.290 src/sys/kern/kern_exec.c:1.291
--- src/sys/kern/kern_exec.c:1.290 Thu Aug 6 21:33:54 2009
+++ src/sys/kern/kern_exec.c Sun Oct 25 01:14:03 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exec.c,v 1.290 2009/08/06 21:33:54 dsl Exp $ */
+/* $NetBSD: kern_exec.c,v 1.291 2009/10/25 01:14:03 rmind Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.290 2009/08/06 21:33:54 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.291 2009/10/25 01:14:03 rmind Exp $");
#include "opt_ktrace.h"
#include "opt_modular.h"
@@ -159,49 +159,48 @@
/* NetBSD emul struct */
struct emul emul_netbsd = {
- "netbsd",
- NULL, /* emulation path */
+ .e_name = "netbsd",
+ .e_path = NULL,
#ifndef __HAVE_MINIMAL_EMUL
- EMUL_HAS_SYS___syscall,
- NULL,
- SYS_syscall,
- SYS_NSYSENT,
+ .e_flags = EMUL_HAS_SYS___syscall,
+ .e_errno = NULL,
+ .e_nosys = SYS_syscall,
+ .e_nsysent = SYS_NSYSENT,
#endif
- sysent,
+ .e_sysent = sysent,
#ifdef SYSCALL_DEBUG
- syscallnames,
+ .e_syscallnames = syscallnames,
#else
- NULL,
+ .e_syscallnames = NULL,
#endif
- sendsig,
- trapsignal,
- NULL,
- NULL,
- NULL,
- NULL,
- setregs,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
+ .e_sendsig = sendsig,
+ .e_trapsignal = trapsignal,
+ .e_tracesig = NULL,
+ .e_sigcode = NULL,
+ .e_esigcode = NULL,
+ .e_sigobject = NULL,
+ .e_setregs = setregs,
+ .e_proc_exec = NULL,
+ .e_proc_fork = NULL,
+ .e_proc_exit = NULL,
+ .e_lwp_fork = NULL,
+ .e_lwp_exit = NULL,
#ifdef __HAVE_SYSCALL_INTERN
- syscall_intern,
+ .e_syscall_intern = syscall_intern,
#else
- syscall,
+ .e_syscall = syscall,
#endif
- NULL,
- NULL,
-
- uvm_default_mapaddr,
- NULL,
+ .e_sysctlovly = NULL,
+ .e_fault = NULL,
+ .e_vm_default_addr = uvm_default_mapaddr,
+ .e_usertrap = NULL,
#ifdef KERN_SA
- &saemul_netbsd,
+ .e_sa = &saemul_netbsd,
#else
- NULL,
+ .e_sa = NULL,
#endif
- sizeof(ucontext_t),
- startlwp,
+ .e_ucsize = sizeof(ucontext_t),
+ .e_startlwp = startlwp
};
/*