1 /* Generate targ-vals.h and targ-map.c. */
10 static struct tdefs errno_tdefs
[] = {
12 #include "targ-vals.def"
17 static struct tdefs open_tdefs
[] = {
19 #include "targ-vals.def"
29 printf ("/* Target header values needed by the simulator and gdb. */\n");
30 printf ("/* This file is machine generated by gentmap.c. */\n\n");
32 printf ("#ifndef TARG_VALS_H\n");
33 printf ("#define TARG_VALS_H\n\n");
35 printf ("/* errno values */\n");
36 for (t
= &errno_tdefs
[0]; t
->symbol
; ++t
)
37 printf ("#define TARGET_%s %d\n", t
->symbol
, t
->value
);
40 printf ("/* open flag values */\n");
41 for (t
= &open_tdefs
[0]; t
->symbol
; ++t
)
42 printf ("#define TARGET_%s 0x%x\n", t
->symbol
, t
->value
);
45 printf ("#endif /* TARG_VALS_H */\n");
53 printf ("/* Target value mapping utilities needed by the simulator and gdb. */\n");
54 printf ("/* This file is machine generated by gentmap.c. */\n\n");
56 printf ("#include <errno.h>\n");
57 printf ("#include <fcntl.h>\n");
58 printf ("#include \"ansidecl.h\"\n");
59 printf ("#include \"callback.h\"\n");
60 printf ("#include \"targ-vals.h\"\n");
63 printf ("/* errno mapping table */\n");
64 printf ("target_defs_map errno_map[] = {\n");
65 for (t
= &errno_tdefs
[0]; t
->symbol
; ++t
)
67 printf ("#ifdef %s\n", t
->symbol
);
68 printf (" { %s, TARGET_%s },\n", t
->symbol
, t
->symbol
);
71 printf (" { 0, 0 }\n");
74 printf ("/* open flags mapping table */\n");
75 printf ("target_defs_map open_map[] = {\n");
76 for (t
= &open_tdefs
[0]; t
->symbol
; ++t
)
78 printf ("#ifdef %s\n", t
->symbol
);
79 printf (" { %s, TARGET_%s },\n", t
->symbol
, t
->symbol
);
82 printf (" { -1, -1 }\n");
94 if (strcmp (argv
[1], "-h") == 0)
96 else if (strcmp (argv
[1], "-c") == 0)