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
/
alpha
/
kernel
/
process.c
diff --git
a/arch/alpha/kernel/process.c
b/arch/alpha/kernel/process.c
index
4933f3c
..
c151863
100644
(file)
--- a/
arch/alpha/kernel/process.c
+++ b/
arch/alpha/kernel/process.c
@@
-8,7
+8,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/time.h>
#include <linux/major.h>
#include <linux/stat.h>
#include <linux/time.h>
#include <linux/major.h>
#include <linux/stat.h>
+#include <linux/vt.h>
#include <linux/mman.h>
#include <linux/elfcore.h>
#include <linux/reboot.h>
#include <linux/mman.h>
#include <linux/elfcore.h>
#include <linux/reboot.h>
@@
-43,21
+43,23
@@
#include "proto.h"
#include "pci_impl.h"
#include "proto.h"
#include "pci_impl.h"
-void default_idle(void)
-{
- barrier();
-}
+/*
+ * Power off function, if any
+ */
+void (*pm_power_off)(void) = machine_power_off;
+EXPORT_SYMBOL(pm_power_off);
void
cpu_idle(void)
{
void
cpu_idle(void)
{
+ set_thread_flag(TIF_POLLING_NRFLAG);
+
while (1) {
while (1) {
- void (*idle)(void) = default_idle;
/* FIXME -- EV6 and LCA45 know how to power down
the CPU. */
while (!need_resched())
/* FIXME -- EV6 and LCA45 know how to power down
the CPU. */
while (!need_resched())
-
idle
();
+
cpu_relax
();
schedule();
}
}
schedule();
}
}
@@
-93,7
+95,7
@@
common_shutdown_1(void *generic_ptr)
if (cpuid != boot_cpuid) {
flags |= 0x00040000UL; /* "remain halted" */
*pflags = flags;
if (cpuid != boot_cpuid) {
flags |= 0x00040000UL; /* "remain halted" */
*pflags = flags;
- c
lear_bit(cpuid, &cpu_present_mask
);
+ c
pu_clear(cpuid, cpu_present_map
);
halt();
}
#endif
halt();
}
#endif
@@
-119,14
+121,18
@@
common_shutdown_1(void *generic_ptr)
#ifdef CONFIG_SMP
/* Wait for the secondaries to halt. */
#ifdef CONFIG_SMP
/* Wait for the secondaries to halt. */
- cpu_clear(boot_cpuid, cpu_p
ossible
_map);
- while (cpus_weight(cpu_p
ossible
_map))
+ cpu_clear(boot_cpuid, cpu_p
resent
_map);
+ while (cpus_weight(cpu_p
resent
_map))
barrier();
#endif
/* If booted from SRM, reset some of the original environment. */
if (alpha_using_srm) {
#ifdef CONFIG_DUMMY_CONSOLE
barrier();
#endif
/* If booted from SRM, reset some of the original environment. */
if (alpha_using_srm) {
#ifdef CONFIG_DUMMY_CONSOLE
+ /* If we've gotten here after SysRq-b, leave interrupt
+ context before taking over the console. */
+ if (in_interrupt())
+ irq_exit();
/* This has the effect of resetting the VGA video origin. */
take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);
#endif
/* This has the effect of resetting the VGA video origin. */
take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);
#endif
@@
-165,7
+171,6
@@
machine_restart(char *restart_cmd)
common_shutdown(LINUX_REBOOT_CMD_RESTART, restart_cmd);
}
common_shutdown(LINUX_REBOOT_CMD_RESTART, restart_cmd);
}
-EXPORT_SYMBOL(machine_restart);
void
machine_halt(void)
void
machine_halt(void)
@@
-173,7
+178,6
@@
machine_halt(void)
common_shutdown(LINUX_REBOOT_CMD_HALT, NULL);
}
common_shutdown(LINUX_REBOOT_CMD_HALT, NULL);
}
-EXPORT_SYMBOL(machine_halt);
void
machine_power_off(void)
void
machine_power_off(void)
@@
-181,7
+185,6
@@
machine_power_off(void)
common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL);
}
common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL);
}
-EXPORT_SYMBOL(machine_power_off);
/* Used by sysrq-p, among others. I don't believe r9-r15 are ever
saved in the context it's used. */
/* Used by sysrq-p, among others. I don't believe r9-r15 are ever
saved in the context it's used. */
@@
-203,6
+206,7
@@
start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp)
regs->ps = 8;
wrusp(sp);
}
regs->ps = 8;
wrusp(sp);
}
+EXPORT_SYMBOL(start_thread);
/*
* Free current thread data structures etc..
/*
* Free current thread data structures etc..
@@
-274,7
+278,7
@@
copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
{
extern void ret_from_fork(void);
{
extern void ret_from_fork(void);
- struct thread_info *childti =
p->thread_info
;
+ struct thread_info *childti =
task_thread_info(p)
;
struct pt_regs * childregs;
struct switch_stack * childstack, *stack;
unsigned long stack_offset, settls;
struct pt_regs * childregs;
struct switch_stack * childstack, *stack;
unsigned long stack_offset, settls;
@@
-283,7
+287,7
@@
copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
if (!(regs->ps & 8))
stack_offset = (PAGE_SIZE-1) & (unsigned long) regs;
childregs = (struct pt_regs *)
if (!(regs->ps & 8))
stack_offset = (PAGE_SIZE-1) & (unsigned long) regs;
childregs = (struct pt_regs *)
- (stack_offset + PAGE_SIZE +
(long) childti
);
+ (stack_offset + PAGE_SIZE +
task_stack_page(p)
);
*childregs = *regs;
settls = regs->r20;
*childregs = *regs;
settls = regs->r20;
@@
-374,6
+378,7
@@
dump_thread(struct pt_regs * pt, struct user * dump)
dump->regs[EF_A2] = pt->r18;
memcpy((char *)dump->regs + EF_SIZE, sw->fp, 32 * 8);
}
dump->regs[EF_A2] = pt->r18;
memcpy((char *)dump->regs + EF_SIZE, sw->fp, 32 * 8);
}
+EXPORT_SYMBOL(dump_thread);
/*
* Fill in the user structure for a ELF core dump.
/*
* Fill in the user structure for a ELF core dump.
@@
-422,36
+427,24
@@
dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt, struct thread_info *ti)
useful value of the thread's UNIQUE field. */
dest[32] = ti->pcb.unique;
}
useful value of the thread's UNIQUE field. */
dest[32] = ti->pcb.unique;
}
+EXPORT_SYMBOL(dump_elf_thread);
int
dump_elf_task(elf_greg_t *dest, struct task_struct *task)
{
int
dump_elf_task(elf_greg_t *dest, struct task_struct *task)
{
- struct thread_info *ti;
- struct pt_regs *pt;
-
- ti = task->thread_info;
- pt = (struct pt_regs *)((unsigned long)ti + 2*PAGE_SIZE) - 1;
-
- dump_elf_thread(dest, pt, ti);
-
+ dump_elf_thread(dest, task_pt_regs(task), task_thread_info(task));
return 1;
}
return 1;
}
+EXPORT_SYMBOL(dump_elf_task);
int
dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task)
{
int
dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task)
{
- struct thread_info *ti;
- struct pt_regs *pt;
- struct switch_stack *sw;
-
- ti = task->thread_info;
- pt = (struct pt_regs *)((unsigned long)ti + 2*PAGE_SIZE) - 1;
- sw = (struct switch_stack *)pt - 1;
-
+ struct switch_stack *sw = (struct switch_stack *)task_pt_regs(task) - 1;
memcpy(dest, sw->fp, 32 * 8);
memcpy(dest, sw->fp, 32 * 8);
-
return 1;
}
return 1;
}
+EXPORT_SYMBOL(dump_elf_task_fp);
/*
* sys_execve() executes a new program.
/*
* sys_execve() executes a new program.
@@
-488,10
+481,10
@@
out:
*/
unsigned long
*/
unsigned long
-thread_saved_pc(
task_
t *t)
+thread_saved_pc(
struct task_struc
t *t)
{
{
- unsigned long base = (unsigned long)t
->thread_info
;
- unsigned long fp, sp = t
->thread_info
->pcb.ksp;
+ unsigned long base = (unsigned long)t
ask_stack_page(t)
;
+ unsigned long fp, sp = t
ask_thread_info(t)
->pcb.ksp;
if (sp > base && sp+6*8 < base + 16*1024) {
fp = ((unsigned long*)sp)[6];
if (sp > base && sp+6*8 < base + 16*1024) {
fp = ((unsigned long*)sp)[6];
@@
-521,7
+514,7
@@
get_wchan(struct task_struct *p)
pc = thread_saved_pc(p);
if (in_sched_functions(pc)) {
pc = thread_saved_pc(p);
if (in_sched_functions(pc)) {
- schedule_frame = ((unsigned long *)
p->thread_info
->pcb.ksp)[6];
+ schedule_frame = ((unsigned long *)
task_thread_info(p)
->pcb.ksp)[6];
return ((unsigned long *)schedule_frame)[12];
}
return pc;
return ((unsigned long *)schedule_frame)[12];
}
return pc;