2 * Copyright (c) 1994 Søren Schmidt
3 * Copyright (c) 1995 Steven Wallace
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer
11 * in this position and unchanged.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software withough specific prior written permission
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 * ibcs2_sysi86.c,v 1.1 1994/10/14 08:53:11 sos Exp
30 * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/ibcs2_sysi86.c,v 1.6 2003/08/07 21:17:17 dillon Exp $
33 #include <sys/param.h>
34 #include <sys/systm.h>
35 #include <sys/sysctl.h>
37 #include "ibcs2_types.h"
38 #include "ibcs2_signal.h"
39 #include "ibcs2_util.h"
40 #include "ibcs2_proto.h"
42 #define IBCS2_FP_NO 0 /* no fp support */
43 #define IBCS2_FP_SW 1 /* software emulator */
44 #define IBCS2_FP_287 2 /* 80287 FPU */
45 #define IBCS2_FP_387 3 /* 80387 FPU */
55 ibcs2_sysi86(struct ibcs2_sysi86_args *args)
57 struct thread *td = curthread;
59 switch (SCARG(args, cmd)) {
60 case SI86_FPHW: { /* Floating Point information */
63 if (hw_float) val = IBCS2_FP_387; /* FPU hardware */
64 else val = IBCS2_FP_SW; /* FPU emulator */
66 if ((error = copyout(&val, SCARG(args, arg), sizeof(val))) != 0)
71 case STIME: /* set the system time given pointer to long */
72 /* gettimeofday; time.tv_sec = *args->arg; settimeofday */
75 case SETNAME: { /* set hostname given string w/ len <= 7 chars */
79 if ((error = suser(td)))
82 name[1] = KERN_HOSTNAME;
83 return (userland_sysctl(name, 2, 0, 0, 0,
84 SCARG(args, arg), 7, 0));
87 case SI86_MEM: /* size of physical memory */
88 args->sysmsg_result = ctob(physmem);
93 printf("IBCS2: 'sysi86' function %d(0x%x) "
94 "not implemented yet\n", SCARG(args, cmd), args->cmd);