aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Smith <msmith@FreeBSD.org>1999-08-24 16:42:08 +0000
committerMike Smith <msmith@FreeBSD.org>1999-08-24 16:42:08 +0000
commite6a80efcddded72bb6f6accd1dee9e4f5b6563b9 (patch)
tree281c9ba49ee8600b0b847debe7cb8ce3c57f67ee /sys
parentb01aa9b2b2b61ecdafda0288da28e0c2d2f0c127 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/bios.c13
-rw-r--r--sys/i386/i386/bios.c13
2 files changed, 22 insertions, 4 deletions
diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c
index 980c0b52a4d28..cc8e30bf36ba4 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.17 1999/08/18 02:19:52 msmith Exp $
+ * $Id: bios.c,v 1.18 1999/08/20 21:08:41 msmith Exp $
*/
/*
@@ -315,7 +315,16 @@ bios16(struct bios_args *args, char *fmt, ...)
arg_start = 0xffffffff;
arg_end = 0;
- stack = (caddr_t)PAGE_SIZE;
+ /*
+ * Some BIOS entrypoints attempt to copy the largest-case
+ * argument frame (in order to generalise handling for
+ * different entry types). If our argument frame is
+ * smaller than this, the BIOS will reach off the top of
+ * our constructed stack segment. Pad the top of the stack
+ * with some garbage to avoid this.
+ */
+ stack = (caddr_t)PAGE_SIZE - 32;
+
va_start(ap, fmt);
for (p = fmt; p && *p; p++) {
switch (*p) {
diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c
index 980c0b52a4d28..cc8e30bf36ba4 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.17 1999/08/18 02:19:52 msmith Exp $
+ * $Id: bios.c,v 1.18 1999/08/20 21:08:41 msmith Exp $
*/
/*
@@ -315,7 +315,16 @@ bios16(struct bios_args *args, char *fmt, ...)
arg_start = 0xffffffff;
arg_end = 0;
- stack = (caddr_t)PAGE_SIZE;
+ /*
+ * Some BIOS entrypoints attempt to copy the largest-case
+ * argument frame (in order to generalise handling for
+ * different entry types). If our argument frame is
+ * smaller than this, the BIOS will reach off the top of
+ * our constructed stack segment. Pad the top of the stack
+ * with some garbage to avoid this.
+ */
+ stack = (caddr_t)PAGE_SIZE - 32;
+
va_start(ap, fmt);
for (p = fmt; p && *p; p++) {
switch (*p) {