diff options
author | Helge Deller <deller@gmx.de> | 2021-02-10 22:50:56 +0100 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2021-09-24 11:10:17 +0200 |
commit | 8818f2a01a632bd6c68ab09a64c8d46b0e98e0cd (patch) | |
tree | 07bf3074dc255e38249a9bed459b3416eb67368c | |
parent | 73b7adcfd3f39cf78693375444613a4e4fa02b83 (diff) | |
download | seabios-hppa-8818f2a01a632bd6c68ab09a64c8d46b0e98e0cd.zip seabios-hppa-8818f2a01a632bd6c68ab09a64c8d46b0e98e0cd.tar.gz seabios-hppa-8818f2a01a632bd6c68ab09a64c8d46b0e98e0cd.tar.bz2 |
romfile.c: return values are returned as little-endian
Convert from little-endian to host-endian when returning the value from
romfile_loadint().
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r-- | src/romfile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/romfile.c b/src/romfile.c index b598274..64abe68 100644 --- a/src/romfile.c +++ b/src/romfile.c @@ -5,6 +5,7 @@ // This file may be distributed under the terms of the GNU LGPLv3 license. #include "config.h" // CONFIG_* +#include "byteorder.h" // cpu_to_le16 #include "malloc.h" // free #include "output.h" // dprintf #include "romfile.h" // struct romfile_s @@ -96,7 +97,8 @@ romfile_loadint(const char *name, u64 defval) int ret = file->copy(file, &val, sizeof(val)); if (ret < 0) return defval; - return val; + /* romfile interface stores values in little endian */ + return le64_to_cpu(val); } struct const_romfile_s { |