Deleted Added
full compact
sys_machdep.c (111032) sys_machdep.c (111119)
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/i386/i386/sys_machdep.c 111032 2003-02-17 09:55:10Z julian $
34 * $FreeBSD: head/sys/i386/i386/sys_machdep.c 111119 2003-02-19 05:47:46Z imp $
35 *
36 */
37
38#include "opt_kstack_pages.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/lock.h>

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

293user_ldt_alloc(struct mdproc *mdp, int len)
294{
295 struct proc_ldt *pldt, *new_ldt;
296
297 if (mtx_owned(&sched_lock))
298 mtx_unlock_spin(&sched_lock);
299 mtx_assert(&sched_lock, MA_NOTOWNED);
300 MALLOC(new_ldt, struct proc_ldt *, sizeof(struct proc_ldt),
35 *
36 */
37
38#include "opt_kstack_pages.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/lock.h>

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

293user_ldt_alloc(struct mdproc *mdp, int len)
294{
295 struct proc_ldt *pldt, *new_ldt;
296
297 if (mtx_owned(&sched_lock))
298 mtx_unlock_spin(&sched_lock);
299 mtx_assert(&sched_lock, MA_NOTOWNED);
300 MALLOC(new_ldt, struct proc_ldt *, sizeof(struct proc_ldt),
301 M_SUBPROC, 0);
301 M_SUBPROC, M_WAITOK);
302
303 new_ldt->ldt_len = len = NEW_MAX_LD(len);
304 new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map,
305 len * sizeof(union descriptor));
306 if (new_ldt->ldt_base == NULL) {
307 FREE(new_ldt, M_SUBPROC);
308 return NULL;
309 }

--- 248 unchanged lines hidden ---
302
303 new_ldt->ldt_len = len = NEW_MAX_LD(len);
304 new_ldt->ldt_base = (caddr_t)kmem_alloc(kernel_map,
305 len * sizeof(union descriptor));
306 if (new_ldt->ldt_base == NULL) {
307 FREE(new_ldt, M_SUBPROC);
308 return NULL;
309 }

--- 248 unchanged lines hidden ---