
There's no need for extra cpuid_parse arch callback, it can be handled directly in init callback. Adding the init function to x86 to cover the cpuid initialization. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20171011150158.11895-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
33 lines
738 B
C
33 lines
738 B
C
#include <linux/compiler.h>
|
|
|
|
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, char *cpuid __maybe_unused)
|
|
{
|
|
if (!arch->initialized) {
|
|
arch->initialized = true;
|
|
arch->associate_instruction_ops = s390__associate_ins_ops;
|
|
}
|
|
|
|
return 0;
|
|
}
|