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
/
sparc
/
kernel
/
process.c
diff --git
a/arch/sparc/kernel/process.c
b/arch/sparc/kernel/process.c
index
143fe2f
..
4dd490e
100644
(file)
--- a/
arch/sparc/kernel/process.c
+++ b/
arch/sparc/kernel/process.c
@@
-22,7
+22,6
@@
#include <linux/slab.h>
#include <linux/user.h>
#include <linux/a.out.h>
#include <linux/slab.h>
#include <linux/user.h>
#include <linux/a.out.h>
-#include <linux/config.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/reboot.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/reboot.h>
@@
-54,7
+53,8
@@
void (*pm_idle)(void);
* This is done via auxio, but could be used as a fallback
* handler when auxio is not present-- unused for now...
*/
* This is done via auxio, but could be used as a fallback
* handler when auxio is not present-- unused for now...
*/
-void (*pm_power_off)(void);
+void (*pm_power_off)(void) = machine_power_off;
+EXPORT_SYMBOL(pm_power_off);
/*
* sysctl - toggle power-off restriction for serial console
/*
* sysctl - toggle power-off restriction for serial console
@@
-67,13
+67,6
@@
extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *);
struct task_struct *last_task_used_math = NULL;
struct thread_info *current_set[NR_CPUS];
struct task_struct *last_task_used_math = NULL;
struct thread_info *current_set[NR_CPUS];
-/*
- * default_idle is new in 2.5. XXX Review, currently stolen from sparc64.
- */
-void default_idle(void)
-{
-}
-
#ifndef CONFIG_SMP
#define SUN4C_FAULT_HIGH 100
#ifndef CONFIG_SMP
#define SUN4C_FAULT_HIGH 100
@@
-83,9
+76,6
@@
void default_idle(void)
*/
void cpu_idle(void)
{
*/
void cpu_idle(void)
{
- if (current->pid != 0)
- goto out;
-
/* endless idle loop with no priority at all */
for (;;) {
if (ARCH_SUN4C_SUN4) {
/* endless idle loop with no priority at all */
for (;;) {
if (ARCH_SUN4C_SUN4) {
@@
-95,12
+85,11
@@
void cpu_idle(void)
static unsigned long fps;
unsigned long now;
unsigned long faults;
static unsigned long fps;
unsigned long now;
unsigned long faults;
- unsigned long flags;
extern unsigned long sun4c_kernel_faults;
extern void sun4c_grow_kernel_ring(void);
extern unsigned long sun4c_kernel_faults;
extern void sun4c_grow_kernel_ring(void);
- local_irq_
save(flags
);
+ local_irq_
disable(
);
now = jiffies;
count -= (now - last_jiffies);
last_jiffies = now;
now = jiffies;
count -= (now - last_jiffies);
last_jiffies = now;
@@
-116,18
+105,21
@@
void cpu_idle(void)
sun4c_grow_kernel_ring();
}
}
sun4c_grow_kernel_ring();
}
}
- local_irq_
restore(flags
);
+ local_irq_
enable(
);
}
}
- while((!need_resched()) && pm_idle) {
- (*pm_idle)();
+ if (pm_idle) {
+ while (!need_resched())
+ (*pm_idle)();
+ } else {
+ while (!need_resched())
+ cpu_relax();
}
}
-
+ preempt_enable_no_resched();
schedule();
schedule();
+ preempt_disable();
check_pgt_cache();
}
check_pgt_cache();
}
-out:
- return;
}
#else
}
#else
@@
-135,13
+127,15
@@
out:
/* This is being executed in task 0 'user space'. */
void cpu_idle(void)
{
/* This is being executed in task 0 'user space'. */
void cpu_idle(void)
{
+ set_thread_flag(TIF_POLLING_NRFLAG);
/* endless idle loop with no priority at all */
while(1) {
/* endless idle loop with no priority at all */
while(1) {
- if(need_resched()) {
- schedule();
- check_pgt_cache();
- }
- barrier(); /* or else gcc optimizes... */
+ while (!need_resched())
+ cpu_relax();
+ preempt_enable_no_resched();
+ schedule();
+ preempt_disable();
+ check_pgt_cache();
}
}
}
}
@@
-163,8
+157,6
@@
void machine_halt(void)
panic("Halt failed!");
}
panic("Halt failed!");
}
-EXPORT_SYMBOL(machine_halt);
-
void machine_restart(char * cmd)
{
char *p;
void machine_restart(char * cmd)
{
char *p;
@@
-185,8
+177,6
@@
void machine_restart(char * cmd)
panic("Reboot failed!");
}
panic("Reboot failed!");
}
-EXPORT_SYMBOL(machine_restart);
-
void machine_power_off(void)
{
#ifdef CONFIG_SUN_AUXIO
void machine_power_off(void)
{
#ifdef CONFIG_SUN_AUXIO
@@
-196,8
+186,6
@@
void machine_power_off(void)
machine_halt();
}
machine_halt();
}
-EXPORT_SYMBOL(machine_power_off);
-
static DEFINE_SPINLOCK(sparc_backtrace_lock);
void __show_backtrace(unsigned long fp)
static DEFINE_SPINLOCK(sparc_backtrace_lock);
void __show_backtrace(unsigned long fp)
@@
-314,7
+302,7
@@
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
int count = 0;
if (tsk != NULL)
int count = 0;
if (tsk != NULL)
- task_base = (unsigned long) t
sk->thread_info
;
+ task_base = (unsigned long) t
ask_stack_page(tsk)
;
else
task_base = (unsigned long) current_thread_info();
else
task_base = (unsigned long) current_thread_info();
@@
-333,12
+321,23
@@
void show_stack(struct task_struct *tsk, unsigned long *_ksp)
printk("\n");
}
printk("\n");
}
+void dump_stack(void)
+{
+ unsigned long *ksp;
+
+ __asm__ __volatile__("mov %%fp, %0"
+ : "=r" (ksp));
+ show_stack(current, ksp);
+}
+
+EXPORT_SYMBOL(dump_stack);
+
/*
* Note: sparc64 has a pretty intricated thread_saved_pc, check it out.
*/
unsigned long thread_saved_pc(struct task_struct *tsk)
{
/*
* Note: sparc64 has a pretty intricated thread_saved_pc, check it out.
*/
unsigned long thread_saved_pc(struct task_struct *tsk)
{
- return t
sk->thread_info
->kpc;
+ return t
ask_thread_info(tsk)
->kpc;
}
/*
}
/*
@@
-393,7
+392,7
@@
void flush_thread(void)
/* We must fixup kregs as well. */
/* XXX This was not fixed for ti for a while, worked. Unused? */
current->thread.kregs = (struct pt_regs *)
/* We must fixup kregs as well. */
/* XXX This was not fixed for ti for a while, worked. Unused? */
current->thread.kregs = (struct pt_regs *)
- (
(char *)current->thread_info
+ (THREAD_SIZE - TRACEREG_SZ));
+ (
task_stack_page(current)
+ (THREAD_SIZE - TRACEREG_SZ));
}
}
}
}
@@
-460,7
+459,7
@@
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
unsigned long unused,
struct task_struct *p, struct pt_regs *regs)
{
unsigned long unused,
struct task_struct *p, struct pt_regs *regs)
{
- struct thread_info *ti =
p->thread_info
;
+ struct thread_info *ti =
task_thread_info(p)
;
struct pt_regs *childregs;
char *new_stack;
struct pt_regs *childregs;
char *new_stack;
@@
-483,7
+482,7
@@
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
* V V (stk.fr.) V (pt_regs) { (stk.fr.) }
* +----- - - - - - ------+===========+============={+==========}+
*/
* V V (stk.fr.) V (pt_regs) { (stk.fr.) }
* +----- - - - - - ------+===========+============={+==========}+
*/
- new_stack =
(char*)ti
+ THREAD_SIZE;
+ new_stack =
task_stack_page(p)
+ THREAD_SIZE;
if (regs->psr & PSR_PS)
new_stack -= STACKFRAME_SZ;
new_stack -= STACKFRAME_SZ + TRACEREG_SZ;
if (regs->psr & PSR_PS)
new_stack -= STACKFRAME_SZ;
new_stack -= STACKFRAME_SZ + TRACEREG_SZ;
@@
-707,7
+706,8
@@
pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
/* Notreached by child. */
"1: mov %%o0, %0\n\t" :
"=r" (retval) :
/* Notreached by child. */
"1: mov %%o0, %0\n\t" :
"=r" (retval) :
- "i" (__NR_clone), "r" (flags | CLONE_VM | CLONE_UNTRACED),
+ "i" (__NR_clone), "r" (flags |
+ CLONE_VM | CLONE_UNTRACED | CLONE_KTHREAD),
"i" (__NR_exit), "r" (fn), "r" (arg) :
"g1", "g2", "g3", "o0", "o1", "memory", "cc");
return retval;
"i" (__NR_exit), "r" (fn), "r" (arg) :
"g1", "g2", "g3", "o0", "o1", "memory", "cc");
return retval;
@@
-725,7
+725,7
@@
unsigned long get_wchan(struct task_struct *task)
task->state == TASK_RUNNING)
goto out;
task->state == TASK_RUNNING)
goto out;
- fp = task
->thread_info
->ksp + bias;
+ fp = task
_thread_info(task)
->ksp + bias;
do {
/* Bogus frame pointer? */
if (fp < (task_base + sizeof(struct thread_info)) ||
do {
/* Bogus frame pointer? */
if (fp < (task_base + sizeof(struct thread_info)) ||