summaryrefslogtreecommitdiffstats
path: root/sys/i386/ibcs2/ibcs2_sysi86.c
diff options
context:
space:
mode:
authorswallace <swallace@FreeBSD.org>1995-10-10 07:59:30 +0000
committerswallace <swallace@FreeBSD.org>1995-10-10 07:59:30 +0000
commit20f13c7a7ed3183879431f56c3761a1c7914af8a (patch)
tree81a969abda60acfc5b1785850773a90772c8c462 /sys/i386/ibcs2/ibcs2_sysi86.c
parent6c1c648223be1d6caaddff391d1d2946ebc316a2 (diff)
downloadFreeBSD-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_sysi86.c')
-rw-r--r--sys/i386/ibcs2/ibcs2_sysi86.c51
1 files changed, 38 insertions, 13 deletions
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 <i386/ibcs2/ibcs2.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/proc.h>
+#include <sys/user.h>
+#include <sys/sysctl.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>
+
+#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;
}
}
OpenPOWER on IntegriCloud