summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-08-25 06:44:32 +0000
committerpeter <peter@FreeBSD.org>1999-08-25 06:44:32 +0000
commiteffc6a6023aebb55d3d5ed00e6f50fbd78a63764 (patch)
tree8829b970cce95f413c882074ee09c68fe3dbad7b /sys
parent7ceff14f1823e770e8caeb5cbabe1619916e1ac5 (diff)
downloadFreeBSD-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
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/bios.c6
-rw-r--r--sys/i386/i386/bios.c6
-rw-r--r--sys/i386/i386/bioscall.s7
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 */
OpenPOWER on IntegriCloud