Use the far jump for the base of the page arithmatic rather than the

calling function, otherwise Bad Things Happen(tm) when bios16_call is
not in the same page as bios_jmp.

Reviewed by:  msmith
This commit is contained in:
Peter Wemm 1999-08-25 06:44:32 +00:00
parent 0ff7b13acd
commit 857c0cefe0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50336
3 changed files with 10 additions and 9 deletions

View File

@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bios.c,v 1.18 1999/08/20 21:08:41 msmith Exp $
* $Id: bios.c,v 1.19 1999/08/24 16:42:08 msmith Exp $
*/
/*
@ -78,7 +78,6 @@ bios32_init(void *junk)
u_int8_t ck, *cv;
int i;
/*
* BIOS32 Service Directory
*/
@ -288,6 +287,7 @@ set_bios_selectors(struct bios_segments *seg, int flags)
}
extern int vm86pa;
extern void bios_jmp(void);
/*
* this routine is really greedy with selectors, and uses 5:
@ -366,7 +366,7 @@ bios16(struct bios_args *args, char *fmt, ...)
args->seg.args.limit = 0xffff;
}
args->seg.code32.base = (u_int)&bios16_call & PG_FRAME;
args->seg.code32.base = (u_int)&bios_jmp & PG_FRAME;
args->seg.code32.limit = 0xffff;
ptd = (u_int *)rcr3();

View File

@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bios.c,v 1.18 1999/08/20 21:08:41 msmith Exp $
* $Id: bios.c,v 1.19 1999/08/24 16:42:08 msmith Exp $
*/
/*
@ -78,7 +78,6 @@ bios32_init(void *junk)
u_int8_t ck, *cv;
int i;
/*
* BIOS32 Service Directory
*/
@ -288,6 +287,7 @@ set_bios_selectors(struct bios_segments *seg, int flags)
}
extern int vm86pa;
extern void bios_jmp(void);
/*
* this routine is really greedy with selectors, and uses 5:
@ -366,7 +366,7 @@ bios16(struct bios_args *args, char *fmt, ...)
args->seg.args.limit = 0xffff;
}
args->seg.code32.base = (u_int)&bios16_call & PG_FRAME;
args->seg.code32.base = (u_int)&bios_jmp & PG_FRAME;
args->seg.code32.limit = 0xffff;
ptd = (u_int *)rcr3();

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: bioscall.s,v 1.2 1999/07/29 01:49:18 msmith Exp $
* $Id: bioscall.s,v 1.3 1999/07/29 07:10:34 msmith Exp $
*/
/*
@ -123,11 +123,12 @@ ENTRY(bios16_call)
movl 20(%ebp),%edi
pushl $BC32SEL
leal bios_jmp,%ebp
leal CNAME(bios_jmp),%ebp
andl $PAGE_MASK,%ebp
pushl %ebp /* reload %cs and */
lret /* ...continue below */
bios_jmp:
.globl CNAME(bios_jmp)
CNAME(bios_jmp):
data16
lcall _bioscall_vector /* 16-bit call */