ibcs2_sysvec.c revision 41173
12116Sjkh/*
22116Sjkh * Copyright (c) 1995 Steven Wallace
32116Sjkh * All rights reserved.
42116Sjkh *
52116Sjkh * Redistribution and use in source and binary forms, with or without
62116Sjkh * modification, are permitted provided that the following conditions
72116Sjkh * are met:
88870Srgrimes * 1. Redistributions of source code must retain the above copyright
92116Sjkh *    notice, this list of conditions and the following disclaimer.
102116Sjkh * 2. Redistributions in binary form must reproduce the above copyright
112116Sjkh *    notice, this list of conditions and the following disclaimer in the
122116Sjkh *    documentation and/or other materials provided with the distribution.
132116Sjkh * 3. All advertising materials mentioning features or use of this software
148870Srgrimes *    must display the following acknowledgement:
152116Sjkh *      This product includes software developed by Steven Wallace.
162116Sjkh * 4. The name of the author may not be used to endorse or promote products
172116Sjkh *    derived from this software without specific prior written permission.
188870Srgrimes *
198870Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
202116Sjkh * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
212116Sjkh * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
222116Sjkh * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
232116Sjkh * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
242116Sjkh * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
252116Sjkh * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
262116Sjkh * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
278870Srgrimes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
282116Sjkh * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
292116Sjkh *
302116Sjkh * $Id: ibcs2_sysvec.c,v 1.10 1998/11/07 04:34:02 peter Exp $
312116Sjkh */
322116Sjkh
332116Sjkh#include <sys/param.h>
348870Srgrimes#include <sys/kernel.h>
358870Srgrimes#include <sys/module.h>
368870Srgrimes#include <sys/sysent.h>
378870Srgrimes#include <sys/signalvar.h>
388870Srgrimes#include <i386/ibcs2/ibcs2_syscall.h>
398870Srgrimes
408870Srgrimesextern int bsd_to_ibcs2_sig[];
418870Srgrimesextern int bsd_to_ibcs2_errno[];
428870Srgrimesextern struct sysent ibcs2_sysent[IBCS2_SYS_MAXSYSCALL];
438870Srgrimesextern int szsigcode;
448870Srgrimesextern char sigcode[];
452116Sjkh
462116Sjkhstruct sysentvec ibcs2_svr3_sysvec = {
472116Sjkh        sizeof (ibcs2_sysent) / sizeof (ibcs2_sysent[0]),
482116Sjkh        ibcs2_sysent,
492116Sjkh        0xFF,
502116Sjkh        NSIG,
512116Sjkh        bsd_to_ibcs2_sig,
522116Sjkh        ELAST,
532116Sjkh        bsd_to_ibcs2_errno,
542116Sjkh	0,              /* trap-to-signal translation function */
552116Sjkh	0,		/* fixup */
562116Sjkh	sendsig,
572116Sjkh	sigcode,	/* use generic trampoline */
582116Sjkh	&szsigcode,	/* use generic trampoline size */
592116Sjkh	0,		/* prepsyscall */
602116Sjkh	"IBCS2 COFF",
612116Sjkh	NULL		/* we don't have a COFF coredump function */
622116Sjkh};
632116Sjkh
642116Sjkh#ifndef LKM
652116Sjkh/*
662116Sjkh * Create an "ibcs2" module that does nothing but allow checking for
672116Sjkh * the presence of the subsystem.
682116Sjkh */
692116Sjkhstatic int
702116Sjkhibcs2_modevent(module_t mod, int type, void *unused)
718870Srgrimes{
722116Sjkh	/* Do not care */
738870Srgrimes	return 0;
742116Sjkh}
752116Sjkhmoduledata_t ibcs2_mod = {
762116Sjkh	"ibcs2",
772116Sjkh	ibcs2_modevent,
782116Sjkh	0
792116Sjkh};
802116SjkhDECLARE_MODULE(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
812116Sjkh#endif
822116Sjkh