Skip to content

Commit 6700281

Browse files
committed
csky: Fixup gdbmacros.txt with name sp in thread_struct
The gdbmacros.txt use sp in thread_struct, but csky use ksp. This cause bttnobp fail to excute. TODO: - Still couldn't display the contents of stack. Signed-off-by: Guo Ren <[email protected]>
1 parent 9e2ca15 commit 6700281

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

arch/csky/include/asm/processor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ extern struct cpuinfo_csky cpu_data[];
4141
#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
4242

4343
struct thread_struct {
44-
unsigned long ksp; /* kernel stack pointer */
44+
unsigned long sp; /* kernel stack pointer */
4545
unsigned long trap_no; /* saved status register */
4646

4747
/* FPU regs */
4848
struct user_fp __aligned(16) user_fp;
4949
};
5050

5151
#define INIT_THREAD { \
52-
.ksp = sizeof(init_stack) + (unsigned long) &init_stack, \
52+
.sp = sizeof(init_stack) + (unsigned long) &init_stack, \
5353
}
5454

5555
/*

arch/csky/include/asm/thread_info.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ struct thread_info {
3838
#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
3939

4040
#define thread_saved_fp(tsk) \
41-
((unsigned long)(((struct switch_stack *)(tsk->thread.ksp))->r8))
41+
((unsigned long)(((struct switch_stack *)(tsk->thread.sp))->r8))
4242

4343
#define thread_saved_sp(tsk) \
44-
((unsigned long)(tsk->thread.ksp))
44+
((unsigned long)(tsk->thread.sp))
4545

4646
#define thread_saved_lr(tsk) \
47-
((unsigned long)(((struct switch_stack *)(tsk->thread.ksp))->r15))
47+
((unsigned long)(((struct switch_stack *)(tsk->thread.sp))->r15))
4848

4949
static inline struct thread_info *current_thread_info(void)
5050
{

arch/csky/kernel/asm-offsets.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ int main(void)
1818
DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm));
1919

2020
/* offsets into the thread struct */
21-
DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
21+
DEFINE(THREAD_KSP, offsetof(struct thread_struct, sp));
2222
DEFINE(THREAD_FESR, offsetof(struct thread_struct, user_fp.fesr));
2323
DEFINE(THREAD_FCR, offsetof(struct thread_struct, user_fp.fcr));
2424
DEFINE(THREAD_FPREG, offsetof(struct thread_struct, user_fp.vr));

arch/csky/kernel/process.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void flush_thread(void){}
3535
*/
3636
unsigned long thread_saved_pc(struct task_struct *tsk)
3737
{
38-
struct switch_stack *sw = (struct switch_stack *)tsk->thread.ksp;
38+
struct switch_stack *sw = (struct switch_stack *)tsk->thread.sp;
3939

4040
return sw->r15;
4141
}
@@ -56,8 +56,8 @@ int copy_thread_tls(unsigned long clone_flags,
5656
childstack = ((struct switch_stack *) childregs) - 1;
5757
memset(childstack, 0, sizeof(struct switch_stack));
5858

59-
/* setup ksp for switch_to !!! */
60-
p->thread.ksp = (unsigned long)childstack;
59+
/* setup thread.sp for switch_to !!! */
60+
p->thread.sp = (unsigned long)childstack;
6161

6262
if (unlikely(p->flags & PF_KTHREAD)) {
6363
memset(childregs, 0, sizeof(struct pt_regs));

0 commit comments

Comments
 (0)