11.2Spgoyette/*	$NetBSD: compat_10_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $	*/
21.2Spgoyette
31.2Spgoyette/*-
41.2Spgoyette * Copyright (c) 2018 The NetBSD Foundation, Inc.
51.2Spgoyette * All rights reserved.
61.2Spgoyette *
71.2Spgoyette * This code is derived from software developed for The NetBSD Foundation
81.2Spgoyette * by Paul Goyette
91.2Spgoyette *
101.2Spgoyette * Redistribution and use in source and binary forms, with or without
111.2Spgoyette * modification, are permitted provided that the following conditions
121.2Spgoyette * are met:
131.2Spgoyette * 1. Redistributions of source code must retain the above copyright
141.2Spgoyette *    notice, this list of conditions and the following disclaimer.
151.2Spgoyette * 2. Redistributions in binary form must reproduce the above copyright
161.2Spgoyette *    notice, this list of conditions and the following disclaimer in the
171.2Spgoyette *    documentation and/or other materials provided with the distribution.
181.2Spgoyette *
191.2Spgoyette * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
201.2Spgoyette * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
211.2Spgoyette * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
221.2Spgoyette * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
231.2Spgoyette * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
241.2Spgoyette * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
251.2Spgoyette * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
261.2Spgoyette * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
271.2Spgoyette * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
281.2Spgoyette * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
291.2Spgoyette * POSSIBILITY OF SUCH DAMAGE.
301.2Spgoyette */
311.2Spgoyette
321.2Spgoyette/*
331.2Spgoyette * Linkage for the compat module: spaghetti.
341.2Spgoyette */
351.2Spgoyette
361.2Spgoyette#include <sys/cdefs.h>
371.2Spgoyette__KERNEL_RCSID(0, "$NetBSD: compat_10_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $");
381.2Spgoyette
391.2Spgoyette#if defined(_KERNEL_OPT)
401.2Spgoyette#include "opt_compat_netbsd.h"
411.2Spgoyette#endif
421.2Spgoyette
431.2Spgoyette#include <sys/systm.h>
441.2Spgoyette#include <sys/module.h>
451.2Spgoyette#include <sys/sysctl.h>
461.2Spgoyette#include <sys/syscall.h>
471.2Spgoyette#include <sys/syscallvar.h>
481.2Spgoyette#include <sys/syscallargs.h>
491.2Spgoyette
501.2Spgoyette#include <compat/common/compat_util.h>
511.2Spgoyette#include <compat/common/compat_mod.h>
521.2Spgoyette
531.2Spgoyetteint
541.2Spgoyettecompat_10_init(void)
551.2Spgoyette{
561.2Spgoyette
571.2Spgoyette	vfs_syscalls_10_init();
581.2Spgoyette	return 0;
591.2Spgoyette}
601.2Spgoyette
611.2Spgoyetteint
621.2Spgoyettecompat_10_fini(void)
631.2Spgoyette{
641.2Spgoyette
651.2Spgoyette	vfs_syscalls_10_fini();
661.2Spgoyette	return 0;
671.2Spgoyette}
681.2Spgoyette
691.2SpgoyetteMODULE(MODULE_CLASS_EXEC, compat_10, "compat_12,compat_util");
701.2Spgoyette
711.2Spgoyettestatic int
721.2Spgoyettecompat_10_modcmd(modcmd_t cmd, void *arg)
731.2Spgoyette{
741.2Spgoyette
751.2Spgoyette	switch (cmd) {
761.2Spgoyette	case MODULE_CMD_INIT:
771.2Spgoyette		return compat_10_init();
781.2Spgoyette	case MODULE_CMD_FINI:
791.2Spgoyette		return compat_10_fini();
801.2Spgoyette	default:
811.2Spgoyette		return ENOTTY;
821.2Spgoyette	}
831.2Spgoyette}
84