From ec9ed6196a3433159c8307633bcd1d9370aadb2e Mon Sep 17 00:00:00 2001 From: Jonathan Lemon Date: Tue, 28 Jul 1998 03:29:32 +0000 Subject: [PATCH] Fix an off-by-one error when setting the iomap bits. Change struct i386_*_iomap to use ints instead of shorts/chars. (pointed out by bde long ago, prodded into action by msmith) --- sys/amd64/amd64/sys_machdep.c | 10 +++++----- sys/i386/i386/sys_machdep.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index af0ec8ec7cef..bd3dab7ee243 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 - * $Id: sys_machdep.c,v 1.33 1998/02/13 05:25:37 bde Exp $ + * $Id: sys_machdep.c,v 1.34 1998/03/23 19:52:34 jlemon Exp $ * */ @@ -169,9 +169,9 @@ i386_extend_pcb(struct proc *p) } struct i386_ioperm_args { - u_short start; - u_short length; - u_char enable; + u_int start; + u_int length; + int enable; }; static int @@ -205,7 +205,7 @@ i386_set_ioperm(p, args) if (ua.start + ua.length > IOPAGES * PAGE_SIZE * NBBY) return (EINVAL); - for (i = ua.start; i < (int)(ua.start + ua.length) + 1; i++) { + for (i = ua.start; i < ua.start + ua.length; i++) { if (ua.enable) iomap[i >> 3] &= ~(1 << (i & 7)); else diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index af0ec8ec7cef..bd3dab7ee243 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 - * $Id: sys_machdep.c,v 1.33 1998/02/13 05:25:37 bde Exp $ + * $Id: sys_machdep.c,v 1.34 1998/03/23 19:52:34 jlemon Exp $ * */ @@ -169,9 +169,9 @@ i386_extend_pcb(struct proc *p) } struct i386_ioperm_args { - u_short start; - u_short length; - u_char enable; + u_int start; + u_int length; + int enable; }; static int @@ -205,7 +205,7 @@ i386_set_ioperm(p, args) if (ua.start + ua.length > IOPAGES * PAGE_SIZE * NBBY) return (EINVAL); - for (i = ua.start; i < (int)(ua.start + ua.length) + 1; i++) { + for (i = ua.start; i < ua.start + ua.length; i++) { if (ua.enable) iomap[i >> 3] &= ~(1 << (i & 7)); else