sys_machdep.c (efeaf95a41820e4eb661a90cfb59a26e36575784) sys_machdep.c (87b911575102f86e2cbceac54e8b0518d27200cd)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91
34 * $Id: sys_machdep.c,v 1.11 1995/11/12 07:10:47 bde Exp $
34 * $Id: sys_machdep.c,v 1.12 1995/12/07 12:45:38 davidg Exp $
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/sysproto.h>
41#include <sys/proc.h>
42

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

51#include <sys/user.h>
52
53#include <machine/cpu.h>
54#include <machine/sysarch.h>
55
56#include <vm/vm_kern.h> /* for kernel_map */
57
58void set_user_ldt __P((struct pcb *pcb));
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/sysproto.h>
41#include <sys/proc.h>
42

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

51#include <sys/user.h>
52
53#include <machine/cpu.h>
54#include <machine/sysarch.h>
55
56#include <vm/vm_kern.h> /* for kernel_map */
57
58void set_user_ldt __P((struct pcb *pcb));
59int i386_get_ldt __P((struct proc *, char *, int *));
60int i386_set_ldt __P((struct proc *, char *, int *));
59static int i386_get_ldt __P((struct proc *, char *, int *));
60static int i386_set_ldt __P((struct proc *, char *, int *));
61
62#ifndef _SYS_SYSPROTO_H_
63struct sysarch_args {
64 int op;
65 char *parms;
66};
67#endif
68

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

103}
104
105struct i386_get_ldt_args {
106 int start;
107 union descriptor *desc;
108 int num;
109};
110
61
62#ifndef _SYS_SYSPROTO_H_
63struct sysarch_args {
64 int op;
65 char *parms;
66};
67#endif
68

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

103}
104
105struct i386_get_ldt_args {
106 int start;
107 union descriptor *desc;
108 int num;
109};
110
111int
111static int
112i386_get_ldt(p, args, retval)
113 struct proc *p;
114 char *args;
115 int *retval;
116{
117 int error = 0;
118 struct pcb *pcb = &p->p_addr->u_pcb;
119 int nldt, num;

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

157}
158
159struct i386_set_ldt_args {
160 int start;
161 union descriptor *desc;
162 int num;
163};
164
112i386_get_ldt(p, args, retval)
113 struct proc *p;
114 char *args;
115 int *retval;
116{
117 int error = 0;
118 struct pcb *pcb = &p->p_addr->u_pcb;
119 int nldt, num;

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

157}
158
159struct i386_set_ldt_args {
160 int start;
161 union descriptor *desc;
162 int num;
163};
164
165int
165static int
166i386_set_ldt(p, args, retval)
167 struct proc *p;
168 char *args;
169 int *retval;
170{
171 int error = 0, i, n;
172 struct pcb *pcb = &p->p_addr->u_pcb;
173 union descriptor *lp;

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

251 /*NOTREACHED*/
252 }
253 }
254
255 s = splhigh();
256
257 /* Fill in range */
258 for (i = 0, n = uap->start; i < uap->num && !error; i++, n++) {
166i386_set_ldt(p, args, retval)
167 struct proc *p;
168 char *args;
169 int *retval;
170{
171 int error = 0, i, n;
172 struct pcb *pcb = &p->p_addr->u_pcb;
173 union descriptor *lp;

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

251 /*NOTREACHED*/
252 }
253 }
254
255 s = splhigh();
256
257 /* Fill in range */
258 for (i = 0, n = uap->start; i < uap->num && !error; i++, n++) {
259 union descriptor desc, *dp;
259 union descriptor *dp;
260 dp = &uap->desc[i];
261 lp = &((union descriptor *)(pcb->pcb_ldt))[n];
262#ifdef DEBUG
263 printf("i386_set_ldt(%d): ldtp=%x\n", p->p_pid, lp);
264#endif
265 error = copyin(dp, lp, sizeof(union descriptor));
266 }
267 if (!error) {
268 *retval = uap->start;
269/* need_resched(); */
270 }
271
272 splx(s);
273 return(error);
274}
275#endif /* USER_LDT */
260 dp = &uap->desc[i];
261 lp = &((union descriptor *)(pcb->pcb_ldt))[n];
262#ifdef DEBUG
263 printf("i386_set_ldt(%d): ldtp=%x\n", p->p_pid, lp);
264#endif
265 error = copyin(dp, lp, sizeof(union descriptor));
266 }
267 if (!error) {
268 *retval = uap->start;
269/* need_resched(); */
270 }
271
272 splx(s);
273 return(error);
274}
275#endif /* USER_LDT */