Christian Borntraeger | d9f8dfa | 2017-04-06 09:51:52 +0200 | [diff] [blame^] | 1 | static struct ins_ops *s390__associate_ins_ops(struct arch *arch, const char *name) |
| 2 | { |
| 3 | struct ins_ops *ops = NULL; |
| 4 | |
| 5 | /* catch all kind of jumps */ |
| 6 | if (strchr(name, 'j') || |
| 7 | !strncmp(name, "bct", 3) || |
| 8 | !strncmp(name, "br", 2)) |
| 9 | ops = &jump_ops; |
| 10 | /* override call/returns */ |
| 11 | if (!strcmp(name, "bras") || |
| 12 | !strcmp(name, "brasl") || |
| 13 | !strcmp(name, "basr")) |
| 14 | ops = &call_ops; |
| 15 | if (!strcmp(name, "br")) |
| 16 | ops = &ret_ops; |
| 17 | |
| 18 | arch__associate_ins_ops(arch, name, ops); |
| 19 | return ops; |
| 20 | } |
| 21 | |
| 22 | static int s390__annotate_init(struct arch *arch) |
| 23 | { |
| 24 | if (!arch->initialized) { |
| 25 | arch->initialized = true; |
| 26 | arch->associate_instruction_ops = s390__associate_ins_ops; |
| 27 | } |
| 28 | |
| 29 | return 0; |
| 30 | } |