diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-07-31 20:15:09 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-07-31 20:15:09 +0000 |
commit | 5d5a178048db414afbe6d69877249bb056a697be (patch) | |
tree | c2fd3483630d4d3d4bb6958898e9ae93000bbc21 /sys/arch/i386/stand | |
parent | 8a3f9a45accbd6ff1208331c078d08a480c04e6e (diff) |
optimize emulation handler
Diffstat (limited to 'sys/arch/i386/stand')
-rw-r--r-- | sys/arch/i386/stand/libsa/gidt.S | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/sys/arch/i386/stand/libsa/gidt.S b/sys/arch/i386/stand/libsa/gidt.S index fea51002506..9c2bf2ae81a 100644 --- a/sys/arch/i386/stand/libsa/gidt.S +++ b/sys/arch/i386/stand/libsa/gidt.S @@ -1,4 +1,4 @@ -/* $OpenBSD: gidt.S,v 1.10 1997/07/30 19:40:58 flipk Exp $ */ +/* $OpenBSD: gidt.S,v 1.11 1997/07/31 20:15:08 mickey Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -38,7 +38,6 @@ #include <machine/psl.h> #define _LOCORE #include <machine/trap.h> -#include <machine/segments.h> #include <debug_md.h> #undef _LOCORE #include <assym.h> @@ -338,30 +337,34 @@ IEMUENT(44); IEMUENT(45); IEMUENT(46); IEMUENT(47) * entry point for BIOS real-mode interface * all the magic for real-prot mode switching is here * - * Call: %eax, %ecx, %edx, %ebx, %ebp, %esi, %edi, %es + * Call: %eax, %ecx, %edx, %ebx, %ebp, %esi, %edi, %es, %ds * Return: %eax, %edx, %ecx, %eflags (as returned from BIOS) * */ EMUh: + /* save %eax */ + movl %eax, 3f + popl %eax + pushal pushl %ds pushl %es pushl %fs pushl %gs - /* save %eax */ - movl %eax, 3f - /* save BIOS int vector */ - movb 12*4(%esp), %al movb %al, intno - movl %eax, 2f prot2real + pushl %ds + addr32 movl _C_LABEL(BIOS_regs)+(biosr_es), %eax movl %ax, %es + addr32 + movl _C_LABEL(BIOS_regs)+(biosr_ds), %eax + movl %ax, %ds data32 # movl Leax, %eax @@ -373,6 +376,8 @@ EMUh: intno = . - 1 cli + popl %ds + addr32 data32 movl %ebx, _C_LABEL(BIOS_regs)+(biosr_bx) @@ -397,7 +402,7 @@ intno = . - 1 movl %eax, 0xb*4(%esp) movl %ecx, 0xa*4(%esp) movl %edx, 0x9*4(%esp) - movb %bh , 0xf*4(%esp) + movb %bh , 0xe*4(%esp) /* save registers into save area */ movl %eax, _C_LABEL(BIOS_regs)+biosr_ax @@ -412,7 +417,6 @@ intno = . - 1 popl %es popl %ds popal - addl $4, %esp iret .globl _C_LABEL(kentry) |