[Xenomai-core] [PATCH] detect conflict with INPUT_PCSPKR

2006-07-29 Thread Jan Kiszka
This is a simple patch to catch the very rare but fatal conflict between
Xenomai's TSC emulation and the PC speaker driver on 2.6/x86.

Jan


--- include/asm-i386/hal.h  (Revision 1390)
+++ include/asm-i386/hal.h  (Arbeitskopie)
@@ -169,6 +169,11 @@ static inline unsigned long long rthal_r
 return t;
 }
 #else  /* !CONFIG_X86_TSC */
+#if defined(CONFIG_INPUT_PCSPKR) || defined(CONFIG_INPUT_PCSPKR_MODULE)
+#error Please disable PC speaker driver (CONFIG_INPUT_PCSPKR).
+#error It conflicts with Xenomai's TSC emulation.
+#endif /* CONFIG_INPUT_PCSPKR */
+
 #define RTHAL_8254_COUNT2LATCH  0xfffe
 void rthal_setup_8254_tsc(void);
 rthal_time_t rthal_get_8254_tsc(void);




signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


[Xenomai-core] cpu_set_t and friends undefined

2006-07-29 Thread Wolfgang Grandegger

Hello,

with todays SVN version of Xenomai, the testsuite program 
switchtest/switch.c does not compile because cpu_set_t and friends 
(CPU_SET, ...) are not undefined. I'm using kernel version 2.4.25.


Any idea what goes wrong. I haven't found where cpu_set_t is declared, 
not even in Linux 2.4.17.7.


Thanks.

Wolfgang.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] cpu_set_t and friends undefined

2006-07-29 Thread Jan Kiszka
Wolfgang Grandegger wrote:
> Hello,
> 
> with todays SVN version of Xenomai, the testsuite program
> switchtest/switch.c does not compile because cpu_set_t and friends
> (CPU_SET, ...) are not undefined. I'm using kernel version 2.4.25.
> 
> Any idea what goes wrong. I haven't found where cpu_set_t is declared,
> not even in Linux 2.4.17.7.

That's user-space stuff, in /usr/include/bits/sched.h on my box. Maybe
some #ifndef __cpu_set_t_defined + local definition is required here.
What glibc version do you use?

Jan



signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] cpu_set_t and friends undefined

2006-07-29 Thread Wolfgang Grandegger

Jan Kiszka wrote:

Wolfgang Grandegger wrote:

Hello,

with todays SVN version of Xenomai, the testsuite program
switchtest/switch.c does not compile because cpu_set_t and friends
(CPU_SET, ...) are not undefined. I'm using kernel version 2.4.25.

Any idea what goes wrong. I haven't found where cpu_set_t is declared,
not even in Linux 2.4.17.7.


That's user-space stuff, in /usr/include/bits/sched.h on my box. Maybe
some #ifndef __cpu_set_t_defined + local definition is required here.
What glibc version do you use?


Ah, OK. The problem is with gcc version 3.3.3 (DENX ELDK 3.1.1 3.3.3-9),
which does not have cpu_set_t, indeed. The configure script already 
deals with different implementations of setaffinity. The attached patch 
fixes the problem. It removes CONFIG_SMP, which is not known to user 
space applications anyhow. Well, it might get defined in 
"src/include/xeno_config.h" somehow but I don't know how this could work 
properly without knowing the configured kernel tree.


Wolfgang,

+ diff -u xenomai/src/testsuite/switchtest/switch.c.SMP xenomai/src/testsuite/switchtest/switch.c
--- xenomai/src/testsuite/switchtest/switch.c.SMP	2006-07-29 13:31:06.0 +0200
+++ xenomai/src/testsuite/switchtest/switch.c	2006-07-29 13:32:18.0 +0200
@@ -15,7 +15,6 @@
 #include 
 #include 
 
-#if CONFIG_SMP
 #ifdef HAVE_RECENT_SETAFFINITY
 #define smp_sched_setaffinity(pid,len,mask) sched_setaffinity(pid,len,mask)
 #else /* !HAVE_RECENT_SETAFFINITY */
@@ -28,9 +27,6 @@
 #define	 CPU_SET(n,set) 	do { *(set) |= (1 << n); } while(0)
 #endif /* HAVE_OLD_SETAFFINITY */
 #endif /* HAVE_RECENT_SETAFFINITY */
-#else /* !CONFIG_SMP */
-#define smp_sched_setaffinity(pid,len,mask) 0
-#endif /* !CONFIG_SMP */
 
 struct cpu_tasks;
 
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] cpu_set_t and friends undefined

