summaryrefslogtreecommitdiff
path: root/util/mkelfImage/util
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2008-02-15 18:16:06 +0000
committerStefan Reinauer <stepan@openbios.org>2008-02-15 18:16:06 +0000
commitb34eea348cb7d6d9c93d17d51a1f322114b8f15d (patch)
tree38dd85932dacaa7c7a174d87307baff6210d70c4 /util/mkelfImage/util
parent46fc14dcc8cdba1d66ae6fa9fdcbbf33265d676e (diff)
Importing mkelfimage from
ftp://ftp.lnxi.com/pub/mkelfImage/mkelfImage-2.7.tar.gz Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3103 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/mkelfImage/util')
-rw-r--r--util/mkelfImage/util/Makefile3
-rw-r--r--util/mkelfImage/util/bin-to-hex.c20
2 files changed, 23 insertions, 0 deletions
diff --git a/util/mkelfImage/util/Makefile b/util/mkelfImage/util/Makefile
new file mode 100644
index 0000000000..67ec05be49
--- /dev/null
+++ b/util/mkelfImage/util/Makefile
@@ -0,0 +1,3 @@
+$(OBJDIR)/bin/bin-to-hex: util/bin-to-hex.c
+ $(MKDIR) -p $(@D)
+ $(HOST_CC) $(HOST_CFLAGS) $< -o $@
diff --git a/util/mkelfImage/util/bin-to-hex.c b/util/mkelfImage/util/bin-to-hex.c
new file mode 100644
index 0000000000..af87e3ac0c
--- /dev/null
+++ b/util/mkelfImage/util/bin-to-hex.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ int c;
+ int i;
+ i = 0;
+ while((c = getchar()) != EOF) {
+ if ((i % 16) != 0) {
+ putchar(' ');
+ }
+ printf("0x%02x,", c);
+ i++;
+ if ((i %16) == 0) {
+ putchar('\n');
+ }
+ }
+ putchar('\n');
+ return 0;
+}