mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 00:43:12 +00:00
Implement simple detection for all kind of jumps and branches. Signed-off-by: Christian Borntraeger <[email protected]> Cc: Andreas Krebbel <[email protected]> Cc: Hendrik Brueckner <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: linux-s390 <[email protected]> Cc: [email protected] # v4.10+ Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
31 lines
681 B
C
31 lines
681 B
C
static struct ins_ops *s390__associate_ins_ops(struct arch *arch, const char *name)
|
|
{
|
|
struct ins_ops *ops = NULL;
|
|
|
|
/* catch all kind of jumps */
|
|
if (strchr(name, 'j') ||
|
|
!strncmp(name, "bct", 3) ||
|
|
!strncmp(name, "br", 2))
|
|
ops = &jump_ops;
|
|
/* override call/returns */
|
|
if (!strcmp(name, "bras") ||
|
|
!strcmp(name, "brasl") ||
|
|
!strcmp(name, "basr"))
|
|
ops = &call_ops;
|
|
if (!strcmp(name, "br"))
|
|
ops = &ret_ops;
|
|
|
|
arch__associate_ins_ops(arch, name, ops);
|
|
return ops;
|
|
}
|
|
|
|
static int s390__annotate_init(struct arch *arch)
|
|
{
|
|
if (!arch->initialized) {
|
|
arch->initialized = true;
|
|
arch->associate_instruction_ops = s390__associate_ins_ops;
|
|
}
|
|
|
|
return 0;
|
|
}
|