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 kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
arch
/
ia64
/
kernel
/
process.c
diff --git
a/arch/ia64/kernel/process.c
b/arch/ia64/kernel/process.c
index
ebb71f3
..
355d579
100644
(file)
--- a/
arch/ia64/kernel/process.c
+++ b/
arch/ia64/kernel/process.c
@@
-4,6
+4,9
@@
* Copyright (C) 1998-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
* 04/11/17 Ashok Raj <ashok.raj@intel.com> Added CPU Hotplug Support
* Copyright (C) 1998-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
* 04/11/17 Ashok Raj <ashok.raj@intel.com> Added CPU Hotplug Support
+ *
+ * 2005-10-07 Keith Owens <kaos@sgi.com>
+ * Add notify_die() hooks.
*/
#define __KERNEL_SYSCALLS__ /* see <asm/unistd.h> */
#include <linux/config.h>
*/
#define __KERNEL_SYSCALLS__ /* see <asm/unistd.h> */
#include <linux/config.h>
@@
-33,6
+36,7
@@
#include <asm/elf.h>
#include <asm/ia32.h>
#include <asm/irq.h>
#include <asm/elf.h>
#include <asm/ia32.h>
#include <asm/irq.h>
+#include <asm/kdebug.h>
#include <asm/pgalloc.h>
#include <asm/processor.h>
#include <asm/sal.h>
#include <asm/pgalloc.h>
#include <asm/processor.h>
#include <asm/sal.h>
@@
-178,7
+182,7
@@
static int can_do_pal_halt = 1;
static int __init nohalt_setup(char * str)
{
static int __init nohalt_setup(char * str)
{
- pal_halt = 0;
+ pal_halt =
can_do_pal_halt =
0;
return 1;
}
__setup("nohalt", nohalt_setup);
return 1;
}
__setup("nohalt", nohalt_setup);
@@
-195,11
+199,13
@@
update_pal_halt_status(int status)
void
default_idle (void)
{
void
default_idle (void)
{
- while (!need_resched())
+ local_irq_enable();
+ while (!need_resched()) {
if (can_do_pal_halt)
safe_halt();
else
cpu_relax();
if (can_do_pal_halt)
safe_halt();
else
cpu_relax();
+ }
}
#ifdef CONFIG_HOTPLUG_CPU
}
#ifdef CONFIG_HOTPLUG_CPU
@@
-261,16
+267,20
@@
void __attribute__((noreturn))
cpu_idle (void)
{
void (*mark_idle)(int) = ia64_mark_idle;
cpu_idle (void)
{
void (*mark_idle)(int) = ia64_mark_idle;
+ int cpu = smp_processor_id();
/* endless idle loop with no priority at all */
while (1) {
/* endless idle loop with no priority at all */
while (1) {
+ if (can_do_pal_halt)
+ clear_thread_flag(TIF_POLLING_NRFLAG);
+ else
+ set_thread_flag(TIF_POLLING_NRFLAG);
+
+ if (!need_resched()) {
+ void (*idle)(void);
#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
- if (!need_resched())
min_xtp();
#endif
min_xtp();
#endif
- while (!need_resched()) {
- void (*idle)(void);
-
if (__get_cpu_var(cpu_idle_state))
__get_cpu_var(cpu_idle_state) = 0;
if (__get_cpu_var(cpu_idle_state))
__get_cpu_var(cpu_idle_state) = 0;
@@
-282,17
+292,17
@@
cpu_idle (void)
if (!idle)
idle = default_idle;
(*idle)();
if (!idle)
idle = default_idle;
(*idle)();
- }
-
- if (mark_idle)
- (*mark_idle)(0);
-
+ if (mark_idle)
+ (*mark_idle)(0);
#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
- normal_xtp();
+
normal_xtp();
#endif
#endif
+ }
+ preempt_enable_no_resched();
schedule();
schedule();
+ preempt_disable();
check_pgt_cache();
check_pgt_cache();
- if (cpu_is_offline(
smp_processor_id()
))
+ if (cpu_is_offline(
cpu
))
play_dead();
}
}
play_dead();
}
}
@@
-317,7
+327,7
@@
ia64_save_extra (struct task_struct *task)
#endif
#ifdef CONFIG_IA32_SUPPORT
#endif
#ifdef CONFIG_IA32_SUPPORT
- if (IS_IA32_PROCESS(
ia64_task
_regs(task)))
+ if (IS_IA32_PROCESS(
task_pt
_regs(task)))
ia32_save_state(task);
#endif
}
ia32_save_state(task);
#endif
}
@@
-342,7
+352,7
@@
ia64_load_extra (struct task_struct *task)
#endif
#ifdef CONFIG_IA32_SUPPORT
#endif
#ifdef CONFIG_IA32_SUPPORT
- if (IS_IA32_PROCESS(
ia64_task
_regs(task)))
+ if (IS_IA32_PROCESS(
task_pt
_regs(task)))
ia32_load_state(task);
#endif
}
ia32_load_state(task);
#endif
}
@@
-477,7
+487,7
@@
copy_thread (int nr, unsigned long clone_flags,
* If we're cloning an IA32 task then save the IA32 extra
* state from the current task to the new task
*/
* If we're cloning an IA32 task then save the IA32 extra
* state from the current task to the new task
*/
- if (IS_IA32_PROCESS(
ia64_task
_regs(current))) {
+ if (IS_IA32_PROCESS(
task_pt
_regs(current))) {
ia32_save_state(p);
if (clone_flags & CLONE_SETTLS)
retval = ia32_clone_tls(p, child_ptregs);
ia32_save_state(p);
if (clone_flags & CLONE_SETTLS)
retval = ia32_clone_tls(p, child_ptregs);
@@
-690,7
+700,7
@@
int
kernel_thread_helper (int (*fn)(void *), void *arg)
{
#ifdef CONFIG_IA32_SUPPORT
kernel_thread_helper (int (*fn)(void *), void *arg)
{
#ifdef CONFIG_IA32_SUPPORT
- if (IS_IA32_PROCESS(
ia64_task
_regs(current))) {
+ if (IS_IA32_PROCESS(
task_pt
_regs(current))) {
/* A kernel thread is always a 64-bit process. */
current->thread.map_base = DEFAULT_MAP_BASE;
current->thread.task_size = DEFAULT_TASK_SIZE;
/* A kernel thread is always a 64-bit process. */
current->thread.map_base = DEFAULT_MAP_BASE;
current->thread.task_size = DEFAULT_TASK_SIZE;
@@
-710,8
+720,13
@@
flush_thread (void)
/* drop floating-point and debug-register state if it exists: */
current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);
ia64_drop_fpu(current);
/* drop floating-point and debug-register state if it exists: */
current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);
ia64_drop_fpu(current);
- if (IS_IA32_PROCESS(ia64_task_regs(current)))
+#ifdef CONFIG_IA32_SUPPORT
+ if (IS_IA32_PROCESS(task_pt_regs(current))) {
ia32_drop_partial_page_list(current);
ia32_drop_partial_page_list(current);
+ current->thread.task_size = IA32_PAGE_OFFSET;
+ set_fs(USER_DS);
+ }
+#endif
}
/*
}
/*
@@
-721,6
+736,7
@@
flush_thread (void)
void
exit_thread (void)
{
void
exit_thread (void)
{
+
ia64_drop_fpu(current);
#ifdef CONFIG_PERFMON
/* if needed, stop monitoring and flush state to perfmon context */
ia64_drop_fpu(current);
#ifdef CONFIG_PERFMON
/* if needed, stop monitoring and flush state to perfmon context */
@@
-731,7
+747,7
@@
exit_thread (void)
if (current->thread.flags & IA64_THREAD_DBG_VALID)
pfm_release_debug_registers(current);
#endif
if (current->thread.flags & IA64_THREAD_DBG_VALID)
pfm_release_debug_registers(current);
#endif
- if (IS_IA32_PROCESS(
ia64_task
_regs(current)))
+ if (IS_IA32_PROCESS(
task_pt
_regs(current)))
ia32_drop_partial_page_list(current);
}
ia32_drop_partial_page_list(current);
}
@@
-787,19
+803,17
@@
cpu_halt (void)
void
machine_restart (char *restart_cmd)
{
void
machine_restart (char *restart_cmd)
{
+ (void) notify_die(DIE_MACHINE_RESTART, restart_cmd, NULL, 0, 0, 0);
(*efi.reset_system)(EFI_RESET_WARM, 0, 0, NULL);
}
(*efi.reset_system)(EFI_RESET_WARM, 0, 0, NULL);
}
-EXPORT_SYMBOL(machine_restart);
-
void
machine_halt (void)
{
void
machine_halt (void)
{
+ (void) notify_die(DIE_MACHINE_HALT, "", NULL, 0, 0, 0);
cpu_halt();
}
cpu_halt();
}
-EXPORT_SYMBOL(machine_halt);
-
void
machine_power_off (void)
{
void
machine_power_off (void)
{
@@
-808,4
+822,3
@@
machine_power_off (void)
machine_halt();
}
machine_halt();
}
-EXPORT_SYMBOL(machine_power_off);