aboutsummaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2008-04-11 18:38:04 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2008-04-11 18:38:04 +0000
commitb103345a14cf3fe28f32573833dd06af66dfadaf (patch)
tree627608743b7207b63db88167a40d1dc73e1b548b /payloads/libpayload/include
parentfad8c2bd7ca3605fdae3548b8a932aa309871931 (diff)
Convert BIN2HEX/HEX2BIN to functions and add the abs() family
of functions while we're at it. hex2bin() now also supports upper-case input characters. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Jordan Crouse <jordan.crouse@amd.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3235 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/libpayload.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index e197e430fd..4b868b447a 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -41,10 +41,6 @@
#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
@@ -119,6 +115,11 @@ void *realloc(void *ptr, size_t size);
/* libc/lib.c */
int bcd2dec(int b);
int dec2bcd(int d);
+int abs(int j);
+long int labs(long int j);
+long long int llabs(long long int j);
+u8 bin2hex(u8 b);
+u8 hex2bin(u8 h);
/* libc/memory.c */
void *memset(void *s, int c, size_t n);