csky: Fixup gdbmacros.txt with name sp in thread_struct
authorGuo Ren <guoren@linux.alibaba.com>
Thu, 14 May 2020 08:04:31 +0000 (16:04 +0800)
committerGuo Ren <guoren@linux.alibaba.com>
Thu, 14 May 2020 16:16:18 +0000 (00:16 +0800)
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 <guoren@linux.alibaba.com>
arch/csky/include/asm/processor.h
arch/csky/include/asm/thread_info.h
arch/csky/kernel/asm-offsets.c
arch/csky/kernel/process.c

index 79eaaae..24442d8 100644 (file)
@@ -41,7 +41,7 @@ extern struct cpuinfo_csky cpu_data[];
 #define TASK_UNMAPPED_BASE      (TASK_SIZE / 3)
 
 struct thread_struct {
-       unsigned long  ksp;       /* kernel stack pointer */
+       unsigned long  sp;        /* kernel stack pointer */
        unsigned long  trap_no;   /* saved status register */
 
        /* FPU regs */
@@ -49,7 +49,7 @@ struct thread_struct {
 };
 
 #define INIT_THREAD  { \
-       .ksp = sizeof(init_stack) + (unsigned long) &init_stack, \
+       .sp = sizeof(init_stack) + (unsigned long) &init_stack, \
 }
 
 /*
index d381a57..5c61e84 100644 (file)
@@ -38,13 +38,13 @@ struct thread_info {
 #define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
 
 #define thread_saved_fp(tsk) \
-       ((unsigned long)(((struct switch_stack *)(tsk->thread.ksp))->r8))
+       ((unsigned long)(((struct switch_stack *)(tsk->thread.sp))->r8))
 
 #define thread_saved_sp(tsk) \
-       ((unsigned long)(tsk->thread.ksp))
+       ((unsigned long)(tsk->thread.sp))
 
 #define thread_saved_lr(tsk) \
-       ((unsigned long)(((struct switch_stack *)(tsk->thread.ksp))->r15))
+       ((unsigned long)(((struct switch_stack *)(tsk->thread.sp))->r15))
 
 static inline struct thread_info *current_thread_info(void)
 {
index bbc259e..1747986 100644 (file)
@@ -18,7 +18,7 @@ int main(void)
        DEFINE(TASK_ACTIVE_MM,    offsetof(struct task_struct, active_mm));
 
        /* offsets into the thread struct */
-       DEFINE(THREAD_KSP,        offsetof(struct thread_struct, ksp));
+       DEFINE(THREAD_KSP,        offsetof(struct thread_struct, sp));
        DEFINE(THREAD_FESR,       offsetof(struct thread_struct, user_fp.fesr));
        DEFINE(THREAD_FCR,        offsetof(struct thread_struct, user_fp.fcr));
        DEFINE(THREAD_FPREG,      offsetof(struct thread_struct, user_fp.vr));
index 4ad6db5..8b3fad0 100644 (file)
@@ -35,7 +35,7 @@ void flush_thread(void){}
  */
 unsigned long thread_saved_pc(struct task_struct *tsk)
 {
-       struct switch_stack *sw = (struct switch_stack *)tsk->thread.ksp;
+       struct switch_stack *sw = (struct switch_stack *)tsk->thread.sp;
 
        return sw->r15;
 }
@@ -56,8 +56,8 @@ int copy_thread_tls(unsigned long clone_flags,
        childstack = ((struct switch_stack *) childregs) - 1;
        memset(childstack, 0, sizeof(struct switch_stack));
 
-       /* setup ksp for switch_to !!! */
-       p->thread.ksp = (unsigned long)childstack;
+       /* setup thread.sp for switch_to !!! */
+       p->thread.sp = (unsigned long)childstack;
 
        if (unlikely(p->flags & PF_KTHREAD)) {
                memset(childregs, 0, sizeof(struct pt_regs));