.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
---|
1 | 2 | /* |
---|
2 | 3 | * arch/arm/probes/decode.h |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Some contents moved here from arch/arm/include/asm/kprobes.h which is |
---|
7 | 8 | * Copyright (C) 2006, 2007 Motorola Inc. |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or modify |
---|
10 | | - * it under the terms of the GNU General Public License version 2 as |
---|
11 | | - * published by the Free Software Foundation. |
---|
12 | | - * |
---|
13 | | - * This program is distributed in the hope that it will be useful, |
---|
14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | | - * General Public License for more details. |
---|
17 | 9 | */ |
---|
18 | 10 | |
---|
19 | 11 | #ifndef _ARM_KERNEL_PROBES_H |
---|
.. | .. |
---|
22 | 14 | #include <linux/types.h> |
---|
23 | 15 | #include <linux/stddef.h> |
---|
24 | 16 | #include <asm/probes.h> |
---|
| 17 | +#include <asm/ptrace.h> |
---|
25 | 18 | #include <asm/kprobes.h> |
---|
26 | 19 | |
---|
27 | 20 | void __init arm_probes_decode_init(void); |
---|
.. | .. |
---|
42 | 35 | |
---|
43 | 36 | #endif |
---|
44 | 37 | |
---|
45 | | - |
---|
46 | | -/* |
---|
47 | | - * Update ITSTATE after normal execution of an IT block instruction. |
---|
48 | | - * |
---|
49 | | - * The 8 IT state bits are split into two parts in CPSR: |
---|
50 | | - * ITSTATE<1:0> are in CPSR<26:25> |
---|
51 | | - * ITSTATE<7:2> are in CPSR<15:10> |
---|
52 | | - */ |
---|
53 | | -static inline unsigned long it_advance(unsigned long cpsr) |
---|
54 | | - { |
---|
55 | | - if ((cpsr & 0x06000400) == 0) { |
---|
56 | | - /* ITSTATE<2:0> == 0 means end of IT block, so clear IT state */ |
---|
57 | | - cpsr &= ~PSR_IT_MASK; |
---|
58 | | - } else { |
---|
59 | | - /* We need to shift left ITSTATE<4:0> */ |
---|
60 | | - const unsigned long mask = 0x06001c00; /* Mask ITSTATE<4:0> */ |
---|
61 | | - unsigned long it = cpsr & mask; |
---|
62 | | - it <<= 1; |
---|
63 | | - it |= it >> (27 - 10); /* Carry ITSTATE<2> to correct place */ |
---|
64 | | - it &= mask; |
---|
65 | | - cpsr &= ~mask; |
---|
66 | | - cpsr |= it; |
---|
67 | | - } |
---|
68 | | - return cpsr; |
---|
69 | | -} |
---|
70 | 38 | |
---|
71 | 39 | static inline void __kprobes bx_write_pc(long pcv, struct pt_regs *regs) |
---|
72 | 40 | { |
---|