Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79698
b: refs/heads/master
c: 1a0c009
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Jan 30, 2008
1 parent c05cacd commit e56fd24
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4713e22ce81eb8b3353e16435362eb3d0ec95640
refs/heads/master: 1a0c009ac53de4a7664a1239936f0bc258133156
19 changes: 19 additions & 0 deletions trunk/arch/x86/kernel/i8253.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
DEFINE_SPINLOCK(i8253_lock);
EXPORT_SYMBOL(i8253_lock);

#ifdef CONFIG_X86_32
static void pit_disable_clocksource(void);
#else
static inline void pit_disable_clocksource(void) { }
#endif

/*
* HPET replaces the PIT, when enabled. So we need to know, which of
* the two timers is used
Expand Down Expand Up @@ -52,11 +58,13 @@ static void init_pit_timer(enum clock_event_mode mode,
outb_p(0, PIT_CH0);
outb_p(0, PIT_CH0);
}
pit_disable_clocksource();
break;

case CLOCK_EVT_MODE_ONESHOT:
/* One shot setup */
outb_p(0x38, PIT_MODE);
pit_disable_clocksource();
break;

case CLOCK_EVT_MODE_RESUME:
Expand Down Expand Up @@ -196,6 +204,17 @@ static struct clocksource clocksource_pit = {
.shift = 20,
};

static void pit_disable_clocksource(void)
{
/*
* Use mult to check whether it is registered or not
*/
if (clocksource_pit.mult) {
clocksource_unregister(&clocksource_pit);
clocksource_pit.mult = 0;
}
}

static int __init init_pit_clocksource(void)
{
/*
Expand Down

0 comments on commit e56fd24

Please sign in to comment.