1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1994 Søren Schmidt
5 * Copyright (c) 1994 Sean Eric Fagan
6 * Copyright (c) 1995 Steven Wallace
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer
14 * in this position and unchanged.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33 #include <sys/cdefs.h>
34 __FBSDID("$FreeBSD: releng/12.0/sys/i386/ibcs2/ibcs2_isc.c 326260 2017-11-27 15:08:52Z pfg $");
35
36 #include <sys/param.h>
37 #include <sys/lock.h>
38 #include <sys/mutex.h>
39 #include <sys/systm.h>
40 #include <sys/sysent.h>
41 #include <sys/proc.h>
42
43 #include <machine/cpu.h>
44
45 #include <i386/ibcs2/ibcs2_types.h>
46 #include <i386/ibcs2/ibcs2_signal.h>
47 #include <i386/ibcs2/ibcs2_proto.h>
48 #include <i386/ibcs2/ibcs2_isc_syscall.h>
49
50 extern struct sysent isc_sysent[];
51
52 int
53 ibcs2_isc(struct thread *td, struct ibcs2_isc_args *uap)
54 {
55 struct trapframe *tf = td->td_frame;
56 struct sysent *callp;
57 u_int code;
58 int error;
59
60 code = (tf->tf_eax & 0xffffff00) >> 8;
61 callp = &isc_sysent[code];
62
63 if (code < IBCS2_ISC_MAXSYSCALL)
64 error = (*callp->sy_call)(td, (void *)uap);
65 else
66 error = ENOSYS;
67 return (error);
68 }
Cache object: 107c14fe337da05873ca4befdf7987b3
|