diff options
author | swallace <swallace@FreeBSD.org> | 1995-10-10 07:59:30 +0000 |
---|---|---|
committer | swallace <swallace@FreeBSD.org> | 1995-10-10 07:59:30 +0000 |
commit | 20f13c7a7ed3183879431f56c3761a1c7914af8a (patch) | |
tree | 81a969abda60acfc5b1785850773a90772c8c462 /sys/i386/ibcs2/ibcs2_isc.c | |
parent | 6c1c648223be1d6caaddff391d1d2946ebc316a2 (diff) | |
download | FreeBSD-src-20f13c7a7ed3183879431f56c3761a1c7914af8a.zip FreeBSD-src-20f13c7a7ed3183879431f56c3761a1c7914af8a.tar.gz |
Remove old files no longer needed.
Add new files created for emulator.
Modify NetBSD import to work with FreeBSD and add new features and
code. The complete emulator is essentially a combination of work/code
implemented by Sean Eric Fagan, Soren Schmidt, Scott Bartram, and myself,
Steven Wallace.
Features of this new emulator system include:
o "clean" code, including strict prototyping.
o Auto-generation of ibcs2 system calls, xenix system calls, isc system
calls. Generation includes system tables, structure definitions,
and prototyping of function calls.
o ibcs2 emulator does not rely on any COMPAT_43 system calls.
o embedded socksys support
o ibcs2 msgsys, semsys, shmsys calls supported if supported in kernel
o alternate /emul/ibcs2 namespace searched first for files in ibcs2
system. Usefull to keep sysv libraries, binaries in /emul/ibcs2.
o many other finer details and functions fixed or implemented.
Diffstat (limited to 'sys/i386/ibcs2/ibcs2_isc.c')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_isc.c | 170 |
1 files changed, 21 insertions, 149 deletions
diff --git a/sys/i386/ibcs2/ibcs2_isc.c b/sys/i386/ibcs2/ibcs2_isc.c index a6c9dbd..0b6f596 100644 --- a/sys/i386/ibcs2/ibcs2_isc.c +++ b/sys/i386/ibcs2/ibcs2_isc.c @@ -1,6 +1,7 @@ /*- * Copyright (c) 1994 Søren Schmidt * Copyright (c) 1994 Sean Eric Fagan + * Copyright (c) 1995 Steven Wallace * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,166 +27,37 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: ibcs2_isc.c,v 1.3 1995/04/30 11:30:12 ache Exp $ + * $Id: ibcs2_isc.c,v 1.4 1995/05/30 07:59:58 rgrimes Exp $ */ -#include <i386/ibcs2/ibcs2.h> #include <sys/param.h> -#include <sys/proc.h> +#include <sys/systm.h> #include <sys/sysent.h> -#include <sys/errno.h> -#include <sys/ioctl.h> -#include <sys/signal.h> -#include <sys/syslimits.h> -#include <sys/timeb.h> -#include <sys/unistd.h> -#include <sys/utsname.h> + #include <machine/cpu.h> #include <machine/psl.h> #include <machine/reg.h> +#include <i386/ibcs2/ibcs2_types.h> +#include <i386/ibcs2/ibcs2_signal.h> +#include <i386/ibcs2/ibcs2_util.h> +#include <i386/ibcs2/ibcs2_proto.h> +#include <i386/ibcs2/ibcs2_isc_syscall.h> + +extern struct sysent isc_sysent[]; + int -ibcs2_cisc(struct proc *p, void *args, int *retval) +ibcs2_isc(struct proc *p, struct ibcs2_isc_args *uap, int *retval) { struct trapframe *tf = (struct trapframe *)p->p_md.md_regs; + struct sysent *callp; + u_int code; - switch ((tf->tf_eax & 0xffffff00) >> 8) { - - case 0x00: - printf("IBCS2: 'cisc #0' what is this ??\n"); - return 0; - - case 0x02: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc rename'\n"); - return rename(p, args, retval); - - case 0x03: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc sigaction'\n"); - return ibcs2_sigaction(p, args, retval); - - case 0x04: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc sigprocmask'\n"); - return ibcs2_sigprocmask(p, args, retval); - - case 0x05: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc sigpending'\n"); - return ibcs2_sigpending(p, args, retval); - - case 0x06: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc getgroups'\n"); - return getgroups(p, args, retval); - - case 0x07: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc setgroups'\n"); - return setgroups(p, args, retval); - - case 0x08: /* pathconf */ - case 0x09: /* fpathconf */ - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc (f)pathconf'"); - return ibcs2_pathconf(p, args, retval); - - case 0x10: { /* sysconf */ - struct ibcs2_sysconf_args { - int num; - } *sysconf_args = args; - - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc sysconf'"); - switch (sysconf_args->num) { - case 0: /* _SC_ARG_MAX */ - *retval = (ARG_MAX); - break; - case 1: /* _SC_CHILD_MAX */ - *retval = (CHILD_MAX); - break; - case 2: /* _SC_CLK_TCK */ - *retval = (_BSD_CLK_TCK_); - break; - case 3: /* _SC_NGROUPS_MAX */ - *retval = (NGROUPS_MAX); - break; - case 4: /* _SC_OPEN_MAX */ - *retval = (OPEN_MAX); - break; - case 5: /* _SC_JOB_CONTROL */ -#ifdef _POSIX_JOB_CONTROL - *retval = (1); -#else - *retval = (-1); -#endif - break; - case 6: /* _SC_SAVED_IDS */ -#ifdef _POSIX_SAVED_IDS - *retval = (1); -#else - *retval = (-1); -#endif - break; - case 7: /* _SC_VERSION */ - *retval = (_POSIX_VERSION); - break; - default: - *retval = -1; - return EINVAL; - } - return 0; - } - - case 0x0b: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc waitpid'\n"); - return ibcs2_wait(p, args, retval); - - case 0x0c: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc setsid'\n"); - return setsid(p, args, retval); - - case 0x0d: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc setpgid'\n"); - return setpgid(p, args, retval); - - case 0x11: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc sigsuspend'\n"); - return ibcs2_sigsuspend(p, args, retval); - - case 0x12: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc symlink'\n"); - return symlink(p, args, retval); - - case 0x13: - if (ibcs2_trace & IBCS2_TRACE_ISC) - printf("IBCS2: 'cisc readlink'\n"); - return readlink(p, args, retval); + code = (tf->tf_eax & 0xffffff00) >> 8; + callp = &isc_sysent[code]; - /* Here needs more work to be done */ - case 0x01: - printf("IBCS2: 'cisc setostype'"); - break; - case 0x0e: - printf("IBCS2: 'cisc adduser'"); - break; - case 0x0f: - printf("IBCS2: 'cisc setuser'"); - break; - case 0x14: - printf("IBCS2: 'cisc getmajor'"); - break; - default: - printf("IBCS2: 'cisc' function %d(0x%x)", - tf->tf_eax>>8, tf->tf_eax>>8); - break; - } - printf(" not implemented yet\n"); - return EINVAL; + if(code < IBCS2_ISC_MAXSYSCALL) + return((*callp->sy_call)(p, (void *)uap, retval)); + else + return ENOSYS; } |