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#define TASK_SIZE (0xB0000000UL)
27
28#define INIT_THREAD { }
29
30#define KSTK_EIP(tsk) \
31({ \
32 unsigned long eip = 0; \
33 unsigned long regs = (unsigned long)task_pt_regs(tsk); \
34 if (regs > PAGE_SIZE && virt_addr_valid(regs)) \
35 eip = ((struct pt_regs *)regs)->erp; \
36 eip; \
37})
38
39
40
41
42
43#define start_thread(regs, ip, usp) \
44do { \
45 regs->erp = ip; \
46 regs->ccs |= 1 << (U_CCS_BITNR + CCS_SHIFT); \
47 wrusp(usp); \
48} while(0)
49
50
51#define arch_fixup(regs) {};
52
53#endif
54