summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-12-16 15:21:51 +0000
committerbde <bde@FreeBSD.org>1998-12-16 15:21:51 +0000
commit9dd9cb4cb28ec01a4407ae4a7a8cb0fbce4f357e (patch)
treef28ac6d9c65aefcbb3d340c4fc9bb29ec2e034a9 /sys/amd64
parent83e223ac3aaa15f444f462d48abc2e69856ae5bf (diff)
downloadFreeBSD-src-9dd9cb4cb28ec01a4407ae4a7a8cb0fbce4f357e.zip
FreeBSD-src-9dd9cb4cb28ec01a4407ae4a7a8cb0fbce4f357e.tar.gz
Removed bogus casts of USRSTACK and/or the other operand in binary
expressions involving USRSTACK.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/trap.c11
-rw-r--r--sys/amd64/amd64/vm_machdep.c8
2 files changed, 8 insertions, 11 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index e56286a..3d35483 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -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);
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index 18ebeb3..761008e 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -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);
OpenPOWER on IntegriCloud