Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/i386 Move the ibcs2 setmachine function here (...



details:   https://anonhg.NetBSD.org/src/rev/9937efc79892
branches:  trunk
changeset: 480365:9937efc79892
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Jan 10 03:05:35 2000 +0000

description:
Move the ibcs2 setmachine function here (from compat/ibcs2) since it is
i386 specific.

diffstat:

 sys/arch/i386/i386/ibcs2_machdep.c |  44 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diffs (55 lines):

diff -r 9f58d2600e8e -r 9937efc79892 sys/arch/i386/i386/ibcs2_machdep.c
--- a/sys/arch/i386/i386/ibcs2_machdep.c        Mon Jan 10 03:03:54 2000 +0000
+++ b/sys/arch/i386/i386/ibcs2_machdep.c        Mon Jan 10 03:05:35 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ibcs2_machdep.c,v 1.8 1998/09/11 12:50:05 mycroft Exp $        */
+/*     $NetBSD: ibcs2_machdep.c,v 1.9 2000/01/10 03:05:35 matt Exp $   */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -184,3 +184,45 @@
        if (onstack)
                psp->ps_sigstk.ss_flags |= SS_ONSTACK;
 }
+
+int
+ibcs2_sys_sysmachine(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       struct ibcs2_sys_sysmachine_args /* {
+               syscallarg(int) cmd;
+               syscallarg(int) arg;
+       } */ *uap = v;
+       int val, error;
+
+       switch (SCARG(uap, cmd)) {
+       case IBCS2_SI86FPHW:
+               val = IBCS2_FP_NO;
+#ifdef MATH_EMULATE
+               val = IBCS2_FP_SW;
+#else
+               val = IBCS2_FP_387;             /* a real coprocessor */
+#endif
+               if ((error = copyout((caddr_t)&val, (caddr_t)SCARG(uap, arg),
+                                    sizeof(val))))
+                       return error;
+               break;
+
+       case IBCS2_SI86STIME:           /* XXX - not used much, if at all */
+       case IBCS2_SI86SETNAME:
+               return EINVAL;
+
+       case IBCS2_SI86PHYSMEM:
+                *retval = ctob(physmem);
+               break;
+
+       case IBCS2_SI86GETFEATURES:     /* XXX structure def? */
+               break;
+
+       default:
+               return EINVAL;
+       }
+       return 0;
+}



Home | Main Index | Thread Index | Old Index