Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-compat]: src/sys Initial cut at a compat_netbsd32_09 and compat...
details: https://anonhg.NetBSD.org/src/rev/1f663b054184
branches: pgoyette-compat
changeset: 830639:1f663b054184
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Mon Sep 10 09:54:47 2018 +0000
description:
Initial cut at a compat_netbsd32_09 and compat_netbsd32_12 modules.
diffstat:
sys/compat/netbsd32/netbsd32_compat_09.c | 33 ++++++++++++++++++++++++-
sys/compat/netbsd32/netbsd32_compat_10.c | 6 +++-
sys/compat/netbsd32/netbsd32_compat_12.c | 40 ++++++++++++++++++++++++++++++-
sys/compat/netbsd32/syscalls.master | 11 +++++---
sys/modules/compat_netbsd32_09/Makefile | 15 ++++++++++++
sys/modules/compat_netbsd32_12/Makefile | 15 ++++++++++++
6 files changed, 110 insertions(+), 10 deletions(-)
diffs (226 lines):
diff -r 1ed263f8a522 -r 1f663b054184 sys/compat/netbsd32/netbsd32_compat_09.c
--- a/sys/compat/netbsd32/netbsd32_compat_09.c Mon Sep 10 08:53:12 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_09.c Mon Sep 10 09:54:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_09.c,v 1.18 2008/05/29 14:51:26 mrg Exp $ */
+/* $NetBSD: netbsd32_compat_09.c,v 1.18.86.1 2018/09/10 09:54:47 pgoyette Exp $ */
/*
* Copyright (c) 1998 Matthew R. Green
@@ -27,11 +27,13 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_09.c,v 1.18 2008/05/29 14:51:26 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_09.c,v 1.18.86.1 2018/09/10 09:54:47 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/module.h>
#include <sys/mount.h>
+#include <sys/syscallvar.h>
#include <sys/syscallargs.h>
#include <sys/time.h>
@@ -84,3 +86,30 @@
NETBSD32TOP_UAP(name, struct outsname);
return (compat_09_sys_uname(l, &ua, retval));
}
+
+static struct syscall_package compat_netbsd32_09_syscalls[] = {
+ { NETBSD32_SYS_ogetdomainname, 0,
+ (sy_call_t *)compat_09_netbsd32_ogetdomainname },
+ { NETBSD32_SYS_osetdomainname, 0,
+ (sy_call_t *)compat_09_netbsd32_osetdomainname },
+ { NETBSD32_SYS_ouname, 0, (sy_call_t *)compat_09_netbsd32_uname },
+ { 0, 0, NULL }
+};
+
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_09, "compat_netbsd32,compat_09");
+
+static int
+compat_netbsd32_09_modcmd(modcmt_t cmd, void *(arg)
+{
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ return syscall_establish(NULL, compat_netbsd32_09_syscalls);
+
+ case MODULE_CMD_FINI:
+ return syscall_disestablish(NULL, compat_netbsd32_09_syscalls);
+
+ default:
+ return ENOTTY;
+ }
+}
diff -r 1ed263f8a522 -r 1f663b054184 sys/compat/netbsd32/netbsd32_compat_10.c
--- a/sys/compat/netbsd32/netbsd32_compat_10.c Mon Sep 10 08:53:12 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_10.c Mon Sep 10 09:54:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_10.c,v 1.25 2015/12/03 10:38:21 pgoyette Exp $ */
+/* $NetBSD: netbsd32_compat_10.c,v 1.25.16.1 2018/09/10 09:54:47 pgoyette Exp $ */
/*
* Copyright (c) 1994 Adam Glass and Charles M. Hannum. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_10.c,v 1.25 2015/12/03 10:38:21 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_10.c,v 1.25.16.1 2018/09/10 09:54:47 pgoyette Exp $");
#ifdef _KERNEL_OPT
#include "opt_sysv.h"
@@ -40,6 +40,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/module.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/sem.h>
@@ -48,6 +49,7 @@
#include <sys/syscallargs.h>
#include <compat/netbsd32/netbsd32.h>
+#include <compat/netbsd32/netbsd32_syscallvar.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
#include <compat/sys/shm.h>
diff -r 1ed263f8a522 -r 1f663b054184 sys/compat/netbsd32/netbsd32_compat_12.c
--- a/sys/compat/netbsd32/netbsd32_compat_12.c Mon Sep 10 08:53:12 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_compat_12.c Mon Sep 10 09:54:47 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_compat_12.c,v 1.33 2012/12/10 02:21:58 chs Exp $ */
+/* $NetBSD: netbsd32_compat_12.c,v 1.33.36.1 2018/09/10 09:54:47 pgoyette Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_12.c,v 1.33 2012/12/10 02:21:58 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_12.c,v 1.33.36.1 2018/09/10 09:54:47 pgoyette Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -35,6 +35,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/module.h>
#include <sys/filedesc.h>
#include <sys/mount.h>
#include <sys/mman.h>
@@ -49,6 +50,7 @@
#include <compat/sys/stat.h>
#include <compat/netbsd32/netbsd32.h>
+#include <compat/netbsd32/netbsd32_syscallvar.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
static void netbsd32_stat12_to_netbsd32(struct stat12 *,
@@ -207,3 +209,37 @@
return (compat_12_sys_getdirentries(l, &ua, retval));
}
+
+static struct syscall_package compat_netbsd32_09_syscalls[] = {
+ { NETBSD32_SYS_reboot, 0,
+ (sy_call_t *)compat_12_netbsd32_reboot },
+ { NETBSD32_SYS_msync, 0,
+ (sy_call_t *)compat_12_netbsd32_msync },
+ { NETBSD32_SYS_swapon, 0,
+ (sy_call_t *)compat_12_netbsd32_swapon },
+ { NETBSD32_SYS_stat12, 0,
+ (sy_call_t *)compat_12_netbsd32_stat12 },
+ { NETBSD32_SYS_fstat12, 0,
+ (sy_call_t *)compat_12_netbsd32_fstat12 },
+ { NETBSD32_SYS_lstat12, 0,
+ (sy_call_t *)compat_12_netbsd32_lstat12 },
+ { NETBSD32_SYS_getdirentries, 0,
+ (sy_call_t *)compat_12_netbsd32_getdirentries },
+ { 0, 0, NULL }
+};
+
+MODULE(MODULE_CLASS_EXEC, compat_netbsd32_12, "compat_netbsd32,compat_12");
+
+static int
+compat_netbsd32_12_modcmd(modcmd_t cmd, void *arg)
+{
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+
+ case MODULE_CMD_FINI:
+
+ default:
+ return ENOTTY;
+ }
+}
diff -r 1ed263f8a522 -r 1f663b054184 sys/compat/netbsd32/syscalls.master
--- a/sys/compat/netbsd32/syscalls.master Mon Sep 10 08:53:12 2018 +0000
+++ b/sys/compat/netbsd32/syscalls.master Mon Sep 10 09:54:47 2018 +0000
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.120.2.3 2018/09/06 06:55:47 pgoyette Exp $
+ $NetBSD: syscalls.master,v 1.120.2.4 2018/09/10 09:54:47 pgoyette Exp $
; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -330,11 +330,14 @@
160 UNIMPL
161 COMPAT_30 { int|netbsd32||getfh(netbsd32_charp fname, \
netbsd32_compat_30_fhandlep_t fhp); }
-162 COMPAT_09 { int|netbsd32||ogetdomainname( \
+162 COMPAT_09 modular compat_netbsd32_09 \
+ { int|netbsd32||ogetdomainname( \
netbsd32_charp domainname, int len); }
-163 COMPAT_09 { int|netbsd32||osetdomainname( \
+163 COMPAT_09 modular compat_netbsd32_09 \
+ { int|netbsd32||osetdomainname( \
netbsd32_charp domainname, int len); }
-164 COMPAT_09 { int|netbsd32||uname(netbsd32_outsnamep_t name); }
+164 COMPAT_09 modular compat_netbsd32_09 \
+ { int|netbsd32||uname(netbsd32_outsnamep_t name); }
165 STD { int|netbsd32||sysarch(int op, netbsd32_voidp parms); }
166 UNIMPL
167 UNIMPL
diff -r 1ed263f8a522 -r 1f663b054184 sys/modules/compat_netbsd32_09/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/compat_netbsd32_09/Makefile Mon Sep 10 09:54:47 2018 +0000
@@ -0,0 +1,15 @@
+# $NetBSD: Makefile,v 1.1.2.1 2018/09/10 09:54:47 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/compat/netbsd32
+
+KMOD= compat_netbsd32_09
+
+CPPFLAGS+= -DCOMPAT_09 -DCOMPAT_10 -DCOMPAT_12
+CPPFLAGS+= -DCOMPAT_13 -DCOMPAT_14 -DCOMPAT_16 -DCOMPAT_20 -DCOMPAT_30
+CPPFLAGS+= -DCOMPAT_40 -DCOMPAT_50 -DCOMPAT_60 -DCOMPAT_70 -DCOMPAT_80
+
+SRCS+= netbsd32_compat_09.c
+
+.include <bsd.kmodule.mk>
diff -r 1ed263f8a522 -r 1f663b054184 sys/modules/compat_netbsd32_12/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/compat_netbsd32_12/Makefile Mon Sep 10 09:54:47 2018 +0000
@@ -0,0 +1,15 @@
+# $NetBSD: Makefile,v 1.1.2.1 2018/09/10 09:54:47 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/compat/netbsd32
+
+KMOD= compat_netbsd32_12
+
+CPPFLAGS+= -DCOMPAT_12
+CPPFLAGS+= -DCOMPAT_13 -DCOMPAT_14 -DCOMPAT_16 -DCOMPAT_20 -DCOMPAT_30
+CPPFLAGS+= -DCOMPAT_40 -DCOMPAT_50 -DCOMPAT_60 -DCOMPAT_70 -DCOMPAT_80
+
+SRCS+= netbsd32_compat_12.c
+
+.include <bsd.kmodule.mk>
Home |
Main Index |
Thread Index |
Old Index