-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 120079 b: refs/heads/master c: 1da1180 h: refs/heads/master i: 120077: 6477c95 120075: 39673d3 120071: 711bede 120063: e1b490c v: v3
- Loading branch information
Paul Mundt
committed
Dec 22, 2008
1 parent
a986ab7
commit bc093e2
Showing
6 changed files
with
84 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: eb67cf14ae5c21609c200859d6f3eba71c591569 | ||
refs/heads/master: 1da1180c6e28cf21be356e2701978727558fa198 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* The idle loop for all SuperH platforms. | ||
* | ||
* Copyright (C) 2002 - 2008 Paul Mundt | ||
* | ||
* 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. | ||
*/ | ||
#include <linux/module.h> | ||
#include <linux/init.h> | ||
#include <linux/mm.h> | ||
#include <linux/pm.h> | ||
#include <linux/tick.h> | ||
#include <linux/preempt.h> | ||
#include <linux/thread_info.h> | ||
#include <linux/irqflags.h> | ||
#include <asm/pgalloc.h> | ||
#include <asm/system.h> | ||
#include <asm/atomic.h> | ||
|
||
static int hlt_counter; | ||
void (*pm_idle)(void); | ||
void (*pm_power_off)(void); | ||
EXPORT_SYMBOL(pm_power_off); | ||
|
||
static int __init nohlt_setup(char *__unused) | ||
{ | ||
hlt_counter = 1; | ||
return 1; | ||
} | ||
__setup("nohlt", nohlt_setup); | ||
|
||
static int __init hlt_setup(char *__unused) | ||
{ | ||
hlt_counter = 0; | ||
return 1; | ||
} | ||
__setup("hlt", hlt_setup); | ||
|
||
static void default_idle(void) | ||
{ | ||
if (!hlt_counter) { | ||
clear_thread_flag(TIF_POLLING_NRFLAG); | ||
smp_mb__after_clear_bit(); | ||
set_bl_bit(); | ||
stop_critical_timings(); | ||
|
||
while (!need_resched()) | ||
cpu_sleep(); | ||
|
||
start_critical_timings(); | ||
clear_bl_bit(); | ||
set_thread_flag(TIF_POLLING_NRFLAG); | ||
} else | ||
while (!need_resched()) | ||
cpu_relax(); | ||
} | ||
|
||
void cpu_idle(void) | ||
{ | ||
set_thread_flag(TIF_POLLING_NRFLAG); | ||
|
||
/* endless idle loop with no priority at all */ | ||
while (1) { | ||
void (*idle)(void) = pm_idle; | ||
|
||
if (!idle) | ||
idle = default_idle; | ||
|
||
tick_nohz_stop_sched_tick(1); | ||
while (!need_resched()) | ||
idle(); | ||
tick_nohz_restart_sched_tick(); | ||
|
||
preempt_enable_no_resched(); | ||
schedule(); | ||
preempt_disable(); | ||
check_pgt_cache(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters