* [Xenomai-core] [PATCH] fix i386 nmi build for 2.6.19
@ 2006-12-02 11:27 Jan Kiszka
2006-12-02 13:26 ` Philippe Gerum
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2006-12-02 11:27 UTC (permalink / raw)
To: xenomai-core
[-- Attachment #1.1: Type: text/plain, Size: 189 bytes --]
As the subject states. Compiles and runs fine - which implies that the
whole 2.6.19-ipipe-1.6-00 patch works perfectly on my Thinkpad. Also
right now while typing this mail. :)
Jan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: fix-nmi-for-2.6.19-i386.patch --]
[-- Type: text/x-patch; name="fix-nmi-for-2.6.19-i386.patch", Size: 2985 bytes --]
Index: ksrc/arch/i386/nmi.c
===================================================================
--- ksrc/arch/i386/nmi.c (Revision 1914)
+++ ksrc/arch/i386/nmi.c (Arbeitskopie)
@@ -72,11 +72,13 @@ static rthal_nmi_wd_t rthal_nmi_wds[NR_C
static unsigned long rthal_nmi_perfctr_msr;
static unsigned int rthal_nmi_p4_cccr_val;
static void (*rthal_nmi_emergency) (struct pt_regs *);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
static void (*rthal_linux_nmi_tick) (struct pt_regs *);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
#define MSR_P4_IQ_CCCR0 0x36C
-#define nmi_active (nmi_watchdog != NMI_NONE)
+#define rthal_nmi_active (nmi_watchdog != NMI_NONE)
static inline void wrmsrl(unsigned long msr, unsigned long long val)
{
unsigned long lo, hi;
@@ -84,9 +86,15 @@ static inline void wrmsrl(unsigned long
hi = val >> 32;
wrmsr(msr, lo, hi);
}
-#else /* Linux >= 2.6 */
+#else /* Linux 2.6.0..18 */
extern int nmi_active;
-#endif /* Linux >= 2.6 */
+#define rthal_nmi_active nmi_active
+#endif /* Linux 2.6.0..18 */
+
+#else /* Linux >= 2.6.19 */
+static int (*rthal_linux_nmi_tick) (struct pt_regs *, unsigned);
+#define rthal_nmi_active atomic_read(&nmi_active)
+#endif /* Linux >= 2.6.19 */
static void rthal_touch_nmi_watchdog(void)
{
@@ -105,7 +113,15 @@ static void rthal_touch_nmi_watchdog(voi
}
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+#define CALL_LINUX_NMI rthal_linux_nmi_tick(regs)
+#define NMI_RETURN return
static void rthal_nmi_watchdog_tick(struct pt_regs *regs)
+#else /* Linux >= 2.6.19 */
+#define CALL_LINUX_NMI rthal_linux_nmi_tick(regs, reason)
+#define NMI_RETURN return 1
+static int rthal_nmi_watchdog_tick(struct pt_regs *regs, unsigned reason)
+#endif /* Linux >= 2.6.19 */
{
int cpu = rthal_processor_id();
rthal_nmi_wd_t *wd = &rthal_nmi_wds[cpu];
@@ -125,7 +141,7 @@ static void rthal_nmi_watchdog_tick(stru
if ((long long)(now - wd->next_linux_check) >= 0) {
- rthal_linux_nmi_tick(regs);
+ CALL_LINUX_NMI;
do {
wd->next_linux_check += RTHAL_CPU_FREQ;
@@ -150,6 +166,7 @@ static void rthal_nmi_watchdog_tick(stru
}
wrmsrl(wd->perfctr_msr, now - wd->next_linux_check);
+ NMI_RETURN;
}
static int earlyshots_read_proc(char *page,
@@ -175,7 +192,7 @@ static int earlyshots_read_proc(char *pa
int rthal_nmi_request(void (*emergency) (struct pt_regs *))
{
- if (!nmi_active || !nmi_watchdog_tick)
+ if (!rthal_nmi_active || !nmi_watchdog_tick)
return -ENODEV;
if (rthal_linux_nmi_tick)
Index: ChangeLog
===================================================================
--- ChangeLog (Revision 1914)
+++ ChangeLog (Arbeitskopie)
@@ -1,3 +1,7 @@
+2006-12-02 Jan Kiszka <jan.kiszka@domain.hid>
+
+ * ksrc/arch/i386/nmi.c: Fix build against 2.6.19.
+
2006-12-02 Jeff Webb <jeff.webb@domain.hid>
* ksrc/skins/posix/syscall.c (__pse51_sem_timed_wait): Fix return
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Xenomai-core] [PATCH] fix i386 nmi build for 2.6.19
2006-12-02 11:27 [Xenomai-core] [PATCH] fix i386 nmi build for 2.6.19 Jan Kiszka
@ 2006-12-02 13:26 ` Philippe Gerum
0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2006-12-02 13:26 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
On Sat, 2006-12-02 at 12:27 +0100, Jan Kiszka wrote:
> As the subject states. Compiles and runs fine - which implies that the
> whole 2.6.19-ipipe-1.6-00 patch works perfectly on my Thinkpad. Also
> right now while typing this mail. :)
>
Nice. Merged, thanks.
> Jan
>
> _______________________________________________
> Xenomai-core mailing list
> Xenomai-core@domain.hid
> https://mail.gna.org/listinfo/xenomai-core
--
Philippe.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-12-02 13:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-02 11:27 [Xenomai-core] [PATCH] fix i386 nmi build for 2.6.19 Jan Kiszka
2006-12-02 13:26 ` Philippe Gerum
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.