Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 7 commits
  • 17 files changed
  • 0 comments
  • 2 contributors
Feb 23, 2013
Lars-Peter Clausen lm32: Drop unused debugger_info field from thread_info struct
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
37807cf
Lars-Peter Clausen Drop __devinit/__devexit from milkymist drivers
These will be gone in upstream v3.8

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
b0017d7
Lars-Peter Clausen lm32: Implement user_stack_pointer()
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
a756401
Lars-Peter Clausen lm32: Switch to GENERIC_KERNEL_THREAD and GENERIC_KERNEL_EXECVE
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
50af5f9
Lars-Peter Clausen lm32: switch to generic sys_execve()
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
aab9d67
generic sys_fork / sys_vfork / sys_clone
... and get rid of idiotic struct pt_regs * in asm-generic/syscalls.h
prototypes of the same, while we are at it.  Eventually we want those
in linux/syscalls.h, of course, but that'll have to wait a bit.

Note that there are *three* variants of sys_clone() order of arguments.
Braindamage galore...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
e1bbf3a
Lars-Peter Clausen lm32: switch to generic clone(2)
Unfortunately lm32 has yet another crazy sys_clone parameter order. We need to
fix this at some point. This will break all existing userspace though.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
0ca475b
17  arch/Kconfig
@@ -341,4 +341,21 @@ config MODULES_USE_ELF_REL
341 341
 	  Modules only use ELF REL relocations.  Modules with ELF RELA
342 342
 	  relocations will give an error.
343 343
 
  344
+#
  345
+# ABI hall of shame
  346
+#
  347
+config CLONE_BACKWARDS
  348
+	bool
  349
+	help
  350
+	  Architecture has tls passed as the 4th argument of clone(2),
  351
+	  not the 5th one.
  352
+
  353
+config CLONE_BACKWARDS2
  354
+	bool
  355
+	help
  356
+	  Architecture has the first two arguments of clone(2) swapped.
  357
+
  358
+config CLONE_BACKWARDS3
  359
+	bool
  360
+
344 361
 source "kernel/gcov/Kconfig"
3  arch/lm32/Kconfig
@@ -13,6 +13,9 @@ config LM32
13 13
 	select HAVE_MEMBLOCK
14 14
 	select MODULES_USE_ELF_REL
15 15
 	select MODULES_USE_ELF_RELA
  16
+	select GENERIC_KERNEL_THREAD
  17
+	select GENERIC_KERNEL_EXECVE
  18
+	select CLONE_BACKWARDS3
16 19
 
17 20
 config GENERIC_GPIO
18 21
 	bool
1  arch/lm32/include/asm/processor.h
@@ -63,7 +63,6 @@ struct thread_struct {
63 63
 	unsigned long ksp;	/* kernel stack pointer */
64 64
 	unsigned long usp;	/* user stack pointer */
65 65
 	unsigned long which_stack; /* 0 if we are on kernel stack, 1 if we are on user stack */
66  
-	void *        debuggerinfo;
67 66
 };
68 67
 
69 68
 #define KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + THREAD_SIZE - 32)
