From 20f13c7a7ed3183879431f56c3761a1c7914af8a Mon Sep 17 00:00:00 2001 From: swallace Date: Tue, 10 Oct 1995 07:59:30 +0000 Subject: 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. --- sys/i386/ibcs2/ibcs2_sysi86.c | 51 ++++++++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 13 deletions(-) (limited to 'sys/i386/ibcs2/ibcs2_sysi86.c') diff --git a/sys/i386/ibcs2/ibcs2_sysi86.c b/sys/i386/ibcs2/ibcs2_sysi86.c index 611ad10..c00be03 100644 --- a/sys/i386/ibcs2/ibcs2_sysi86.c +++ b/sys/i386/ibcs2/ibcs2_sysi86.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 1994 Søren Schmidt + * Copyright (c) 1995 Steven Wallace * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,44 +26,68 @@ * (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_sysi86.c,v 1.1 1994/10/14 08:53:11 sos Exp $ + * ibcs2_sysi86.c,v 1.1 1994/10/14 08:53:11 sos Exp */ -#include #include #include #include #include +#include +#include +#include +#include +#include +#include + +#define IBCS2_FP_NO 0 /* no fp support */ +#define IBCS2_FP_SW 1 /* software emulator */ +#define IBCS2_FP_287 2 /* 80287 FPU */ +#define IBCS2_FP_387 3 /* 80387 FPU */ + +#define SI86_FPHW 40 +#define STIME 54 +#define SETNAME 56 +#define SI86_MEM 65 -struct ibcs2_sysi86_args { - int cmd; - int *arg; -}; int ibcs2_sysi86(struct proc *p, struct ibcs2_sysi86_args *args, int *retval) { - switch (args->cmd) { - case 0x28: { /* SI86_FPHW */ + switch (SCARG(args, cmd)) { + case SI86_FPHW: { /* Floating Point information */ int val, error; - extern int hw_float; if (hw_float) val = IBCS2_FP_387; /* FPU hardware */ else val = IBCS2_FP_SW; /* FPU emulator */ - - if (error = copyout(&val, args->arg, sizeof(val))) + + if (error = copyout(&val, SCARG(args, arg), sizeof(val))) return error; return 0; } - case 0x33: /* SI86_MEM */ + case STIME: /* set the system time given pointer to long */ + /* gettimeofday; time.tv_sec = *args->arg; settimeofday */ + return EINVAL; + + case SETNAME: { /* set hostname given string w/ len <= 7 chars */ + int name; + int error; + + if ((error = suser(p->p_ucred, &p->p_acflag))) + return (error); + name = KERN_HOSTNAME; + return (kern_sysctl(&name, 1, 0, 0, SCARG(args, arg), 7, p)); + } + + case SI86_MEM: /* size of physical memory */ *retval = ctob(physmem); return 0; default: printf("IBCS2: 'sysi86' function %d(0x%x) " - "not implemented yet\n", args->cmd, args->cmd); + "not implemented yet\n", SCARG(args, cmd), args->cmd); return EINVAL; } } -- cgit v1.1