]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/common/gentmap.c
1 /* Generate targ-vals.h and targ-map.c. */
12 static struct tdefs sys_tdefs
[] = {
14 #include "nltvals.def"
20 gen_targ_vals_h (void)
24 printf ("/* Target header values needed by the simulator and gdb. */\n");
25 printf ("/* This file is machine generated by gentmap.c. */\n\n");
27 printf ("#ifndef TARG_VALS_H\n");
28 printf ("#define TARG_VALS_H\n\n");
30 printf ("/* syscall values */\n");
31 for (t
= &sys_tdefs
[0]; t
->symbol
; ++t
)
32 printf ("#define TARGET_%s %d\n", t
->symbol
, t
->value
);
35 printf ("#endif /* TARG_VALS_H */\n");
43 printf ("/* Target value mapping utilities needed by the simulator and gdb. */\n");
44 printf ("/* This file is machine generated by gentmap.c. */\n\n");
46 printf ("#include \"defs.h\"\n");
47 printf ("#include \"ansidecl.h\"\n");
48 printf ("#include \"sim/callback.h\"\n");
49 printf ("#include \"targ-vals.h\"\n");
52 printf ("/* syscall mapping table */\n");
53 printf ("CB_TARGET_DEFS_MAP cb_init_syscall_map[] = {\n");
54 for (t
= &sys_tdefs
[0]; t
->symbol
; ++t
)
56 printf ("#ifdef CB_%s\n", t
->symbol
);
57 /* Skip the "SYS_" prefix for the name. */
58 printf (" { \"%s\", CB_%s, TARGET_%s },\n", t
->symbol
+ 4, t
->symbol
, t
->symbol
);
61 printf (" { 0, -1, -1 }\n");
66 main (int argc
, char *argv
[])
71 if (strcmp (argv
[1], "-h") == 0)
73 else if (strcmp (argv
[1], "-c") == 0)