Module Name: src
Committed By: rkujawa
Date: Wed May 29 23:29:44 UTC 2013
Modified Files:
src/sys/arch/arm/include/arm32: param.h
Log Message:
Explicitely cast to unsigned. Avoid bugs caused by misintepreting the result as
signed.
riastradh@ suggested to change these macros into static inline functions.
But I'm still not convinced...
Obtained from Marvell, Semihalf.
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/include/arm32/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/arm/include/arm32/param.h
diff -u src/sys/arch/arm/include/arm32/param.h:1.19 src/sys/arch/arm/include/arm32/param.h:1.20
--- src/sys/arch/arm/include/arm32/param.h:1.19 Wed Mar 20 13:43:39 2013
+++ src/sys/arch/arm/include/arm32/param.h Wed May 29 23:29:44 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.19 2013/03/20 13:43:39 skrll Exp $ */
+/* $NetBSD: param.h,v 1.20 2013/05/29 23:29:44 rkujawa Exp $ */
/*
* Copyright (c) 1994,1995 Mark Brinicombe.
@@ -89,8 +89,8 @@
#define USPACE_SVC_STACK_TOP (USPACE)
#define USPACE_SVC_STACK_BOTTOM (sizeof(struct pcb))
-#define arm_btop(x) ((x) >> PGSHIFT)
-#define arm_ptob(x) ((x) << PGSHIFT)
+#define arm_btop(x) ((unsigned)(x) >> PGSHIFT)
+#define arm_ptob(x) ((unsigned)(x) << PGSHIFT)
#define arm_trunc_page(x) ((unsigned)(x) & ~PGOFSET)
#ifdef _KERNEL