/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2001, 06 by Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 2001 MIPS Technologies, Inc. */ #include <linux/kernel.h> #include <linux/export.h> #include <linux/pm.h> #include <linux/types.h> #include <linux/reboot.h> #include <linux/delay.h> #include <asm/compiler.h> #include <asm/idle.h> #include <asm/mipsregs.h> #include <asm/reboot.h> /* * Urgs ... Too many MIPS machines to handle this in a generic way. * So handle all using function pointers to machine specific * functions. */ void (*_machine_restart)(char *command); void (*_machine_halt)(void); void (*pm_power_off)(void); EXPORT_SYMBOL(pm_power_off);
static void machine_hang(void) { /* * We're hanging the system so we don't want to be interrupted anymore. * Any interrupt handlers that ran would at best be useless & at worst * go awry because the system isn't in a functional state. */ local_irq_disable(); /* * Mask all interrupts, giving us a better chance of remaining in the * low power wait state. */ clear_c0_status(ST0_IM); while (true) { if (cpu_has_mips_r) { /* * We know that the wait instruction is supported so * make use of it directly, leaving interrupts * disabled. */ asm volatile( ".set push\n\t" ".set " MIPS_ISA_ARCH_LEVEL "\n\t" "wait\n\t" ".set pop"); } else if (cpu_wait) { /* * Try the cpu_wait() callback. This isn't ideal since * it'll re-enable interrupts, but that ought to be * harmless given that they're all masked. */ cpu_wait(); local_irq_disable(); } else { /* * We're going to burn some power running round the * loop, but we don't really have a choice. This isn't * a path we should expect to run for long during * typical use anyway. */ } /* * In most modern MIPS CPUs interrupts will cause the wait * instruction to graduate even when disabled, and in some * cases even when masked. In order to prevent a timer * interrupt from continuously taking us out of the low power * wait state, we clear any pending timer interrupt here. */ if (cpu_has_counter) write_c0_compare(0); } }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Paul Burton | 62 | 100.00% | 1 | 100.00% |
Total | 62 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Andrew Bresticker | 28 | 59.57% | 1 | 25.00% |
Linus Torvalds (pre-git) | 14 | 29.79% | 1 | 25.00% |
Ralf Bächle | 4 | 8.51% | 1 | 25.00% |
Paul Burton | 1 | 2.13% | 1 | 25.00% |
Total | 47 | 100.00% | 4 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Andrew Bresticker | 13 | 46.43% | 1 | 25.00% |
Linus Torvalds (pre-git) | 10 | 35.71% | 1 | 25.00% |
Ralf Bächle | 4 | 14.29% | 1 | 25.00% |
Paul Burton | 1 | 3.57% | 1 | 25.00% |
Total | 28 | 100.00% | 4 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Andrew Bresticker | 13 | 46.43% | 1 | 20.00% |
Linus Torvalds (pre-git) | 9 | 32.14% | 1 | 20.00% |
Ralf Bächle | 5 | 17.86% | 2 | 40.00% |
Paul Burton | 1 | 3.57% | 1 | 20.00% |
Total | 28 | 100.00% | 5 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Paul Burton | 74 | 32.03% | 1 | 11.11% |
Andrew Bresticker | 57 | 24.68% | 1 | 11.11% |
Linus Torvalds (pre-git) | 46 | 19.91% | 1 | 11.11% |
Linus Torvalds | 28 | 12.12% | 1 | 11.11% |
Ralf Bächle | 23 | 9.96% | 3 | 33.33% |
Arnaldo Carvalho de Melo | 2 | 0.87% | 1 | 11.11% |
Paul Gortmaker | 1 | 0.43% | 1 | 11.11% |
Total | 231 | 100.00% | 9 | 100.00% |