Home | History | Annotate | Line # | Download | only in common
      1 /*-
      2  * Copyright (c) 2012 The NetBSD Foundation, Inc.
      3  * All rights reserved.
      4  *
      5  * This code is derived from software contributed to The NetBSD Foundation
      6  * by Matt Thomas of 3am Software Foundry.
      7  *
      8  * Redistribution and use in source and binary forms, with or without
      9  * modification, are permitted provided that the following conditions
     10  * are met:
     11  * 1. Redistributions of source code must retain the above copyright
     12  *    notice, this list of conditions and the following disclaimer.
     13  * 2. Redistributions in binary form must reproduce the above copyright
     14  *    notice, this list of conditions and the following disclaimer in the
     15  *    documentation and/or other materials provided with the distribution.
     16  *
     17  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     19  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     20  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     21  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     27  * POSSIBILITY OF SUCH DAMAGE.
     28  */
     29 
     30 #include <sys/cdefs.h>
     31 
     32 __KERNEL_RCSID(1, "$NetBSD: kern_sa_60.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $");
     33 
     34 #if defined(_KERNEL_OPT)
     35 #include "opt_compat_netbsd.h"
     36 #endif
     37 
     38 #include <sys/systm.h>
     39 #include <sys/syscall.h>
     40 #include <sys/syscallvar.h>
     41 #include <sys/syscallargs.h>
     42 
     43 #include <compat/common/compat_mod.h>
     44 
     45 static const struct syscall_package kern_sa_60_syscalls[] = {
     46 	{ SYS_compat_60_sa_register, 0,
     47 	     (sy_call_t *)compat_60_sys_sa_register },
     48 	{ SYS_compat_60_sa_stacks, 0, (sy_call_t *)compat_60_sys_sa_stacks },
     49 	{ SYS_compat_60_sa_enable, 0, (sy_call_t *)compat_60_sys_sa_enable },
     50 	{ SYS_compat_60_sa_setconcurrency, 0,
     51 	     (sy_call_t *)compat_60_sys_sa_setconcurrency },
     52 	{ SYS_compat_60_sa_yield, 0, (sy_call_t *)compat_60_sys_sa_yield },
     53 	{ SYS_compat_60_sa_preempt, 0, (sy_call_t *)compat_60_sys_sa_preempt },
     54 	{ 0, 0, NULL }
     55 };
     56 
     57 int
     58 compat_60_sys_sa_register(lwp_t *l,
     59 	const struct compat_60_sys_sa_register_args *uap,
     60 	register_t *retval)
     61 {
     62 	return sys_nosys(l, uap, retval);
     63 }
     64 
     65 int
     66 compat_60_sys_sa_stacks(lwp_t *l,
     67 	const struct compat_60_sys_sa_stacks_args *uap,
     68 	register_t *retval)
     69 {
     70 	return sys_nosys(l, uap, retval);
     71 }
     72 
     73 int
     74 compat_60_sys_sa_enable(lwp_t *l,
     75 	const void *uap,
     76 	register_t *retval)
     77 {
     78 	return sys_nosys(l, uap, retval);
     79 }
     80 
     81 int
     82 compat_60_sys_sa_setconcurrency(lwp_t *l,
     83 	const struct compat_60_sys_sa_setconcurrency_args *uap,
     84 	register_t *retval)
     85 {
     86 	return sys_nosys(l, uap, retval);
     87 }
     88 
     89 int
     90 compat_60_sys_sa_yield(lwp_t *l,
     91 	const void *uap,
     92 	register_t *retval)
     93 {
     94 	return sys_nosys(l, uap, retval);
     95 }
     96 
     97 int
     98 compat_60_sys_sa_preempt(lwp_t *l,
     99 	const struct compat_60_sys_sa_preempt_args *uap,
    100 	register_t *retval)
    101 {
    102 	return sys_nosys(l, uap, retval);
    103 }
    104 
    105 int
    106 kern_sa_60_init(void)
    107 {
    108 
    109 	return syscall_establish(NULL, kern_sa_60_syscalls);
    110 }
    111 
    112 int
    113 kern_sa_60_fini(void)
    114 {
    115 
    116 	return syscall_disestablish(NULL, kern_sa_60_syscalls);
    117 }
    118