Skip to content

Commit 17a6877

Browse files
committed
csky: remove unused members in processor.h
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>
1 parent 8f4f163 commit 17a6877

7 files changed

Lines changed: 0 additions & 40 deletions

File tree

‎arch/csky/include/asm/processor.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,7 @@
1717
#endif
1818

1919
struct cpuinfo_csky {
20-
unsigned long udelay_val;
2120
unsigned long asid_cache;
22-
/*
23-
* Capability and feature descriptor structure for CSKY CPU
24-
*/
25-
unsigned long options;
26-
unsigned int processor_id[4];
27-
unsigned int fpu_id;
2821
} __aligned(SMP_CACHE_BYTES);
2922

3023
extern struct cpuinfo_csky cpu_data[];
@@ -50,11 +43,6 @@ extern struct cpuinfo_csky cpu_data[];
5043
struct thread_struct {
5144
unsigned long ksp; /* kernel stack pointer */
5245
unsigned long sr; /* saved status register */
53-
unsigned long esp0; /* points to SR of stack frame */
54-
55-
/* Other stuff associated with the thread. */
56-
unsigned long address; /* Last user fault */
57-
unsigned long error_code;
5846

5947
/* FPU regs */
6048
struct user_fp __aligned(16) user_fp;

‎arch/csky/kernel/asm-offsets.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ int main(void)
2020
/* offsets into the thread struct */
2121
DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
2222
DEFINE(THREAD_SR, offsetof(struct thread_struct, sr));
23-
DEFINE(THREAD_ESP0, offsetof(struct thread_struct, esp0));
2423
DEFINE(THREAD_FESR, offsetof(struct thread_struct, user_fp.fesr));
2524
DEFINE(THREAD_FCR, offsetof(struct thread_struct, user_fp.fcr));
2625
DEFINE(THREAD_FPREG, offsetof(struct thread_struct, user_fp.vr));

‎arch/csky/kernel/entry.S‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,6 @@ ENTRY(csky_systemcall)
122122

123123
psrset ee, ie
124124

125-
/* Stack frame for syscall, origin call set_esp0 */
126-
mov r12, sp
127-
128-
bmaski r11, 13
129-
andn r12, r11
130-
bgeni r11, 9
131-
addi r11, 32
132-
addu r12, r11
133-
st sp, (r12, 0)
134-
135125
lrw r11, __NR_syscalls
136126
cmphs syscallid, r11 /* Check nr of syscall */
137127
bt ret_from_exception
@@ -230,8 +220,6 @@ resume_userspace:
230220
1: RESTORE_ALL
231221

232222
exit_work:
233-
mov a0, sp /* Stack address is arg[0] */
234-
jbsr set_esp0 /* Call C level */
235223
btsti r8, TIF_NEED_RESCHED
236224
bt work_resched
237225
/* If thread_info->flag is empty, RESTORE_ALL */

‎arch/csky/kernel/ptrace.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,11 @@ static void singlestep_enable(struct task_struct *tsk)
5050
*/
5151
void user_enable_single_step(struct task_struct *child)
5252
{
53-
if (child->thread.esp0 == 0)
54-
return;
5553
singlestep_enable(child);
5654
}
5755

5856
void user_disable_single_step(struct task_struct *child)
5957
{
60-
if (child->thread.esp0 == 0)
61-
return;
6258
singlestep_disable(child);
6359
}
6460

‎arch/csky/kernel/signal.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
238238
if (!user_mode(regs))
239239
return;
240240

241-
current->thread.esp0 = (unsigned long)regs;
242-
243241
/*
244242
* If we were from a system call, check for system call restarting...
245243
*/

‎arch/csky/kernel/traps.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ void buserr(struct pt_regs *regs)
106106
pr_err("User mode Bus Error\n");
107107
show_regs(regs);
108108

109-
current->thread.esp0 = (unsigned long) regs;
110109
force_sig_fault(SIGSEGV, 0, (void __user *)regs->pc, current);
111110
}
112111

@@ -162,8 +161,3 @@ asmlinkage void trap_c(struct pt_regs *regs)
162161
}
163162
send_sig(sig, current, 0);
164163
}
165-
166-
asmlinkage void set_esp0(unsigned long ssp)
167-
{
168-
current->thread.esp0 = ssp;
169-
}

‎arch/csky/mm/fault.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
172172
bad_area_nosemaphore:
173173
/* User mode accesses just cause a SIGSEGV */
174174
if (user_mode(regs)) {
175-
tsk->thread.address = address;
176-
tsk->thread.error_code = write;
177175
force_sig_fault(SIGSEGV, si_code, (void __user *)address, current);
178176
return;
179177
}
@@ -207,6 +205,5 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
207205
if (!user_mode(regs))
208206
goto no_context;
209207

210-
tsk->thread.address = address;
211208
force_sig_fault(SIGBUS, BUS_ADRERR, (void __user *)address, current);
212209
}

0 commit comments

Comments
 (0)