This source file includes following definitions.
- sys_idle
- hard_reset_now
- show_regs
- exit_thread
- flush_thread
- copy_thread
- dump_thread
- sys_execve
- sys_fork
- sys_clone
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
23 #include <asm/segment.h>
24 #include <asm/system.h>
25 #include <asm/io.h>
26
27 asmlinkage int sys_idle(void)
28 {
29 if (current->pid != 0)
30 return -EPERM;
31
32
33 current->counter = -100;
34 for (;;) {
35 schedule();
36 }
37 }
38
39 void hard_reset_now(void)
40 {
41 halt();
42 }
43
44 void show_regs(struct pt_regs * regs)
45 {
46 printk("\nPS: %04lx PC: %016lx\n", regs->ps, regs->pc);
47 }
48
49
50
51
52 void exit_thread(void)
53 {
54 halt();
55 }
56
57 void flush_thread(void)
58 {
59 halt();
60 }
61
62
63
64
65 void copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
66 struct task_struct * p, struct pt_regs * regs)
67 {
68 struct pt_regs * childregs;
69
70 p->tss.usp = usp;
71 childregs = ((struct pt_regs *) (p->kernel_stack_page + PAGE_SIZE)) - 1;
72 *childregs = *regs;
73 p->tss.ksp = (unsigned long) childregs;
74
75 panic("copy_thread not implemented");
76 }
77
78
79
80
81 void dump_thread(struct pt_regs * regs, struct user * dump)
82 {
83 }
84
85
86
87
88
89
90
91
92
93
94
95 asmlinkage int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
96 unsigned long a3, unsigned long a4, unsigned long a5,
97 struct pt_regs regs)
98 {
99 int error;
100 char * filename;
101
102 error = getname((char *) a0, &filename);
103 if (error)
104 return error;
105 error = do_execve(filename, (char **) a1, (char **) a2, ®s);
106 putname(filename);
107 return error;
108 }
109
110
111
112
113
114 asmlinkage int sys_fork(unsigned long a0, unsigned long a1, unsigned long a2,
115 unsigned long a3, unsigned long a4, unsigned long a5,
116 struct pt_regs regs)
117 {
118 return do_fork(COPYVM | SIGCHLD, rdusp(), ®s);
119 }
120
121 asmlinkage int sys_clone(unsigned long a0, unsigned long a1, unsigned long a2,
122 unsigned long a3, unsigned long a4, unsigned long a5,
123 struct pt_regs regs)
124 {
125 unsigned long clone_flags = a0;
126 unsigned long newsp;
127
128 newsp = rdusp();
129 if (newsp == a1 || !a1)
130 clone_flags |= COPYVM;
131 else
132 newsp = a1;
133 return do_fork(clone_flags, newsp, ®s);
134 }