git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
arch
/
m68k
/
kernel
/
process.c
diff --git
a/arch/m68k/kernel/process.c
b/arch/m68k/kernel/process.c
index
a270b5f
..
765bb57
100644
(file)
--- a/
arch/m68k/kernel/process.c
+++ b/
arch/m68k/kernel/process.c
@@
-10,7
+10,6
@@
* This file handles the architecture-dependent parts of process handling..
*/
* 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/errno.h>
#include <linux/module.h>
#include <linux/sched.h>
@@
-26,6
+25,7
@@
#include <linux/a.out.h>
#include <linux/reboot.h>
#include <linux/init_task.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>
#include <asm/uaccess.h>
#include <asm/system.h>
@@
-67,8
+67,7
@@
unsigned long thread_saved_pc(struct task_struct *tsk)
{
struct switch_stack *sw = (struct switch_stack *)tsk->thread.ksp;
/* Check whether the thread is blocked in resume() */
{
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;
return ((unsigned long *)sw->a6)[1];
else
return sw->retpc;
@@
-77,7
+76,7
@@
unsigned long thread_saved_pc(struct task_struct *tsk)
/*
* The idle loop on an m68k..
*/
/*
* 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)
{
if (!need_resched())
#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
@@
-102,7
+101,9
@@
void cpu_idle(void)
while (1) {
while (!need_resched())
idle();
while (1) {
while (!need_resched())
idle();
+ preempt_enable_no_resched();
schedule();
schedule();
+ preempt_disable();
}
}
}
}
@@
-113,8
+114,6
@@
void machine_restart(char * __unused)
for (;;);
}
for (;;);
}
-EXPORT_SYMBOL(machine_restart);
-
void machine_halt(void)
{
if (mach_halt)
void machine_halt(void)
{
if (mach_halt)
@@
-122,8
+121,6
@@
void machine_halt(void)
for (;;);
}
for (;;);
}
-EXPORT_SYMBOL(machine_halt);
-
void machine_power_off(void)
{
if (mach_power_off)
void machine_power_off(void)
{
if (mach_power_off)
@@
-131,7
+128,8
@@
void machine_power_off(void)
for (;;);
}
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)
{
void show_regs(struct pt_regs * regs)
{
@@
-161,7
+159,8
@@
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
{
register long retval __asm__ ("d0");
{
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__
retval = __NR_clone;
__asm__ __volatile__
@@
-189,6
+188,7
@@
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
set_fs (fs);
return pid;
}
set_fs (fs);
return pid;
}
+EXPORT_SYMBOL(kernel_thread);
void flush_thread(void)
{
void flush_thread(void)
{
@@
-223,16
+223,16
@@
asmlinkage int m68k_clone(struct pt_regs *regs)
{
unsigned long clone_flags;
unsigned long newsp;
{
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;
/* 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();
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);
}
parent_tidptr, child_tidptr);
}
@@
-242,10
+242,9
@@
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
{
struct pt_regs * childregs;
struct switch_stack * childstack, *stack;
{
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;
*childregs = *regs;
childregs->d0 = 0;
@@
-314,6
+313,7
@@
int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu)
: "memory");
return 1;
}
: "memory");
return 1;
}
+EXPORT_SYMBOL(dump_fpu);
/*
* fill in the user structure for a core dump..
/*
* fill in the user structure for a core dump..
@@
-360,11
+360,12
@@
void dump_thread(struct pt_regs * regs, struct user * dump)
/* dump floating point stuff */
dump->u_fpvalid = dump_fpu (regs, &dump->m68kfp);
}
/* dump floating point stuff */
dump->u_fpvalid = dump_fpu (regs, &dump->m68kfp);
}
+EXPORT_SYMBOL(dump_thread);
/*
* sys_execve() executes a new program.
*/
/*
* 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;
{
int error;
char * filename;
@@
-382,12
+383,6
@@
out:
return error;
}
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;
unsigned long get_wchan(struct task_struct *p)
{
unsigned long fp, pc;
@@
-396,14
+391,14
@@
unsigned long get_wchan(struct task_struct *p)
if (!p || p == current || p->state == TASK_RUNNING)
return 0;
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];
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);
return pc;
fp = *(unsigned long *) fp;
} while (count++ < 16);