Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163725
b: refs/heads/master
c: 454ede7
h: refs/heads/master
i:
  163723: b64321a
v: v3
  • Loading branch information
Thomas Gleixner committed Aug 31, 2009
1 parent 90cee88 commit a74aede
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 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: 0be6939422eb2f54df4b3d8763c569c6759c1a42
refs/heads/master: 454ede7eebf91b92ab1eafe10c6b6ed04de29bf8
8 changes: 5 additions & 3 deletions trunk/arch/x86/kernel/time_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
int timer_ack;
#endif

#ifdef CONFIG_X86_64
volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES;
#endif

unsigned long profile_pc(struct pt_regs *regs)
{
unsigned long pc = instruction_pointer(regs);
Expand All @@ -53,9 +57,7 @@ unsigned long profile_pc(struct pt_regs *regs)
EXPORT_SYMBOL(profile_pc);

/*
* This is the same as the above, except we _also_ save the current
* Time Stamp Counter value at the time of the timer interrupt, so that
* we later on can estimate the time of day more exactly.
* Default timer interrupt handler for PIT/HPET
*/
static irqreturn_t timer_interrupt(int irq, void *dev_id)
{
Expand Down
38 changes: 30 additions & 8 deletions trunk/arch/x86/kernel/time_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@
#include <asm/time.h>
#include <asm/nmi.h>

#if defined(CONFIG_X86_32) && defined(CONFIG_X86_IO_APIC)
int timer_ack;
#endif

#ifdef CONFIG_X86_64
volatile unsigned long __jiffies __section_jiffies = INITIAL_JIFFIES;
#endif

unsigned long profile_pc(struct pt_regs *regs)
{
Expand All @@ -47,8 +53,12 @@ unsigned long profile_pc(struct pt_regs *regs)
}
EXPORT_SYMBOL(profile_pc);

/*
* Default timer interrupt handler for PIT/HPET
*/
static irqreturn_t timer_interrupt(int irq, void *dev_id)
{
/* Keep nmi watchdog up to date */
inc_irq_stat(irq0_irqs);

/* Optimized out for !IO_APIC and x86_64 */
Expand All @@ -74,8 +84,10 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}

/* calibrate_cpu is used on systems with fixed rate TSCs to determine
* processor frequency */
/*
* calibrate_cpu is used on systems with fixed rate TSCs to determine
* processor frequency
*/
#define TICK_COUNT 100000000
unsigned long __init calibrate_cpu(void)
{
Expand Down Expand Up @@ -122,25 +134,35 @@ unsigned long __init calibrate_cpu(void)
return pmc_now * tsc_khz / (tsc_now - tsc_start);
}

static struct irqaction irq0 = {
.handler = timer_interrupt,
.flags = IRQF_DISABLED | IRQF_IRQPOLL | IRQF_NOBALANCING | IRQF_TIMER,
.name = "timer"
static struct irqaction irq0 = {
.handler = timer_interrupt,
.flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER,
.name = "timer"
};

void __init setup_default_timer_irq(void)
{
irq0.mask = cpumask_of_cpu(0);
setup_irq(0, &irq0);
}

/* Default timer init function */
void __init hpet_time_init(void)
{
if (!hpet_enable())
setup_pit_timer();

setup_irq(0, &irq0);
setup_default_timer_irq();
}

static void x86_late_time_init(void)
{
x86_init.timers.timer_init();
}

/*
* Initialize TSC and delay the periodic timer init to
* late x86_late_time_init() so ioremap works.
*/
void __init time_init(void)
{
tsc_init();
Expand Down

0 comments on commit a74aede

Please sign in to comment.