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
vserver 1.9.5.x5
[linux-2.6.git]
/
arch
/
sh
/
kernel
/
process.c
diff --git
a/arch/sh/kernel/process.c
b/arch/sh/kernel/process.c
index
7d45ea0
..
3d02459
100644
(file)
--- a/
arch/sh/kernel/process.c
+++ b/
arch/sh/kernel/process.c
@@
-1,4
+1,4
@@
-/* $Id: process.c,v 1.2
6 2004/02/06 14:14:14 kkojima
Exp $
+/* $Id: process.c,v 1.2
8 2004/05/05 16:54:23 lethal
Exp $
*
* linux/arch/sh/kernel/process.c
*
*
* linux/arch/sh/kernel/process.c
*
@@
-25,6
+25,11
@@
#include <asm/uaccess.h>
#include <asm/mmu_context.h>
#include <asm/elf.h>
#include <asm/uaccess.h>
#include <asm/mmu_context.h>
#include <asm/elf.h>
+#if defined(CONFIG_SH_HS7751RVOIP)
+#include <asm/hs7751rvoip/hs7751rvoip.h>
+#elif defined(CONFIG_SH_RTS7751R2D)
+#include <asm/rts7751r2d/rts7751r2d.h>
+#endif
static int hlt_counter=0;
static int hlt_counter=0;
@@
-50,14
+55,20
@@
void default_idle(void)
{
/* endless idle loop with no priority at all */
while (1) {
{
/* endless idle loop with no priority at all */
while (1) {
- while (!need_resched())
- cpu_relax();
+ if (hlt_counter) {
+ while (1)
+ if (need_resched())
+ break;
+ } else {
+ while (!need_resched())
+ cpu_sleep();
+ }
schedule();
}
}
schedule();
}
}
-void cpu_idle(void
*unused
)
+void cpu_idle(void)
{
default_idle();
}
{
default_idle();
}
@@
-73,14
+84,30
@@
EXPORT_SYMBOL(machine_restart);
void machine_halt(void)
{
void machine_halt(void)
{
+#if defined(CONFIG_SH_HS7751RVOIP)
+ unsigned short value;
+
+ value = ctrl_inw(PA_OUTPORTR);
+ ctrl_outw((value & 0xffdf), PA_OUTPORTR);
+#elif defined(CONFIG_SH_RTS7751R2D)
+ ctrl_outw(0x0001, PA_POWOFF);
+#endif
while (1)
while (1)
- cpu_
relax
();
+ cpu_
sleep
();
}
EXPORT_SYMBOL(machine_halt);
void machine_power_off(void)
{
}
EXPORT_SYMBOL(machine_halt);
void machine_power_off(void)
{
+#if defined(CONFIG_SH_HS7751RVOIP)
+ unsigned short value;
+
+ value = ctrl_inw(PA_OUTPORTR);
+ ctrl_outw((value & 0xffdf), PA_OUTPORTR);
+#elif defined(CONFIG_SH_RTS7751R2D)
+ ctrl_outw(0x0001, PA_POWOFF);
+#endif
}
EXPORT_SYMBOL(machine_power_off);
}
EXPORT_SYMBOL(machine_power_off);
@@
-172,7
+199,7
@@
void exit_thread(void)
void flush_thread(void)
{
void flush_thread(void)
{
-#if defined(CONFIG_
CPU_SH4
)
+#if defined(CONFIG_
SH_FPU
)
struct task_struct *tsk = current;
struct pt_regs *regs = (struct pt_regs *)
((unsigned long)tsk->thread_info
struct task_struct *tsk = current;
struct pt_regs *regs = (struct pt_regs *)
((unsigned long)tsk->thread_info
@@
-181,7
+208,7
@@
void flush_thread(void)
/* Forget lazy FPU state */
clear_fpu(tsk, regs);
/* Forget lazy FPU state */
clear_fpu(tsk, regs);
-
tsk->used_math = 0
;
+
clear_used_math()
;
#endif
}
#endif
}
@@
-195,10
+222,10
@@
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
{
int fpvalid = 0;
{
int fpvalid = 0;
-#if defined(CONFIG_
CPU_SH4
)
+#if defined(CONFIG_
SH_FPU
)
struct task_struct *tsk = current;
struct task_struct *tsk = current;
- fpvalid =
tsk->used_math
;
+ fpvalid =
!!tsk_used_math(tsk)
;
if (fpvalid) {
unlazy_fpu(tsk, regs);
memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu));
if (fpvalid) {
unlazy_fpu(tsk, regs);
memcpy(fpu, &tsk->thread.fpu.hard, sizeof(*fpu));
@@
-232,8
+259,8
@@
dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *fpu)
{
int fpvalid = 0;
{
int fpvalid = 0;
-#if defined(CONFIG_
CPU_SH4
)
- fpvalid =
tsk->used_math
;
+#if defined(CONFIG_
SH_FPU
)
+ fpvalid =
!!tsk_used_math(tsk)
;
if (fpvalid) {
struct pt_regs *regs = (struct pt_regs *)
((unsigned long)tsk->thread_info
if (fpvalid) {
struct pt_regs *regs = (struct pt_regs *)
((unsigned long)tsk->thread_info
@@
-254,12
+281,12
@@
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
struct task_struct *p, struct pt_regs *regs)
{
struct pt_regs *childregs;
struct task_struct *p, struct pt_regs *regs)
{
struct pt_regs *childregs;
-#if defined(CONFIG_
CPU_SH4
)
+#if defined(CONFIG_
SH_FPU
)
struct task_struct *tsk = current;
unlazy_fpu(tsk, regs);
p->thread.fpu = tsk->thread.fpu;
struct task_struct *tsk = current;
unlazy_fpu(tsk, regs);
p->thread.fpu = tsk->thread.fpu;
-
p->used_math = tsk->used_math
;
+
copy_to_stopped_child_used_math(p)
;
#endif
childregs = ((struct pt_regs *)
#endif
childregs = ((struct pt_regs *)
@@
-279,7
+306,6
@@
int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
childregs->gbr = childregs->regs[0];
}
childregs->regs[0] = 0; /* Set return value for child */
childregs->gbr = childregs->regs[0];
}
childregs->regs[0] = 0; /* Set return value for child */
- p->set_child_tid = p->clear_child_tid = NULL;
p->thread.sp = (unsigned long) childregs;
p->thread.pc = (unsigned long) ret_from_fork;
p->thread.sp = (unsigned long) childregs;
p->thread.pc = (unsigned long) ret_from_fork;
@@
-336,7
+362,7
@@
ubc_set_tracing(int asid, unsigned long pc)
*/
struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next)
{
*/
struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next)
{
-#if defined(CONFIG_
CPU_SH4
)
+#if defined(CONFIG_
SH_FPU
)
struct pt_regs *regs = (struct pt_regs *)
((unsigned long)prev->thread_info
+ THREAD_SIZE - sizeof(struct pt_regs)
struct pt_regs *regs = (struct pt_regs *)
((unsigned long)prev->thread_info
+ THREAD_SIZE - sizeof(struct pt_regs)
@@
-413,7
+439,7
@@
asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
{
if (!newsp)
newsp = regs.regs[15];
{
if (!newsp)
newsp = regs.regs[15];
- return do_fork(clone_flags
& ~CLONE_IDLETASK
, newsp, ®s, 0,
+ return do_fork(clone_flags, newsp, ®s, 0,
(int __user *)parent_tidptr, (int __user *)child_tidptr);
}
(int __user *)parent_tidptr, (int __user *)child_tidptr);
}
@@
-454,19
+480,16
@@
asmlinkage int sys_execve(char *ufilename, char **uargv,
(char __user * __user *)uargv,
(char __user * __user *)uenvp,
®s);
(char __user * __user *)uargv,
(char __user * __user *)uenvp,
®s);
- if (error == 0)
+ if (error == 0) {
+ task_lock(current);
current->ptrace &= ~PT_DTRACE;
current->ptrace &= ~PT_DTRACE;
+ task_unlock(current);
+ }
putname(filename);
out:
return error;
}
putname(filename);
out:
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 schedule_frame;
unsigned long get_wchan(struct task_struct *p)
{
unsigned long schedule_frame;
@@
-479,7
+502,7
@@
unsigned long get_wchan(struct task_struct *p)
* The same comment as on the Alpha applies here, too ...
*/
pc = thread_saved_pc(p);
* The same comment as on the Alpha applies here, too ...
*/
pc = thread_saved_pc(p);
- if (
pc >= first_sched && pc < last_sched
) {
+ if (
in_sched_functions(pc)
) {
schedule_frame = ((unsigned long *)(long)p->thread.sp)[1];
return (unsigned long)((unsigned long *)schedule_frame)[1];
}
schedule_frame = ((unsigned long *)(long)p->thread.sp)[1];
return (unsigned long)((unsigned long *)schedule_frame)[1];
}