diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2012-08-29 15:03:09 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2012-11-08 19:38:59 +0100 |
commit | f27d36c361abef8fcbb377a8949067290770571a (patch) | |
tree | 29dfea423bd2c05b07eda68afa860cc89b2dbb5a /util/cbmem | |
parent | 01c3de9bb45e09edfe715ec2934805b5ea2edd2f (diff) | |
download | coreboot-f27d36c361abef8fcbb377a8949067290770571a.tar.xz |
Fix cbmem to work on 64 bit platforms
For some reason which I fail to understand, specifying endiannes using
'@' (which means 'native' and should be the same as '<' on x86
platforms) causes cbmem.py to crash the machine on 64 bit systems.
What happens is that the addresses read from various table headers'
struct representations do not make sense, when bogus address gets
passed to get_phys_mem, the crash happens while that function is
executed.
dlaurie@ found out that replacing "@" with "<" in fact fixes the
issue. After some investigation I am just submitting this fix without
much understanding of the root cause.
Change-Id: Iaba9bc72a3f6b1d0407a5f1e3b459ccf5063969d
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/1715
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'util/cbmem')
-rwxr-xr-x | util/cbmem/cbmem.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/util/cbmem/cbmem.py b/util/cbmem/cbmem.py index f4f3e887e7..839393bba4 100755 --- a/util/cbmem/cbmem.py +++ b/util/cbmem/cbmem.py @@ -57,7 +57,7 @@ def get_phys_mem(addr, size): class MetaCStruct(type): def __init__(cls, name, bases, dct): struct_members = dct["struct_members"] - cls.struct_fmt = "@" + cls.struct_fmt = "<" for char, name in struct_members: cls.struct_fmt += char cls.struct_len = struct.calcsize(cls.struct_fmt) |