Skip to contentSkip to conversation

fix ffnz for 64-bit hosts

PATCH Applied Jan Kiszka 2 participants 2 messages Apr 23, 2007 – Apr 24, 2007

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 fix ffnz for 64-bit hosts

I'm just not sure if "#define _GNU_SOURCE" is the preferred way to go.

include/asm-sim/system.h +2 -1
Index: xenomai/include/asm-sim/system.h
===================================================================
@@ -24,6 +24,7 @@
 
 #include <asm/param.h>
 #include <errno.h>
+#define _GNU_SOURCE
 #include <string.h>
 #include <malloc.h>
 #include <stdlib.h>
@@ -172,7 +173,7 @@ static inline unsigned long long xnarch_
 
 static inline unsigned long ffnz (unsigned long word)
 {
-    return ffs((int)word) - 1;
+    return ffsl(word) - 1;
 }
 
 #define xnarch_stack_size(tcb)    0
ChangeLog +2 -0
Index: xenomai/ChangeLog
===================================================================
@@ -5,6 +5,8 @@
 
 	* include/nucleus/system.h: Remove unused (and bogus) ffnz wrapper.
 
+	* include/asm-sim/system.h: Fix ffnz for 64-bit hosts.
+
 2007-04-19  Philippe Gerum  <[email protected]>
 
 	* ksrc/skins/vrtx/module.c, ksrc/nucleus/pipe.c,
#1 lore raw
Quoted 2 lines · Jan Kiszka

I'm just not sure if "#define _GNU_SOURCE" is the preferred way to go.

It's already there when compiling the skins in simulation mode.

Quoted 14 lines

Index: xenomai/include/asm-sim/system.h
===================================================================

include/asm-sim/system.h +1 -0
@@ -24,6 +24,7 @@
 
 #include <asm/param.h>
 #include <errno.h>
+#define _GNU_SOURCE
 #include <string.h>
 #include <malloc.h>
 #include <stdlib.h>

include/asm-sim/system.h static inline unsigned long long xnarch_ · line 178

Quoted 7 lines
include/asm-sim/system.h +1 -1
@@ -172,7 +173,7 @@ static inline unsigned long long xnarch_
 
 static inline unsigned long ffnz (unsigned long word)
 {
-    return ffs((int)word) - 1;
+    return ffsl(word) - 1;
 }
 

Merged, thanks.

Quoted 19 lines
include/asm-sim/system.h +0 -0
 #define xnarch_stack_size(tcb)    0

Index: xenomai/ChangeLog
===================================================================

ChangeLog +2 -0
@@ -5,6 +5,8 @@
 
 	* include/nucleus/system.h: Remove unused (and bogus) ffnz wrapper.
 
+	* include/asm-sim/system.h: Fix ffnz for 64-bit hosts.
+
 2007-04-19  Philippe Gerum  <[email protected]>
 
 	* ksrc/skins/vrtx/module.c, ksrc/nucleus/pipe.c,

_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core

Signature · 1 line
Philippe.