Skip to content

Commit db55947

Browse files
heicarstMartin Schwidefsky
authored andcommitted
s390/uprobes: fix compile for !KPROBES
Fix the following compile error(s) if CONFIG_KPROBES is disabled: arch/s390/kernel/uprobes.c:79:14: error: implicit declaration of function 'probe_get_fixup_type' arch/s390/kernel/uprobes.c:87:14: error: 'FIXUP_PSW_NORMAL' undeclared (first use in this function) Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 085b6ba commit db55947

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

‎arch/s390/include/asm/dis.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ static inline int insn_length(unsigned char code)
4040
return ((((int) code + 64) >> 7) + 1) << 1;
4141
}
4242

43+
struct pt_regs;
44+
4345
void show_code(struct pt_regs *regs);
4446
void print_fn_code(unsigned char *code, unsigned long len);
4547
int insn_to_mnemonic(unsigned char *instruction, char *buf, unsigned int len);

‎arch/s390/include/asm/kprobes.h‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,21 @@
2727
* 2005-Dec Used as a template for s390 by Mike Grundy
2828
* <grundym@us.ibm.com>
2929
*/
30+
#include <linux/types.h>
3031
#include <asm-generic/kprobes.h>
3132

3233
#define BREAKPOINT_INSTRUCTION 0x0002
3334

35+
#define FIXUP_PSW_NORMAL 0x08
36+
#define FIXUP_BRANCH_NOT_TAKEN 0x04
37+
#define FIXUP_RETURN_REGISTER 0x02
38+
#define FIXUP_NOT_REQUIRED 0x01
39+
40+
int probe_is_prohibited_opcode(u16 *insn);
41+
int probe_get_fixup_type(u16 *insn);
42+
int probe_is_insn_relative_long(u16 *insn);
43+
3444
#ifdef CONFIG_KPROBES
35-
#include <linux/types.h>
3645
#include <linux/ptrace.h>
3746
#include <linux/percpu.h>
3847
#include <linux/sched/task_stack.h>
@@ -56,11 +65,6 @@ typedef u16 kprobe_opcode_t;
5665

5766
#define KPROBE_SWAP_INST 0x10
5867

59-
#define FIXUP_PSW_NORMAL 0x08
60-
#define FIXUP_BRANCH_NOT_TAKEN 0x04
61-
#define FIXUP_RETURN_REGISTER 0x02
62-
#define FIXUP_NOT_REQUIRED 0x01
63-
6468
/* Architecture specific copy of original instruction */
6569
struct arch_specific_insn {
6670
/* copy of original instruction */
@@ -90,10 +94,6 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
9094
int kprobe_exceptions_notify(struct notifier_block *self,
9195
unsigned long val, void *data);
9296

93-
int probe_is_prohibited_opcode(u16 *insn);
94-
int probe_get_fixup_type(u16 *insn);
95-
int probe_is_insn_relative_long(u16 *insn);
96-
9797
#define flush_insn_slot(p) do { } while (0)
9898

9999
#endif /* CONFIG_KPROBES */

‎arch/s390/lib/probes.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Copyright IBM Corp. 2014
55
*/
66

7+
#include <linux/errno.h>
78
#include <asm/kprobes.h>
89
#include <asm/dis.h>
910

0 commit comments

Comments
 (0)