Skip to contentSkip to conversation

Timer interrupt cleanups [1/3] - global timer

PATCH New Martin J. Bligh 1 participant 1 message Jan 6, 2003 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Timer interrupt cleanups [1/3] - global timer

This patch renames:

do_timer                  -> do_global_timer
do_timer_interrupt_hook   -> do_global_timer_interrupt_hook
do_timer_interrupt        -> do_global_timer_interrupt
timer_interrupt           -> global_timer_interrupt

--------------------

Assuming we're SMP with a local apic timer all firing away:

global_timer_interrupt

	do_global_timer_interrupt
		{ack the interrupt}
		do_global_timer_interrupt_hook
			do_global_timer
				jiffies_64++;
				update_times
		{update CMOS clock}    (In the interrupt still ??!!)

apic_timer_interrupt

	smp_apic_timer_interrupt
		{ack the interrupt}
		smp_local_timer_interrupt
			x86_do_profile
			update_process_times

--------------------

On UP with local apic timer:

global_timer_interrupt

	do_global_timer_interrupt
		{ack the interrupt}
		do_global_timer_interrupt_hook
			do_global_timer
				jiffies_64++;
				update_process_times
				update_times
		{update CMOS clock}    (In the interrupt still ??!!)

apic_timer_interrupt

	smp_apic_timer_interrupt
		{ack the interrupt}
		smp_local_timer_interrupt
			x86_do_profile

--------------------

On a UP 386 with stale crusty breadcrumbs, and no local timer:

global_timer_interrupt

	do_global_timer_interrupt
		{ack the interrupt}
		do_global_timer_interrupt_hook
			do_global_timer
				jiffies_64++;
				update_process_times
				update_times
			x86_do_profile()
		{update CMOS clock}    (In the interrupt still ??!!)

--------------------

