1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __ASM_PROC_PROCESSOR_H
19#define __ASM_PROC_PROCESSOR_H
20
21#include <asm/proc/domain.h>
22
23#define KERNEL_STACK_SIZE PAGE_SIZE
24
25struct context_save_struct {
26 unsigned long cpsr;
27 unsigned long r4;
28 unsigned long r5;
29 unsigned long r6;
30 unsigned long r7;
31 unsigned long r8;
32 unsigned long r9;
33 unsigned long sl;
34 unsigned long fp;
35 unsigned long pc;
36};
37
38#define INIT_CSS (struct context_save_struct){ SVC_MODE, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
39
40#define EXTRA_THREAD_STRUCT \
41 unsigned int domain;
42
43#define EXTRA_THREAD_STRUCT_INIT \
44 domain: domain_val(DOMAIN_USER, DOMAIN_CLIENT) | \
45 domain_val(DOMAIN_KERNEL, DOMAIN_MANAGER) | \
46 domain_val(DOMAIN_IO, DOMAIN_CLIENT)
47
48#define start_thread(regs,pc,sp) \
49({ \
50 unsigned long *stack = (unsigned long *)sp; \
51 set_fs(USER_DS); \
52 memzero(regs->uregs, sizeof(regs->uregs)); \
53 if (current->personality & ADDR_LIMIT_32BIT) \
54 regs->ARM_cpsr = USR_MODE; \
55 else \
56 regs->ARM_cpsr = USR26_MODE; \
57 regs->ARM_pc = pc; \
58 regs->ARM_sp = sp; \
59 regs->ARM_r2 = stack[2]; \
60 regs->ARM_r1 = stack[1]; \
61 regs->ARM_r0 = stack[0]; \
62})
63
64#define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1019])
65#define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1017])
66
67
68
69
70
71#define ll_alloc_task_struct() ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
72#define ll_free_task_struct(p) free_pages((unsigned long)(p),1)
73
74#endif
75