1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef _ASM_C6X_PROCESSOR_H
14#define _ASM_C6X_PROCESSOR_H
15
16#include <asm/ptrace.h>
17#include <asm/page.h>
18#include <asm/current.h>
19
20
21
22
23
24#define current_text_addr() \
25({ \
26 void *__pc; \
27 asm("mvc .S2 pce1,%0\n" : "=b"(__pc)); \
28 __pc; \
29})
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46#define TASK_SIZE 0xFFFFF000
47
48
49
50
51
52#define TASK_UNMAPPED_BASE 0
53
54struct thread_struct {
55 unsigned long long b15_14;
56 unsigned long long a15_14;
57 unsigned long long b13_12;
58 unsigned long long a13_12;
59 unsigned long long b11_10;
60 unsigned long long a11_10;
61 unsigned long long ricl_icl;
62 unsigned long usp;
63 unsigned long pc;
64 unsigned long wchan;
65};
66
67#define INIT_THREAD \
68{ \
69 .usp = 0, \
70 .wchan = 0, \
71}
72
73#define INIT_MMAP { \
74 &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, \
75 NULL, NULL }
76
77#define task_pt_regs(task) \
78 ((struct pt_regs *)(THREAD_START_SP + task_stack_page(task)) - 1)
79
80#define alloc_kernel_stack() __get_free_page(GFP_KERNEL)
81#define free_kernel_stack(page) free_page((page))
82
83
84
85struct task_struct;
86
87extern void start_thread(struct pt_regs *regs, unsigned int pc,
88 unsigned long usp);
89
90
91static inline void release_thread(struct task_struct *dead_task)
92{
93}
94
95#define copy_segments(tsk, mm) do { } while (0)
96#define release_segments(mm) do { } while (0)
97
98
99
100
101#define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc)
102
103
104
105
106#ifdef _BIG_ENDIAN
107#define thread_saved_ksp(tsk) \
108 (*(unsigned long *)&(tsk)->thread.b15_14)
109#define thread_saved_dp(tsk) \
110 (*(((unsigned long *)&(tsk)->thread.b15_14) + 1))
111#else
112#define thread_saved_ksp(tsk) \
113 (*(((unsigned long *)&(tsk)->thread.b15_14) + 1))
114#define thread_saved_dp(tsk) \
115 (*(unsigned long *)&(tsk)->thread.b15_14)
116#endif
117
118extern unsigned long get_wchan(struct task_struct *p);
119
120#define KSTK_EIP(task) (task_pt_regs(task)->pc)
121#define KSTK_ESP(task) (task_pt_regs(task)->sp)
122
123#define cpu_relax() do { } while (0)
124
125extern const struct seq_operations cpuinfo_op;
126
127
128#define HARD_RESET_NOW()
129
130extern unsigned int c6x_core_freq;
131
132
133extern void (*c6x_restart)(void);
134extern void (*c6x_halt)(void);
135
136#endif
137