Module Name:    src
Committed By:   msaitoh
Date:           Fri Dec 12 02:25:55 UTC 2014

Modified Files:
        src/sys/arch/x86/include: specialreg.h
        src/sys/arch/x86/x86: cpu_ucode_intel.c

Log Message:
Use specialreg.h's definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.5 -r1.6 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/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.80 src/sys/arch/x86/include/specialreg.h:1.81
--- src/sys/arch/x86/include/specialreg.h:1.80	Thu Sep 11 18:11:59 2014
+++ src/sys/arch/x86/include/specialreg.h	Fri Dec 12 02:25:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.80 2014/09/11 18:11:59 msaitoh Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.81 2014/12/12 02:25:55 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -506,6 +506,7 @@
 #define	MSR_CESR		0x011	/* P5 only (trap on P6) */
 #define	MSR_CTR0		0x012	/* P5 only (trap on P6) */
 #define	MSR_CTR1		0x013	/* P5 only (trap on P6) */
+#define MSR_IA32_PLATFORM_ID	0x017
 #define MSR_APICBASE		0x01b
 #define MSR_EBL_CR_POWERON	0x02a
 #define MSR_EBC_FREQUENCY_ID	0x02c	/* PIV only */

Index: src/sys/arch/x86/x86/cpu_ucode_intel.c
diff -u src/sys/arch/x86/x86/cpu_ucode_intel.c:1.5 src/sys/arch/x86/x86/cpu_ucode_intel.c:1.6
--- src/sys/arch/x86/x86/cpu_ucode_intel.c:1.5	Wed Mar 26 08:04:19 2014
+++ src/sys/arch/x86/x86/cpu_ucode_intel.c	Fri Dec 12 02:25:55 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_intel.c,v 1.5 2014/03/26 08:04:19 christos Exp $ */
+/* $NetBSD: cpu_ucode_intel.c,v 1.6 2014/12/12 02:25:55 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.5 2014/03/26 08:04:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_intel.c,v 1.6 2014/12/12 02:25:55 msaitoh Exp $");
 
 #include "opt_xen.h"
 #include "opt_cpu_ucode.h"
@@ -46,10 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_ucode_in
 #include <machine/specialreg.h>
 #include <x86/cpu_ucode.h>
 
-#define MSR_IA32_PLATFORM_ID 0x17
-#define MSR_IA32_BIOS_UPDT_TRIGGER 0x79
-#define MSR_IA32_BIOS_SIGN_ID 0x8b
-
 static void
 intel_getcurrentucode(uint32_t *ucodeversion, int *platformid)
 {
@@ -58,9 +54,9 @@ intel_getcurrentucode(uint32_t *ucodever
 
 	kpreempt_disable();
 
-	wrmsr(MSR_IA32_BIOS_SIGN_ID, 0);
+	wrmsr(MSR_BIOS_SIGN, 0);
 	x86_cpuid(0, unneeded_ids);
-	msr = rdmsr(MSR_IA32_BIOS_SIGN_ID);
+	msr = rdmsr(MSR_BIOS_SIGN);
 	*ucodeversion = msr >> 32;
 
 	kpreempt_enable();
@@ -138,7 +134,7 @@ cpu_ucode_intel_apply(struct cpu_ucode_s
 		kpreempt_enable();
 		return EEXIST; /* ??? */
 	}
-	wrmsr(MSR_IA32_BIOS_UPDT_TRIGGER, (uintptr_t)(sc->sc_blob) + 48);
+	wrmsr(MSR_BIOS_UPDT_TRIG, (uintptr_t)(sc->sc_blob) + 48);
 	intel_getcurrentucode(&nucodeversion, &platformid);
 
 	kpreempt_enable();

Reply via email to