All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] [PATCH] fix 2.4 build of mksound workaround
@ 2006-08-14 16:57 Jan Kiszka
  2006-08-18 14:46 ` [Xenomai-core] " Philippe Gerum
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2006-08-14 16:57 UTC (permalink / raw)
  To: Philippe Gerum, xenomai-core


[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Xenomai-core] Re: [PATCH] fix 2.4 build of mksound workaround
  2006-08-14 16:57 [Xenomai-core] [PATCH] fix 2.4 build of mksound workaround Jan Kiszka
@ 2006-08-18 14:46 ` Philippe Gerum
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Gerum @ 2006-08-18 14:46 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-core

On Mon, 2006-08-14 at 18:57 +0200, Jan Kiszka wrote:
> 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.

Applied, thanks.

> 
> 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?
> 

Nope. This export is indeed useless and will be removed, thanks.

> Jan
> plain text document attachment (fix-mksound-workaround.patch)
> 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");
>  }
>  
-- 
Philippe.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-18 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-14 16:57 [Xenomai-core] [PATCH] fix 2.4 build of mksound workaround Jan Kiszka
2006-08-18 14:46 ` [Xenomai-core] " 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.