Add support for getting %es value from the bios call.

This commit is contained in:
jdolecek 2001-05-02 13:12:45 +00:00
parent 9b12c80149
commit 0b26347639
3 changed files with 15 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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__ */