summaryrefslogtreecommitdiff
path: root/util/msrtool/msrtool.c
diff options
context:
space:
mode:
authorPeter Stuge <peter@stuge.se>2009-01-26 17:18:31 +0000
committerPeter Stuge <peter@stuge.se>2009-01-26 17:18:31 +0000
commit3108a12e9b701e6c3daeb0ae629ecb603dd6509c (patch)
treec5a1455804e58d611f6d0a0134193754809e4cd5 /util/msrtool/msrtool.c
parentc1d6ed9a21bc96b0d4eb778b78c65b304e5e46f9 (diff)
downloadcoreboot-3108a12e9b701e6c3daeb0ae629ecb603dd6509c.tar.xz
msrtool: Allow MSR symbols (names) to also be used as addresses.
Thanks for the idea Mart! Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3921 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/msrtool/msrtool.c')
-rw-r--r--util/msrtool/msrtool.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/msrtool/msrtool.c b/util/msrtool/msrtool.c
index 5742a1765c..bafb0908c0 100644
--- a/util/msrtool/msrtool.c
+++ b/util/msrtool/msrtool.c
@@ -278,7 +278,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");
@@ -398,7 +398,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);