Remove commented out example MSR definitions
[coreboot.git] / util / msrtool / msrtool.c
index 5742a1765ccf1416653f0f0d20588493c52b7318..251da40d99fccd8327e3f751ea45f3943c9ad41a 100644 (file)
@@ -42,11 +42,13 @@ struct pci_access *pacc = NULL;
 static struct targetdef alltargets[] = {
        { "geodelx", "AMD Geode(tm) LX", geodelx_probe, geodelx_msrs },
        { "cs5536", "AMD Geode(tm) CS5536", cs5536_probe, cs5536_msrs },
+       { "K8", "AMD K8 Family", k8_probe, k8_msrs },
        { TARGET_EOT }
 };
 
 static struct sysdef allsystems[] = {
        { "linux", "Linux with /dev/cpu/*/msr", linux_probe, linux_open, linux_close, linux_rdmsr },
+       { "darwin", "OS X with DirectIO", darwin_probe, darwin_open, darwin_close, darwin_rdmsr },
        { SYSTEM_EOT }
 };
 
@@ -278,7 +280,7 @@ int main(int argc, char *argv[]) {
                        break;
                case 'i':
                        input = 1;
-                       addr = strtoul(optarg, NULL, 16);
+                       addr = msraddrbyname(optarg);
                        optarg = strchr(optarg, '=');
                        if (NULL == optarg) {
                                fprintf(stderr, "missing value in -i argument!\n");
@@ -349,6 +351,7 @@ int main(int argc, char *argv[]) {
 
        if (sys && !sys->name) {
                fprintf(stderr, "Unable to detect the current operating system!\n");
+               fprintf(stderr, "On Linux, please do 'modprobe msr' and retry.\n");
                fprintf(stderr, "Please send a report or patch to coreboot@coreboot.org. Thanks for your help!\n");
                fprintf(stderr, "\n");
        }
@@ -398,7 +401,7 @@ int main(int argc, char *argv[]) {
        }
 
        for (; optind < argc; optind++) {
-               addr = strtoul(argv[optind], NULL, 16);
+               addr = msraddrbyname(argv[optind]);
                if (!sys->rdmsr(cpu, addr, &msrval))
                        break;
                decodemsr(cpu, addr, msrval);