From: Jan Kiszka <jan.kiszka@domain.hid>
To: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] fix i386 nmi build for 2.6.19
Date: Sat, 02 Dec 2006 12:27:44 +0100 [thread overview]
Message-ID: <45716330.7000306@domain.hid> (raw)
[-- 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 --]
next reply other threads:[~2006-12-02 11:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-02 11:27 Jan Kiszka [this message]
2006-12-02 13:26 ` [Xenomai-core] [PATCH] fix i386 nmi build for 2.6.19 Philippe Gerum
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=45716330.7000306@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=xenomai@xenomai.org \
/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.