coretemp.c (178989) | coretemp.c (185341) |
---|---|
1/*- 2 * Copyright (c) 2007, 2008 Rui Paulo <rpaulo@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 */ 26 27/* 28 * Device driver for Intel's On Die thermal sensor via MSR. 29 * First introduced in Intel's Core line of processors. 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2007, 2008 Rui Paulo <rpaulo@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 */ 26 27/* 28 * Device driver for Intel's On Die thermal sensor via MSR. 29 * First introduced in Intel's Core line of processors. 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/dev/coretemp/coretemp.c 178989 2008-05-14 10:02:25Z rpaulo $"); | 33__FBSDID("$FreeBSD: head/sys/dev/coretemp/coretemp.c 185341 2008-11-26 19:25:13Z jkim $"); |
34 35#include <sys/param.h> 36#include <sys/bus.h> 37#include <sys/systm.h> 38#include <sys/types.h> 39#include <sys/module.h> 40#include <sys/conf.h> 41#include <sys/kernel.h> 42#include <sys/sysctl.h> 43#include <sys/proc.h> /* for curthread */ 44#include <sys/sched.h> 45 46#include <machine/specialreg.h> 47#include <machine/cpufunc.h> | 34 35#include <sys/param.h> 36#include <sys/bus.h> 37#include <sys/systm.h> 38#include <sys/types.h> 39#include <sys/module.h> 40#include <sys/conf.h> 41#include <sys/kernel.h> 42#include <sys/sysctl.h> 43#include <sys/proc.h> /* for curthread */ 44#include <sys/sched.h> 45 46#include <machine/specialreg.h> 47#include <machine/cpufunc.h> |
48#include <machine/cputypes.h> |
|
48#include <machine/md_var.h> 49 50struct coretemp_softc { 51 device_t sc_dev; 52 int sc_tjmax; 53 struct sysctl_oid *sc_oid; 54}; 55 --- 33 unchanged lines hidden (view full) --- 89 device_t child; 90 u_int regs[4]; 91 92 /* Make sure we're not being doubly invoked. */ 93 if (device_find_child(parent, "coretemp", -1) != NULL) 94 return; 95 96 /* Check that CPUID 0x06 is supported and the vendor is Intel.*/ | 49#include <machine/md_var.h> 50 51struct coretemp_softc { 52 device_t sc_dev; 53 int sc_tjmax; 54 struct sysctl_oid *sc_oid; 55}; 56 --- 33 unchanged lines hidden (view full) --- 90 device_t child; 91 u_int regs[4]; 92 93 /* Make sure we're not being doubly invoked. */ 94 if (device_find_child(parent, "coretemp", -1) != NULL) 95 return; 96 97 /* Check that CPUID 0x06 is supported and the vendor is Intel.*/ |
97 if (cpu_high < 6 || strcmp(cpu_vendor, "GenuineIntel")) | 98 if (cpu_high < 6 || cpu_vendor_id != CPU_VENDOR_INTEL) |
98 return; 99 /* 100 * CPUID 0x06 returns 1 if the processor has on-die thermal 101 * sensors. EBX[0:3] contains the number of sensors. 102 */ 103 do_cpuid(0x06, regs); 104 if ((regs[0] & 0x1) != 1) 105 return; --- 183 unchanged lines hidden --- | 99 return; 100 /* 101 * CPUID 0x06 returns 1 if the processor has on-die thermal 102 * sensors. EBX[0:3] contains the number of sensors. 103 */ 104 do_cpuid(0x06, regs); 105 if ((regs[0] & 0x1) != 1) 106 return; --- 183 unchanged lines hidden --- |