Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Use roundup2() instead of hardcoding the op...



details:   https://anonhg.NetBSD.org/src/rev/e151b2693cff
branches:  trunk
changeset: 751971:e151b2693cff
user:      jym <jym%NetBSD.org@localhost>
date:      Tue Feb 09 23:47:10 2010 +0000

description:
Use roundup2() instead of hardcoding the operation.

diffstat:

 sys/arch/x86/x86/cpu.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 273cdc623905 -r e151b2693cff sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c    Tue Feb 09 23:14:19 2010 +0000
+++ b/sys/arch/x86/x86/cpu.c    Tue Feb 09 23:47:10 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index