Patch for amdtemp

Mario Lobo mlobo at digiart.art.br
Sat Oct 31 01:26:40 UTC 2009


Hi;

Recently I bought a Phenom II quad and I noticed that amdtemp.ko only 
displayed 2 temp sysctl values. I started digging the net for some clues and I 
found a patch from a guy (sorry, don't remember his name any longer) that 
changed amdtemp for his 3 core amd cpu.

I expanded HIS idea to 4 cores and it worked fine, so I'm submitting the patch 
for testing by other members.

[~]>sysctl -a | grep temp
hw.usb.template: 0
dev.amdtemp.0.%desc: AMD K8 Thermal Sensors
dev.amdtemp.0.%driver: amdtemp
dev.amdtemp.0.%parent: hostb4
dev.cpu.0.temperature: 48.0C
dev.cpu.1.temperature: 48.0C
dev.cpu.2.temperature: 48.0C
dev.cpu.3.temperature: 47.8C

Since I know before hand how many cores my cpu has, I changed the code for the 
exact amount of cores but maybe there is a way to detect how many cores the 
CPU has before creating the sysctl variables.

BW
-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since version 2.2.8 [not Pro-Audio.... YET!!] (99,7% winedows FREE)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amdtemp.c.diff
Type: text/x-patch
Size: 3391 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20091031/0f2b11f7/amdtemp.c.bin


More information about the freebsd-current mailing list