diff options
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index dc3567e083f9..b644e1c765dc 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -293,71 +293,6 @@ sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
293 | } | 293 | } |
294 | 294 | ||
295 | /* | 295 | /* |
296 | * This gets run with %si containing the | ||
297 | * function to call, and %di containing | ||
298 | * the "args". | ||
299 | */ | ||
300 | extern void kernel_thread_helper(void); | ||
301 | |||
302 | /* | ||
303 | * Create a kernel thread | ||
304 | */ | ||
305 | int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | ||
306 | { | ||
307 | struct pt_regs regs; | ||
308 | |||
309 | memset(®s, 0, sizeof(regs)); | ||
310 | |||
311 | regs.si = (unsigned long) fn; | ||
312 | regs.di = (unsigned long) arg; | ||
313 | |||
314 | #ifdef CONFIG_X86_32 | ||
315 | regs.ds = __USER_DS; | ||
316 | regs.es = __USER_DS; | ||
317 | regs.fs = __KERNEL_PERCPU; | ||
318 | regs.gs = __KERNEL_STACK_CANARY; | ||
319 | #else | ||
320 | regs.ss = __KERNEL_DS; | ||
321 | #endif | ||
322 | |||
323 | regs.orig_ax = -1; | ||
324 | regs.ip = (unsigned long) kernel_thread_helper; | ||
325 | regs.cs = __KERNEL_CS | get_kernel_rpl(); | ||
326 | regs.flags = X86_EFLAGS_IF | X86_EFLAGS_BIT1; | ||
327 | |||
328 | /* Ok, create the new process.. */ | ||
329 | return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); | ||
330 | } | ||
331 | EXPORT_SYMBOL(kernel_thread); | ||
332 | |||
333 | /* | ||
334 | * sys_execve() executes a new program. | ||
335 | */ | ||
336 | long sys_execve(const char __user *name, | ||
337 | const char __user *const __user *argv, | ||
338 | const char __user *const __user *envp, struct pt_regs *regs) | ||
339 | { | ||
340 | long error; | ||
341 | char *filename; | ||
342 | |||
343 | filename = getname(name); | ||
344 | error = PTR_ERR(filename); | ||
345 | if (IS_ERR(filename)) | ||
346 | return error; | ||
347 | error = do_execve(filename, argv, envp, regs); | ||
348 | |||
349 | #ifdef CONFIG_X86_32 | ||
350 | if (error == 0) { | ||
351 | /* Make sure we don't return using sysenter.. */ | ||
352 | set_thread_flag(TIF_IRET); | ||
353 | } | ||
354 | #endif | ||
355 | |||
356 | putname(filename); | ||
357 | return error; | ||
358 | } | ||
359 | |||
360 | /* | ||
361 | * Idle related variables and functions | 296 | * Idle related variables and functions |
362 | */ | 297 | */ |
363 | unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE; | 298 | unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE; |