1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-04-03 20:12:55 +00:00

bin2hex: Make sure to generate little endian files

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Benjamin Herrenschmidt
2020-06-01 18:24:15 +10:00
parent b8df0647fd
commit a9178ed0c1

View File

@@ -8,9 +8,9 @@ with open(sys.argv[1], "rb") as f:
while True:
word = f.read(8)
if len(word) == 8:
print("%016x" % struct.unpack('Q', word));
print("%016x" % struct.unpack('<Q', word));
elif len(word) == 4:
print("00000000%08x" % struct.unpack('I', word));
print("00000000%08x" % struct.unpack('<I', word));
elif len(word) == 0:
exit(0);
else: