Skip to contentSkip to conversation

platform hook for timer_interrupt()

PATCH New Martin Hicks 1 participant 1 message Sep 3, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform hook for timer_interrupt()

Hello,

SGI has a need to run platform specific code during the timer interrupt. Attached are patches for both 2.4 and 2.6 that add a hook inside the timer interrupt that will run platform specific code if required.

Any opinions on this?
mh

Signature · 1 line
Wild Open Source Inc.                  [email protected]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1082 -> 1.1083
# arch/ia64/kernel/time.c 1.8 -> 1.9
# arch/ia64/sn/kernel/setup.c 1.9 -> 1.10
# arch/ia64/sn/kernel/sn2/Makefile 1.4 -> 1.5
# (new) -> 1.1 arch/ia64/sn/kernel/sn2/timer_interrupt.c
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/29 [email protected] 1.1083
# Add a hook so that ia64-platform specific code can be run from within timer_interrupt() # --------------------------------------------
#

arch/ia64/kernel/time.c +5 -0
diff -Nru a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
@@ -27,6 +27,8 @@
 extern unsigned long wall_jiffies;
 extern unsigned long last_time_offset;
 
+void (*ia64_platform_timer_extras)(void);
+
 #ifdef CONFIG_IA64_DEBUG_IRQ
 
 unsigned long last_cli_ip;
@@ -148,6 +150,9 @@
 timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long new_itm;
+
+	if (ia64_platform_timer_extras)
+	     (*ia64_platform_timer_extras)();
 
 	new_itm = local_cpu_data->itm_next;
 
arch/ia64/sn/kernel/setup.c +4 -0
diff -Nru a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
@@ -80,6 +80,8 @@
 extern void sn_timer_init(void);
 extern unsigned long last_time_offset;
 extern void (*ia64_mark_idle)(int);
+extern void (*ia64_platform_timer_extras)(void);
+extern void sn_timer_interrupt_extras(void);
 extern void snidle(int);
 
 unsigned long sn_rtc_cycles_per_second;   
@@ -315,6 +317,8 @@
 	init_smp_config();
 #endif
 	screen_info = sn_screen_info;
+
+	ia64_platform_timer_extras = &sn_timer_interrupt_extras;
 
 	sn_timer_init();
 }
arch/ia64/sn/kernel/sn2/Makefile +1 -1
diff -Nru a/arch/ia64/sn/kernel/sn2/Makefile b/arch/ia64/sn/kernel/sn2/Makefile
@@ -44,6 +44,6 @@
 export-objs	:= io.o
 
 obj-y		= cache.o io.o ptc_deadlock.o sn2_smp.o sn_proc_fs.o \
-		  prominfo_proc.o timer.o
+		  prominfo_proc.o timer.o timer_interrupt.o
 
 include $(TOPDIR)/Rules.make
arch/ia64/sn/kernel/sn2/timer_interrupt.c new file +60 -0

60 lines not on this page · raw message

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1298 -> 1.1299
# arch/ia64/kernel/time.c 1.31 -> 1.32
# arch/ia64/sn/kernel/setup.c 1.18 -> 1.19
# arch/ia64/sn/kernel/sn2/Makefile 1.12 -> 1.13
# (new) -> 1.1 arch/ia64/sn/kernel/sn2/timer_interrupt.c
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/29 [email protected] 1.1299
# Add a hook so that ia64-platform specific code can be run from within timer_interrupt() # --------------------------------------------
#

arch/ia64/kernel/time.c +5 -0
diff -Nru a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
@@ -32,6 +32,8 @@
 
 #define TIME_KEEPER_ID	0	/* smp_processor_id() of time-keeper */
 
+void (*ia64_platform_timer_extras)(void);
+
 #ifdef CONFIG_IA64_DEBUG_IRQ
 
 unsigned long last_cli_ip;
@@ -203,6 +205,9 @@
 timer_interrupt (int irq, void *dev_id, struct pt_regs *regs)
 {
 	unsigned long new_itm;
+
+	if (ia64_platform_timer_extras)
+	     (*ia64_platform_timer_extras)();
 
 	new_itm = local_cpu_data->itm_next;
 
arch/ia64/sn/kernel/setup.c +4 -0
diff -Nru a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
@@ -83,6 +83,9 @@
 extern void sn_timer_init(void);
 extern unsigned long last_time_offset;
 extern void (*ia64_mark_idle)(int);
+extern void (*ia64_platform_timer_extras)(void);
+extern void sn_timer_interrupt_extras(void);
 extern void snidle(int);
 
 unsigned long sn_rtc_cycles_per_second;   
@@ -318,6 +321,8 @@
 	init_smp_config();
 #endif
 	screen_info = sn_screen_info;
+
+	ia64_platform_timer_extras = &sn_timer_interrupt_extras;
 
 	sn_timer_init();
 }
arch/ia64/sn/kernel/sn2/Makefile +1 -1
diff -Nru a/arch/ia64/sn/kernel/sn2/Makefile b/arch/ia64/sn/kernel/sn2/Makefile
@@ -12,4 +12,4 @@
 EXTRA_CFLAGS := -DLITTLE_ENDIAN
 
 obj-y += cache.o io.o ptc_deadlock.o sn2_smp.o sn_proc_fs.o \
-	 prominfo_proc.o timer.o
+	 prominfo_proc.o timer.o timer_interrupt.o
arch/ia64/sn/kernel/sn2/timer_interrupt.c new file +60 -0

60 lines not on this page · raw message