#include <stdio.h>
|
#include <stdio.h>
|
|
|
extern long ce_exec_config[];
|
extern long ce_exec_config[];
|
|
|
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
{
|
{
|
int i, cnt, pos, len;
|
int i, cnt, pos, len;
|
unsigned char *lp;
|
unsigned char *lp;
|
unsigned char buf[8192];
|
unsigned char buf[8192];
|
if (argc != 1)
|
if (argc != 1)
|
{
|
{
|
fprintf(stderr, "usage: %s <in-file >out-file\n", argv[0]);
|
fprintf(stderr, "usage: %s <in-file >out-file\n", argv[0]);
|
exit(1);
|
exit(1);
|
}
|
}
|
fprintf(stdout, "#\n");
|
fprintf(stdout, "#\n");
|
fprintf(stdout, "# Miscellaneous data structures:\n");
|
fprintf(stdout, "# Miscellaneous data structures:\n");
|
fprintf(stdout, "# WARNING - this file is automatically generated!\n");
|
fprintf(stdout, "# WARNING - this file is automatically generated!\n");
|
fprintf(stdout, "#\n");
|
fprintf(stdout, "#\n");
|
fprintf(stdout, "\n");
|
fprintf(stdout, "\n");
|
fprintf(stdout, "\t.section .linux, \"a\"\n");
|
fprintf(stdout, "\t.section .linux, \"a\"\n");
|
pos = 0;
|
pos = 0;
|
while ((len = read(0, buf, sizeof(buf))) > 0)
|
while ((len = read(0, buf, sizeof(buf))) > 0)
|
{
|
{
|
cnt = 0;
|
cnt = 0;
|
lp = (unsigned char *)buf;
|
lp = (unsigned char *)buf;
|
len = (len + 3) & ~3; /* Round up to longwords */
|
len = (len + 3) & ~3; /* Round up to longwords */
|
for (i = 0; i < len; i += 4)
|
for (i = 0; i < len; i += 4)
|
{
|
{
|
if (cnt == 0)
|
if (cnt == 0)
|
{
|
{
|
fprintf(stdout, "\t.long\t");
|
fprintf(stdout, "\t.long\t");
|
}
|
}
|
fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);
|
fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);
|
lp += 4;
|
lp += 4;
|
if (++cnt == 4)
|
if (++cnt == 4)
|
{
|
{
|
cnt = 0;
|
cnt = 0;
|
fprintf(stdout, "/* %x */\n", pos+i-12);
|
fprintf(stdout, "/* %x */\n", pos+i-12);
|
fflush(stdout);
|
fflush(stdout);
|
} else
|
} else
|
{
|
{
|
fprintf(stdout, ",");
|
fprintf(stdout, ",");
|
}
|
}
|
}
|
}
|
if (cnt)
|
if (cnt)
|
{
|
{
|
fprintf(stdout, "0\n");
|
fprintf(stdout, "0\n");
|
}
|
}
|
pos += len;
|
pos += len;
|
}
|
}
|
fflush(stdout);
|
fflush(stdout);
|
fclose(stdout);
|
fclose(stdout);
|
exit(0);
|
exit(0);
|
}
|
}
|
|
|
|
|