Removed bogus casts of USRSTACK and/or the other operand in binary

expressions involving USRSTACK.
This commit is contained in:
Bruce Evans 1998-12-16 15:21:51 +00:00
parent 9de1707415
commit 4f2129fa86
9 changed files with 34 additions and 43 deletions

@ -1,4 +1,4 @@
/* $Id: trap.c,v 1.7 1998/12/04 10:52:47 dfr Exp $ */
/* $Id: trap.c,v 1.8 1998/12/04 22:54:42 archie Exp $ */
/* $NetBSD: trap.c,v 1.31 1998/03/26 02:21:46 thorpej Exp $ */
/*
@ -419,7 +419,7 @@ trap(a0, a1, a2, entry, framep)
* Grow the stack if necessary
*/
if ((caddr_t)va > vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
&& va < USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.4 1998/10/15 09:53:27 dfr Exp $
* $Id: vm_machdep.c,v 1.5 1998/12/04 10:52:47 dfr Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -378,10 +378,10 @@ grow(p, sp)
caddr_t v;
struct vmspace *vm = p->p_vmspace;
if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= (size_t) USRSTACK)
return (1);
if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK)
return (1);
nss = roundup(USRSTACK - (vm_offset_t)sp, PAGE_SIZE);
nss = roundup(USRSTACK - sp, PAGE_SIZE);
if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur)
return (0);

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
* $Id: trap.c,v 1.129 1998/12/02 08:15:16 kato Exp $
* $Id: trap.c,v 1.130 1998/12/06 00:03:30 archie Exp $
*/
/*
@ -661,8 +661,7 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
if ((caddr_t)va > vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@ -772,8 +771,7 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
if ((caddr_t)va > vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@ -967,8 +965,7 @@ int trapwrite(addr)
++p->p_lock;
if ((caddr_t)va >= vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
if ((caddr_t)va >= vm->vm_maxsaddr && va < USRSTACK) {
if (!grow(p, va)) {
--p->p_lock;
return (1);

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.112 1998/10/13 08:24:33 dg Exp $
* $Id: vm_machdep.c,v 1.113 1998/10/31 17:21:30 peter Exp $
*/
#include "npx.h"
@ -520,10 +520,10 @@ grow(p, sp)
caddr_t v;
struct vmspace *vm = p->p_vmspace;
if ((caddr_t)sp <= vm->vm_maxsaddr || (unsigned)sp >= (unsigned)USRSTACK)
return (1);
if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK)
return (1);
nss = roundup(USRSTACK - (unsigned)sp, PAGE_SIZE);
nss = roundup(USRSTACK - sp, PAGE_SIZE);
if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur)
return (0);

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
* $Id: trap.c,v 1.129 1998/12/02 08:15:16 kato Exp $
* $Id: trap.c,v 1.130 1998/12/06 00:03:30 archie Exp $
*/
/*
@ -661,8 +661,7 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
if ((caddr_t)va > vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@ -772,8 +771,7 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
if ((caddr_t)va > vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@ -967,8 +965,7 @@ int trapwrite(addr)
++p->p_lock;
if ((caddr_t)va >= vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
if ((caddr_t)va >= vm->vm_maxsaddr && va < USRSTACK) {
if (!grow(p, va)) {
--p->p_lock;
return (1);

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.112 1998/10/13 08:24:33 dg Exp $
* $Id: vm_machdep.c,v 1.113 1998/10/31 17:21:30 peter Exp $
*/
#include "npx.h"
@ -520,10 +520,10 @@ grow(p, sp)
caddr_t v;
struct vmspace *vm = p->p_vmspace;
if ((caddr_t)sp <= vm->vm_maxsaddr || (unsigned)sp >= (unsigned)USRSTACK)
return (1);
if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK)
return (1);
nss = roundup(USRSTACK - (unsigned)sp, PAGE_SIZE);
nss = roundup(USRSTACK - sp, PAGE_SIZE);
if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur)
return (0);

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
* $Id: trap.c,v 1.129 1998/12/02 08:15:16 kato Exp $
* $Id: trap.c,v 1.130 1998/12/06 00:03:30 archie Exp $
*/
/*
@ -661,8 +661,7 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
if ((caddr_t)va > vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@ -772,8 +771,7 @@ trap_pfault(frame, usermode, eva)
/*
* Grow the stack if necessary
*/
if ((caddr_t)va > vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
if ((caddr_t)va > vm->vm_maxsaddr && va < USRSTACK) {
if (!grow(p, va)) {
rv = KERN_FAILURE;
--p->p_lock;
@ -967,8 +965,7 @@ int trapwrite(addr)
++p->p_lock;
if ((caddr_t)va >= vm->vm_maxsaddr
&& (caddr_t)va < (caddr_t)USRSTACK) {
if ((caddr_t)va >= vm->vm_maxsaddr && va < USRSTACK) {
if (!grow(p, va)) {
--p->p_lock;
return (1);

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.4 1998/10/15 09:53:27 dfr Exp $
* $Id: vm_machdep.c,v 1.5 1998/12/04 10:52:47 dfr Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -378,10 +378,10 @@ grow(p, sp)
caddr_t v;
struct vmspace *vm = p->p_vmspace;
if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= (size_t) USRSTACK)
return (1);
if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK)
return (1);
nss = roundup(USRSTACK - (vm_offset_t)sp, PAGE_SIZE);
nss = roundup(USRSTACK - sp, PAGE_SIZE);
if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur)
return (0);

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.4 1998/10/15 09:53:27 dfr Exp $
* $Id: vm_machdep.c,v 1.5 1998/12/04 10:52:47 dfr Exp $
*/
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -378,10 +378,10 @@ grow(p, sp)
caddr_t v;
struct vmspace *vm = p->p_vmspace;
if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= (size_t) USRSTACK)
return (1);
if ((caddr_t)sp <= vm->vm_maxsaddr || sp >= USRSTACK)
return (1);
nss = roundup(USRSTACK - (vm_offset_t)sp, PAGE_SIZE);
nss = roundup(USRSTACK - sp, PAGE_SIZE);
if (nss > p->p_rlimit[RLIMIT_STACK].rlim_cur)
return (0);