1  arch/lm32/include/asm/ptrace.h
@@ -70,6 +70,7 @@ struct pt_regs {
70 70
 #ifdef __KERNEL__
71 71
 #define user_mode(regs) ((regs)->pt_mode == PT_MODE_USER)
72 72
 
  73
+#define user_stack_pointer(regs) ((regs)->sp)
73 74
 #define instruction_pointer(regs) ((regs)->ea)
74 75
 #define profile_pc(regs) instruction_pointer(regs)
75 76
 
2  arch/lm32/include/asm/unistd.h
@@ -5,6 +5,8 @@
5 5
 #define __ARCH_WANT_SYSCALL_NO_FLAGS
6 6
 #define __ARCH_WANT_SYSCALL_OFF_T
7 7
 #define __ARCH_WANT_SYSCALL_DEPRECATED
  8
+#define __ARCH_WANT_SYS_EXECVE
  9
+#define __ARCH_WANT_SYS_CLONE
8 10
 
9 11
 #include <asm-generic/unistd.h>
10 12
 
2  arch/lm32/kernel/Makefile
@@ -4,7 +4,7 @@
4 4
 
5 5
 extra-y := head.o vmlinux.lds
6 6
 obj-y := \
7  
-	sys_lm32.o setup.o traps.o signal.o time.o \
  7
+	setup.o traps.o signal.o time.o \
8 8
 	ptrace.o irq.o process.o entry.o \
9 9
 	flat.o cpuinfo.o prom.o platform.o
10 10
 
18  arch/lm32/kernel/entry.S
@@ -154,14 +154,18 @@ EXCEPTION_RETURN_PATH(_return_from_exception, _restore_and_return_exception)
154 154
 /* returns to continuation(arg1, arg2) */
155 155
 ENTRY(ret_from_fork)
156 156
 	calli	schedule_tail
157  
-	mv r1, r11
158  
-	mv r2, r12
159  
-	mv ra, r13
160  
-	ret
  157
+	mvi r1, 0
  158
+	bi syscall_tail
161 159
 
162  
-ENTRY(sys_execve)
163  
-	mv r4, r7
164  
-	bi lm32_execve
  160
+/* ret_from_fork(arg1, arg2, continuation) */
  161
+/* calls schedule_tail and then manage_signals */
  162
+/* returns to continuation(arg1, arg2) */
  163
+ENTRY(ret_from_kernel_thread)
  164
+	calli	schedule_tail
  165
+	mv r1, r12
  166
+	mvhi ra, hi(syscall_tail)
  167
+	ori ra, ra, lo(syscall_tail)
  168
+	b r11
165 169
 
166 170
 ENTRY(sys_rt_sigreturn)
167 171
 	mv r1, r7
50  arch/lm32/kernel/process.c
@@ -47,6 +47,7 @@
47 47
 #include <asm/pgtable.h>
48 48
 
49 49
 asmlinkage void ret_from_fork(void);
  50
+asmlinkage void ret_from_kernel_thread(void);
50 51
 asmlinkage void syscall_tail(void);
51 52
 
52 53
 struct thread_info* lm32_current_thread;
@@ -127,32 +128,6 @@ void show_regs(struct pt_regs *regs)
127 128
 		printk("%3s: 0x%lx\n", lm32_reg_names[i], reg[i]);
128 129
 }
129 130
 
130  
-static void kernel_thread_helper(int (*fn)(void*), void* arg)
131  
-{
132  
-	do_exit(fn(arg));
133  
-}
134  
-
135  
-/*
136  
- * Create a kernel thread
137  
- */
138  
-int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
139  
-{
140  
-	/* prepare registers from which a child task switch frame will be copied */
141  
-	struct pt_regs regs;
142  
-
143  
-	set_fs(KERNEL_DS);
144  
-
145  
-	memset(&regs, 0, sizeof(regs));
146  
-
147  
-	//printk("kernel_thread fn=%x arg=%x regs=%x\n", fn, arg, &regs);
148  
-
149  
-	regs.r11 = (unsigned long)fn;
150  
-	regs.r12 = (unsigned long)arg;
151  
-	regs.r13 = (unsigned long)kernel_thread_helper;
152  
-	regs.pt_mode = PT_MODE_KERNEL;
153  
-	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
154  
-}
155  
-
156 131
 void flush_thread(void)
157 132
 {
158 133
 }
@@ -169,24 +144,23 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
169 144
 }
170 145
 
171 146
 int copy_thread(unsigned long clone_flags,
172  
-		unsigned long usp, unsigned long stk_size,
173  
-		struct task_struct * p, struct pt_regs * regs)
  147
+		unsigned long usp_thread_fn, unsigned long thread_fn_arg,
  148
