Deleted Added
full compact
sys_machdep.c (72930) sys_machdep.c (76078)
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 * $FreeBSD: head/sys/amd64/amd64/sys_machdep.c 72930 2001-02-23 01:25:02Z peter $
34 * $FreeBSD: head/sys/amd64/amd64/sys_machdep.c 76078 2001-04-27 19:28:25Z jhb $
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/sysproto.h>
41#include <sys/ipl.h>
42#include <sys/malloc.h>
43#include <sys/proc.h>
35 *
36 */
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/sysproto.h>
41#include <sys/ipl.h>
42#include <sys/malloc.h>
43#include <sys/proc.h>
44#include <sys/smp.h>
44
45#include <vm/vm.h>
46#include <sys/lock.h>
47#include <vm/pmap.h>
48#include <vm/vm_map.h>
49#include <vm/vm_extern.h>
50
51#include <sys/user.h>
52
53#include <machine/cpu.h>
54#include <machine/pcb_ext.h> /* pcb.h included by sys/user.h */
55#include <machine/sysarch.h>
45
46#include <vm/vm.h>
47#include <sys/lock.h>
48#include <vm/pmap.h>
49#include <vm/vm_map.h>
50#include <vm/vm_extern.h>
51
52#include <sys/user.h>
53
54#include <machine/cpu.h>
55#include <machine/pcb_ext.h> /* pcb.h included by sys/user.h */
56#include <machine/sysarch.h>
56#ifdef SMP
57#include <machine/smp.h>
58#endif
59
60#include <vm/vm_kern.h> /* for kernel_map */
61
62#define MAX_LD 8192
63#define LD_PER_PAGE 512
64#define NEW_MAX_LD(num) ((num + LD_PER_PAGE) & ~(LD_PER_PAGE-1))
65#define SIZE_FROM_LARGEST_LD(num) (NEW_MAX_LD(num) << 3)
66

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

149 for (i = 0; i < (ctob(IOPAGES) + 32 + 16) / sizeof(u_long); i++)
150 *addr++ = ~0;
151
152 ssd.ssd_base = (unsigned)&ext->ext_tss;
153 ssd.ssd_limit -= ((unsigned)&ext->ext_tss - (unsigned)ext);
154 ssdtosd(&ssd, &ext->ext_tssd);
155
156 /* switch to the new TSS after syscall completes */
57
58#include <vm/vm_kern.h> /* for kernel_map */
59
60#define MAX_LD 8192
61#define LD_PER_PAGE 512
62#define NEW_MAX_LD(num) ((num + LD_PER_PAGE) & ~(LD_PER_PAGE-1))
63#define SIZE_FROM_LARGEST_LD(num) (NEW_MAX_LD(num) << 3)
64

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

147 for (i = 0; i < (ctob(IOPAGES) + 32 + 16) / sizeof(u_long); i++)
148 *addr++ = ~0;
149
150 ssd.ssd_base = (unsigned)&ext->ext_tss;
151 ssd.ssd_limit -= ((unsigned)&ext->ext_tss - (unsigned)ext);
152 ssdtosd(&ssd, &ext->ext_tssd);
153
154 /* switch to the new TSS after syscall completes */
157 need_resched();
155 /*
156 * XXX: The sched_lock here needs to be over a slightly larger area.
157 * I have patches to more properly lock accesses to process ldt's
158 * and tss's that still need to be reviewed, but this keeps us from
159 * panic'ing on the mtx_assert() in need_resched() for the time being.
160 */
161 mtx_lock_spin(&sched_lock);
162 need_resched(p);
163 mtx_unlock_spin(&sched_lock);
158
159 return 0;
160}
161
162static int
163i386_set_ioperm(p, args)
164 struct proc *p;
165 char *args;

--- 329 unchanged lines hidden ---
164
165 return 0;
166}
167
168static int
169i386_set_ioperm(p, args)
170 struct proc *p;
171 char *args;

--- 329 unchanged lines hidden ---