summaryrefslogtreecommitdiff
path: root/util/msrtool/msrtool.c
diff options
context:
space:
mode:
authorPeter Stuge <peter@stuge.se>2010-01-17 18:33:53 +0000
committerPeter Stuge <peter@stuge.se>2010-01-17 18:33:53 +0000
commit34f2907a1b969270e92281849cfdfc43c343799c (patch)
treeff4562be914b01b10e9fdda313f7d97d90140705 /util/msrtool/msrtool.c
parent838c5a5d8019eff857dac21c24a2bca624fa3152 (diff)
msrtool: Add endptr to str2msr() showing how many characters were parsed
This also introduces a small change in the user interface for immediate mode (-i). Previously, whitespace could separate high and low words in an MSR as such: msrtool -i 4c00000f='f2f100ff 56960004' That is no longer allowed, a space character now ends the MSR value. Any other character can still be used as separator however, so the following syntax still works as expected: msrtool -i 4c00000f=f2f100ff:56960004 Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5032 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 570f1fb7b2..41e7e2c2ce 100644
--- a/util/msrtool/msrtool.c
+++ b/util/msrtool/msrtool.c
@@ -208,7 +208,7 @@ int do_diff(const char *difffn) {
m1start = line + tmp + m1pos;
for (len = strlen(m1start) - 1; NULL != strchr("\r\n", m1start[len]); --len)
m1start[len] = 0;
- if (!str2msr(m1start, &m1)) {
+ if (!str2msr(m1start, &m1, NULL)) {
fprintf(stderr, "%s:%d: invalid MSR value '%s'\n", difffn, linenum, m1start);
continue;
}
@@ -288,7 +288,7 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "missing value in -i argument!\n");
break;
}
- if (!str2msr(++optarg, &msrval))
+ if (!str2msr(++optarg, &msrval, NULL))
fprintf(stderr, "invalid value in -i argument!\n");
break;
case 's':