Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56801
b: refs/heads/master
c: f3a9022
h: refs/heads/master
i:
  56799: fcc502b
v: v3
  • Loading branch information
Paul Mundt committed May 21, 2007
1 parent 5e1dc13 commit 01775f7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 69d87daa18aced7f494bc1d5a977b063bbbdffbd
refs/heads/master: f3a9022fd187de41a04de9c5b44ff40e68c6d661
33 changes: 27 additions & 6 deletions trunk/arch/sh/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
static int hlt_counter;
int ubc_usercnt = 0;

#define HARD_IDLE_TIMEOUT (HZ / 3)

void (*pm_idle)(void);
void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);
Expand All @@ -44,16 +42,39 @@ void enable_hlt(void)
}
EXPORT_SYMBOL(enable_hlt);

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);

void default_idle(void)
{
if (!hlt_counter)
cpu_sleep();
else
cpu_relax();
if (!hlt_counter) {
clear_thread_flag(TIF_POLLING_NRFLAG);
smp_mb__after_clear_bit();
set_bl_bit();
while (!need_resched())
cpu_sleep();
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;
Expand Down

0 comments on commit 01775f7

Please sign in to comment.