This source file includes following definitions.
- thread_saved_pc
- start_thread
1
2
3
4
5
6
7 #ifndef __ASM_SPARC_PROCESSOR_H
8 #define __ASM_SPARC_PROCESSOR_H
9
10 #include <linux/a.out.h>
11
12 #include <asm/psr.h>
13 #include <asm/ptrace.h>
14 #include <asm/head.h>
15 #include <asm/signal.h>
16 #include <asm/segment.h>
17
18
19
20
21 #define EISA_bus 0
22 #define EISA_bus__is_a_macro
23 #define MCA_bus 0
24 #define MCA_bus__is_a_macro
25
26
27
28
29
30 extern char wp_works_ok;
31
32
33 #define TASK_SIZE (KERNBASE)
34
35
36 struct thread_struct {
37 unsigned long uwinmask __attribute__ ((aligned (8)));
38 struct pt_regs *kregs;
39
40
41 unsigned long sig_address __attribute__ ((aligned (8)));
42 unsigned long sig_desc;
43
44
45 unsigned long ksp __attribute__ ((aligned (8)));
46 unsigned long kpc;
47 unsigned long kpsr;
48 unsigned long kwim;
49
50
51 unsigned long fork_kpsr __attribute__ ((aligned (8)));
52 unsigned long fork_kwim;
53
54
55
56
57 #define NSWINS 8
58 struct reg_window reg_window[NSWINS] __attribute__ ((aligned (8)));
59 unsigned long rwbuf_stkptrs[NSWINS] __attribute__ ((aligned (8)));
60 unsigned long w_saved;
61
62
63 unsigned long float_regs[64] __attribute__ ((aligned (8)));
64 unsigned long fsr;
65 unsigned long fpqdepth;
66 struct fpq {
67 unsigned long *insn_addr;
68 unsigned long insn;
69 } fpqueue[16];
70 struct sigstack sstk_info;
71 unsigned long flags;
72 int current_ds;
73 struct exec core_exec;
74 };
75
76 #define SPARC_FLAG_KTHREAD 0x1
77
78 #define INIT_MMAP { &init_mm, (0), (0), \
79 __pgprot(0x0) , VM_READ | VM_WRITE | VM_EXEC }
80
81 #define INIT_TSS { \
82 \
83 0, 0, 0, 0, 0, 0, 0, 0, \
84 \
85 0, 0, \
86 \
87 { { { 0, }, { 0, } }, }, \
88 \
89 { 0, 0, 0, 0, 0, 0, 0, 0, }, \
90 \
91 0, \
92 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
93 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
94 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
95 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
96 \
97 0, 0, { { 0, 0, }, }, \
98 \
99 { 0, 0, }, \
100 \
101 SPARC_FLAG_KTHREAD, USER_DS, \
102 \
103 { 0, }, \
104 }
105
106
107 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
108 {
109 return t->kregs->pc;
110 }
111
112
113
114
115 extern inline void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
116 {
117 unsigned long saved_psr = (regs->psr & (PSR_CWP)) | PSR_S;
118 int i;
119
120 for(i = 0; i < 16; i++) regs->u_regs[i] = 0;
121 regs->y = 0;
122 regs->pc = ((pc & (~3)) - 4);
123 regs->npc = regs->pc + 4;
124 regs->psr = saved_psr;
125 regs->u_regs[UREG_G1] = sp;
126 regs->u_regs[UREG_G2] = regs->u_regs[UREG_G7] = regs->npc;
127 regs->u_regs[UREG_FP] = (sp - REGWIN_SZ);
128 }
129
130 extern unsigned long (*alloc_kernel_stack)(struct task_struct *tsk);
131 extern void (*free_kernel_stack)(unsigned long stack);
132 extern struct task_struct *(*alloc_task_struct)(void);
133 extern void (*free_task_struct)(struct task_struct *tsk);
134
135 #endif