1 // SPDX-License-Identifier: GPL-2.0-only
3 * IOP Coprocessor-6 access handler
4 * Copyright (c) 2006, Intel Corporation.
6 #include <linux/init.h>
8 #include <asm/ptrace.h>
12 void iop_enable_cp6(void)
16 /* enable cp6 access */
18 "mrc p15, 0, %0, c15, c1, 0\n\t"
19 "orr %0, %0, #(1 << 6)\n\t"
20 "mcr p15, 0, %0, c15, c1, 0\n\t"
21 "mrc p15, 0, %0, c15, c1, 0\n\t"
23 "sub pc, pc, #4 @ cp_wait\n\t"
27 static int cp6_trap(struct pt_regs *regs, unsigned int instr)
34 /* permit kernel space cp6 access
35 * deny user space cp6 access
37 static struct undef_hook cp6_hook = {
38 .instr_mask = 0x0f000ff0,
39 .instr_val = 0x0e000610,
40 .cpsr_mask = MODE_MASK,
45 void __init iop_init_cp6_handler(void)
47 register_undef_hook(&cp6_hook);