Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3610
b: refs/heads/master
c: 2ea8339
h: refs/heads/master
v: v3
  • Loading branch information
Russell King authored and Russell King committed Jun 27, 2005
1 parent 43b175b commit 7331ded
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 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: 99bcc0590806c4f7a4ecf1a11add335b56cde963
refs/heads/master: 2ea83398b75309d8fdc999c4bb252e72d7e4fd9d
5 changes: 4 additions & 1 deletion trunk/arch/arm/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <asm/leds.h>
#include <asm/processor.h>
#include <asm/uaccess.h>
#include <asm/mach/time.h>

extern const char *processor_modes[];
extern void setup_mm_for_reboot(char mode);
Expand Down Expand Up @@ -85,8 +86,10 @@ EXPORT_SYMBOL(pm_power_off);
void default_idle(void)
{
local_irq_disable();
if (!need_resched() && !hlt_counter)
if (!need_resched() && !hlt_counter) {
timer_dyn_reprogram();
arch_idle();
}
local_irq_enable();
}

Expand Down
10 changes: 7 additions & 3 deletions trunk/arch/arm/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,19 @@ static int timer_dyn_tick_disable(void)
return ret;
}

/*
* Reprogram the system timer for at least the calculated time interval.
* This function should be called from the idle thread with IRQs disabled,
* immediately before sleeping.
*/
void timer_dyn_reprogram(void)
{
struct dyn_tick_timer *dyn_tick = system_timer->dyn_tick;
unsigned long flags;

write_seqlock_irqsave(&xtime_lock, flags);
write_seqlock(&xtime_lock);
if (dyn_tick->state & DYN_TICK_ENABLED)
dyn_tick->reprogram(next_timer_interrupt() - jiffies);
write_sequnlock_irqrestore(&xtime_lock, flags);
write_sequnlock(&xtime_lock);
}

static ssize_t timer_show_dyn_tick(struct sys_device *dev, char *buf)
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-arm/mach/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ struct dyn_tick_timer {
};

void timer_dyn_reprogram(void);
#else
#define timer_dyn_reprogram() do { } while (0)
#endif

extern struct sys_timer *system_timer;
Expand Down

0 comments on commit 7331ded

Please sign in to comment.