1#ifndef _ASM_CRIS_ARCH_PROCESSOR_H
2#define _ASM_CRIS_ARCH_PROCESSOR_H
3
4
5
6#define current_text_addr() \
7 ({void *pc; __asm__ __volatile__ ("lapcq .,%0" : "=rm" (pc)); pc;})
8
9
10
11
12
13
14
15
16struct thread_struct {
17 unsigned long ksp;
18 unsigned long usp;
19 unsigned long ccs;
20};
21
22
23
24
25
26#ifndef CONFIG_ETRAX_VCS_SIM
27#define TASK_SIZE (0xB0000000UL)
28#else
29#define TASK_SIZE (0xA0000000UL)
30#endif
31
32
33#define INIT_THREAD { 0, 0, (1 << I_CCS_BITNR) }
34
35#define KSTK_EIP(tsk) \
36({ \
37 unsigned long eip = 0; \
38 unsigned long regs = (unsigned long)task_pt_regs(tsk); \
39 if (regs > PAGE_SIZE && virt_addr_valid(regs)) \
40 eip = ((struct pt_regs *)regs)->erp; \
41 eip; \
42})
43
44
45
46
47
48#define start_thread(regs, ip, usp) \
49do { \
50 set_fs(USER_DS); \
51 regs->erp = ip; \
52 regs->ccs |= 1 << (U_CCS_BITNR + CCS_SHIFT); \
53 wrusp(usp); \
54} while(0)
55
56
57#define arch_fixup(regs) {};
58
59#endif
60