This source file includes following definitions.
- sys_sethae
- sys_idle
- hard_reset_now
- show_regs
- exit_thread
- flush_thread
- release_thread
- alpha_clone
- copy_thread
- dump_thread
- sys_execve
1
2
3
4
5
6
7
8
9
10
11 #include <linux/errno.h>
12 #include <linux/sched.h>
13 #include <linux/kernel.h>
14 #include <linux/mm.h>
15 #include <linux/stddef.h>
16 #include <linux/unistd.h>
17 #include <linux/ptrace.h>
18 #include <linux/malloc.h>
19 #include <linux/ldt.h>
20 #include <linux/user.h>
21 #include <linux/a.out.h>
22 #include <linux/utsname.h>
23 #include <linux/time.h>
24 #include <linux/major.h>
25 #include <linux/stat.h>
26 #include <linux/mman.h>
27
28 #include <asm/segment.h>
29 #include <asm/system.h>
30 #include <asm/io.h>
31
32 asmlinkage int sys_sethae(unsigned long hae, unsigned long a1, unsigned long a2,
33 unsigned long a3, unsigned long a4, unsigned long a5,
34 struct pt_regs regs)
35 {
36 (®s)->hae = hae;
37 return 0;
38 }
39
40 asmlinkage int sys_idle(void)
41 {
42 if (current->pid != 0)
43 return -EPERM;
44
45
46 current->counter = -100;
47 for (;;) {
48 schedule();
49 }
50 }
51
52 void hard_reset_now(void)
53 {
54 halt();
55 }
56
57 void show_regs(struct pt_regs * regs)
58 {
59 printk("\nps: %04lx pc: %016lx\n", regs->ps, regs->pc);
60 printk("rp: %016lx sp: %p\n", regs->r26, regs+1);
61 printk(" r0: %016lx r1: %016lx r2: %016lx r3: %016lx\n",
62 regs->r0, regs->r1, regs->r2, regs->r3);
63 printk(" r4: %016lx r5: %016lx r6: %016lx r7: %016lx\n",
64 regs->r4, regs->r5, regs->r6, regs->r7);
65 printk(" r8: %016lx r16: %016lx r17: %016lx r18: %016lx\n",
66 regs->r8, regs->r16, regs->r17, regs->r18);
67 printk("r19: %016lx r20: %016lx r21: %016lx r22: %016lx\n",
68 regs->r19, regs->r20, regs->r21, regs->r22);
69 printk("r23: %016lx r24: %016lx r25: %016lx r26: %016lx\n",
70 regs->r23, regs->r24, regs->r25, regs->r26);
71 printk("r27: %016lx r28: %016lx r29: %016lx hae: %016lx\n",
72 regs->r27, regs->r28, regs->gp, regs->hae);
73 }
74
75
76
77
78 void exit_thread(void)
79 {
80 }
81
82 void flush_thread(void)
83 {
84 }
85
86 void release_thread(struct task_struct *dead_task)
87 {
88 }
89
90
91
92
93
94
95
96
97
98
99 int alpha_clone(unsigned long clone_flags, unsigned long usp,
100 struct switch_stack * swstack)
101 {
102 if (!usp)
103 usp = rdusp();
104 return do_fork(clone_flags, usp, (struct pt_regs *) (swstack+1));
105 }
106
107 extern void ret_from_sys_call(void);
108
109
110
111
112
113
114
115
116
117
118 void copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
119 struct task_struct * p, struct pt_regs * regs)
120 {
121 struct pt_regs * childregs;
122 struct switch_stack * childstack, *stack;
123 unsigned long stack_offset;
124
125 stack_offset = PAGE_SIZE - sizeof(struct pt_regs);
126 if (!(regs->ps & 8))
127 stack_offset = (PAGE_SIZE-1) & (unsigned long) regs;
128 childregs = (struct pt_regs *) (p->kernel_stack_page + stack_offset);
129
130 *childregs = *regs;
131 childregs->r0 = 0;
132 childregs->r19 = 0;
133 childregs->r20 = 1;
134 regs->r20 = 0;
135 stack = ((struct switch_stack *) regs) - 1;
136 childstack = ((struct switch_stack *) childregs) - 1;
137 *childstack = *stack;
138 childstack->r26 = (unsigned long) ret_from_sys_call;
139 p->tss.usp = usp;
140 p->tss.ksp = (unsigned long) childstack;
141 p->tss.flags = 1;
142 }
143
144
145
146
147 void dump_thread(struct pt_regs * regs, struct user * dump)
148 {
149 }
150
151
152
153
154
155
156
157
158
159
160
161 asmlinkage int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
162 unsigned long a3, unsigned long a4, unsigned long a5,
163 struct pt_regs regs)
164 {
165 int error;
166 char * filename;
167
168 error = getname((char *) a0, &filename);
169 if (error)
170 return error;
171 error = do_execve(filename, (char **) a1, (char **) a2, ®s);
172 putname(filename);
173 return error;
174 }