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