18 #include <sys/types.h>
23 #define MSR_FIDVID_STATUS 0xc0010042
25 #define MSR_S_HI_CURRENT_VID 0x0000001f
26 #define MSR_S_LO_CURRENT_FID 0x0000003f
38 sprintf(file,
"/dev/cpu/%d/msr", cpu);
44 if (
read(fd, &msr, 8) != 8)
60 return 800 + (fid * 100);
78 cpu = strtoul(argv[1],
NULL, 0);
80 err = get_fidvid(cpu, &fid, &vid);
83 printf(
"can't get fid, vid from MSR\n");
84 printf(
"Possible trouble: you don't run a powernow-k8 capable cpu\n");
85 printf(
"or you are not root, or the msr driver is not present\n");
90 printf(
"cpu %d currently at %d MHz and %d mV\n",
92 find_freq_from_fid(fid),
93 find_millivolts_from_vid(vid));