Deleted Added
full compact
ibcs2_sysi86.c (107839) ibcs2_sysi86.c (107849)
1/*-
2 * Copyright (c) 1994 S�ren Schmidt
3 * Copyright (c) 1995 Steven Wallace
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

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.
28 *
1/*-
2 * Copyright (c) 1994 S�ren Schmidt
3 * Copyright (c) 1995 Steven Wallace
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

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.
28 *
29 * $FreeBSD: head/sys/i386/ibcs2/ibcs2_sysi86.c 107839 2002-12-13 22:41:47Z alfred $
29 * $FreeBSD: head/sys/i386/ibcs2/ibcs2_sysi86.c 107849 2002-12-14 01:56:26Z alfred $
30 */
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/sysctl.h>
35
36#include <i386/ibcs2/ibcs2_types.h>
37#include <i386/ibcs2/ibcs2_signal.h>

--- 10 unchanged lines hidden (view full) ---

48#define SETNAME 56
49#define SI86_MEM 65
50
51extern int hw_float;
52
53int
54ibcs2_sysi86(struct thread *td, struct ibcs2_sysi86_args *args)
55{
30 */
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/sysctl.h>
35
36#include <i386/ibcs2/ibcs2_types.h>
37#include <i386/ibcs2/ibcs2_signal.h>

--- 10 unchanged lines hidden (view full) ---

48#define SETNAME 56
49#define SI86_MEM 65
50
51extern int hw_float;
52
53int
54ibcs2_sysi86(struct thread *td, struct ibcs2_sysi86_args *args)
55{
56 switch (SCARG(args, cmd)) {
56 switch (args->cmd) {
57 case SI86_FPHW: { /* Floating Point information */
58 int val, error;
59
60 if (hw_float) val = IBCS2_FP_387; /* FPU hardware */
61 else val = IBCS2_FP_SW; /* FPU emulator */
62
57 case SI86_FPHW: { /* Floating Point information */
58 int val, error;
59
60 if (hw_float) val = IBCS2_FP_387; /* FPU hardware */
61 else val = IBCS2_FP_SW; /* FPU emulator */
62
63 if ((error = copyout(&val, SCARG(args, arg), sizeof(val))) != 0)
63 if ((error = copyout(&val, args->arg, sizeof(val))) != 0)
64 return error;
65 return 0;
66 }
67
68 case STIME: /* set the system time given pointer to long */
69 /* gettimeofday; time.tv_sec = *args->arg; settimeofday */
70 return EINVAL;
71
72 case SETNAME: { /* set hostname given string w/ len <= 7 chars */
73 int name[2];
74 int error;
75
76 if ((error = suser(td)))
77 return (error);
78 name[0] = CTL_KERN;
79 name[1] = KERN_HOSTNAME;
80 return (userland_sysctl(td, name, 2, 0, 0, 0,
64 return error;
65 return 0;
66 }
67
68 case STIME: /* set the system time given pointer to long */
69 /* gettimeofday; time.tv_sec = *args->arg; settimeofday */
70 return EINVAL;
71
72 case SETNAME: { /* set hostname given string w/ len <= 7 chars */
73 int name[2];
74 int error;
75
76 if ((error = suser(td)))
77 return (error);
78 name[0] = CTL_KERN;
79 name[1] = KERN_HOSTNAME;
80 return (userland_sysctl(td, name, 2, 0, 0, 0,
81 SCARG(args, arg), 7, 0));
81 args->arg, 7, 0));
82 }
83
84 case SI86_MEM: /* size of physical memory */
85 td->td_retval[0] = ctob(physmem);
86 return 0;
87
88 default:
89#ifdef DIAGNOSTIC
90 printf("IBCS2: 'sysi86' function %d(0x%x) "
82 }
83
84 case SI86_MEM: /* size of physical memory */
85 td->td_retval[0] = ctob(physmem);
86 return 0;
87
88 default:
89#ifdef DIAGNOSTIC
90 printf("IBCS2: 'sysi86' function %d(0x%x) "
91 "not implemented yet\n", SCARG(args, cmd), args->cmd);
91 "not implemented yet\n", args->cmd, args->cmd);
92#endif
93 return EINVAL;
94 }
95}
92#endif
93 return EINVAL;
94 }
95}