1
2
3
4
5
6
7
8
9
10 #ifndef __UNICORE_PROCESSOR_H__
11 #define __UNICORE_PROCESSOR_H__
12
13 #ifdef __KERNEL__
14
15 #include <asm/ptrace.h>
16 #include <asm/types.h>
17
18 #ifdef __KERNEL__
19 #define STACK_TOP TASK_SIZE
20 #define STACK_TOP_MAX TASK_SIZE
21 #endif
22
23 struct debug_entry {
24 u32 address;
25 u32 insn;
26 };
27
28 struct debug_info {
29 int nsaved;
30 struct debug_entry bp[2];
31 };
32
33 struct thread_struct {
34
35 unsigned long address;
36 unsigned long trap_no;
37 unsigned long error_code;
38
39 struct debug_info debug;
40 };
41
42 #define INIT_THREAD { }
43
44 #define start_thread(regs, pc, sp) \
45 ({ \
46 unsigned long *stack = (unsigned long *)sp; \
47 memset(regs->uregs, 0, sizeof(regs->uregs)); \
48 regs->UCreg_asr = USER_MODE; \
49 regs->UCreg_pc = pc & ~1; \
50 regs->UCreg_sp = sp; \
51 regs->UCreg_02 = stack[2]; \
52 regs->UCreg_01 = stack[1]; \
53 regs->UCreg_00 = stack[0]; \
54 })
55
56
57 struct task_struct;
58
59
60 extern void release_thread(struct task_struct *);
61
62 unsigned long get_wchan(struct task_struct *p);
63
64 #define cpu_relax() barrier()
65
66 #define task_pt_regs(p) \
67 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(p)) - 1)
68
69 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->UCreg_pc)
70 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->UCreg_sp)
71
72 #endif
73
74 #endif