summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/libpayload.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 5595ff6978..2cdb0d00f6 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -41,6 +41,10 @@
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#define BIN2HEX(b) ("0123456789abcdef"[b & 15])
+#define HEX2BIN(h) (('0' <= h && h <= '9') ? (h - '0') : \
+ ('a' <= h && h <= 'f') ? (h - 'a' + 10) : 0)
+
#define LITTLE_ENDIAN 1234
#define BIG_ENDIAN 4321
#ifdef CONFIG_TARGET_I386