* This file handles the architecture-dependent parts of process handling..
*/
-#include <linux/config.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/a.out.h>
#include <linux/reboot.h>
#include <linux/init_task.h>
+#include <linux/mqueue.h>
#include <asm/uaccess.h>
#include <asm/system.h>
{
struct switch_stack *sw = (struct switch_stack *)tsk->thread.ksp;
/* Check whether the thread is blocked in resume() */
- if (sw->retpc > (unsigned long)scheduling_functions_start_here &&
- sw->retpc < (unsigned long)scheduling_functions_end_here)
+ if (in_sched_functions(sw->retpc))
return ((unsigned long *)sw->a6)[1];
else
return sw->retpc;
/*
* The idle loop on an m68k..
*/
-void default_idle(void)
+static void default_idle(void)
{
if (!need_resched())
#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
while (1) {
while (!need_resched())
idle();
+ preempt_enable_no_resched();
schedule();
+ preempt_disable();
}
}
for (;;);
}
-EXPORT_SYMBOL(machine_restart);
-
void machine_halt(void)
{
if (mach_halt)
for (;;);
}
-EXPORT_SYMBOL(machine_halt);
-
void machine_power_off(void)
{
if (mach_power_off)
for (;;);
}
-EXPORT_SYMBOL(machine_power_off);
+void (*pm_power_off)(void) = machine_power_off;
+EXPORT_SYMBOL(pm_power_off);
void show_regs(struct pt_regs * regs)
{
{
register long retval __asm__ ("d0");
- register long clone_arg __asm__ ("d1") = flags | CLONE_VM | CLONE_UNTRACED;
+ register long clone_arg __asm__ ("d1") =
+ flags | CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD;
retval = __NR_clone;
__asm__ __volatile__
set_fs (fs);
return pid;
}
+EXPORT_SYMBOL(kernel_thread);
void flush_thread(void)
{
{
unsigned long clone_flags;
unsigned long newsp;
- int *parent_tidptr, *child_tidptr;
+ int __user *parent_tidptr, *child_tidptr;
/* syscall2 puts clone_flags in d1 and usp in d2 */
clone_flags = regs->d1;
newsp = regs->d2;
- parent_tidptr = (int *)regs->d3;
- child_tidptr = (int *)regs->d4;
+ parent_tidptr = (int __user *)regs->d3;
+ child_tidptr = (int __user *)regs->d4;
if (!newsp)
newsp = rdusp();
- return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0,
+ return do_fork(clone_flags, newsp, regs, 0,
parent_tidptr, child_tidptr);
}
{
struct pt_regs * childregs;
struct switch_stack * childstack, *stack;
- unsigned long stack_offset, *retp;
+ unsigned long *retp;
- stack_offset = THREAD_SIZE - sizeof(struct pt_regs);
- childregs = (struct pt_regs *) ((unsigned long) (p->thread_info) + stack_offset);
+ childregs = (struct pt_regs *) (task_stack_page(p) + THREAD_SIZE) - 1;
*childregs = *regs;
childregs->d0 = 0;
: "memory");
return 1;
}
+EXPORT_SYMBOL(dump_fpu);
/*
* fill in the user structure for a core dump..
/* dump floating point stuff */
dump->u_fpvalid = dump_fpu (regs, &dump->m68kfp);
}
+EXPORT_SYMBOL(dump_thread);
/*
* sys_execve() executes a new program.
*/
-asmlinkage int sys_execve(char *name, char **argv, char **envp)
+asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __user * __user *envp)
{
int error;
char * filename;
return error;
}
-/*
- * These bracket the sleeping functions..
- */
-#define first_sched ((unsigned long) scheduling_functions_start_here)
-#define last_sched ((unsigned long) scheduling_functions_end_here)
-
unsigned long get_wchan(struct task_struct *p)
{
unsigned long fp, pc;
if (!p || p == current || p->state == TASK_RUNNING)
return 0;
- stack_page = (unsigned long)(p->thread_info);
+ stack_page = (unsigned long)task_stack_page(p);
fp = ((struct switch_stack *)p->thread.ksp)->a6;
do {
if (fp < stack_page+sizeof(struct thread_info) ||
fp >= 8184+stack_page)
return 0;
pc = ((unsigned long *)fp)[1];
- if (pc < first_sched || pc >= last_sched)
+ if (!in_sched_functions(pc))
return pc;
fp = *(unsigned long *) fp;
} while (count++ < 16);