From f996ef639507f381eda2074825b17c6d87ae5752 Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Fri, 20 Aug 1999 21:08:41 +0000 Subject: [PATCH] Loosen up the constructed argument segment generation slightly; rather than trying to size it intelligently just make it 64k and leave it up to the caller to ensure that the arguments all fit within that range. This should resolve the issue that some people were seeing with the PnP BIOS scan crashing on a large PnP node. --- sys/amd64/amd64/bios.c | 13 +++---------- sys/i386/i386/bios.c | 13 +++---------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c index bc1e535f8e0d..980c0b52a4d2 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.16 1999/08/17 07:10:29 msmith Exp $ + * $Id: bios.c,v 1.17 1999/08/18 02:19:52 msmith Exp $ */ /* @@ -287,13 +287,6 @@ set_bios_selectors(struct bios_segments *seg, int flags) } } -/* - * for pointers, we don't know how much space is supposed to be allocated, - * so we assume a minimum size of 256 bytes. If more than this is needed, - * then this can be revisited, such as adding a length specifier. - */ -#define ASSUMED_ARGSIZE 256 - extern int vm86pa; /* @@ -329,7 +322,7 @@ bios16(struct bios_args *args, char *fmt, ...) case 'p': /* 32-bit pointer */ i = va_arg(ap, u_int); arg_start = min(arg_start, i); - arg_end = max(arg_end, i + ASSUMED_ARGSIZE); + arg_end = max(arg_end, i); flags |= BIOSARGS_FLAG; stack -= 4; break; @@ -361,7 +354,7 @@ bios16(struct bios_args *args, char *fmt, ...) if (arg_end - arg_start > ctob(16)) return (EACCES); args->seg.args.base = arg_start; - args->seg.args.limit = arg_end - arg_start; + args->seg.args.limit = 0xffff; } args->seg.code32.base = (u_int)&bios16_call & PG_FRAME; diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c index bc1e535f8e0d..980c0b52a4d2 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.16 1999/08/17 07:10:29 msmith Exp $ + * $Id: bios.c,v 1.17 1999/08/18 02:19:52 msmith Exp $ */ /* @@ -287,13 +287,6 @@ set_bios_selectors(struct bios_segments *seg, int flags) } } -/* - * for pointers, we don't know how much space is supposed to be allocated, - * so we assume a minimum size of 256 bytes. If more than this is needed, - * then this can be revisited, such as adding a length specifier. - */ -#define ASSUMED_ARGSIZE 256 - extern int vm86pa; /* @@ -329,7 +322,7 @@ bios16(struct bios_args *args, char *fmt, ...) case 'p': /* 32-bit pointer */ i = va_arg(ap, u_int); arg_start = min(arg_start, i); - arg_end = max(arg_end, i + ASSUMED_ARGSIZE); + arg_end = max(arg_end, i); flags |= BIOSARGS_FLAG; stack -= 4; break; @@ -361,7 +354,7 @@ bios16(struct bios_args *args, char *fmt, ...) if (arg_end - arg_start > ctob(16)) return (EACCES); args->seg.args.base = arg_start; - args->seg.args.limit = arg_end - arg_start; + args->seg.args.limit = 0xffff; } args->seg.code32.base = (u_int)&bios16_call & PG_FRAME;