/* * Power off function, if any
*/ void (*pm_power_off)(void) = machine_power_off;
EXPORT_SYMBOL(pm_power_off);
#ifdef CONFIG_ALPHA_WTINT /* * Sleep the CPU. * EV6, LCA45 and QEMU know how to power down, skipping N timer interrupts.
*/ void arch_cpu_idle(void)
{
wtint(0);
}
if (how->mode == LINUX_REBOOT_CMD_RESTART) { if (!how->restart_cmd) {
flags |= 0x00020000UL; /* "cold bootstrap" */
} else { /* For SRM, we could probably set environment variables to get this to work. We'd have to delay this until after srm_paging_stop unless we ever got srm_fixup working.
At the moment, SRM will use the last boot device, but the file and flags will be the defaults, when
doing a "warm" bootstrap. */
flags |= 0x00030000UL; /* "warm bootstrap" */
}
} else {
flags |= 0x00040000UL; /* "remain halted" */
}
*pflags = flags;
#ifdef CONFIG_SMP /* Wait for the secondaries to halt. */
set_cpu_present(boot_cpuid, false);
set_cpu_possible(boot_cpuid, false); while (!cpumask_empty(cpu_present_mask))
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_hardirq())
irq_exit(); /* This has the effect of resetting the VGA video origin. */
console_lock();
do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);
console_unlock(); #endif
pci_restore_srm_config();
set_hae(srm_hae);
}
if (alpha_mv.kill_arch)
alpha_mv.kill_arch(how->mode);
if (! alpha_using_srm && how->mode != LINUX_REBOOT_CMD_RESTART) { /* Unfortunately, since MILO doesn't currently understand the hwrpb bits above, we can't reliably halt the
processor and keep it halted. So just loop. */ return;
}
void
flush_thread(void)
{ /* Arrange for each exec'ed process to start off with a clean slate
with respect to the FPU. This is all exceptions disabled. */
current_thread_info()->ieee_state = 0;
wrfpcr(FPCR_DYN_NORMAL | ieee_swcr_to_fpcr(0));
/* Clean slate for TLS. */
current_thread_info()->pcb.unique = 0;
}
if (unlikely(args->fn)) { /* kernel thread */
memset(childstack, 0, sizeof(struct switch_stack) + sizeof(struct pt_regs));
childstack->r26 = (unsignedlong) ret_from_kernel_thread;
childstack->r9 = (unsignedlong) args->fn;
childstack->r10 = (unsignedlong) args->fn_arg;
childregs->hae = alpha_mv.hae_cache;
memset(childti->fp, '\0', sizeof(childti->fp));
childti->pcb.usp = 0; return 0;
} /* Note: if CLONE_SETTLS is not set, then we must inherit the value from the parent, which will have been set by the block copy in dup_task_struct. This is non-intuitive, but is required for proper operation in the case of a threaded
application calling fork. */ if (clone_flags & CLONE_SETTLS)
childti->pcb.unique = tls; else
regs->r20 = 0; /* OSF/1 has some strange fork() semantics. */
childti->pcb.usp = usp ?: rdusp();
*childregs = *regs;
childregs->r0 = 0;
childregs->r19 = 0;
childregs->r20 = 1; /* OSF/1 has some strange fork() semantics. */
stack = ((struct switch_stack *) regs) - 1;
*childstack = *stack;
childstack->r26 = (unsignedlong) ret_from_fork; return 0;
}
/* * Fill in the user structure for a ELF core dump.
*/ void
dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt, struct thread_info *ti)
{ /* switch stack follows right below pt_regs: */ struct switch_stack * sw = ((struct switch_stack *) pt) - 1;
/* Once upon a time this was the PS value. Which is stupid since that is always 8 for usermode. Usurped for the more
useful value of the thread's UNIQUE field. */
dest[32] = ti->pcb.unique;
}
EXPORT_SYMBOL(dump_elf_thread);
/* * Return saved PC of a blocked thread. This assumes the frame * pointer is the 6th saved long on the kernel stack and that the * saved return address is the first long in the frame. This all * holds provided the thread blocked through a call to schedule() ($15 * is the frame pointer in schedule() and $15 is saved at offset 48 by * entry.S:do_switch_stack). * * Under heavy swap load I've seen this lose in an ugly way. So do * some extra sanity checking on the ranges we expect these pointers * to be in so that we can fail gracefully. This is just for ps after * all. -- r~
*/
/* * This one depends on the frame size of schedule(). Do a * "disass schedule" in gdb to find the frame size. Also, the * code assumes that sleep_on() follows immediately after * interruptible_sleep_on() and that add_timer() follows * immediately after interruptible_sleep(). Ugly, isn't it? * Maybe adding a wchan field to task_struct would be better, * after all...
*/
pc = thread_saved_pc(p); if (in_sched_functions(pc)) {
schedule_frame = ((unsignedlong *)task_thread_info(p)->pcb.ksp)[6]; return ((unsignedlong *)schedule_frame)[12];
} return pc;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.