[Xenomai-core] [patch] fix pthread_set_mode_np

2006-05-25 Thread Jan Kiszka
Hi Gilles,

obviously, the userspace part of pthread_set_mode_np was forgotten on
the last refactoring. This fixes it.

Jan
Index: src/skins/posix/thread.c
===
--- src/skins/posix/thread.c	(Revision 1136)
+++ src/skins/posix/thread.c	(Arbeitskopie)
@@ -213,12 +213,10 @@ int pthread_set_mode_np (int clrmask,
 			 int setmask)
 {
 extern int xeno_sigxcpu_no_mlock;
-pthread_t tid = pthread_self();
 int err;
 
-err = -XENOMAI_SKINCALL3(__pse51_muxid,
+err = -XENOMAI_SKINCALL2(__pse51_muxid,
 			 __pse51_thread_set_mode,
-			 tid, /* Do not inline. */
 			 clrmask,
 			 setmask);
 


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


[Xenomai-core] Porting xeno-{info|load|test} to a busybox system

2006-05-25 Thread Niklaus Giger
Hi

For my embedded target system I installed BusyBox as it was the easiest way to 
get a small GNU/Linux system to boot into a working shell. (But it takes less 
than 16 seconds from power on till the the familiar login:  prompt.)

But I ran into the problem, that the xeno-*-applications did not run under the 
busybox environment. Here are some comment on my proposed changes.

1) To make a shell work under the busybox I had to specify #! /bin/sh instead 
of #! /bin/bash.

2) To make the run I run the xeno-*-applications on my Debian GNU/Linux 
PowerBook 
either as:
$ xeno-info
or as 
$ busybox sh xeno-info

3) Once all tests passed on my PowerBook, I switched to the embedded PPC405GPr 
board using a recent busybox (version 1.1.3).
This exposed some more not supported errors, eg.
fdformat: unrecognized option `--version'
Also on an embedded system a lot of the usual utilites like gcc, make, etc are 
not present. Therefore I checked for their existence with expressions like 
`which make`

4) As the BSD utility script is not present on my embedded system, 
xeno-test -L does not work.

5) The busybox shell does not know arrays. Also for unknown reasons the 
dd_jobs variable got not updated outside of the function generate_loads. 
Therefore I added a killall dd in the cleanup.

6) trap CHLD did not work under the BusyBox. Also (to be sure) called 
cleanup_load manually before exit.

7) Id did not ident the not busybox parts in xeno-info. This makes the patch 
smaller and more readable, but should probably be corrected before applying 
it.

8) Using `dirname $0` relative paths to make xeno-test work also if not called 
in /usr/xenomai/bin

9) Changing the e-mail address to [EMAIL PROTECTED] is also included.

Checking the changes between running xeno-test (as bash or as busybox) and the 
old one did not reveal any significant changes. On my PPC405 system I could 
not complete this test as there segmentation faults running the invidual 
tests.

I would appreciate if these changes (or similar) could go -- after a review -- 
into the trunk (not necessarily before 2.2). I am specially interested in Jim 
Cromie's opinion. 

If anybody has a working target with a Xenomai + BusyBox combination and would 
be willing to test drive my changes, I would appreciate a feedback 
enormously.

These changes are a precondition to make the buildbot run xeno-test on the 
only board where I can easily and automatically switch the power off and on, 
without risking a family crisis.

Best regards
-- 
Niklaus Giger
Index: scripts/xeno-config.in
===
--- scripts/xeno-config.in	(Revision 1135)
+++ scripts/xeno-config.in	(Arbeitskopie)
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
 
 staging=${DESTDIR}
 prefix=@prefix@
Index: scripts/xeno-info
===
--- scripts/xeno-info	(Revision 1135)
+++ scripts/xeno-info	(Arbeitskopie)
@@ -1,31 +1,51 @@
-#!/bin/sh
+#! /bin/sh
 #
 # This file has been lifted 'as is' from linux/scripts/ver_linux.
-#
+# Adapted to be run also under the BusyBox. If you want to test it under the BusyBox use
+# busybox sh xeno-info 
 
 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:$PATH
 echo 'If some fields are empty or look unusual you may have an old version.'
 echo 'Compare to the current minimal requirements in Documentation/Changes.'
 echo ' '
 
+withBusybox=0
+if test -L $SHELL ; then # is sh a logical link to busybox
+exeName=`ls -l $SHELL|cut -d\  -f2`
+if test `basename $exeName` = busybox;  then
+	withBusybox=1; else echo 2.3
+fi
+elif test -n $_ -a `basename $_` = busybox; then
+withBusybox=1;
+# else running a real /bin/sh (bash) shell
+fi
+
+if test $withBusybox -eq 1; then busybox | grep -i BusyBox v ; fi
+
 uname -a
 echo ' '
 
+if test -n `which gcc` ; then
 gcc --version 21| head -n 1 | grep -v gcc | awk \
 'NR==1{print Gnu C , $1}'
 
 gcc --version 21| grep gcc | awk \
 'NR==1{print Gnu C , $3}'
+fi
 
+if test -n `which gcc` ; then
 make --version 21 | awk -F, '{print $1}' | awk \
   '/GNU Make/{print Gnu make  ,$NF}'
+fi
 
 ld -v 21 | awk -F\) '{print $1}' | awk \
   '/BFD/{print binutils  ,$NF}'
 
+if test 0 -eq $withBusybox ; then 
 fdformat --version | awk -F\- '{print util-linux, $NF}'
 
 mount --version | awk -F\- '{print mount , $NF}'
+fi 
 
 depmod -V  21 | awk 'NR==1 {print module-init-tools ,$NF}'
 
@@ -50,21 +70,26 @@
 isdnctrl 21 | grep version | awk \
 'NR==1{print isdn4k-utils  , $NF}'
 
+if test -n `which ldd` ; then
 ls -l `ldd /bin/sh | awk '/libc/{print $3}'` | sed \
 -e 's/\.so$//' | awk -F'[.-]'   '{print Linux C Library \
 $(NF-2).$(NF-1).$NF}'
 
 ldd -v  /dev/null 21  ldd -v || ldd --version |head -n1 | awk \
 'NR==1{print Dynamic linker (ldd)  , $NF}'
+fi
 
 ls -l /usr/lib/lib{g,stdc}++.so  2/dev/null | awk -F. \
'{print