aboutsummaryrefslogtreecommitdiff
path: root/lib/libnvram
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2011-06-29 13:18:28 +0200
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-10-12 08:43:12 +0200
commit2e2e4cae3728d7c4565cae90e687555a7df1af12 (patch)
tree39ccc9ef131065739b5a1343c53598bb0927dcf8 /lib/libnvram
parentb94bde008b0d49ec4bfe933e110d0952d032ac28 (diff)
downloadSLOF-2e2e4cae3728d7c4565cae90e687555a7df1af12.zip
SLOF-2e2e4cae3728d7c4565cae90e687555a7df1af12.tar.gz
SLOF-2e2e4cae3728d7c4565cae90e687555a7df1af12.tar.bz2
Move functions for byte-swapping into common header file.
The byte-swapping functions were scattered all over the source tree, now they are merged into a new common header file called byteswap.h. Signed-off-by: <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'lib/libnvram')
-rw-r--r--lib/libnvram/nvram.c7
-rw-r--r--lib/libnvram/nvram.h20
2 files changed, 2 insertions, 25 deletions
diff --git a/lib/libnvram/nvram.c b/lib/libnvram/nvram.c
index 7ec12d2..45b13b8 100644
--- a/lib/libnvram/nvram.c
+++ b/lib/libnvram/nvram.c
@@ -11,17 +11,14 @@
*****************************************************************************/
#include "cache.h"
-
-#include "../libc/include/stdio.h"
-#include "../libc/include/string.h"
-#include "../libc/include/stdlib.h"
-
#include "nvram.h"
+#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <southbridge.h>
#include <nvramlog.h>
+#include <byteorder.h>
#ifndef NVRAM_LENGTH
#define NVRAM_LENGTH 0x10000
diff --git a/lib/libnvram/nvram.h b/lib/libnvram/nvram.h
index d15b85e..1324809 100644
--- a/lib/libnvram/nvram.h
+++ b/lib/libnvram/nvram.h
@@ -33,26 +33,6 @@ typedef struct {
#define PARTITION_HEADER_SIZE 16
-/* FIXME this should be done complete and in a more prominent place */
-#define __LITTLE_ENDIAN 1234
-#define __BIG_ENDIAN 4321
-#ifdef __i386__
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#else
-#define __BYTE_ORDER __BIG_ENDIAN
-#endif
-#if __BYTE_ORDER == __BIG_ENDIAN
-#define cpu_to_be64(x) (x)
-#define be64_to_cpu(x) (x)
-#define cpu_to_be32(x) (x)
-#define be32_to_cpu(x) (x)
-#else
-#include <byteswap.h>
-#define cpu_to_be64(x) bswap_64(x)
-#define be64_to_cpu(x) bswap_64(x)
-#define cpu_to_be32(x) bswap_32(x)
-#define be32_to_cpu(x) bswap_32(x)
-#endif
/* exported functions */