#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;
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)
{
child_tidptr = (int *)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;
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);