+		struct task_struct *p, struct pt_regs *unused)
174 149
 {
175 150
 	unsigned long child_tos = KSTK_TOS(p);
176  
-	struct pt_regs *childregs;
  151
+	struct pt_regs *childregs = task_pt_regs(p);
177 152
 
178  
-	if (!user_mode(regs)) {
  153
+	if (p->flags & PF_KTHREAD) {
179 154
 		/* kernel thread */
180 155
 
181  
-		if( usp != 0 )
182  
-			panic("trying to start kernel thread with usp != 0");
183  
-
184  
-		/* childregs = full task switch frame on kernel stack of child */
185 156
 		childregs = (struct pt_regs *)(child_tos) - 1;
186  
-		*childregs = *regs;
  157
+		memset(childregs, 0, sizeof(childregs));
  158
+		childregs->r11 = usp_thread_fn;
  159
+		childregs->r12 = thread_fn_arg;
  160
+		/* childregs = full task switch frame on kernel stack of child */
187 161
 
188 162
 		/* return via ret_from_fork */
189  
-		childregs->ra = (unsigned long)ret_from_fork;
  163
+		childregs->ra = (unsigned long)ret_from_kernel_thread;
190 164
 
191 165
 		/* setup ksp/usp */
192 166
 		p->thread.ksp = (unsigned long)childregs - 4; /* perhaps not necessary */
@@ -204,14 +178,14 @@ int copy_thread(unsigned long clone_flags,
204 178
 		/* childsyscallregs = full syscall frame on kernel stack of child */
205 179
 		childsyscallregs = (struct pt_regs *)(child_tos) - 1; /* 32 = safety */
206 180
 		/* child shall have same syscall context to restore as parent has ... */
207  
-		*childsyscallregs = *regs;
  181
+		*childsyscallregs = *current_pt_regs();
208 182
 
209 183
 		/* childregs = full task switch frame on kernel stack of child below * childsyscallregs */
210 184
 		childregs = childsyscallregs - 1;
211 185
 		memset(childregs, 0, sizeof(childregs));
212 186
 
213 187
 		/* user stack pointer is shared with the parent per definition of vfork */
214  
-		p->thread.usp = usp;
  188
+		p->thread.usp = usp_thread_fn;
215 189
 
216 190
 		/* kernel stack pointer is not shared with parent, it is the beginning of
217 191
 		 * the just created new task switch segment on the kernel stack */
98  arch/lm32/kernel/sys_lm32.c
... ...
@@ -1,98 +0,0 @@
1  
-/*
2  
- * (C) Copyright 2007
3  
- *     Theobroma Systems <www.theobroma-systems.com>
4  
- *
5  
- * See file CREDITS for list of people who contributed to this
6  
- * project.
7  
- *
8  
- * This program is free software; you can redistribute it and/or
9  
- * modify it under the terms of the GNU General Public License as
10  
- * published by the Free Software Foundation; either version 2 of
11  
- * the License, or (at your option) any later version.
12  
- *
13  
- * This program is distributed in the hope that it will be useful,
14  
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  
- * GNU General Public License for more details.
17  
- *
18  
- * You should have received a copy of the GNU General Public License
19  
- * along with this program; if not, write to the Free Software
20  
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  
- * MA 02111-1307 USA
22  
- */
23  
-
24  
-#include <linux/module.h>
25  
-#include <linux/errno.h>
26  
-#include <linux/sched.h>
27  
-#include <linux/slab.h>
28  
-#include <linux/mm.h>
29  
-#include <linux/sem.h>
30  
-#include <linux/msg.h>
31  
-#include <linux/shm.h>
32  
-#include <linux/stat.h>
33  
-#include <linux/syscalls.h>
34  
-#include <linux/mman.h>
35  
-#include <linux/fs.h>
36  
-#include <linux/file.h>
37  
-#include <linux/utsname.h>
38  
-
39  
-#include <asm/uaccess.h>
40  
-#include <asm/unistd.h>
41  
-
42  
-asmlinkage int lm32_execve(const char __user *ufilename,
43  
-                           const char __user *const __user *uargv,
44  
-                           const char __user *const __user *uenvp,
45  
-                           struct pt_regs *regs)
46  
-{
47  
-	int error;
48  
-	struct filename *filename;
49  
-
50  
-	filename = getname(ufilename);
51  
-	error = PTR_ERR(filename);
52  
-	if (IS_ERR(filename))
53  
-		goto out;
54  
-
55  
-	error = do_execve(filename->name, uargv, uenvp, regs);
56  
-	putname(filename);
57  
-out:
58  
-	return error;
59  
-}
60  
-
61  
-int kernel_execve(const char *filename, const char *const argv[], const char *const envp[])
62  
-{
63  
-    register unsigned long _r8 asm("r8") = __NR_execve; 
64  
-    register unsigned long _r1 asm("r1") = (unsigned long)filename; 
65  
-    register unsigned long _r2 asm("r2") = (unsigned long)argv; 
66  
-    register unsigned long _r3 asm("r3") = (unsigned long)envp; 
67  
-
68  
-	__asm__ __volatile__ ("scall\n"
69  
-			: "=r"(_r1)
70  
-			: "r"(_r8),
71  
-			  "0"(_r1), "r"(_r2), "r"(_r3) );
72  
-
73  
-    if(_r1 >=(unsigned long) -4095) {
74  
-      _r1 = (unsigned long) -1;
75  
-    }
76  
-
77  
-    return (int) _r1;
78  
-}
79  
-EXPORT_SYMBOL(kernel_execve);
80  
-
81  
-/* the args to sys_lm32_clone try to match the libc call to avoid register
82  
- * reshuffling:
83  
- *   int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
84  
-asmlinkage int sys_clone(
85  
-		int _unused_fn,
86  
-		unsigned long newsp,
87  
-		unsigned long clone_flags,
88  
-		int _unused_arg,
89  
-		unsigned long _unused_r5,
90  
-		int _unused_r6,
91  
-		struct pt_regs *regs)
92  
-{
93  
-	if (!newsp)
94  
-		newsp = current->thread.usp;
95  
-
96  
-	return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
97  
-}
98  
-
6  arch/lm32/platforms/milkymist/gpio.c
@@ -94,7 +94,7 @@ static int milkymist_gpio_direction_output(struct gpio_chip *gc,
94 94
 	return 0;
95 95
 }
96 96
 
97  
-static int __devinit milkymist_gpio_probe(struct platform_device *ofdev)
  97
+static int milkymist_gpio_probe(struct platform_device *ofdev)
98 98
 {
99 99
 	struct device_node *np = ofdev->dev.of_node;
100 100
 	struct milkymist_gpio_chip *chip;
@@ -148,7 +148,7 @@ static int __devinit milkymist_gpio_probe(struct platform_device *ofdev)
148 148
 	return ret;
149 149
 }
150 150
 
151  
-static int __devexit milkymist_gpio_remove(struct platform_device *ofdev)
  151
+static int milkymist_gpio_remove(struct platform_device *ofdev)
152 152
 {
153 153
 	struct milkymist_gpio_chip *chip = platform_get_drvdata(ofdev);
154 154
 
@@ -173,7 +173,7 @@ static struct platform_driver milkymist_gpio_driver = {
173 173
 		.of_match_table = milkymist_gpio_match,
174 174
 	},
175 175
 	.probe		= milkymist_gpio_probe,
176  
-	.remove		= __devexit_p(milkymist_gpio_remove),
  176
+	.remove		= milkymist_gpio_remove,
177 177
 };
178 178
 
179 179
 static int __init milkymist_gpio_init(void)
6  drivers/input/keyboard/softusb.c
@@ -125,7 +125,7 @@ printk(" ");
125 125
 	return IRQ_HANDLED;
126 126
 }
127 127
 
128  
-static int __devinit softusb_probe(struct platform_device *pdev)
  128
+static int softusb_probe(struct platform_device *pdev)
129 129
 {
130 130
 	struct input_dev *dev;
131 131
 	int i, nwords, err;
@@ -189,7 +189,7 @@ static int __devinit softusb_probe(struct platform_device *pdev)
189 189
 	return 0;
190 190
 }
191 191
 
192  
-static int __devexit softusb_remove(struct platform_device *pdev)
  192
+static int softusb_remove(struct platform_device *pdev)
193 193
 {
194 194
 	struct input_dev *dev = platform_get_drvdata(pdev);
195 195
 
@@ -207,7 +207,7 @@ static const struct of_device_id softusb_of_ids[] = {
207 207
 
208 208
 static struct platform_driver softusb_driver = {
209 209
 	.probe		= softusb_probe,
210  
-	.remove		= __devexit_p(softusb_remove),
  210
+	.remove		= softusb_remove,
211 211
 	.driver		= {
212 212
 		.name		= "softusb",
213 213
 		.of_match_table = softusb_of_ids,
6  drivers/input/serio/milkbd.c
@@ -84,7 +84,7 @@ static void milkbd_close(struct serio *port)
84 84
  * Allocate and initialize serio structure for subsequent registration
85 85
  * with serio core.
86 86
  */
87  
-static int __devinit milkbd_probe(struct platform_device *dev)
  87
+static int milkbd_probe(struct platform_device *dev)
88 88
 {
89 89
 	struct serio *serio;
90 90
 
@@ -105,7 +105,7 @@ static int __devinit milkbd_probe(struct platform_device *dev)
105 105
 	return 0;
106 106
 }
107 107
 
108  
-static int __devexit milkbd_remove(struct platform_device *dev)
  108
+static int milkbd_remove(struct platform_device *dev)
109 109
 {
110 110
 	struct serio *serio = platform_get_drvdata(dev);
111 111
 	serio_unregister_port(serio);
@@ -114,7 +114,7 @@ static int __devexit milkbd_remove(struct platform_device *dev)
114 114
 
115 115
 static struct platform_driver milkbd_driver = {
116 116
 	.probe		= milkbd_probe,
117  
-	.remove		= __devexit_p(milkbd_remove),
  117
+	.remove		= milkbd_remove,
118 118
 	.driver		= {
119 119
 	.name		= "milkbd",
120 120
 	},
6  drivers/input/serio/milkmouse.c
@@ -84,7 +84,7 @@ static void milkmouse_close(struct serio *port)
84 84
  * Allocate and initialize serio structure for subsequent registration
85 85
  * with serio core.
86 86
  */
87  
-static int __devinit milkmouse_probe(struct platform_device *dev)
  87
+static int milkmouse_probe(struct platform_device *dev)
88 88
 {
89 89
 	struct serio *serio;
90 90
 
@@ -105,7 +105,7 @@ static int __devinit milkmouse_probe(struct platform_device *dev)
105 105
 	return 0;
106 106
 }
107 107
 
108  
-static int __devexit milkmouse_remove(struct platform_device *dev)
  108
+static int milkmouse_remove(struct platform_device *dev)
109 109
 {
110 110
 	struct serio *serio = platform_get_drvdata(dev);
111 111
 	serio_unregister_port(serio);
@@ -114,7 +114,7 @@ static int __devexit milkmouse_remove(struct platform_device *dev)
114 114
 
115 115
 static struct platform_driver milkmouse_driver = {
116 116
 	.probe		= milkmouse_probe,
117  
-	.remove		= __devexit_p(milkmouse_remove),
  117
+	.remove		= milkmouse_remove,
118 118
 	.driver		= {
119 119
 	.name		= "milkmouse",
120 120
 	},
8  drivers/tty/serial/milkymist_uart.c
@@ -342,7 +342,7 @@ static void milkymist_uart_console_write(struct console *co, const char *s,
342 342
 		spin_unlock_irqrestore(&port->lock, flags);
343 343
 }
344 344
 
345  
-static int __devinit milkymist_uart_console_setup(struct console *co,
  345
+static int milkymist_uart_console_setup(struct console *co,
346 346
 		char *options)
347 347
 {
348 348
 	struct uart_port *port;
@@ -399,7 +399,7 @@ static struct uart_driver milkymist_uart_driver = {
399 399
 #endif
400 400
 };
401 401
 
402  
-static int __devinit milkymist_uart_probe(struct platform_device *op)
  402
+static int milkymist_uart_probe(struct platform_device *op)
403 403
 {
404 404
 	struct uart_port *port;
405 405
 	struct device_node *np = op->dev.of_node;
@@ -482,7 +482,7 @@ static int __devinit milkymist_uart_probe(struct platform_device *op)
482 482
 	return 0;
483 483
 }
484 484
 
485  
-static int __devexit milkymist_uart_remove(struct platform_device *dev)
  485
+static int milkymist_uart_remove(struct platform_device *dev)
486 486
 {
487 487
 	struct uart_port *port = dev_get_drvdata(&dev->dev);
488 488
 
@@ -506,7 +506,7 @@ static struct platform_driver milkymist_uart_of_driver = {
506 506
 		.of_match_table = milkymist_uart_match,
507 507
 	},
508 508
 	.probe		= milkymist_uart_probe,
509  
-	.remove		= __devexit_p(milkymist_uart_remove),
  509
+	.remove		= milkymist_uart_remove,
510 510
 };
511 511
 
512 512
 static int __init milkymist_uart_init(void)
6  drivers/video/milkymistfb.c
@@ -248,7 +248,7 @@ static struct fb_ops milkymistfb_ops = {
248 248
 #endif
249 249
 };
250 250
 
251  
-static int __devinit milkymistfb_probe(struct platform_device *ofdev)
  251
+static int milkymistfb_probe(struct platform_device *ofdev)
252 252
 {
253 253
 	struct device_node *np = ofdev->dev.of_node;
254 254
 	struct fb_info *info;
@@ -328,7 +328,7 @@ static int __devinit milkymistfb_probe(struct platform_device *ofdev)
328 328
 	return ret;
329 329
 }
330 330
 
331  
-static int __devexit milkymistfb_remove(struct platform_device *ofdev)
  331
+static int milkymistfb_remove(struct platform_device *ofdev)
332 332
 {
333 333
 	struct milkymistfb *milkymistfb = platform_get_drvdata(ofdev);
334 334
 	struct fb_info *info = milkymistfb->fb;
@@ -360,7 +360,7 @@ static struct platform_driver milkymist_vgafb_of_driver = {
360 360
 		.of_match_table = milkymist_vgafb_match,
361 361
 	},
362 362
 	.probe		= milkymistfb_probe,
363  
-	.remove		= __devexit_p(milkymistfb_remove),
  363
+	.remove		= milkymistfb_remove,
364 364
 };
365 365
 
366 366
 #ifndef MODULE
7  include/asm-generic/syscalls.h
@@ -10,16 +10,15 @@
10 10
  */
11 11
 #ifndef sys_clone
12 12
 asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp,
13  
-			void __user *parent_tid, void __user *child_tid,
14  
-			struct pt_regs *regs);
  13
+			void __user *parent_tid, void __user *child_tid);
15 14
 #endif
16 15
 
17 16
 #ifndef sys_fork
18  
-asmlinkage long sys_fork(struct pt_regs *regs);
  17
+asmlinkage long sys_fork(void);
19 18
 #endif
20 19
 
21 20
 #ifndef sys_vfork
22  
-asmlinkage long sys_vfork(struct pt_regs *regs);
  21
+asmlinkage long sys_vfork(void);
23 22
 #endif
24 23
 
25 24
 #ifndef sys_execve
48  kernel/fork.c
@@ -1645,6 +1645,54 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
1645 1645
 }
1646 1646
 #endif
1647 1647
 
  1648
+#ifdef __ARCH_WANT_SYS_FORK
  1649
+SYSCALL_DEFINE0(fork)
  1650
+{
  1651
+#ifdef CONFIG_MMU
  1652
+	return do_fork(SIGCHLD, 0, current_pt_regs(), 0, NULL, NULL);
  1653
+#else
  1654
+	/* can not support in nommu mode */
  1655
+	return(-EINVAL);
  1656
+#endif
  1657
+}
  1658
+#endif
  1659
+
  1660
+#ifdef __ARCH_WANT_SYS_VFORK
  1661
+SYSCALL_DEFINE0(vfork)
  1662
+{
  1663
+	return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, current_pt_regs(),
  1664
+			0, NULL, NULL);
  1665
+}
  1666
+#endif
  1667
+
  1668
+#ifdef __ARCH_WANT_SYS_CLONE
  1669
+#ifdef CONFIG_CLONE_BACKWARDS
  1670
+SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
  1671
+		 int __user *, parent_tidptr,
  1672
+		 int, tls_val,
  1673
+		 int __user *, child_tidptr)
  1674
+#elif defined(CONFIG_CLONE_BACKWARDS2)
  1675
+SYSCALL_DEFINE5(clone, unsigned long, newsp, unsigned long, clone_flags,
  1676
+		 int __user *, parent_tidptr,
  1677
+		 int __user *, child_tidptr,
  1678
+		 int, tls_val)
  1679
+#elif defined(CONFIG_CLONE_BACKWARDS3)
  1680
+SYSCALL_DEFINE6(clone, unsigned int, unused, unsigned long, newsp, unsigned long, clone_flags,
  1681
+		 int __user *, parent_tidptr,
  1682
+		 int __user *, child_tidptr,
  1683
+		 int, tls_val)
  1684
+#else
  1685
+SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
  1686
+		 int __user *, parent_tidptr,
  1687
+		 int __user *, child_tidptr,
  1688
+		 int, tls_val)
  1689
+#endif
  1690
+{
  1691
+	return do_fork(clone_flags, newsp, current_pt_regs(), 0,
  1692
+		parent_tidptr, child_tidptr);
  1693
+}
  1694
+#endif
  1695
+
1648 1696
 #ifndef ARCH_MIN_MMSTRUCT_ALIGN
1649 1697
 #define ARCH_MIN_MMSTRUCT_ALIGN 0
1650 1698
 #endif

No commit comments for this range

Something went wrong with that request. Please try again.