From: Dimitri Sivanich <sivanich@sgi.com>
To: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Cc: Dimitri Sivanich <sivanich@sgi.com>
Subject: [PATCH 2/2 v3] SGI RTC: add RTC system interrupt
Date: Thu, 23 Oct 2008 22:11:27 -0500 [thread overview]
Message-ID: <20081024031127.GA25165@sgi.com> (raw)
In-Reply-To: <20081023163414.GB14815@sgi.com>
This patch allocates a system interrupt vector for architecture specific
use in implementing RTC timer interrupts.
Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
---
Note that this version (v3) was created simply to apply on top of the changes
brought about by the move from include/asm-x86 to arch/x86/include/asm:
http://lkml.org/lkml/2008/10/23/63
No changes to the other patch in this set were required.
arch/x86/include/asm/genapic_64.h | 2 +
arch/x86/include/asm/hw_irq.h | 1
arch/x86/include/asm/irq_vectors.h | 1
arch/x86/kernel/entry_64.S | 4 +++
arch/x86/kernel/genx2apic_uv_x.c | 41 +++++++++++++++++++++++++++++++++
arch/x86/kernel/irqinit_64.c | 3 ++
6 files changed, 52 insertions(+)
Index: linux/arch/x86/kernel/entry_64.S
===================================================================
--- linux.orig/arch/x86/kernel/entry_64.S 2008-10-23 21:45:08.000000000 -0500
+++ linux/arch/x86/kernel/entry_64.S 2008-10-23 21:48:12.000000000 -0500
@@ -858,6 +858,10 @@ ENTRY(apic_timer_interrupt)
apicinterrupt LOCAL_TIMER_VECTOR,smp_apic_timer_interrupt
END(apic_timer_interrupt)
+ENTRY(uv_rtc_timer_intr)
+ apicinterrupt RTC_TIMER_VECTOR,uv_rtc_timer_interrupt
+END(uv_rtc_timer_intr)
+
ENTRY(uv_bau_message_intr1)
apicinterrupt 220,uv_bau_message_interrupt
END(uv_bau_message_intr1)
Index: linux/arch/x86/kernel/irqinit_64.c
===================================================================
--- linux.orig/arch/x86/kernel/irqinit_64.c 2008-10-23 21:45:08.000000000 -0500
+++ linux/arch/x86/kernel/irqinit_64.c 2008-10-23 21:48:12.000000000 -0500
@@ -201,6 +201,9 @@ static void __init apic_intr_init(void)
/* self generated IPI for local APIC timer */
alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
+ /* IPI for RTC timers */
+ alloc_intr_gate(RTC_TIMER_VECTOR, uv_rtc_timer_intr);
+
/* IPI vectors for APIC spurious and error interrupts */
alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
Index: linux/arch/x86/kernel/genx2apic_uv_x.c
===================================================================
--- linux.orig/arch/x86/kernel/genx2apic_uv_x.c 2008-10-23 21:46:38.000000000 -0500
+++ linux/arch/x86/kernel/genx2apic_uv_x.c 2008-10-23 21:48:12.000000000 -0500
@@ -22,6 +22,7 @@
#include <asm/ipi.h>
#include <asm/genapic.h>
#include <asm/pgtable.h>
+#include <asm/idle.h>
#include <asm/uv/uv_mmrs.h>
#include <asm/uv/uv_hub.h>
#include <asm/uv/bios.h>
@@ -356,6 +357,46 @@ static __init void uv_rtc_init(void)
sn_rtc_cycles_per_second = ticks_per_sec;
}
+/* Function pointer for RTC interrupt handling */
+static void (*uv_rtc_interrupt_extension)(void);
+
+int
+uv_rtc_reg_extension(void (*fn)(void))
+{
+ if (uv_rtc_interrupt_extension)
+ return 1;
+
+ uv_rtc_interrupt_extension = fn;
+ return 0;
+}
+EXPORT_SYMBOL_GPL(uv_rtc_reg_extension);
+
+void
+uv_rtc_unreg_extension(void)
+{
+ if (uv_rtc_interrupt_extension)
+ uv_rtc_interrupt_extension = NULL;
+}
+EXPORT_SYMBOL_GPL(uv_rtc_unreg_extension);
+
+void uv_rtc_timer_interrupt(struct pt_regs *regs)
+{
+ struct pt_regs *old_regs = set_irq_regs(regs);
+
+ ack_APIC_irq();
+
+ exit_idle();
+
+ irq_enter();
+
+ if (uv_rtc_interrupt_extension)
+ uv_rtc_interrupt_extension();
+
+ irq_exit();
+
+ set_irq_regs(old_regs);
+}
+
/*
* Called on each cpu to initialize the per_cpu UV data area.
* ZZZ hotplug not supported yet
Index: linux/arch/x86/include/asm/irq_vectors.h
===================================================================
--- linux.orig/arch/x86/include/asm/irq_vectors.h 2008-10-23 21:45:08.000000000 -0500
+++ linux/arch/x86/include/asm/irq_vectors.h 2008-10-23 21:50:14.000000000 -0500
@@ -85,6 +85,7 @@
* sources per level' errata.
*/
#define LOCAL_TIMER_VECTOR 0xef
+#define RTC_TIMER_VECTOR 0xee
/*
* First APIC vector available to drivers: (vectors 0x30-0xee) we
Index: linux/arch/x86/include/asm/hw_irq.h
===================================================================
--- linux.orig/arch/x86/include/asm/hw_irq.h 2008-10-23 21:45:08.000000000 -0500
+++ linux/arch/x86/include/asm/hw_irq.h 2008-10-23 21:54:05.000000000 -0500
@@ -29,6 +29,7 @@
/* Interrupt handlers registered during init_IRQ */
extern void apic_timer_interrupt(void);
+extern void uv_rtc_timer_intr(void);
extern void error_interrupt(void);
extern void spurious_interrupt(void);
extern void thermal_interrupt(void);
Index: linux/arch/x86/include/asm/genapic_64.h
===================================================================
--- linux.orig/arch/x86/include/asm/genapic_64.h 2008-10-23 21:45:08.000000000 -0500
+++ linux/arch/x86/include/asm/genapic_64.h 2008-10-23 21:54:59.000000000 -0500
@@ -49,6 +49,8 @@ extern int is_uv_system(void);
extern struct genapic apic_x2apic_uv_x;
DECLARE_PER_CPU(int, x2apic_extra_bits);
+extern int uv_rtc_reg_extension(void (*fn)(void));
+extern void uv_rtc_unreg_extension(void);
extern void uv_cpu_init(void);
extern void uv_system_init(void);
extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip);
next prev parent reply other threads:[~2008-10-24 3:11 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-23 16:30 [PATCH 0/2 v2] SGI RTC: add clocksource/clockevent driver Dimitri Sivanich
2008-10-23 16:32 ` [PATCH 1/2 v2] SGI RTC: add clocksource driver Dimitri Sivanich
2008-10-23 16:34 ` [PATCH 2/2 v2] SGI RTC: add RTC system interrupt Dimitri Sivanich
2008-10-24 3:11 ` Dimitri Sivanich [this message]
2008-10-27 14:08 ` [PATCH 2/2 v3] " Ingo Molnar
2008-10-27 15:29 ` Dimitri Sivanich
2008-11-19 21:22 ` [PATCH 0/2 v3] SGI RTC: add clocksource/clockevent driver and generic timer vector Dimitri Sivanich
2008-11-19 21:23 ` [PATCH 1/2 v3] SGI RTC: add clocksource driver Dimitri Sivanich
2008-11-19 21:26 ` [PATCH 2/2 v3] SGI RTC: add generic timer system interrupt Dimitri Sivanich
2008-11-20 23:12 ` Andrew Morton
2008-11-20 23:19 ` H. Peter Anvin
2008-11-21 17:15 ` Dimitri Sivanich
2008-11-21 18:26 ` H. Peter Anvin
2008-11-21 19:09 ` Yinghai Lu
2008-11-23 13:36 ` Ingo Molnar
2008-11-21 17:21 ` Dimitri Sivanich
2008-11-20 23:08 ` [PATCH 1/2 v3] SGI RTC: add clocksource driver Andrew Morton
2008-11-21 0:08 ` john stultz
2008-11-21 17:23 ` Dimitri Sivanich
2008-11-20 9:59 ` [PATCH 0/2 v3] SGI RTC: add clocksource/clockevent driver and generic timer vector Ingo Molnar
2008-11-21 1:44 ` H. Peter Anvin
2008-11-21 8:06 ` Ingo Molnar
2008-11-21 17:16 ` Dimitri Sivanich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081024031127.GA25165@sgi.com \
--to=sivanich@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.