lkdtm/heap: Hide allocation size from -Warray-bounds
[linux-2.6-microblaze.git] / arch / arm / mach-iop32x / cp6.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * IOP Coprocessor-6 access handler
4  * Copyright (c) 2006, Intel Corporation.
5  */
6 #include <linux/init.h>
7 #include <asm/traps.h>
8 #include <asm/ptrace.h>
9
10 void iop_enable_cp6(void)
11 {
12         u32 temp;
13
14         /* enable cp6 access */
15         asm volatile (
16                 "mrc    p15, 0, %0, c15, c1, 0\n\t"
17                 "orr    %0, %0, #(1 << 6)\n\t"
18                 "mcr    p15, 0, %0, c15, c1, 0\n\t"
19                 "mrc    p15, 0, %0, c15, c1, 0\n\t"
20                 "mov    %0, %0\n\t"
21                 "sub    pc, pc, #4  @ cp_wait\n\t"
22                 : "=r"(temp));
23 }
24
25 static int cp6_trap(struct pt_regs *regs, unsigned int instr)
26 {
27         iop_enable_cp6();
28
29         return 0;
30 }
31
32 /* permit kernel space cp6 access
33  * deny user space cp6 access
34  */
35 static struct undef_hook cp6_hook = {
36         .instr_mask     = 0x0f000ff0,
37         .instr_val      = 0x0e000610,
38         .cpsr_mask      = MODE_MASK,
39         .cpsr_val       = SVC_MODE,
40         .fn             = cp6_trap,
41 };
42
43 void __init iop_init_cp6_handler(void)
44 {
45         register_undef_hook(&cp6_hook);
46 }