1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef __ASM_AVR32_PROCESSOR_H
23#define __ASM_AVR32_PROCESSOR_H
24
25#ifndef __ASSEMBLY__
26
27#define current_text_addr() ({ void *pc; __asm__("mov %0,pc" : "=r"(pc)); pc; })
28
29struct avr32_cpuinfo {
30 unsigned long loops_per_jiffy;
31};
32
33extern struct avr32_cpuinfo boot_cpu_data;
34
35#ifdef CONFIG_SMP
36extern struct avr32_cpuinfo cpu_data[];
37#define current_cpu_data cpu_data[smp_processor_id()]
38#else
39#define cpu_data (&boot_cpu_data)
40#define current_cpu_data boot_cpu_data
41#endif
42
43
44#define TASK_SIZE 0x80000000
45
46
47
48
49#define TASK_UNMAPPED_BASE (TASK_SIZE / 3)
50
51#define cpu_relax() barrier()
52#define cpu_sync_pipeline() asm volatile("sub pc, -2" : : : "memory")
53
54
55struct thread_struct {
56 unsigned long pc;
57 unsigned long ksp;
58 unsigned long r7;
59 unsigned long r6;
60 unsigned long r5;
61 unsigned long r4;
62 unsigned long r3;
63 unsigned long r2;
64 unsigned long r1;
65 unsigned long r0;
66};
67
68#define INIT_THREAD { \
69 .ksp = sizeof(init_stack) + (long)&init_stack, \
70}
71
72
73
74
75#define start_thread(regs, new_pc, new_sp) \
76 set_fs(USER_DS); \
77 regs->sr = 0; \
78 regs->gr[REG_PC] = new_pc; \
79 regs->gr[REG_SP] = new_sp
80
81struct task_struct;
82
83
84extern void release_thread(struct task_struct *);
85
86
87extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
88
89
90#define prepare_to_copy(tsk) do { } while(0)
91
92
93#define thread_saved_pc(tsk) (tsk->thread.pc)
94
95#endif
96
97#endif
98