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