Module Name: src Committed By: msaitoh Date: Tue May 12 00:00:35 UTC 2015
Modified Files: src/sys/arch/x86/x86: cpu_ucode_intel.c Log Message: Use roundup2() and uintptr_t. Adviced by riastradh@. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/x86/cpu_ucode_intel.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_ucode_intel.c diff -u src/sys/arch/x86/x86/cpu_ucode_intel.c:1.7 src/sys/arch/x86/x86/cpu_ucode_intel.c:1.8 --- src/sys/arch/x86/x86/cpu_ucode_intel.c:1.7 Mon May 11 08:24:50 2015 +++ src/sys/arch/x86/x86/cpu_ucode_intel.c Tue May 12 00:00:35 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_ucode_intel.c,v 1.7 2015/05/11 08:24:50 msaitoh Exp $ */ +/* $NetBSD: cpu_ucode_intel.c,v 1.8 2015/05/12 00:00:35 msaitoh Exp $ */ /* * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.7 2015/05/11 08:24:50 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.8 2015/05/12 00:00:35 msaitoh Exp $"); #include "opt_xen.h" #include "opt_cpu_ucode.h" @@ -131,8 +131,7 @@ cpu_ucode_intel_apply(struct cpu_ucode_s printf("%s: memory allocation failed\n", __func__); return EINVAL; } - uh = (struct intel1_ucode_header *) - (((unsigned long)uh + 15) & ~0x0000000f); + uh = (struct intel1_ucode_header *)roundup2((uintptr_t)uh, 16); /* Copy to the new area */ memcpy(uh, sc->sc_blob, sc->sc_blobsize); }