2 * Jump label s390 support
4 * Copyright IBM Corp. 2011
5 * Author(s): Jan Glauber <jang@linux.vnet.ibm.com>
7 #include <linux/module.h>
8 #include <linux/uaccess.h>
9 #include <linux/stop_machine.h>
10 #include <linux/jump_label.h>
13 #ifdef HAVE_JUMP_LABEL
21 struct jump_entry
*entry
;
22 enum jump_label_type type
;
25 static void __jump_label_transform(struct jump_entry
*entry
,
26 enum jump_label_type type
)
31 if (type
== JUMP_LABEL_ENABLE
) {
34 insn
.offset
= (entry
->target
- entry
->code
) >> 1;
41 rc
= probe_kernel_write((void *)entry
->code
, &insn
, JUMP_LABEL_NOP_SIZE
);
45 static int __sm_arch_jump_label_transform(void *data
)
47 struct insn_args
*args
= data
;
49 __jump_label_transform(args
->entry
, args
->type
);
53 void arch_jump_label_transform(struct jump_entry
*entry
,
54 enum jump_label_type type
)
56 struct insn_args args
;
61 stop_machine(__sm_arch_jump_label_transform
, &args
, NULL
);
64 void arch_jump_label_transform_static(struct jump_entry
*entry
,
65 enum jump_label_type type
)
67 __jump_label_transform(entry
, type
);