All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] cpu_set_t and friends undefined
@ 2006-07-29  9:58 Wolfgang Grandegger
  2006-07-29 10:20 ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Grandegger @ 2006-07-29  9:58 UTC (permalink / raw)
  To: xenomai-core

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.


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

* Re: [Xenomai-core] cpu_set_t and friends undefined
  2006-07-29  9:58 [Xenomai-core] cpu_set_t and friends undefined Wolfgang Grandegger
@ 2006-07-29 10:20 ` Jan Kiszka
  2006-07-29 11:44   ` Wolfgang Grandegger
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2006-07-29 10:20 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

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


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

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

* Re: [Xenomai-core] cpu_set_t and friends undefined
  2006-07-29 10:20 ` Jan Kiszka
@ 2006-07-29 11:44   ` Wolfgang Grandegger
  2006-07-29 13:13     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Grandegger @ 2006-07-29 11:44 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai-core

[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]

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,


[-- Attachment #2: xenomai-switch.patch --]
[-- Type: text/x-patch, Size: 785 bytes --]

+ 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.000000000 +0200
+++ xenomai/src/testsuite/switchtest/switch.c	2006-07-29 13:32:18.000000000 +0200
@@ -15,7 +15,6 @@
 #include <asm/xenomai/fptest.h>
 #include <rtdm/rttesting.h>
 
-#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;
 

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

* Re: [Xenomai-core] cpu_set_t and friends undefined
  2006-07-29 11:44   ` Wolfgang Grandegger
@ 2006-07-29 13:13     ` Gilles Chanteperdrix
  0 siblings, 0 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2006-07-29 13:13 UTC (permalink / raw)
  To: Wolfgang Grandegger; +Cc: Jan Kiszka, xenomai-core

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.


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

end of thread, other threads:[~2006-07-29 13:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-29  9:58 [Xenomai-core] cpu_set_t and friends undefined Wolfgang Grandegger
2006-07-29 10:20 ` Jan Kiszka
2006-07-29 11:44   ` Wolfgang Grandegger
2006-07-29 13:13     ` Gilles Chanteperdrix

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.