summaryrefslogtreecommitdiff
path: root/util/cbfstool/lzma
diff options
context:
space:
mode:
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-01-29 17:02:55 -0600
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-02-10 05:45:54 +0100
commited87ebc3259abea8f952a7ffd785f670a779bde2 (patch)
tree00afe5969cc7ae28a252a349523a0a527f735bc2 /util/cbfstool/lzma
parentb63b75b0f7262a4a28b6c1e147f81edcfebf37d2 (diff)
downloadcoreboot-ed87ebc3259abea8f952a7ffd785f670a779bde2.tar.xz
cbfstool/lzma: Remove LITTLE_ENDIAN_AND_UNALIGNED_ACCESS_OK
This was designed as a micro-optimization for x86, but it is only used once. Let the compiler decide if optimizing this is worth the effort. Change-Id: I5939efa34f0e9d16643893ca04675247842e7db5 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5085 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'util/cbfstool/lzma')
-rw-r--r--util/cbfstool/lzma/lzma.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/util/cbfstool/lzma/lzma.c b/util/cbfstool/lzma/lzma.c
index 5eebc7e60c..7a6081557a 100644
--- a/util/cbfstool/lzma/lzma.c
+++ b/util/cbfstool/lzma/lzma.c
@@ -6,33 +6,18 @@
#include "C/LzmaDec.h"
#include "C/LzmaEnc.h"
-/* Endianness / unaligned memory access handling */
-
-#if defined(__x86_64__) || defined(__i386__)
-#define LITTLE_ENDIAN_AND_UNALIGNED_ACCESS_OK
-#else
-#undef LITTLE_ENDIAN_AND_UNALIGNED_ACCESS_OK
-#endif
-
#define L (uint64_t)
static inline uint64_t get_64(const void *p)
{
-#ifdef LITTLE_ENDIAN_AND_UNALIGNED_ACCESS_OK
- return *(const uint64_t *)p;
-#else
const unsigned char *data = (const unsigned char *)p;
return (L data[0]) | (L data[1] << 8) | (L data[2] << 16) |
(L data[3] << 24) | (L data [4] << 32) | (L data[5] << 40) |
(L data[6] << 48) | (L data[7] << 56);
-#endif
}
static void put_64(void *p, uint64_t value)
{
-#ifdef LITTLE_ENDIAN_AND_UNALIGNED_ACCESS_OK
- *(uint64_t *) p = value;
-#else
unsigned char *data = (unsigned char *)p;
data[0] = value & 0xff;
data[1] = (value >> 8) & 0xff;
@@ -42,7 +27,6 @@ static void put_64(void *p, uint64_t value)
data[5] = (value >> 40) & 0xff;
data[6] = (value >> 48) & 0xff;
data[7] = (value >> 56) & 0xff;
-#endif
}
/* Memory Allocation API */