1
2
3
4
5
6
7
8
9
10
11
12#ifndef _ASM_PROCESSOR_H
13#define _ASM_PROCESSOR_H
14
15#include <asm/mem-layout.h>
16
17#ifndef __ASSEMBLY__
18
19
20
21
22#define current_text_addr() ({ __label__ _l; _l: &&_l;})
23
24#include <linux/compiler.h>
25#include <linux/linkage.h>
26#include <asm/sections.h>
27#include <asm/segment.h>
28#include <asm/fpu.h>
29#include <asm/registers.h>
30#include <asm/ptrace.h>
31#include <asm/current.h>
32#include <asm/cache.h>
33
34
35struct task_struct;
36
37
38
39
40struct cpuinfo_frv {
41#ifdef CONFIG_MMU
42 unsigned long *pgd_quick;
43 unsigned long *pte_quick;
44 unsigned long pgtable_cache_sz;
45#endif
46} __cacheline_aligned;
47
48extern struct cpuinfo_frv __nongprelbss boot_cpu_data;
49
50#define cpu_data (&boot_cpu_data)
51#define current_cpu_data boot_cpu_data
52
53
54
55
56#define EISA_bus 0
57
58struct thread_struct {
59 struct pt_regs *frame;
60 struct task_struct *curr;
61 unsigned long sp;
62 unsigned long fp;
63 unsigned long lr;
64 unsigned long pc;
65 unsigned long gr[12];
66 unsigned long sched_lr;
67
68 union {
69 struct pt_regs *frame0;
70 struct user_context *user;
71 };
72} __attribute__((aligned(8)));
73
74extern struct pt_regs *__kernel_frame0_ptr;
75extern struct task_struct *__kernel_current_task;
76
77#endif
78
79#ifndef __ASSEMBLY__
80#define INIT_THREAD_FRAME0 \
81 ((struct pt_regs *) \
82 (sizeof(init_stack) + (unsigned long) init_stack - sizeof(struct user_context)))
83
84#define INIT_THREAD { \
85 NULL, \
86 (struct task_struct *) init_stack, \
87 0, 0, 0, 0, \
88 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, \
89 0, \
90 { INIT_THREAD_FRAME0 }, \
91}
92
93
94
95
96#define start_thread(_regs, _pc, _usp) \
97do { \
98 _regs->pc = (_pc); \
99 _regs->psr &= ~PSR_S; \
100 _regs->sp = (_usp); \
101} while(0)
102
103
104static inline void release_thread(struct task_struct *dead_task)
105{
106}
107
108extern asmlinkage void save_user_regs(struct user_context *target);
109extern asmlinkage void *restore_user_regs(const struct user_context *target, ...);
110
111#define copy_segments(tsk, mm) do { } while (0)
112#define release_segments(mm) do { } while (0)
113#define forget_segments() do { } while (0)
114
115
116
117
118static inline void exit_thread(void)
119{
120}
121
122
123
124
125extern unsigned long thread_saved_pc(struct task_struct *tsk);
126
127unsigned long get_wchan(struct task_struct *p);
128
129#define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc)
130#define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp)
131
132#define cpu_relax() barrier()
133
134
135#define ARCH_HAS_PREFETCH
136static inline void prefetch(const void *x)
137{
138 asm volatile("dcpl %0,gr0,#0" : : "r"(x));
139}
140
141#endif
142#endif
143