vm86bios.s (47080) | vm86bios.s (47081) |
---|---|
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 * $Id: vm86bios.s,v 1.11 1999/05/11 16:04:40 luoqi Exp $ | 26 * $Id: vm86bios.s,v 1.12 1999/05/12 21:30:51 luoqi Exp $ |
27 */ 28 29#include "opt_vm86.h" 30 31#include <machine/asmacros.h> /* miscellaneous asm macros */ 32#include <machine/trap.h> 33 34#include "assym.s" --- 58 unchanged lines hidden (view full) --- 93 cld 94 rep 95 movsl /* copy frame to new stack */ 96 97 movl _curpcb,%eax 98 pushl %eax /* save curpcb */ 99 movl %edx,_curpcb /* set curpcb to vm86pcb */ 100 | 27 */ 28 29#include "opt_vm86.h" 30 31#include <machine/asmacros.h> /* miscellaneous asm macros */ 32#include <machine/trap.h> 33 34#include "assym.s" --- 58 unchanged lines hidden (view full) --- 93 cld 94 rep 95 movsl /* copy frame to new stack */ 96 97 movl _curpcb,%eax 98 pushl %eax /* save curpcb */ 99 movl %edx,_curpcb /* set curpcb to vm86pcb */ 100 |
101 movl $GPROC0_SEL,%esi 102 leal _gdt(,%esi,8),%ebx /* entry in GDT */ | 101 movl _tss_gdt,%ebx /* entry in GDT */ |
103 movl 0(%ebx),%eax 104 movl %eax,SCR_TSS0(%edx) /* save first word */ 105 movl 4(%ebx),%eax 106 andl $~0x200, %eax /* flip 386BSY -> 386TSS */ 107 movl %eax,SCR_TSS1(%edx) /* save second word */ 108 109 movl PCB_EXT(%edx),%edi /* vm86 tssd entry */ 110 movl 0(%edi),%eax 111 movl %eax,0(%ebx) 112 movl 4(%edi),%eax 113 movl %eax,4(%ebx) | 102 movl 0(%ebx),%eax 103 movl %eax,SCR_TSS0(%edx) /* save first word */ 104 movl 4(%ebx),%eax 105 andl $~0x200, %eax /* flip 386BSY -> 386TSS */ 106 movl %eax,SCR_TSS1(%edx) /* save second word */ 107 108 movl PCB_EXT(%edx),%edi /* vm86 tssd entry */ 109 movl 0(%edi),%eax 110 movl %eax,0(%ebx) 111 movl 4(%edi),%eax 112 movl %eax,4(%ebx) |
114 shll $3,%esi /* GSEL(entry, SEL_KPL) */ | 113 movl $GPROC0_SEL*8,%esi /* GSEL(entry, SEL_KPL) */ |
115 ltr %si 116 117 movl %cr3,%eax 118 pushl %eax /* save address space */ 119 movl _IdlePTD,%ecx 120 movl %ecx,%ebx 121 addl $KERNBASE,%ebx /* va of Idle PTD */ 122 movl 0(%ebx),%eax --- 48 unchanged lines hidden (view full) --- 171 popl %ebx /* saved va of Idle PTD */ 172 popl %eax 173 movl %eax,0(%ebx) /* restore old pte */ 174 popl %eax 175 movl %eax,%cr3 /* install old page table */ 176 177 movl $0,_in_vm86call /* reset trapflag */ 178 | 114 ltr %si 115 116 movl %cr3,%eax 117 pushl %eax /* save address space */ 118 movl _IdlePTD,%ecx 119 movl %ecx,%ebx 120 addl $KERNBASE,%ebx /* va of Idle PTD */ 121 movl 0(%ebx),%eax --- 48 unchanged lines hidden (view full) --- 170 popl %ebx /* saved va of Idle PTD */ 171 popl %eax 172 movl %eax,0(%ebx) /* restore old pte */ 173 popl %eax 174 movl %eax,%cr3 /* install old page table */ 175 176 movl $0,_in_vm86call /* reset trapflag */ 177 |
179 movl $GPROC0_SEL,%esi 180 leal _gdt(,%esi,8),%ebx /* entry in GDT */ | 178 movl _tss_gdt,%ebx /* entry in GDT */ |
181 movl SCR_TSS0(%edx),%eax 182 movl %eax,0(%ebx) /* restore first word */ 183 movl SCR_TSS1(%edx),%eax 184 movl %eax,4(%ebx) /* restore second word */ | 179 movl SCR_TSS0(%edx),%eax 180 movl %eax,0(%ebx) /* restore first word */ 181 movl SCR_TSS1(%edx),%eax 182 movl %eax,4(%ebx) /* restore second word */ |
185 shll $3,%esi /* GSEL(entry, SEL_KPL) */ | 183 movl $GPROC0_SEL*8,%esi /* GSEL(entry, SEL_KPL) */ |
186 ltr %si 187 188 popl _curpcb /* restore curpcb/curproc */ 189 movl SCR_ARGFRAME(%edx),%edx /* original stack frame */ 190 movl TF_TRAPNO(%edx),%eax /* return (trapno) */ 191 192 popl %gs 193 popl %edi 194 popl %esi 195 popl %ebp 196 popl %ebx 197 ret /* back to our normal program */ | 184 ltr %si 185 186 popl _curpcb /* restore curpcb/curproc */ 187 movl SCR_ARGFRAME(%edx),%edx /* original stack frame */ 188 movl TF_TRAPNO(%edx),%eax /* return (trapno) */ 189 190 popl %gs 191 popl %edi 192 popl %esi 193 popl %ebp 194 popl %ebx 195 ret /* back to our normal program */ |