diff options
author | msmith <msmith@FreeBSD.org> | 1999-08-20 21:08:41 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1999-08-20 21:08:41 +0000 |
commit | c540cb886d0239c0ef10f6f716379ca46e03611a (patch) | |
tree | cd3cebeb7f56d3ac9caaf78b098e14b78b74cf86 | |
parent | c54627898a4267bd9a7a2bf98a2da7a238186aa0 (diff) | |
download | FreeBSD-src-c540cb886d0239c0ef10f6f716379ca46e03611a.zip FreeBSD-src-c540cb886d0239c0ef10f6f716379ca46e03611a.tar.gz |
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.
-rw-r--r-- | sys/amd64/amd64/bios.c | 13 | ||||
-rw-r--r-- | 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 bc1e535..980c0b5 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 bc1e535..980c0b5 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; |