2 * Copyright 2001 IBM Corp
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
13 extern long ce_exec_config[];
15 int main(int argc, char *argv[])
18 unsigned int cksum, val;
20 unsigned char buf[8192];
24 fprintf(stderr, "usage: %s name <in-file >out-file\n",
29 varname = strrchr(argv[1], '/');
35 fprintf(stdout, "#\n");
36 fprintf(stdout, "# Miscellaneous data structures:\n");
37 fprintf(stdout, "# WARNING - this file is automatically generated!\n");
38 fprintf(stdout, "#\n");
39 fprintf(stdout, "\n");
40 fprintf(stdout, "\t.data\n");
41 fprintf(stdout, "\t.globl %s_data\n", varname);
42 fprintf(stdout, "%s_data:\n", varname);
45 while ((len = read(0, buf, sizeof(buf))) > 0)
48 lp = (unsigned char *)buf;
49 len = (len + 3) & ~3; /* Round up to longwords */
50 for (i = 0; i < len; i += 4)
54 fprintf(stdout, "\t.long\t");
56 fprintf(stdout, "0x%02X%02X%02X%02X", lp[0], lp[1], lp[2], lp[3]);
57 val = *(unsigned long *)lp;
63 fprintf(stdout, " # %x \n", pos+i-12);
72 fprintf(stdout, "0\n");
76 fprintf(stdout, "\t.globl %s_len\n", varname);
77 fprintf(stdout, "%s_len:\t.long\t0x%x\n", varname, pos);
80 fprintf(stderr, "cksum = %x\n", cksum);