csky: remove unused members in processor.h
authorGuo Ren <ren_guo@c-sky.com>
Sun, 9 Dec 2018 09:31:53 +0000 (17:31 +0800)
committerGuo Ren <ren_guo@c-sky.com>
Mon, 31 Dec 2018 15:16:00 +0000 (23:16 +0800)
Cleanup struct cpuinfo_csky and struct thread_struct, remove all esp0
related code. We could get pt_regs from sp and backtrace could use fp
in switch_stack.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
arch/csky/include/asm/processor.h
arch/csky/kernel/asm-offsets.c
arch/csky/kernel/entry.S
arch/csky/kernel/ptrace.c
arch/csky/kernel/signal.c
arch/csky/kernel/traps.c
arch/csky/mm/fault.c

index 5ac3f3227294c7a5fe8b90641e384c6cbe517802..8f454810514f21be1356bd9d763f28e68f8d70b5 100644 (file)
 #endif
 
 struct cpuinfo_csky {
-       unsigned long udelay_val;
        unsigned long asid_cache;
-       /*
-        * Capability and feature descriptor structure for CSKY CPU
-        */
-       unsigned long options;
-       unsigned int processor_id[4];
-       unsigned int fpu_id;
 } __aligned(SMP_CACHE_BYTES);
 
 extern struct cpuinfo_csky cpu_data[];
@@ -50,11 +43,6 @@ extern struct cpuinfo_csky cpu_data[];
 struct thread_struct {
        unsigned long  ksp;       /* kernel stack pointer */
        unsigned long  sr;        /* saved status register */
-       unsigned long  esp0;      /* points to SR of stack frame */
-
-       /* Other stuff associated with the thread. */
-       unsigned long address;      /* Last user fault */
-       unsigned long error_code;
 
        /* FPU regs */
        struct user_fp __aligned(16) user_fp;
index 2f07670ac65fd644cd18184ee3253a65e40b7798..9b48b1b1a61b57cee9f37de3336cfb6f2deffb3d 100644 (file)
@@ -20,7 +20,6 @@ int main(void)
        /* offsets into the thread struct */
        DEFINE(THREAD_KSP,        offsetof(struct thread_struct, ksp));
        DEFINE(THREAD_SR,         offsetof(struct thread_struct, sr));
-       DEFINE(THREAD_ESP0,       offsetof(struct thread_struct, esp0));
        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 de378e479dee686e91bc30f6150cfa6627afdd6d..5137ed9062bdc1448e0ccb491ef67f3abc2d734d 100644 (file)
@@ -122,16 +122,6 @@ ENTRY(csky_systemcall)
 
        psrset  ee, ie
 
-       /* Stack frame for syscall, origin call set_esp0 */
-       mov     r12, sp
-
-       bmaski  r11, 13
-       andn    r12, r11
-       bgeni   r11, 9
-       addi    r11, 32
-       addu    r12, r11
-       st      sp, (r12, 0)
-
        lrw     r11, __NR_syscalls
        cmphs   syscallid, r11          /* Check nr of syscall */
        bt      ret_from_exception
@@ -230,8 +220,6 @@ resume_userspace:
 1:  RESTORE_ALL
 
 exit_work:
-       mov     a0, sp                  /* Stack address is arg[0] */
-       jbsr    set_esp0                /* Call C level */
        btsti   r8, TIF_NEED_RESCHED
        bt      work_resched
        /* If thread_info->flag is empty, RESTORE_ALL */
index eb62e0764b422e2f4f4aeb8c2013edecbb32efa8..57f1afe19a52cb7896021a47691fc17c37d0b4bb 100644 (file)
@@ -50,15 +50,11 @@ static void singlestep_enable(struct task_struct *tsk)
  */
 void user_enable_single_step(struct task_struct *child)
 {
-       if (child->thread.esp0 == 0)
-               return;
        singlestep_enable(child);
 }
 
 void user_disable_single_step(struct task_struct *child)
 {
-       if (child->thread.esp0 == 0)
-               return;
        singlestep_disable(child);
 }
 
index 66e1b729b10b741d63cf841c0fa0bd733a3e4f3f..e680dc127f40615c6ef4a4800f6e7f2e233eb81f 100644 (file)
@@ -238,8 +238,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
        if (!user_mode(regs))
                return;
 
-       current->thread.esp0 = (unsigned long)regs;
-
        /*
         * If we were from a system call, check for system call restarting...
         */
index a8368ed43517c3d403bcad793bb426fd59b9ac90..f487a9b996ae1e4e23b33d34db193dcbf2205279 100644 (file)
@@ -106,7 +106,6 @@ void buserr(struct pt_regs *regs)
        pr_err("User mode Bus Error\n");
        show_regs(regs);
 
-       current->thread.esp0 = (unsigned long) regs;
        force_sig_fault(SIGSEGV, 0, (void __user *)regs->pc, current);
 }
 
@@ -162,8 +161,3 @@ asmlinkage void trap_c(struct pt_regs *regs)
        }
        send_sig(sig, current, 0);
 }
-
-asmlinkage void set_esp0(unsigned long ssp)
-{
-       current->thread.esp0 = ssp;
-}
index 6a946614cc47a9ee69e09c85182db8a641d88832..d6f4b66b93e21c8ede70e2cc4070861d6df7730d 100644 (file)
@@ -172,8 +172,6 @@ bad_area:
 bad_area_nosemaphore:
        /* User mode accesses just cause a SIGSEGV */
        if (user_mode(regs)) {
-               tsk->thread.address = address;
-               tsk->thread.error_code = write;
                force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
                return;
        }
@@ -207,6 +205,5 @@ do_sigbus:
        if (!user_mode(regs))
                goto no_context;
 
-       tsk->thread.address = address;
        force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
 }