diff options
author | peter <peter@FreeBSD.org> | 1999-08-25 06:44:32 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-08-25 06:44:32 +0000 |
commit | effc6a6023aebb55d3d5ed00e6f50fbd78a63764 (patch) | |
tree | 8829b970cce95f413c882074ee09c68fe3dbad7b | |
parent | 7ceff14f1823e770e8caeb5cbabe1619916e1ac5 (diff) | |
download | FreeBSD-src-effc6a6023aebb55d3d5ed00e6f50fbd78a63764.zip FreeBSD-src-effc6a6023aebb55d3d5ed00e6f50fbd78a63764.tar.gz |
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
-rw-r--r-- | sys/amd64/amd64/bios.c | 6 | ||||
-rw-r--r-- | sys/i386/i386/bios.c | 6 | ||||
-rw-r--r-- | sys/i386/i386/bioscall.s | 7 |
3 files changed, 10 insertions, 9 deletions
diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c index cc8e30b..521761f 100644 --- a/sys/amd64/amd64/bios.c +++ b/sys/amd64/amd64/bios.c @@ -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(); diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c index cc8e30b..521761f 100644 --- a/sys/i386/i386/bios.c +++ b/sys/i386/i386/bios.c @@ -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(); diff --git a/sys/i386/i386/bioscall.s b/sys/i386/i386/bioscall.s index 5e325ba..a7e9dd0 100644 --- a/sys/i386/i386/bioscall.s +++ b/sys/i386/i386/bioscall.s @@ -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 */ |