Deleted Added
full compact
vm86bios.s (87702) vm86bios.s (106542)
1/*-
2 * Copyright (c) 1998 Jonathan Lemon
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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1998 Jonathan Lemon
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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/i386/i386/vm86bios.s 87702 2001-12-11 23:33:44Z jhb $
26 * $FreeBSD: head/sys/i386/i386/vm86bios.s 106542 2002-11-07 01:34:23Z davidxu $
27 */
28
29#include "opt_npx.h"
30
31#include <machine/asmacros.h> /* miscellaneous asm macros */
32#include <machine/trap.h>
33
34#include "assym.s"

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

39#define SCR_PGTABLE PCB_EBX
40#define SCR_ARGFRAME PCB_EIP
41#define SCR_TSS0 PCB_SPARE
42#define SCR_TSS1 (PCB_SPARE+4)
43
44 .data
45 ALIGN_DATA
46
27 */
28
29#include "opt_npx.h"
30
31#include <machine/asmacros.h> /* miscellaneous asm macros */
32#include <machine/trap.h>
33
34#include "assym.s"

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

39#define SCR_PGTABLE PCB_EBX
40#define SCR_ARGFRAME PCB_EIP
41#define SCR_TSS0 PCB_SPARE
42#define SCR_TSS1 (PCB_SPARE+4)
43
44 .data
45 ALIGN_DATA
46
47 .globl in_vm86call, vm86pcb
47 .globl vm86pcb
48
48
49in_vm86call: .long 0
50vm86pcb: .long 0
51
52 .text
53
54/*
55 * vm86_bioscall(struct trapframe_vm86 *vm86)
56 */
57ENTRY(vm86_bioscall)

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

124 movl SCR_NEWPTD(%edx),%eax /* mapping for vm86 page table */
125 movl %eax,0(%ebx) /* ... install as PTD entry 0 */
126
127 movl %ecx,%cr3 /* new page tables */
128 movl SCR_VMFRAME(%edx),%esp /* switch to new stack */
129
130 call vm86_prepcall /* finish setup */
131
49vm86pcb: .long 0
50
51 .text
52
53/*
54 * vm86_bioscall(struct trapframe_vm86 *vm86)
55 */
56ENTRY(vm86_bioscall)

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

123 movl SCR_NEWPTD(%edx),%eax /* mapping for vm86 page table */
124 movl %eax,0(%ebx) /* ... install as PTD entry 0 */
125
126 movl %ecx,%cr3 /* new page tables */
127 movl SCR_VMFRAME(%edx),%esp /* switch to new stack */
128
129 call vm86_prepcall /* finish setup */
130
132 movl $1,in_vm86call /* set flag for trap() */
133
134 /*
135 * Return via doreti
136 */
137 MEXITCOUNT
138 jmp doreti
139
140
141/*

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

153
154 movl SCR_STACK(%edx),%esp /* back to old stack */
155 popl %ebx /* saved va of Idle PTD */
156 popl %eax
157 movl %eax,0(%ebx) /* restore old pte */
158 popl %eax
159 movl %eax,%cr3 /* install old page table */
160
131 /*
132 * Return via doreti
133 */
134 MEXITCOUNT
135 jmp doreti
136
137
138/*

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

150
151 movl SCR_STACK(%edx),%esp /* back to old stack */
152 popl %ebx /* saved va of Idle PTD */
153 popl %eax
154 movl %eax,0(%ebx) /* restore old pte */
155 popl %eax
156 movl %eax,%cr3 /* install old page table */
157
161 movl $0,in_vm86call /* reset trapflag */
162
163 movl PCPU(TSS_GDT),%ebx /* entry in GDT */
164 movl SCR_TSS0(%edx),%eax
165 movl %eax,0(%ebx) /* restore first word */
166 movl SCR_TSS1(%edx),%eax
167 movl %eax,4(%ebx) /* restore second word */
168 movl $GPROC0_SEL*8,%esi /* GSEL(entry, SEL_KPL) */
169 ltr %si
170
171 popl PCPU(CURPCB) /* restore curpcb/curproc */
172 movl SCR_ARGFRAME(%edx),%edx /* original stack frame */
173 movl TF_TRAPNO(%edx),%eax /* return (trapno) */
174
175 popl %gs
176 popl %edi
177 popl %esi
178 popl %ebp
179 popl %ebx
180 ret /* back to our normal program */
158 movl PCPU(TSS_GDT),%ebx /* entry in GDT */
159 movl SCR_TSS0(%edx),%eax
160 movl %eax,0(%ebx) /* restore first word */
161 movl SCR_TSS1(%edx),%eax
162 movl %eax,4(%ebx) /* restore second word */
163 movl $GPROC0_SEL*8,%esi /* GSEL(entry, SEL_KPL) */
164 ltr %si
165
166 popl PCPU(CURPCB) /* restore curpcb/curproc */
167 movl SCR_ARGFRAME(%edx),%edx /* original stack frame */
168 movl TF_TRAPNO(%edx),%eax /* return (trapno) */
169
170 popl %gs
171 popl %edi
172 popl %esi
173 popl %ebp
174 popl %ebx
175 ret /* back to our normal program */