1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #ifndef __ASM_OPENRISC_PROCESSOR_H
16 #define __ASM_OPENRISC_PROCESSOR_H
17
18 #include <asm/spr_defs.h>
19 #include <asm/page.h>
20 #include <asm/ptrace.h>
21
22 #define STACK_TOP TASK_SIZE
23 #define STACK_TOP_MAX STACK_TOP
24
25 #define KERNEL_SR (SPR_SR_DME | SPR_SR_IME | SPR_SR_ICE \
26 | SPR_SR_DCE | SPR_SR_SM)
27 #define USER_SR (SPR_SR_DME | SPR_SR_IME | SPR_SR_ICE \
28 | SPR_SR_DCE | SPR_SR_IEE | SPR_SR_TEE)
29
30
31
32
33
34
35 #define TASK_SIZE (0x80000000UL)
36
37
38
39
40 #define TASK_UNMAPPED_BASE (TASK_SIZE / 8 * 3)
41
42 #ifndef __ASSEMBLY__
43
44 struct task_struct;
45
46 struct thread_struct {
47 };
48
49
50
51
52
53
54
55
56
57 #define user_regs(thread_info) (((struct pt_regs *)((unsigned long)(thread_info) + THREAD_SIZE - STACK_FRAME_OVERHEAD)) - 1)
58
59
60
61
62
63 #define task_pt_regs(task) user_regs(task_thread_info(task))
64
65 #define INIT_SP (sizeof(init_stack) + (unsigned long) &init_stack)
66
67 #define INIT_THREAD { }
68
69
70 #define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
71 #define KSTK_ESP(tsk) (task_pt_regs(tsk)->sp)
72
73
74 void start_thread(struct pt_regs *regs, unsigned long nip, unsigned long sp);
75 void release_thread(struct task_struct *);
76 unsigned long get_wchan(struct task_struct *p);
77
78 #define cpu_relax() barrier()
79
80 #endif
81 #endif