Hi Greg,
Thanks for the prompt response. I haven't try the latest patch yet. I feel
it is the problem of my setup rather than the patch itself. The previous
point I made was incorrect. The hard_preempt_disable macro is a
statement-embedded expression supported by GNU so there is no problem at
all (I was not aware of this). That said, I still cannot figure out why my
compiler report errors on codes that seems absolutely fine. I attached my
errors and my patch here in case you would bother to take a look at it.
Regards,
Yunjie
On Tue, 19 Apr 2022 at 00:25, Greg Gallagher wrote:
>
>
> On Mon, Apr 18, 2022 at 7:21 PM Yunjie Gu via Xenomai
> wrote:
>
>> Hi All,
>>
>> I'm trying to use xenomai on linux 5.4. I previously used xenomai 3.0 on
>> linux 4.9 and xenomai 3.1 on linux 4.19 and both were fine. However when I
>> use xenomai 3.2.1 on linux 5.4 there are errors in compile. One of the
>> errors says
>> expected expression before ')' token (__flags) = hard_preempt_disable();
>> for the macro below in fpsimd.c:
>> #define get_cpu_fpsimd_context(__flags) \ do { \ (__flags) =
>> hard_preempt_disable(); \ __get_cpu_fpsimd_context(); \ } while (0)
>>
>> hard_preempt_disable is also a macro defined in preempt.h:
>> #define hard_preempt_disable() \ ({ \ unsigned long __flags__; \ __flags__
>> = hard_local_irq_save(); \ if (__ipipe_root_p) \ preempt_disable(); \
>> __flags__; \ })
>>
>> It is clear that hard_preempt_disable() should be a function-like macro
>> but
>> is actually not. It seems to me that there are inconsistencies in the
>> ipipe
>> patch I used. I used ipipe-core-5.4.72-arm64-0.patch. Anyone has a
>> suggestion on I can I resolve this issue?
>>
>> Best Regards,
>> Yunjie
>
>
> Have you tried the latest patch? The mainline release doesn’t have this
> issue. I’m about to release the next patch.
>
> -Greg
>
>>
>>
-- next part --
CALLscripts/atomic/check-atomics.sh
CALLscripts/checksyscalls.sh
CHK include/generated/compile.h
make[1]: *** No rule to make target 'debian/canonical-certs.pem', needed by
'certs/x509_certificate_list'. Stop.
make[1]: *** Waiting for unfinished jobs
Makefile:1652: recipe for target 'certs' failed
make: *** [certs] Error 2
make: *** Waiting for unfinished jobs
CC arch/arm64/kernel/fpsimd.o
CC arch/arm64/kernel/sys.o
arch/arm64/kernel/fpsimd.c: In function 'fpsimd_restore_current_state':
arch/arm64/kernel/fpsimd.c:174:11: error: expected expression before ')' token
174 | (__flags) = hard_preempt_disable(); \
| ^
arch/arm64/kernel/fpsimd.c:1212:2: note: in expansion of macro
'get_cpu_fpsimd_context'
1212 | get_cpu_fpsimd_context();
| ^~
In file included from ./include/linux/bottom_half.h:5,
from arch/arm64/kernel/fpsimd.c:11:
./include/linux/preempt.h:259:3: error: '__flags__' undeclared (first use in
this function); did you mean 'vm_flags_t'?
259 | __flags__ = hard_local_irq_save(); \
| ^
arch/arm64/kernel/fpsimd.c:174:15: note: in expansion of macro
'hard_preempt_disable'
174 | (__flags) = hard_preempt_disable(); \
| ^~~~
arch/arm64/kernel/fpsimd.c:1212:2: note: in expansion of macro
'get_cpu_fpsimd_context'
1212 | get_cpu_fpsimd_context();
| ^~
./include/linux/preempt.h:259:3: note: each undeclared identifier is reported
only once for each function it appears in
259 | __flags__ = hard_local_irq_save(); \
| ^
arch/arm64/kernel/fpsimd.c:174:15: note: in expansion of macro
'hard_preempt_disable'
174 | (__flags) = hard_preempt_disable(); \
| ^~~~
arch/arm64/kernel/fpsimd.c:1212:2: note: in expansion of macro
'get_cpu_fpsimd_context'
1212 | get_cpu_fpsimd_context();
| ^~
In file included from ./arch/arm64/include/asm/irqflags.h:12,
from ./include/linux/irqflags.h:16,
from ./include/linux/spinlock.h:54,
from ./include/linux/seqlock.h:36,
from ./include/linux/time.h:6,
from ./include/linux/compat.h:10,
from arch/arm64/kernel/fpsimd.c:14:
./arch/arm64/include/asm/ipipe_hwirq.h:36:10: error: expected expression before
')' token
36 | : "r" (x) \
| ^
./arch/arm64/include/asm/ipipe_hwirq.h:134:35: note: in expansion of macro
'hard_local_irq_restore_notrace'
134 | #define hard_local_irq_restorehard_local_irq_restore_notrace
| ^~
./include/linux/preempt.h:269:4: note: in expansion of macro
'hard_local_irq_restore'
269 |hard_local_irq_restore(__flags__); \