1*d91f98a8Spgoyette /* $NetBSD: vfs_syscalls_40.c,v 1.5 2019/01/27 02:08:39 pgoyette Exp $ */
257de28faSad
357de28faSad /*-
457de28faSad * Copyright (c) 2008 The NetBSD Foundation, Inc.
557de28faSad * All rights reserved.
657de28faSad *
757de28faSad * Redistribution and use in source and binary forms, with or without
857de28faSad * modification, are permitted provided that the following conditions
957de28faSad * are met:
1057de28faSad * 1. Redistributions of source code must retain the above copyright
1157de28faSad * notice, this list of conditions and the following disclaimer.
1257de28faSad * 2. Redistributions in binary form must reproduce the above copyright
1357de28faSad * notice, this list of conditions and the following disclaimer in the
1457de28faSad * documentation and/or other materials provided with the distribution.
1557de28faSad *
1657de28faSad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1757de28faSad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1857de28faSad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1957de28faSad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2057de28faSad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2157de28faSad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2257de28faSad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2357de28faSad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2457de28faSad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2557de28faSad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2657de28faSad * POSSIBILITY OF SUCH DAMAGE.
2757de28faSad */
2857de28faSad
2957de28faSad /*
3057de28faSad * Copyright (c) 1989, 1993
3157de28faSad * The Regents of the University of California. All rights reserved.
3257de28faSad * (c) UNIX System Laboratories, Inc.
3357de28faSad * All or some portions of this file are derived from material licensed
3457de28faSad * to the University of California by American Telephone and Telegraph
3557de28faSad * Co. or Unix System Laboratories, Inc. and are reproduced herein with
3657de28faSad * the permission of UNIX System Laboratories, Inc.
3757de28faSad *
3857de28faSad * Redistribution and use in source and binary forms, with or without
3957de28faSad * modification, are permitted provided that the following conditions
4057de28faSad * are met:
4157de28faSad * 1. Redistributions of source code must retain the above copyright
4257de28faSad * notice, this list of conditions and the following disclaimer.
4357de28faSad * 2. Redistributions in binary form must reproduce the above copyright
4457de28faSad * notice, this list of conditions and the following disclaimer in the
4557de28faSad * documentation and/or other materials provided with the distribution.
4657de28faSad * 3. Neither the name of the University nor the names of its contributors
4757de28faSad * may be used to endorse or promote products derived from this software
4857de28faSad * without specific prior written permission.
4957de28faSad *
5057de28faSad * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
5157de28faSad * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5257de28faSad * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5357de28faSad * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
5457de28faSad * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5557de28faSad * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5657de28faSad * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5757de28faSad * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5857de28faSad * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5957de28faSad * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
6057de28faSad * SUCH DAMAGE.
6157de28faSad *
6257de28faSad * @(#)vfs_syscalls.c 8.42 (Berkeley) 7/31/95
6357de28faSad */
6457de28faSad
6557de28faSad #include <sys/cdefs.h>
66*d91f98a8Spgoyette __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_40.c,v 1.5 2019/01/27 02:08:39 pgoyette Exp $");
67*d91f98a8Spgoyette
68*d91f98a8Spgoyette #if defined(_KERNEL_OPT)
69*d91f98a8Spgoyette #include "opt_compat_netbsd.h"
70*d91f98a8Spgoyette #endif
7157de28faSad
7257de28faSad #include <sys/param.h>
7357de28faSad #include <sys/systm.h>
7457de28faSad #include <sys/mount.h>
75*d91f98a8Spgoyette #include <sys/syscall.h>
76*d91f98a8Spgoyette #include <sys/syscallvar.h>
7757de28faSad #include <sys/syscallargs.h>
7857de28faSad
79*d91f98a8Spgoyette #include <compat/common/compat_mod.h>
80*d91f98a8Spgoyette
81*d91f98a8Spgoyette static const struct syscall_package vfs_syscalls_40_syscalls[] = {
82*d91f98a8Spgoyette { SYS_compat_40_mount, 0, (sy_call_t *)compat_40_sys_mount },
83*d91f98a8Spgoyette { 0, 0, NULL },
84*d91f98a8Spgoyette };
85*d91f98a8Spgoyette
8657de28faSad int
compat_40_sys_mount(struct lwp * l,const struct compat_40_sys_mount_args * uap,register_t * retval)8757de28faSad compat_40_sys_mount(struct lwp *l, const struct compat_40_sys_mount_args *uap, register_t *retval)
8857de28faSad {
8957de28faSad /* {
9057de28faSad syscallarg(const char *) type;
9157de28faSad syscallarg(const char *) path;
9257de28faSad syscallarg(int) flags;
9357de28faSad syscallarg(void *) data;
9457de28faSad } */
9557de28faSad register_t dummy;
9657de28faSad
97ea498acaSmaxv return do_sys_mount(l, SCARG(uap, type), UIO_USERSPACE, SCARG(uap, path),
9857de28faSad SCARG(uap, flags), SCARG(uap, data), UIO_USERSPACE, 0, &dummy);
9957de28faSad }
100*d91f98a8Spgoyette
101*d91f98a8Spgoyette int
vfs_syscalls_40_init(void)102*d91f98a8Spgoyette vfs_syscalls_40_init(void)
103*d91f98a8Spgoyette {
104*d91f98a8Spgoyette
105*d91f98a8Spgoyette return syscall_establish(NULL, vfs_syscalls_40_syscalls);
106*d91f98a8Spgoyette }
107*d91f98a8Spgoyette
108*d91f98a8Spgoyette int
vfs_syscalls_40_fini(void)109*d91f98a8Spgoyette vfs_syscalls_40_fini(void)
110*d91f98a8Spgoyette {
111*d91f98a8Spgoyette
112*d91f98a8Spgoyette return syscall_disestablish(NULL, vfs_syscalls_40_syscalls);
113*d91f98a8Spgoyette }
114