All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>, xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [PATCH] fix 2.4 build of mksound workaround
Date: Mon, 14 Aug 2006 18:57:27 +0200	[thread overview]
Message-ID: <44E0AB77.3080705@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 589 bytes --]

Hi Philippe,

various issues with the new mksound workaround for x86-2.4 kernels
popped up here during test builds (wrong dependency on
CONFIG_XENO_HW_NMI_DEBUG_LATENCY, missing dep on CONFIG_VT, missing
linux/vt_kern.h). The attached patch aims at fixing them. Compile-tested
over 2.4.33.

Additionally, you may remove the EXPORT_SYMBOL(kd_mksound) from the
latest ipipe patch. A) it's broken in case of !CONFIG_VT, B) it should
not be required given that kd_mksound is only needed by the hal, and
that's built-in anyway. Or do you have non-Xenomai users in mind here?

Jan

[-- Attachment #1.2: fix-mksound-workaround.patch --]
[-- Type: text/plain, Size: 2221 bytes --]

Index: ksrc/arch/i386/hal.c
===================================================================
--- ksrc/arch/i386/hal.c	(revision 1435)
+++ ksrc/arch/i386/hal.c	(working copy)
@@ -62,6 +62,16 @@
 #include <asm/xenomai/hal.h>
 #include <stdarg.h>
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) && !defined(CONFIG_X86_TSC) && defined(CONFIG_VT)
+#include <linux/vt_kern.h>
+
+static void (*old_mksound)(unsigned int hz, unsigned int ticks);
+
+static void dummy_mksound (unsigned int hz, unsigned int ticks)
+{
+}
+#endif /* Linux < 2.6 && !CONFIG_X86_TSC && CONFIG_VT */
+
 extern struct desc_struct idt_table[];
 
 static struct {
@@ -206,12 +216,6 @@ void die_nmi(struct pt_regs *regs, const
     do_exit(SIGSEGV);
 }
 
-static void (*old_mksound)(unsigned int hz, unsigned int ticks);
-
-static void dummy_mksound (unsigned int hz, unsigned int ticks)
-{
-}
-
 #else /* Linux >= 2.6 */
 #include <asm/nmi.h>
 #endif /* Linux < 2.6 */
@@ -601,13 +605,13 @@ int rthal_arch_init(void)
         rthal_smi_restore();
         return -ENODEV;
     }
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) && !defined(CONFIG_X86_TSC)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) && !defined(CONFIG_X86_TSC) && defined(CONFIG_VT)
     /* Prevent the speaker code from bugging our TSC emulation, also
        based on PIT channel 2. kd_mksound is exported by the Adeos
        patch. */
     old_mksound = kd_mksound;
     kd_mksound = &dummy_mksound;
-#endif /* !CONFIG_X86_LOCAL_APIC && Linux < 2.6 && !CONFIG_X86_TSC */
+#endif /* !CONFIG_X86_LOCAL_APIC && Linux < 2.6 && !CONFIG_X86_TSC && CONFIG_VT */
 
     if (rthal_cpufreq_arg == 0)
 #ifdef CONFIG_X86_TSC
@@ -631,10 +635,10 @@ int rthal_arch_init(void)
 
 void rthal_arch_cleanup(void)
 {
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) && !defined(CONFIG_X86_TSC)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) && !defined(CONFIG_X86_TSC) && defined(CONFIG_VT)
     /* Restore previous PC speaker code. */
     kd_mksound = old_mksound;
-#endif /* Linux < 2.6 && !CONFIG_X86_TSC */
+#endif /* Linux < 2.6 && !CONFIG_X86_TSC && CONFIG_VT */
     printk(KERN_INFO "Xenomai: hal/x86 stopped.\n");
 }
 

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

             reply	other threads:[~2006-08-14 16:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-14 16:57 Jan Kiszka [this message]
2006-08-18 14:46 ` [Xenomai-core] Re: [PATCH] fix 2.4 build of mksound workaround 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=44E0AB77.3080705@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=rpm@xenomai.org \
    --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.