Module Name: src Committed By: matt Date: Mon Feb 27 16:57:58 UTC 2012
Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: mips_param.h Log Message: Make sure we don't overflow a 32-bit integer. To generate a diff of this commit: cvs rdiff -u -r1.23.78.11 -r1.23.78.12 src/sys/arch/mips/include/mips_param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mips/include/mips_param.h diff -u src/sys/arch/mips/include/mips_param.h:1.23.78.11 src/sys/arch/mips/include/mips_param.h:1.23.78.12 --- src/sys/arch/mips/include/mips_param.h:1.23.78.11 Tue Dec 27 16:09:36 2011 +++ src/sys/arch/mips/include/mips_param.h Mon Feb 27 16:57:58 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_param.h,v 1.23.78.11 2011/12/27 16:09:36 matt Exp $ */ +/* mips_param.h,v 1.23.78.11 2011/12/27 16:09:36 matt Exp */ #ifdef _KERNEL #include <machine/cpu.h> @@ -95,8 +95,8 @@ #ifdef _LP64 #define NSEGPG (NBPG/8) -#define NBXSEG (NSEGPG*NBSEG) /* bytes/xsegment */ -#define XSEGOFSET (NBSEG-1) /* byte offset into segment */ +#define NBXSEG ((uint64_t)NSEGPG*NBSEG) /* bytes/xsegment */ +#define XSEGOFSET (NBXSEG-1) /* byte offset into xsegment */ #define XSEGSHIFT (SEGSHIFT+(PGSHIFT-3)) /* LOG2(NBXSEG) */ #endif