0001
0002
0003 #ifndef __ASM_CSKY_PROCESSOR_H
0004 #define __ASM_CSKY_PROCESSOR_H
0005
0006 #include <linux/bitops.h>
0007 #include <linux/cache.h>
0008 #include <asm/ptrace.h>
0009 #include <asm/current.h>
0010 #include <abi/reg_ops.h>
0011 #include <abi/regdef.h>
0012 #include <abi/switch_context.h>
0013 #ifdef CONFIG_CPU_HAS_FPU
0014 #include <abi/fpu.h>
0015 #endif
0016
0017 struct cpuinfo_csky {
0018 unsigned long asid_cache;
0019 } __aligned(SMP_CACHE_BYTES);
0020
0021 extern struct cpuinfo_csky cpu_data[];
0022
0023
0024
0025
0026
0027
0028
0029 #define TASK_SIZE (PAGE_OFFSET - (PAGE_SIZE * 8))
0030
0031 #ifdef __KERNEL__
0032 #define STACK_TOP TASK_SIZE
0033 #define STACK_TOP_MAX STACK_TOP
0034 #endif
0035
0036
0037
0038
0039 #define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
0040
0041 struct thread_struct {
0042 unsigned long sp;
0043 unsigned long trap_no;
0044
0045
0046 struct user_fp __aligned(16) user_fp;
0047 };
0048
0049 #define INIT_THREAD { \
0050 .sp = sizeof(init_stack) + (unsigned long) &init_stack, \
0051 }
0052
0053
0054
0055
0056
0057
0058
0059 #define start_thread(_regs, _pc, _usp) \
0060 do { \
0061 (_regs)->pc = (_pc); \
0062 (_regs)->regs[1] = 0; \
0063 (_regs)->regs[2] = 0; \
0064 (_regs)->regs[3] = 0; \
0065 (_regs)->sr &= ~PS_S; \
0066 (_regs)->usp = (_usp); \
0067 } while (0)
0068
0069
0070 struct task_struct;
0071
0072
0073 static inline void release_thread(struct task_struct *dead_task)
0074 {
0075 }
0076
0077
0078 #define prepare_to_copy(tsk) do { } while (0)
0079
0080 extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
0081
0082 unsigned long __get_wchan(struct task_struct *p);
0083
0084 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
0085 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->usp)
0086
0087 #define task_pt_regs(p) \
0088 ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1)
0089
0090 #define cpu_relax() barrier()
0091
0092 #endif