int ret;
unsigned long flags = 0;
+ if ((unsigned long)addr & 3)
+ return -EINVAL;
+
raw_spin_lock_irqsave(&patch_lock, flags);
ret = copy_to_kernel_nofault(addr, &insn, LOONGARCH_INSN_SIZE);
raw_spin_unlock_irqrestore(&patch_lock, flags);
int ret;
u32 *tp = addr;
- if ((unsigned long)tp & 3)
- return -EINVAL;
-
ret = larch_insn_write(tp, insn);
if (!ret)
flush_icache_range((unsigned long)tp,
*/
#include <linux/kernel.h>
#include <linux/jump_label.h>
+#include <asm/cacheflush.h>
#include <asm/inst.h>
-void arch_jump_label_transform(struct jump_entry *entry, enum jump_label_type type)
+bool arch_jump_label_transform_queue(struct jump_entry *entry, enum jump_label_type type)
{
u32 insn;
void *addr = (void *)jump_entry_code(entry);
else
insn = larch_insn_gen_nop();
- larch_insn_patch_text(addr, insn);
+ larch_insn_write(addr, insn);
+
+ return true;
+}
+
+void arch_jump_label_transform_apply(void)
+{
+ flush_icache_all();
}