Skip to content

Commit 8c7b810

Browse files
AaronDotopsiff
authored andcommitted
LoongArch: Make some signal and ptrace functions non-static
So that they can be probed in the kernel modules to do something. Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
1 parent 2edb194 commit 8c7b810

2 files changed

Lines changed: 31 additions & 13 deletions

File tree

arch/loongarch/kernel/ptrace.c

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,13 @@ void ptrace_disable(struct task_struct *child)
7272

7373
/* regset get/set implementations */
7474

75-
static int gpr_get(struct task_struct *target,
76-
const struct user_regset *regset,
77-
struct membuf to)
75+
int gpr_get(struct task_struct *target,
76+
const struct user_regset *regset,
77+
struct membuf to);
78+
79+
int gpr_get(struct task_struct *target,
80+
const struct user_regset *regset,
81+
struct membuf to)
7882
{
7983
int r;
8084
struct pt_regs *regs = task_pt_regs(target);
@@ -87,10 +91,15 @@ static int gpr_get(struct task_struct *target,
8791
return r;
8892
}
8993

90-
static int gpr_set(struct task_struct *target,
91-
const struct user_regset *regset,
92-
unsigned int pos, unsigned int count,
93-
const void *kbuf, const void __user *ubuf)
94+
int gpr_set(struct task_struct *target,
95+
const struct user_regset *regset,
96+
unsigned int pos, unsigned int count,
97+
const void *kbuf, const void __user *ubuf);
98+
99+
int gpr_set(struct task_struct *target,
100+
const struct user_regset *regset,
101+
unsigned int pos, unsigned int count,
102+
const void *kbuf, const void __user *ubuf)
94103
{
95104
int err;
96105
int a0_start = sizeof(u64) * GPR_NUM;
@@ -950,8 +959,11 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task)
950959
return &user_loongarch64_view;
951960
}
952961

953-
static inline int read_user(struct task_struct *target, unsigned long addr,
954-
unsigned long __user *data)
962+
int read_user(struct task_struct *target, unsigned long addr,
963+
unsigned long __user *data);
964+
965+
int read_user(struct task_struct *target, unsigned long addr,
966+
unsigned long __user *data)
955967
{
956968
unsigned long tmp = 0;
957969

@@ -975,8 +987,11 @@ static inline int read_user(struct task_struct *target, unsigned long addr,
975987
return put_user(tmp, data);
976988
}
977989

978-
static inline int write_user(struct task_struct *target, unsigned long addr,
979-
unsigned long data)
990+
int write_user(struct task_struct *target, unsigned long addr,
991+
unsigned long data);
992+
993+
int write_user(struct task_struct *target, unsigned long addr,
994+
unsigned long data)
980995
{
981996
switch (addr) {
982997
case 0 ... 31:

arch/loongarch/kernel/signal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,11 @@ SYSCALL_DEFINE0(rt_sigreturn)
935935
return 0;
936936
}
937937

938-
static int setup_rt_frame(void *sig_return, struct ksignal *ksig,
939-
struct pt_regs *regs, sigset_t *set)
938+
int setup_rt_frame(void *sig_return, struct ksignal *ksig,
939+
struct pt_regs *regs, sigset_t *set);
940+
941+
int setup_rt_frame(void *sig_return, struct ksignal *ksig,
942+
struct pt_regs *regs, sigset_t *set)
940943
{
941944
int err = 0;
942945
struct extctx_layout extctx;

0 commit comments

Comments
 (0)