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
This commit is contained in:
committed by
Stefan Reinauer
parent
46fc14dcc8
commit
b34eea348c
3
util/mkelfImage/util/Makefile
Normal file
3
util/mkelfImage/util/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
$(OBJDIR)/bin/bin-to-hex: util/bin-to-hex.c
|
||||
$(MKDIR) -p $(@D)
|
||||
$(HOST_CC) $(HOST_CFLAGS) $< -o $@
|
20
util/mkelfImage/util/bin-to-hex.c
Normal file
20
util/mkelfImage/util/bin-to-hex.c
Normal file
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user