2006-07-29 Thread Gilles Chanteperdrix
Wolfgang Grandegger wrote:
 > Jan Kiszka wrote:
 > > Wolfgang Grandegger wrote:
 > >> Hello,
 > >>
 > >> with todays SVN version of Xenomai, the testsuite program
 > >> switchtest/switch.c does not compile because cpu_set_t and friends
 > >> (CPU_SET, ...) are not undefined. I'm using kernel version 2.4.25.
 > >>
 > >> Any idea what goes wrong. I haven't found where cpu_set_t is declared,
 > >> not even in Linux 2.4.17.7.
 > > 
 > > That's user-space stuff, in /usr/include/bits/sched.h on my box. Maybe
 > > some #ifndef __cpu_set_t_defined + local definition is required here.
 > > What glibc version do you use?
 > 
 > Ah, OK. The problem is with gcc version 3.3.3 (DENX ELDK 3.1.1 3.3.3-9),
 > which does not have cpu_set_t, indeed. The configure script already 
 > deals with different implementations of setaffinity. The attached patch 
 > fixes the problem. It removes CONFIG_SMP, which is not known to user 
 > space applications anyhow. Well, it might get defined in 
 > "src/include/xeno_config.h" somehow but I don't know how this could work 
 > properly without knowing the configured kernel tree.

The configure script has a --enable-smp option that set CONFIG_SMP in
xeno_config.h. sched_setaffinity is unneeded when not running over SMP
machine, so I thought it would be simpler to completely avoid
sched_setaffinity over UP machines.

The proper fix is to also define cpu_set_t when CONFIG_SMP is not set.
I will fix this.

-- 


Gilles Chanteperdrix.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [PATCH] detect conflict with INPUT_PCSPKR

2006-07-29 Thread Gilles Chanteperdrix
Jan Kiszka wrote:
 > This is a simple patch to catch the very rare but fatal conflict between
 > Xenomai's TSC emulation and the PC speaker driver on 2.6/x86.
 > 
 > Jan
 > 
 > 
 > --- include/asm-i386/hal.h  (Revision 1390)
 > +++ include/asm-i386/hal.h  (Arbeitskopie)
 > @@ -169,6 +169,11 @@ static inline unsigned long long rthal_r
 >  return t;
 >  }
 >  #else  /* !CONFIG_X86_TSC */
 > +#if defined(CONFIG_INPUT_PCSPKR) || defined(CONFIG_INPUT_PCSPKR_MODULE)
 > +#error Please disable PC speaker driver (CONFIG_INPUT_PCSPKR).
 > +#error It conflicts with Xenomai's TSC emulation.
 > +#endif /* CONFIG_INPUT_PCSPKR */
 > +
 >  #define RTHAL_8254_COUNT2LATCH  0xfffe
 >  void rthal_setup_8254_tsc(void);
 >  rthal_time_t rthal_get_8254_tsc(void);

How about solving this in Kconfig ?


-- 


Gilles Chanteperdrix.
Index: scripts/Kconfig.frag
===
--- scripts/Kconfig.frag(revision 1388)
+++ scripts/Kconfig.frag(working copy)
@@ -2,6 +2,7 @@
 menu "Real-time sub-system"
 
 config XENOMAI
+   depends on CONFIG_X86_TSC || !X86 || !CONFIG_INPUT_PCSPKR
bool "Xenomai"
default y
 select IPIPE
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [PATCH] detect conflict with INPUT_PCSPKR

2006-07-29 Thread Gilles Chanteperdrix
Gilles Chanteperdrix wrote:
 > How about solving this in Kconfig ?
 > Index: scripts/Kconfig.frag
 > ===
 > --- scripts/Kconfig.frag (revision 1388)
 > +++ scripts/Kconfig.frag (working copy)
 > @@ -2,6 +2,7 @@
 >  menu "Real-time sub-system"
 >  
 >  config XENOMAI
 > +depends on CONFIG_X86_TSC || !X86 || !CONFIG_INPUT_PCSPKR
 >  bool "Xenomai"
 >  default y
 >  select IPIPE

Sorry, I meant:

-- 


Gilles Chanteperdrix.
Index: scripts/Kconfig.frag
===
--- scripts/Kconfig.frag(revision 1388)
+++ scripts/Kconfig.frag(working copy)
@@ -2,6 +2,7 @@
 menu "Real-time sub-system"
 
 config XENOMAI
+   depends on X86_TSC || !X86 || !INPUT_PCSPKR
bool "Xenomai"
default y
 select IPIPE
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core