cpu_switch.S (5813dc03bd2fe3bd09b1793a9b95b27e0f1d7432) cpu_switch.S (f1532aadeefd1f9ee9f9b5d94d049a54bb5bc0e6)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * $FreeBSD$
37 */
38
39#include "opt_npx.h"
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * $FreeBSD$
37 */
38
39#include "opt_npx.h"
40#include "opt_user_ldt.h"
41
42#include <machine/asmacros.h>
43#include <machine/ipl.h>
44
45#ifdef SMP
46#include <machine/pmap.h>
47#include <machine/apic.h>
48#include <machine/smptests.h> /** GRAB_LOPRIO */

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

236#endif /* SMP */
237 movl %edx, PCPU(CURPCB)
238 movl %ecx, PCPU(CURPROC) /* into next process */
239
240#ifdef SMP
241 /* XXX FIXME: we should be restoring the local APIC TPR */
242#endif /* SMP */
243
40
41#include <machine/asmacros.h>
42#include <machine/ipl.h>
43
44#ifdef SMP
45#include <machine/pmap.h>
46#include <machine/apic.h>
47#include <machine/smptests.h> /** GRAB_LOPRIO */

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

235#endif /* SMP */
236 movl %edx, PCPU(CURPCB)
237 movl %ecx, PCPU(CURPROC) /* into next process */
238
239#ifdef SMP
240 /* XXX FIXME: we should be restoring the local APIC TPR */
241#endif /* SMP */
242
244#ifdef USER_LDT
245 cmpl $0, PCB_USERLDT(%edx)
246 jnz 1f
247 movl __default_ldt,%eax
248 cmpl PCPU(CURRENTLDT),%eax
249 je 2f
250 lldt __default_ldt
251 movl %eax,PCPU(CURRENTLDT)
252 jmp 2f
2531: pushl %edx
254 call _set_user_ldt
255 popl %edx
2562:
243 cmpl $0, PCB_USERLDT(%edx)
244 jnz 1f
245 movl __default_ldt,%eax
246 cmpl PCPU(CURRENTLDT),%eax
247 je 2f
248 lldt __default_ldt
249 movl %eax,PCPU(CURRENTLDT)
250 jmp 2f
2511: pushl %edx
252 call _set_user_ldt
253 popl %edx
2542:
257#endif
258
259 /* This must be done after loading the user LDT. */
260 .globl cpu_switch_load_gs
261cpu_switch_load_gs:
262 movl PCB_GS(%edx),%gs
263
264 /* test if debug regisers should be restored */
265 movb PCB_FLAGS(%edx),%al

--- 92 unchanged lines hidden ---
255
256 /* This must be done after loading the user LDT. */
257 .globl cpu_switch_load_gs
258cpu_switch_load_gs:
259 movl PCB_GS(%edx),%gs
260
261 /* test if debug regisers should be restored */
262 movb PCB_FLAGS(%edx),%al

--- 92 unchanged lines hidden ---