1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

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)
This commit is contained in:
Jonathan Lemon 1998-07-28 03:29:32 +00:00
parent e8f9ae6c6e
commit ec9ed6196a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37902
2 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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