Module Name: src
Committed By: jym
Date: Tue Feb 9 23:47:10 UTC 2010
Modified Files:
src/sys/arch/x86/x86: cpu.c
Log Message:
Use roundup2() instead of hardcoding the operation.
To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/x86/x86/cpu.c
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/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.66 src/sys/arch/x86/x86/cpu.c:1.67
--- src/sys/arch/x86/x86/cpu.c:1.66 Fri Jan 8 19:43:26 2010
+++ src/sys/arch/x86/x86/cpu.c Tue Feb 9 23:47:10 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.66 2010/01/08 19:43:26 dyoung Exp $ */
+/* $NetBSD: cpu.c,v 1.67 2010/02/09 23:47:10 jym Exp $ */
/*-
* Copyright (c) 2000, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.66 2010/01/08 19:43:26 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.67 2010/02/09 23:47:10 jym Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@@ -294,8 +294,7 @@
aprint_naive(": Application Processor\n");
ptr = (uintptr_t)kmem_alloc(sizeof(*ci) + CACHE_LINE_SIZE - 1,
KM_SLEEP);
- ci = (struct cpu_info *)((ptr + CACHE_LINE_SIZE - 1) &
- ~(CACHE_LINE_SIZE - 1));
+ ci = (struct cpu_info *)roundup2(ptr, CACHE_LINE_SIZE);
memset(ci, 0, sizeof(*ci));
ci->ci_curldt = -1;
#ifdef TRAPLOG