1 /* Generate targ-vals.h and targ-map.c. */
11 static struct tdefs sys_tdefs
[] = {
13 #include "targ-vals.def"
18 static struct tdefs errno_tdefs
[] = {
20 #include "targ-vals.def"
25 static struct tdefs open_tdefs
[] = {
27 #include "targ-vals.def"
37 printf ("/* Target header values needed by the simulator and gdb. */\n");
38 printf ("/* This file is machine generated by gentmap.c. */\n\n");
40 printf ("#ifndef TARG_VALS_H\n");
41 printf ("#define TARG_VALS_H\n\n");
43 printf ("/* syscall values */\n");
44 for (t
= &sys_tdefs
[0]; t
->symbol
; ++t
)
45 printf ("#define TARGET_%s %d\n", t
->symbol
, t
->value
);
48 printf ("/* errno values */\n");
49 for (t
= &errno_tdefs
[0]; t
->symbol
; ++t
)
50 printf ("#define TARGET_%s %d\n", t
->symbol
, t
->value
);
53 printf ("/* open flag values */\n");
54 for (t
= &open_tdefs
[0]; t
->symbol
; ++t
)
55 printf ("#define TARGET_%s 0x%x\n", t
->symbol
, t
->value
);
58 printf ("#endif /* TARG_VALS_H */\n");
66 printf ("/* Target value mapping utilities needed by the simulator and gdb. */\n");
67 printf ("/* This file is machine generated by gentmap.c. */\n\n");
69 printf ("#include <errno.h>\n");
70 printf ("#include <fcntl.h>\n");
71 printf ("#include \"ansidecl.h\"\n");
72 printf ("#include \"gdb/callback.h\"\n");
73 printf ("#include \"targ-vals.h\"\n");
76 printf ("/* syscall mapping table */\n");
77 printf ("CB_TARGET_DEFS_MAP cb_init_syscall_map[] = {\n");
78 for (t
= &sys_tdefs
[0]; t
->symbol
; ++t
)
80 printf ("#ifdef CB_%s\n", t
->symbol
);
81 printf (" { CB_%s, TARGET_%s },\n", t
->symbol
, t
->symbol
);
84 printf (" { -1, -1 }\n");
87 printf ("/* errno mapping table */\n");
88 printf ("CB_TARGET_DEFS_MAP cb_init_errno_map[] = {\n");
89 for (t
= &errno_tdefs
[0]; t
->symbol
; ++t
)
91 printf ("#ifdef %s\n", t
->symbol
);
92 printf (" { %s, TARGET_%s },\n", t
->symbol
, t
->symbol
);
95 printf (" { 0, 0 }\n");
98 printf ("/* open flags mapping table */\n");
99 printf ("CB_TARGET_DEFS_MAP cb_init_open_map[] = {\n");
100 for (t
= &open_tdefs
[0]; t
->symbol
; ++t
)
102 printf ("#ifdef %s\n", t
->symbol
);
103 printf (" { %s, TARGET_%s },\n", t
->symbol
, t
->symbol
);
106 printf (" { -1, -1 }\n");
118 if (strcmp (argv
[1], "-h") == 0)
120 else if (strcmp (argv
[1], "-c") == 0)
This page took 0.032876 seconds and 4 git commands to generate.