diff --git a/sys/arch/i386/bioscall/biostramp.S b/sys/arch/i386/bioscall/biostramp.S index 953c586f77b5..9c21f8a557ba 100644 --- a/sys/arch/i386/bioscall/biostramp.S +++ b/sys/arch/i386/bioscall/biostramp.S @@ -1,4 +1,4 @@ -/* $NetBSD: biostramp.S,v 1.8 1999/08/23 08:24:36 kleink Exp $ */ +/* $NetBSD: biostramp.S,v 1.9 2001/05/02 13:12:45 jdolecek Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -90,9 +90,10 @@ .set ESI_REGADDR,(EDX_REGADDR-4) .set EDI_REGADDR,(ESI_REGADDR-4) .set EFLAGS_REGADDR,(EDI_REGADDR-4) - .set ENDREGADDR,(EFLAGS_REGADDR-4) + .set ES_REGADDR, (EFLAGS_REGADDR-4) + .set ENDREGADDR,(ES_REGADDR-4) - .set REALSTACK,ENDREGADDR-16 # leave a red zone? + .set REALSTACK,ENDREGADDR-20 # leave a red zone? #define COPY_FLAGS (PSL_C|PSL_PF|PSL_AF|PSL_Z|PSL_N|PSL_D|PSL_V) @@ -135,6 +136,7 @@ ENTRY(do_bios_call) andl $COPY_FLAGS,%ecx orl %ecx,%eax movl %eax,EFLAGS_REGADDR + movl $0, ES_REGADDR # save flags, disable interrupts, do real mode stuff pushfl @@ -263,6 +265,8 @@ intaddr: pop %eax addr32 movw %eax,EFLAGS_REGADDR-MYBASE + addr32 + movw %es,ES_REGADDR-MYBASE # and return to protected mode cli # just to be sure @@ -318,6 +322,8 @@ x32: movl %eax,BIOSCALLREG_EDI(%ebx) movl EFLAGS_REGADDR,%eax movl %eax,BIOSCALLREG_EFLAGS(%ebx) + movl ES_REGADDR, %eax + movl %eax,BIOSCALLREG_ES(%ebx) # finish up, restore registers, and return popfl diff --git a/sys/arch/i386/bioscall/genassym.cf b/sys/arch/i386/bioscall/genassym.cf index 526b49b1cdd8..f1a2d6577e77 100644 --- a/sys/arch/i386/bioscall/genassym.cf +++ b/sys/arch/i386/bioscall/genassym.cf @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.1 1998/08/31 23:53:30 jtk Exp $ +# $NetBSD: genassym.cf,v 1.2 2001/05/02 13:12:45 jdolecek Exp $ # # Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -99,3 +99,4 @@ define BIOSCALLREG_EDX offsetof(struct bioscallregs, EDX) define BIOSCALLREG_ESI offsetof(struct bioscallregs, ESI) define BIOSCALLREG_EDI offsetof(struct bioscallregs, EDI) define BIOSCALLREG_EFLAGS offsetof(struct bioscallregs, EFLAGS) +define BIOSCALLREG_ES offsetof(struct bioscallregs, ES) diff --git a/sys/arch/i386/include/bioscall.h b/sys/arch/i386/include/bioscall.h index 21071f10e176..5bc8e6ade751 100644 --- a/sys/arch/i386/include/bioscall.h +++ b/sys/arch/i386/include/bioscall.h @@ -1,4 +1,4 @@ -/* $NetBSD: bioscall.h,v 1.6 2000/07/12 22:58:12 thorpej Exp $ */ +/* $NetBSD: bioscall.h,v 1.7 2001/05/02 13:12:46 jdolecek Exp $ */ /*- * Copyright (c) 1997, 2000 The NetBSD Foundation, Inc. @@ -63,6 +63,7 @@ struct bioscallregs { bios_reg r_si; bios_reg r_di; bios_reg r_flags; + bios_reg r_es; }; #define AL r_ax.biosreg_quarter[BIOSREG_LO] @@ -101,6 +102,8 @@ struct bioscallregs { #define FLAGS_HI r_flags.biosreg_half[BIOSREG_HI] #define EFLAGS r_flags.biosreg_long +#define ES r_es.biosreg_half[BIOSREG_LO] + void bioscall __P((int /* function*/ , struct bioscallregs * /* regs */)); #endif #endif /* __I386_BIOSCALL_H__ */