arch/i386/kernel/io_apic.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/arch/i386/kernel/io_apic.c 01-rename_global_timer/arch/i386/kernel/io_apic.c
@@ -1612,7 +1612,7 @@ static inline void check_timer(void)
	set_intr_gate(vector, interrupt[0]);

	/*

- * Subtle, code in do_timer_interrupt() expects an AEOI
+ * Subtle, code in do_global_timer_interrupt() expects an AEOI
* mode for the 8259A whenever interrupts are routed
* through I/O APICs. Also IRQ0 has to be enabled in
* the 8259A which implies the virtual wire has to be

arch/i386/kernel/time.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/arch/i386/kernel/time.c 01-rename_global_timer/arch/i386/kernel/time.c
@@ -209,10 +209,10 @@ static long last_rtc_update;

int timer_ack;

/*
- * timer_interrupt() needs to keep up the real-time clock,
- * as well as call the "do_timer()" routine every clocktick
+ * global_timer_interrupt() needs to keep up the real-time clock,
+ * as well as call the "do_global_timer()" routine every clocktick
*/
-static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static inline void do_global_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) {

#ifdef CONFIG_X86_IO_APIC
	if (timer_ack) {
@@ -230,7 +230,7 @@ static inline void do_timer_interrupt(in
	}

#endif

- do_timer_interrupt_hook(regs);
+ do_global_timer_interrupt_hook(regs);

	/*
	 * If we have an externally synchronized Linux clock, then update

@@ -269,7 +269,7 @@ static inline void do_timer_interrupt(in
* Time Stamp Counter value at the time of the timer interrupt, so that
* we later on can estimate the time of day more exactly.
*/
-void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +void global_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)

{
	/*
	 * Here we are in the timer irq handler. We just have irqs locally

@@ -282,7 +282,7 @@ void timer_interrupt(int irq, void *dev_

	timer->mark_offset();

- do_timer_interrupt(irq, NULL, regs);
+ do_global_timer_interrupt(irq, NULL, regs);

	write_unlock(&xtime_lock);
arch/i386/mach-default/setup.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/arch/i386/mach-default/setup.c 01-rename_global_timer/arch/i386/mach-default/setup.c
@@ -69,7 +69,7 @@ void __init trap_init_hook(void)

{
}

-static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL}; +static struct irqaction irq0 = { global_timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};

/**
* time_init_hook - do any specific initialisations for the system timer.

arch/i386/mach-visws/setup.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/arch/i386/mach-visws/setup.c 01-rename_global_timer/arch/i386/mach-visws/setup.c
@@ -150,7 +150,7 @@ void __init pre_setup_arch_hook()
{
	visws_get_board_type_and_rev();
}

-static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL}; +static struct irqaction irq0 = { global_timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};

void __init time_init_hook(void)
{

arch/i386/mach-voyager/setup.c +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/arch/i386/mach-voyager/setup.c 01-rename_global_timer/arch/i386/mach-voyager/setup.c
@@ -38,7 +38,7 @@ void __init trap_init_hook(void)

{
}

-static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL}; +static struct irqaction irq0 = { global_timer_interrupt, SA_INTERRUPT, 0, "timer", NULL, NULL};

void __init time_init_hook(void)
{

include/asm-i386/arch_hooks.h +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/include/asm-i386/arch_hooks.h 01-rename_global_timer/include/asm-i386/arch_hooks.h
@@ -12,7 +12,7 @@

extern void init_ISA_irqs(void);
extern void apic_intr_init(void);
extern void smp_intr_init(void);
-extern void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs); +extern void global_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs);

/* these are the defined hooks */
extern void intr_init_hook(void);

include/asm-i386/mach-default/do_timer.h +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/include/asm-i386/mach-default/do_timer.h 01-rename_global_timer/include/asm-i386/mach-default/do_timer.h
@@ -3,7 +3,7 @@

#include <asm/apic.h>

/**
- * do_timer_interrupt_hook - hook into timer tick
+ * do_global_timer_interrupt_hook - hook into timer tick
* @regs: standard registers from interrupt
*
* Description:
@@ -13,9 +13,9 @@
* timer interrupt as a means of triggering reschedules etc.
**/

-static inline void do_timer_interrupt_hook(struct pt_regs *regs) +static inline void do_global_timer_interrupt_hook(struct pt_regs *regs) {
- do_timer(regs);
+ do_global_timer(regs);
/*
* In the SMP case we use the local APIC timer interrupt to do the
* profiling, except when we simulate SMP mode on a uniprocessor
@@ -50,7 +50,7 @@ static inline int do_timer_overflow(int

	spin_lock(&i8259A_lock);
	/*
	 * This is tricky when I/O APICs are used;
-	 * see do_timer_interrupt().
+	 * see do_global_timer_interrupt().
	 */
	i = inb(0x20);
	spin_unlock(&i8259A_lock);
include/asm-i386/mach-visws/do_timer.h +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/include/asm-i386/mach-visws/do_timer.h 01-rename_global_timer/include/asm-i386/mach-visws/do_timer.h
@@ -3,12 +3,12 @@

#include <asm/fixmap.h>
#include <asm/cobalt.h>

-static inline void do_timer_interrupt_hook(struct pt_regs *regs) +static inline void do_global_timer_interrupt_hook(struct pt_regs *regs)

{
	/* Clear the interrupt */
	co_cpu_write(CO_CPU_STAT,co_cpu_read(CO_CPU_STAT) & ~CO_STAT_TIMEINTR);

- do_timer(regs);
+ do_global_timer(regs);
/*
* In the SMP case we use the local APIC timer interrupt to do the
* profiling, except when we simulate SMP mode on a uniprocessor
@@ -29,7 +29,7 @@ static inline int do_timer_overflow(int

	spin_lock(&i8259A_lock);
	/*
	 * This is tricky when I/O APICs are used;
-	 * see do_timer_interrupt().
+	 * see do_global_timer_interrupt().
	 */
	i = inb(0x20);
	spin_unlock(&i8259A_lock);
include/asm-i386/mach-voyager/do_timer.h +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/include/asm-i386/mach-voyager/do_timer.h 01-rename_global_timer/include/asm-i386/mach-voyager/do_timer.h
@@ -1,9 +1,9 @@

/* defines for inline arch setup functions */
#include <asm/voyager.h>

-static inline void do_timer_interrupt_hook(struct pt_regs *regs) +static inline void do_global_timer_interrupt_hook(struct pt_regs *regs) {
- do_timer(regs);
+ do_global_timer(regs);

	voyager_timer_interrupt(regs);
}
include/linux/sched.h +0 -0
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/include/linux/sched.h 01-rename_global_timer/include/linux/sched.h
@@ -481,7 +481,7 @@ extern void free_uid(struct user_struct
 

extern unsigned long itimer_ticks;
extern unsigned long itimer_next;
-extern void do_timer(struct pt_regs *);
+extern void do_global_timer(struct pt_regs *);

extern int FASTCALL(wake_up_process(struct task_struct * tsk)); extern void FASTCALL(wake_up_forked_process(struct task_struct * tsk));

kernel/timer.c +1 -1
diff -urpN -X /home/fletch/.diff.exclude 00-virgin/kernel/timer.c 01-rename_global_timer/kernel/timer.c
@@ -803,7 +803,7 @@ static inline void update_times(void)
 * jiffies is defined in the linker script...
 */
 
-void do_timer(struct pt_regs *regs)
+void do_global_timer(struct pt_regs *regs)
{
	jiffies_64++;

#ifndef CONFIG_SMP