* [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1
@ 2009-07-15 13:00 roderik.wildenburg
2009-07-15 13:16 ` Philippe Gerum
2009-07-15 13:36 ` Wolfgang Grandegger
0 siblings, 2 replies; 8+ messages in thread
From: roderik.wildenburg @ 2009-07-15 13:00 UTC (permalink / raw)
To: xenomai
When I try to compile RTnet (for PPC, Xenomai 2.4.8, Ipipe 2.0.1, Kernel
2.4.25) I get the following error message :
In file included from rtdev.c:33:
../stack/include/rtskb.h: In function `rtskb_queue_init':
../stack/include/rtskb.h:289: error: parse error before '{' token
../stack/include/rtskb.h: At top level:
../stack/include/rtskb.h:290: error: parse error before '->' token
../stack/include/rtskb.h: In function `rtskb_prio_queue_init':
../stack/include/rtskb.h:301: error: parse error before '{' token
rtdev.c: In function `rtdev_alloc':
rtdev.c:243: error: parse error before '{' token
I followed the error through a whole bunch of macros and this is what I
figured out:
1) Startpoint of the error is rtdm_lock_init(&queue->lock) which is used
in RTnet (rtskb.h)
2) rtdm_lock_init() is defined in rtdm_driver.h :
#define rtdm_lock_init(lock) rthal_spin_lock_init(lock)
3) rthal_spin_lock_init(lock) is defined in hal.h :
#define rthal_spin_lock_init(lock) *(lock) = IPIPE_SPIN_LOCK_UNLOCKED
!!(as spin_lock_hw is not defined any more in the 2.0.1 patch !)!!
4) IPIPE_SPIN_LOCK_UNLOCKED is defined in spinlock.h (patched by the
Ipipe-patch) :
#define IPIPE_SPIN_LOCK_UNLOCKED { .__lock = SPIN_LOCK_UNLOCKED }
5) SPIN_LOCK_UNLOCKED is defined in spinlock.h :
#define SPIN_LOCK_UNLOCKED (spinlock_t) { }
so, if I expanded the whole thing correctly I get :
rtdm_lock_init(&queue->lock) ->
rthal_spin_lock_init(&queue->lock) -> *(&queue->lock) =
IPIPE_SPIN_LOCK_UNLOCKED ->
*(&queue->lock) = { .__lock = SPIN_LOCK_UNLOCKED } ->
*(&queue->lock) = { .__lock = (spinlock_t) { } }
===================================================
Unfortunately my preprocessor knowledge is too poor to decode this line
of code, but I think this is not what is intented by the inventor for
the macro expansion.
Could somebody help me to understand what is going on here or, even
better, correct the Ipipe 2.0.1 patch?
Thank you in advance
Roderik
--------------------------------------------------------
manroland AG
Vorsitzender des Aufsichtsrates: Hanno C. Fiedler
Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr. Markus Rall, Paul Steidle
Sitz der Gesellschaft: Offenbach am Main, Registergericht: Amtsgericht Offenbach HRB-Nr. 42592
USt-Ident-Nr. DE 250200933
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 2009-07-15 13:00 [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 roderik.wildenburg @ 2009-07-15 13:16 ` Philippe Gerum 2009-07-16 16:22 ` Philippe Gerum 2009-07-15 13:36 ` Wolfgang Grandegger 1 sibling, 1 reply; 8+ messages in thread From: Philippe Gerum @ 2009-07-15 13:16 UTC (permalink / raw) To: roderik.wildenburg; +Cc: xenomai On Wed, 2009-07-15 at 15:00 +0200, roderik.wildenburg@domain.hid wrote: > When I try to compile RTnet (for PPC, Xenomai 2.4.8, Ipipe 2.0.1, Kernel > 2.4.25) I get the following error message : > > In file included from rtdev.c:33: > ../stack/include/rtskb.h: In function `rtskb_queue_init': > ../stack/include/rtskb.h:289: error: parse error before '{' token > ../stack/include/rtskb.h: At top level: > ../stack/include/rtskb.h:290: error: parse error before '->' token > ../stack/include/rtskb.h: In function `rtskb_prio_queue_init': > ../stack/include/rtskb.h:301: error: parse error before '{' token > rtdev.c: In function `rtdev_alloc': > rtdev.c:243: error: parse error before '{' token > > I followed the error through a whole bunch of macros and this is what I > figured out: > > 1) Startpoint of the error is rtdm_lock_init(&queue->lock) which is used > in RTnet (rtskb.h) > 2) rtdm_lock_init() is defined in rtdm_driver.h : > #define rtdm_lock_init(lock) rthal_spin_lock_init(lock) > 3) rthal_spin_lock_init(lock) is defined in hal.h : > #define rthal_spin_lock_init(lock) *(lock) = IPIPE_SPIN_LOCK_UNLOCKED > !!(as spin_lock_hw is not defined any more in the 2.0.1 patch !)!! Which is normal. This form has been deprecated long ago in the I-pipe core. This is now replaced by a static helper selection based on the spinlock type at build time. > > 4) IPIPE_SPIN_LOCK_UNLOCKED is defined in spinlock.h (patched by the > Ipipe-patch) : > #define IPIPE_SPIN_LOCK_UNLOCKED { .__lock = SPIN_LOCK_UNLOCKED } > 5) SPIN_LOCK_UNLOCKED is defined in spinlock.h : > #define SPIN_LOCK_UNLOCKED (spinlock_t) { } > > so, if I expanded the whole thing correctly I get : > rtdm_lock_init(&queue->lock) -> > rthal_spin_lock_init(&queue->lock) -> *(&queue->lock) = > IPIPE_SPIN_LOCK_UNLOCKED -> > *(&queue->lock) = { .__lock = SPIN_LOCK_UNLOCKED } -> > > *(&queue->lock) = { .__lock = (spinlock_t) { } } In UP mode, you should not even have any expansion for a spinlock init. I will have a look at this. > =================================================== > > > Unfortunately my preprocessor knowledge is too poor to decode this line > of code, but I think this is not what is intented by the inventor for > the macro expansion. > Could somebody help me to understand what is going on here or, even > better, correct the Ipipe 2.0.1 patch? > > Thank you in advance > Roderik > > -------------------------------------------------------- > manroland AG > Vorsitzender des Aufsichtsrates: Hanno C. Fiedler > Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr. Markus Rall, Paul Steidle > Sitz der Gesellschaft: Offenbach am Main, Registergericht: Amtsgericht Offenbach HRB-Nr. 42592 > USt-Ident-Nr. DE 250200933 > > _______________________________________________ > Xenomai-help mailing list > Xenomai-help@domain.hid > https://mail.gna.org/listinfo/xenomai-help -- Philippe. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 2009-07-15 13:16 ` Philippe Gerum @ 2009-07-16 16:22 ` Philippe Gerum 2009-07-17 8:30 ` roderik.wildenburg 0 siblings, 1 reply; 8+ messages in thread From: Philippe Gerum @ 2009-07-16 16:22 UTC (permalink / raw) To: roderik.wildenburg; +Cc: xenomai On Wed, 2009-07-15 at 15:16 +0200, Philippe Gerum wrote: > On Wed, 2009-07-15 at 15:00 +0200, roderik.wildenburg@domain.hid > wrote: > > When I try to compile RTnet (for PPC, Xenomai 2.4.8, Ipipe 2.0.1, Kernel > > 2.4.25) I get the following error message : > > > > In file included from rtdev.c:33: > > ../stack/include/rtskb.h: In function `rtskb_queue_init': > > ../stack/include/rtskb.h:289: error: parse error before '{' token > > ../stack/include/rtskb.h: At top level: > > ../stack/include/rtskb.h:290: error: parse error before '->' token > > ../stack/include/rtskb.h: In function `rtskb_prio_queue_init': > > ../stack/include/rtskb.h:301: error: parse error before '{' token > > rtdev.c: In function `rtdev_alloc': > > rtdev.c:243: error: parse error before '{' token > > > In UP mode, you should not even have any expansion for a spinlock init. > I will have a look at this. > You need this on top of 2.0-01: diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h index 855b815..f50df97 100644 --- a/include/asm-ppc/spinlock.h +++ b/include/asm-ppc/spinlock.h @@ -30,6 +30,7 @@ typedef struct { #endif #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 SPINLOCK_DEBUG_INIT } +#define __SPIN_LOCK_UNLOCKED { 0 SPINLOCK_DEBUG_INIT } #define spin_lock_init(x) do { *(x) = SPIN_LOCK_UNLOCKED; } while(0) #define spin_is_locked(x) ((x)->lock != 0) diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 1462732..fe56f59 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h @@ -120,9 +120,11 @@ do { \ #if (__GNUC__ > 2 || __GNUC_MINOR__ > 95) typedef struct { } spinlock_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { } + #define __SPIN_LOCK_UNLOCKED { } #else typedef struct { int gcc_is_buggy; } spinlock_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } + #define __SPIN_LOCK_UNLOCKED { 0 } #endif #define spin_lock_init(lock) do { } while(0) @@ -138,6 +140,7 @@ typedef struct { volatile unsigned long lock; } spinlock_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } +#define __SPIN_LOCK_UNLOCKED { 0 } #define spin_lock_init(x) do { (x)->lock = 0; } while (0) #define spin_is_locked(lock) (test_bit(0,(lock))) @@ -155,6 +158,7 @@ typedef struct { const char *module; } spinlock_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0, 25, __BASE_FILE__ } +#define __SPIN_LOCK_UNLOCKED { 0, 25, __BASE_FILE__ } #include <linux/kernel.h> @@ -202,7 +206,7 @@ typedef struct { } __ipipe_spinlock_t; #ifdef CONFIG_IPIPE -#define IPIPE_SPIN_LOCK_UNLOCKED { .__lock = SPIN_LOCK_UNLOCKED } +#define IPIPE_SPIN_LOCK_UNLOCKED (__ipipe_spinlock_t) { .__lock = __SPIN_LOCK_UNLOCKED } #define ipipe_spinlock_t __ipipe_spinlock_t #define IPIPE_DEFINE_SPINLOCK(x) ipipe_spinlock_t x = IPIPE_SPIN_LOCK_UNLOCKED #define IPIPE_DECLARE_SPINLOCK(x) extern ipipe_spinlock_t x @@ -219,7 +223,7 @@ void __ipipe_spin_unlock_irqcomplete(unsigned long x); spin_unlock_irqrestore(lock, flags) #else /* !CONFIG_IPIPE */ #define ipipe_spinlock_t spinlock_t -#define IPIPE_SPIN_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED +#define IPIPE_SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED #define IPIPE_DEFINE_SPINLOCK(x) spinlock_t x #define IPIPE_DECLARE_SPINLOCK(x) extern spinlock_t x -- Philippe. ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 2009-07-16 16:22 ` Philippe Gerum @ 2009-07-17 8:30 ` roderik.wildenburg 0 siblings, 0 replies; 8+ messages in thread From: roderik.wildenburg @ 2009-07-17 8:30 UTC (permalink / raw) To: rpm; +Cc: xenomai Problem solved! RTnet compiles without problems now. Thank you very much for your rapid help! Best regards Roderik > -----Ursprüngliche Nachricht----- > Von: Philippe Gerum [mailto:rpm@xenomai.org > Gesendet: Donnerstag, 16. Juli 2009 18:23 > An: Wildenburg, Roderik RAEK3 MRA > Cc: xenomai@xenomai.org > Betreff: Re: [Xenomai-help] rtdm_lock_init does not compile > with ppc-ipipe-patch 2.0.1 > > On Wed, 2009-07-15 at 15:16 +0200, Philippe Gerum wrote: > > On Wed, 2009-07-15 at 15:00 +0200, roderik.wildenburg@domain.hid > > wrote: > > > When I try to compile RTnet (for PPC, Xenomai 2.4.8, > Ipipe 2.0.1, Kernel > > > 2.4.25) I get the following error message : > > > > > > In file included from rtdev.c:33: > > > ../stack/include/rtskb.h: In function `rtskb_queue_init': > > > ../stack/include/rtskb.h:289: error: parse error before '{' token > > > ../stack/include/rtskb.h: At top level: > > > ../stack/include/rtskb.h:290: error: parse error before '->' token > > > ../stack/include/rtskb.h: In function `rtskb_prio_queue_init': > > > ../stack/include/rtskb.h:301: error: parse error before '{' token > > > rtdev.c: In function `rtdev_alloc': > > > rtdev.c:243: error: parse error before '{' token > > > > > > In UP mode, you should not even have any expansion for a > spinlock init. > > I will have a look at this. > > > > You need this on top of 2.0-01: > > diff --git a/include/asm-ppc/spinlock.h b/include/asm-ppc/spinlock.h > index 855b815..f50df97 100644 > --- a/include/asm-ppc/spinlock.h > +++ b/include/asm-ppc/spinlock.h > @@ -30,6 +30,7 @@ typedef struct { > #endif > > #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 SPINLOCK_DEBUG_INIT } > +#define __SPIN_LOCK_UNLOCKED { 0 SPINLOCK_DEBUG_INIT } > > #define spin_lock_init(x) do { *(x) = SPIN_LOCK_UNLOCKED; > } while(0) > #define spin_is_locked(x) ((x)->lock != 0) > diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h > index 1462732..fe56f59 100644 > --- a/include/linux/spinlock.h > +++ b/include/linux/spinlock.h > @@ -120,9 +120,11 @@ do { > \ > #if (__GNUC__ > 2 || __GNUC_MINOR__ > 95) > typedef struct { } spinlock_t; > #define SPIN_LOCK_UNLOCKED (spinlock_t) { } > + #define __SPIN_LOCK_UNLOCKED { } > #else > typedef struct { int gcc_is_buggy; } spinlock_t; > #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } > + #define __SPIN_LOCK_UNLOCKED { 0 } > #endif > > #define spin_lock_init(lock) do { } while(0) > @@ -138,6 +140,7 @@ typedef struct { > volatile unsigned long lock; > } spinlock_t; > #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } > +#define __SPIN_LOCK_UNLOCKED { 0 } > > #define spin_lock_init(x) do { (x)->lock = 0; } while (0) > #define spin_is_locked(lock) (test_bit(0,(lock))) > @@ -155,6 +158,7 @@ typedef struct { > const char *module; > } spinlock_t; > #define SPIN_LOCK_UNLOCKED (spinlock_t) { 0, 25, __BASE_FILE__ } > +#define __SPIN_LOCK_UNLOCKED { 0, 25, __BASE_FILE__ } > > #include <linux/kernel.h> > > @@ -202,7 +206,7 @@ typedef struct { > } __ipipe_spinlock_t; > > #ifdef CONFIG_IPIPE > -#define IPIPE_SPIN_LOCK_UNLOCKED { .__lock = SPIN_LOCK_UNLOCKED } > +#define IPIPE_SPIN_LOCK_UNLOCKED (__ipipe_spinlock_t) { > .__lock = __SPIN_LOCK_UNLOCKED } > #define ipipe_spinlock_t __ipipe_spinlock_t > #define IPIPE_DEFINE_SPINLOCK(x) ipipe_spinlock_t x = > IPIPE_SPIN_LOCK_UNLOCKED > #define IPIPE_DECLARE_SPINLOCK(x) extern ipipe_spinlock_t x > @@ -219,7 +223,7 @@ void > __ipipe_spin_unlock_irqcomplete(unsigned long x); > spin_unlock_irqrestore(lock, flags) > #else /* !CONFIG_IPIPE */ > #define ipipe_spinlock_t spinlock_t > -#define IPIPE_SPIN_LOCK_UNLOCKED SPIN_LOCK_UNLOCKED > +#define IPIPE_SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED > #define IPIPE_DEFINE_SPINLOCK(x) spinlock_t x > #define IPIPE_DECLARE_SPINLOCK(x) extern spinlock_t x > > -- > Philippe. > > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 2009-07-15 13:00 [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 roderik.wildenburg 2009-07-15 13:16 ` Philippe Gerum @ 2009-07-15 13:36 ` Wolfgang Grandegger 2009-07-15 13:44 ` Wolfgang Grandegger 1 sibling, 1 reply; 8+ messages in thread From: Wolfgang Grandegger @ 2009-07-15 13:36 UTC (permalink / raw) To: roderik.wildenburg; +Cc: xenomai Hi Roderik, roderik.wildenburg@domain.hid wrote: > When I try to compile RTnet (for PPC, Xenomai 2.4.8, Ipipe 2.0.1, Kernel > 2.4.25) I get the following error message : > > In file included from rtdev.c:33: > ../stack/include/rtskb.h: In function `rtskb_queue_init': > ../stack/include/rtskb.h:289: error: parse error before '{' token > ../stack/include/rtskb.h: At top level: > ../stack/include/rtskb.h:290: error: parse error before '->' token > ../stack/include/rtskb.h: In function `rtskb_prio_queue_init': > ../stack/include/rtskb.h:301: error: parse error before '{' token > rtdev.c: In function `rtdev_alloc': > rtdev.c:243: error: parse error before '{' token A similar issue has been reported on the RTnet-users ML by Thomas. What version of RTnet are you using? 0.9.11 is broken!!! See also: http://sourceforge.net/mailarchive/forum.php?thread_name=4A4B9610.9080708%40grandegger.com&forum_name=rtnet-users Wolfgang. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 2009-07-15 13:36 ` Wolfgang Grandegger @ 2009-07-15 13:44 ` Wolfgang Grandegger 2009-07-16 5:44 ` roderik.wildenburg 0 siblings, 1 reply; 8+ messages in thread From: Wolfgang Grandegger @ 2009-07-15 13:44 UTC (permalink / raw) To: roderik.wildenburg; +Cc: xenomai Wolfgang Grandegger wrote: > Hi Roderik, > > roderik.wildenburg@domain.hid wrote: >> When I try to compile RTnet (for PPC, Xenomai 2.4.8, Ipipe 2.0.1, Kernel >> 2.4.25) I get the following error message : >> >> In file included from rtdev.c:33: >> ../stack/include/rtskb.h: In function `rtskb_queue_init': >> ../stack/include/rtskb.h:289: error: parse error before '{' token >> ../stack/include/rtskb.h: At top level: >> ../stack/include/rtskb.h:290: error: parse error before '->' token >> ../stack/include/rtskb.h: In function `rtskb_prio_queue_init': >> ../stack/include/rtskb.h:301: error: parse error before '{' token >> rtdev.c: In function `rtdev_alloc': >> rtdev.c:243: error: parse error before '{' token > > A similar issue has been reported on the RTnet-users ML by Thomas. What > version of RTnet are you using? 0.9.11 is broken!!! See also: > > http://sourceforge.net/mailarchive/forum.php?thread_name=4A4B9610.9080708%40grandegger.com&forum_name=rtnet-users ... and you need adeos-ipipe-2.4.25-ppc-DENX-1.2-02.patch instead of adeos-ipipe-2.4.25-ppc-DENX-2.0-01.patch as Thomas reported. Wolfgang. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 2009-07-15 13:44 ` Wolfgang Grandegger @ 2009-07-16 5:44 ` roderik.wildenburg 2009-07-16 6:58 ` Wolfgang Grandegger 0 siblings, 1 reply; 8+ messages in thread From: roderik.wildenburg @ 2009-07-16 5:44 UTC (permalink / raw) To: wg; +Cc: xenomai > > > A similar issue has been reported on the RTnet-users ML by > Thomas. What > > version of RTnet are you using? 0.9.11 is broken!!! See also: > > In deed Thomas´ problem is my problem. I tried to "solve" it but wasn´t very successful. Therefore I asked for your help in this forum, which is probably the better place than the RTnet forum.? > > > http://sourceforge.net/mailarchive/forum.php?thread_name=4A4B9 610.9080708%40grandegger.com&forum_name=rtnet-users > > ... and you need adeos-ipipe-2.4.25-ppc-DENX-1.2-02.patch instead of > adeos-ipipe-2.4.25-ppc-DENX-2.0-01.patch as Thomas reported. > I don´t understand this. The 1.2. patch compiles fine (Thomas mentioned this). The 2.0.01 patch is making trouble and we need 2.0 as it solves one of our problems. Roderik ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 2009-07-16 5:44 ` roderik.wildenburg @ 2009-07-16 6:58 ` Wolfgang Grandegger 0 siblings, 0 replies; 8+ messages in thread From: Wolfgang Grandegger @ 2009-07-16 6:58 UTC (permalink / raw) To: roderik.wildenburg; +Cc: xenomai roderik.wildenburg@domain.hid wrote: >>> A similar issue has been reported on the RTnet-users ML by >> Thomas. What >>> version of RTnet are you using? 0.9.11 is broken!!! See also: >>> > > In deed Thomas´ problem is my problem. I tried to "solve" it but wasn´t very successful. > Therefore I asked for your help in this forum, which is probably the better place than the RTnet forum.? > >> http://sourceforge.net/mailarchive/forum.php?thread_name=4A4B9 > 610.9080708%40grandegger.com&forum_name=rtnet-users >> ... and you need adeos-ipipe-2.4.25-ppc-DENX-1.2-02.patch instead of >> adeos-ipipe-2.4.25-ppc-DENX-2.0-01.patch as Thomas reported. >> > > I don´t understand this. The 1.2. patch compiles fine (Thomas mentioned this). > The 2.0.01 patch is making trouble and we need 2.0 as it solves one of our problems. Ah, I just realize, it's an older version. That's not good, indeed. Wolfgang. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-07-17 8:30 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-07-15 13:00 [Xenomai-help] rtdm_lock_init does not compile with ppc-ipipe-patch 2.0.1 roderik.wildenburg 2009-07-15 13:16 ` Philippe Gerum 2009-07-16 16:22 ` Philippe Gerum 2009-07-17 8:30 ` roderik.wildenburg 2009-07-15 13:36 ` Wolfgang Grandegger 2009-07-15 13:44 ` Wolfgang Grandegger 2009-07-16 5:44 ` roderik.wildenburg 2009-07-16 6:58 ` Wolfgang Grandegger
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.