* [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes
@ 2011-10-19 7:35 Thomas De Schampheleire
2011-10-19 7:35 ` [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL Thomas De Schampheleire
` (4 more replies)
0 siblings, 5 replies; 22+ messages in thread
From: Thomas De Schampheleire @ 2011-10-19 7:35 UTC (permalink / raw)
To: xenomai
This patch series includes some misc. fixes to xenomai-forge:
* definition of ERR_OBJTFULL (should also be added to Xenomai proper)
* port long_names feature to xenomai-forge and fix it
* add tm_getm() function (not present in pSOS but present in Xenomai proper)
* fix compiler warning in task.c
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@domain.hid>
Signed-off-by: Ronny Meeus <ronny.meeus@domain.hid>
---
include/psos/Makefile.am | 2 +-
include/psos/Makefile.in | 2 +-
include/psos/long_names.h | 14 ++++++++++++++
include/psos/psos.h | 5 +++++
lib/psos/init.c | 15 +++++++++++++++
lib/psos/pt.c | 6 ++++++
lib/psos/queue.c | 6 ++++++
lib/psos/rn.c | 5 +++++
lib/psos/sem.c | 6 ++++++
lib/psos/task.c | 9 +++++++--
lib/psos/tm.c | 7 +++++++
11 files changed, 73 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 22+ messages in thread* [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL 2011-10-19 7:35 [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire @ 2011-10-19 7:35 ` Thomas De Schampheleire 2011-10-26 10:19 ` Philippe Gerum 2011-10-19 7:35 ` [Xenomai-help] [PATCH 2 of 4] psos: port long_names feature to xenomai-forge Thomas De Schampheleire ` (3 subsequent siblings) 4 siblings, 1 reply; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-19 7:35 UTC (permalink / raw) To: xenomai Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@domain.hid> Signed-off-by: Ronny Meeus <ronny.meeus@domain.hid> --- include/psos/psos.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/psos/psos.h b/include/psos/psos.h --- a/include/psos/psos.h +++ b/include/psos/psos.h @@ -97,6 +97,7 @@ #define ERR_OBJDEL 0x05 #define ERR_OBJID 0x06 #define ERR_OBJTYPE 0x07 +#define ERR_OBJTFULL 0x08 #define ERR_OBJNF 0x09 #define ERR_NOTCB 0x0E ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL 2011-10-19 7:35 ` [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL Thomas De Schampheleire @ 2011-10-26 10:19 ` Philippe Gerum 2011-10-26 10:26 ` Thomas De Schampheleire 0 siblings, 1 reply; 22+ messages in thread From: Philippe Gerum @ 2011-10-26 10:19 UTC (permalink / raw) To: Thomas De Schampheleire, xenomai On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: > Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid> > Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> > > --- > include/psos/psos.h | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/include/psos/psos.h b/include/psos/psos.h > --- a/include/psos/psos.h > +++ b/include/psos/psos.h > @@ -97,6 +97,7 @@ > #define ERR_OBJDEL 0x05 > #define ERR_OBJID 0x06 > #define ERR_OBJTYPE 0x07 > +#define ERR_OBJTFULL 0x08 > #define ERR_OBJNF 0x09 > > #define ERR_NOTCB 0x0E Where is this error code used in the Xenomai tree? Can't find it right now. -- Philippe. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL 2011-10-26 10:19 ` Philippe Gerum @ 2011-10-26 10:26 ` Thomas De Schampheleire 2011-10-26 10:33 ` Philippe Gerum 0 siblings, 1 reply; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-26 10:26 UTC (permalink / raw) To: Philippe Gerum; +Cc: xenomai Hi, On Wed, Oct 26, 2011 at 12:19 PM, Philippe Gerum <rpm@xenomai.org> wrote: > On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >> >> Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid> >> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >> >> --- >> include/psos/psos.h | 1 + >> 1 files changed, 1 insertions(+), 0 deletions(-) >> >> diff --git a/include/psos/psos.h b/include/psos/psos.h >> --- a/include/psos/psos.h >> +++ b/include/psos/psos.h >> @@ -97,6 +97,7 @@ >> #define ERR_OBJDEL 0x05 >> #define ERR_OBJID 0x06 >> #define ERR_OBJTYPE 0x07 >> +#define ERR_OBJTFULL 0x08 >> #define ERR_OBJNF 0x09 >> >> #define ERR_NOTCB 0x0E > > Where is this error code used in the Xenomai tree? Can't find it right now. It's not used in the Xenomai code itself, but it may be used by applications. The definition is absent both in Xenomai as Xenomai-forge. ~Thomas ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL 2011-10-26 10:26 ` Thomas De Schampheleire @ 2011-10-26 10:33 ` Philippe Gerum 2011-10-26 11:11 ` Thomas De Schampheleire 0 siblings, 1 reply; 22+ messages in thread From: Philippe Gerum @ 2011-10-26 10:33 UTC (permalink / raw) To: Thomas De Schampheleire; +Cc: xenomai On 10/26/2011 12:26 PM, Thomas De Schampheleire wrote: > Hi, > > On Wed, Oct 26, 2011 at 12:19 PM, Philippe Gerum<rpm@xenomai.org> wrote: >> On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >>> >>> Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid> >>> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >>> >>> --- >>> include/psos/psos.h | 1 + >>> 1 files changed, 1 insertions(+), 0 deletions(-) >>> >>> diff --git a/include/psos/psos.h b/include/psos/psos.h >>> --- a/include/psos/psos.h >>> +++ b/include/psos/psos.h >>> @@ -97,6 +97,7 @@ >>> #define ERR_OBJDEL 0x05 >>> #define ERR_OBJID 0x06 >>> #define ERR_OBJTYPE 0x07 >>> +#define ERR_OBJTFULL 0x08 >>> #define ERR_OBJNF 0x09 >>> >>> #define ERR_NOTCB 0x0E >> >> Where is this error code used in the Xenomai tree? Can't find it right now. > > It's not used in the Xenomai code itself, but it may be used by applications. > The definition is absent both in Xenomai as Xenomai-forge. > > ~Thomas > Yes, the point is that so far, only the errors the Xenomai emulation does return are mentioned in this file. But we should merge this anyhow, since the original *_create() calls could throw this, so the app has to check despite Xenomai won't fail this way, right? -- Philippe. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL 2011-10-26 10:33 ` Philippe Gerum @ 2011-10-26 11:11 ` Thomas De Schampheleire 2011-10-26 12:01 ` Philippe Gerum 0 siblings, 1 reply; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-26 11:11 UTC (permalink / raw) To: Philippe Gerum; +Cc: xenomai Hi, On Wed, Oct 26, 2011 at 12:33 PM, Philippe Gerum <rpm@xenomai.org> wrote: > On 10/26/2011 12:26 PM, Thomas De Schampheleire wrote: >> >> Hi, >> >> On Wed, Oct 26, 2011 at 12:19 PM, Philippe Gerum<rpm@xenomai.org> wrote: >>> >>> On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >>>> >>>> Signed-off-by: Thomas De >>>> Schampheleire<thomas.de.schampheleire@domain.hid> >>>> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >>>> >>>> --- >>>> include/psos/psos.h | 1 + >>>> 1 files changed, 1 insertions(+), 0 deletions(-) >>>> >>>> diff --git a/include/psos/psos.h b/include/psos/psos.h >>>> --- a/include/psos/psos.h >>>> +++ b/include/psos/psos.h >>>> @@ -97,6 +97,7 @@ >>>> #define ERR_OBJDEL 0x05 >>>> #define ERR_OBJID 0x06 >>>> #define ERR_OBJTYPE 0x07 >>>> +#define ERR_OBJTFULL 0x08 >>>> #define ERR_OBJNF 0x09 >>>> >>>> #define ERR_NOTCB 0x0E >>> >>> Where is this error code used in the Xenomai tree? Can't find it right >>> now. >> >> It's not used in the Xenomai code itself, but it may be used by >> applications. >> The definition is absent both in Xenomai as Xenomai-forge. >> >> ~Thomas >> > > Yes, the point is that so far, only the errors the Xenomai emulation does > return are mentioned in this file. But we should merge this anyhow, since > the original *_create() calls could throw this, so the app has to check > despite Xenomai won't fail this way, right? Ok, I understand the origin now. But indeed, as you say, legacy apps may still check for ERR_OBJTFULL or any other definition that was in the original psos.h, so Xenomai / Xenomai-forge has to supply these values as well. ~Thomas ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL 2011-10-26 11:11 ` Thomas De Schampheleire @ 2011-10-26 12:01 ` Philippe Gerum 0 siblings, 0 replies; 22+ messages in thread From: Philippe Gerum @ 2011-10-26 12:01 UTC (permalink / raw) To: Thomas De Schampheleire; +Cc: xenomai On 10/26/2011 01:11 PM, Thomas De Schampheleire wrote: > Hi, > > On Wed, Oct 26, 2011 at 12:33 PM, Philippe Gerum<rpm@xenomai.org> wrote: >> On 10/26/2011 12:26 PM, Thomas De Schampheleire wrote: >>> >>> Hi, >>> >>> On Wed, Oct 26, 2011 at 12:19 PM, Philippe Gerum<rpm@xenomai.org> wrote: >>>> >>>> On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >>>>> >>>>> Signed-off-by: Thomas De >>>>> Schampheleire<thomas.de.schampheleire@domain.hid> >>>>> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >>>>> >>>>> --- >>>>> include/psos/psos.h | 1 + >>>>> 1 files changed, 1 insertions(+), 0 deletions(-) >>>>> >>>>> diff --git a/include/psos/psos.h b/include/psos/psos.h >>>>> --- a/include/psos/psos.h >>>>> +++ b/include/psos/psos.h >>>>> @@ -97,6 +97,7 @@ >>>>> #define ERR_OBJDEL 0x05 >>>>> #define ERR_OBJID 0x06 >>>>> #define ERR_OBJTYPE 0x07 >>>>> +#define ERR_OBJTFULL 0x08 >>>>> #define ERR_OBJNF 0x09 >>>>> >>>>> #define ERR_NOTCB 0x0E >>>> >>>> Where is this error code used in the Xenomai tree? Can't find it right >>>> now. >>> >>> It's not used in the Xenomai code itself, but it may be used by >>> applications. >>> The definition is absent both in Xenomai as Xenomai-forge. >>> >>> ~Thomas >>> >> >> Yes, the point is that so far, only the errors the Xenomai emulation does >> return are mentioned in this file. But we should merge this anyhow, since >> the original *_create() calls could throw this, so the app has to check >> despite Xenomai won't fail this way, right? > > Ok, I understand the origin now. > But indeed, as you say, legacy apps may still check for ERR_OBJTFULL > or any other definition that was in the original psos.h, so Xenomai / > Xenomai-forge has to supply these values as well. Ok, I'll merge this since this is explicitly defined by the original interface Xenomai does emulate. So, ok. > > ~Thomas > -- Philippe. ^ permalink raw reply [flat|nested] 22+ messages in thread
* [Xenomai-help] [PATCH 2 of 4] psos: port long_names feature to xenomai-forge 2011-10-19 7:35 [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire 2011-10-19 7:35 ` [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL Thomas De Schampheleire @ 2011-10-19 7:35 ` Thomas De Schampheleire 2011-10-26 10:21 ` Philippe Gerum 2011-10-19 7:35 ` [Xenomai-help] [PATCH 3 of 4] psos: add tm_getm function Thomas De Schampheleire ` (2 subsequent siblings) 4 siblings, 1 reply; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-19 7:35 UTC (permalink / raw) To: xenomai While psos interface accepts 4 character ids, non null terminated, xenomai uses longer ids which must be null terminated. Revert to the behaviour of psos interface, while allowing long id strings if the global variable psos_long_names is set to non-zero. This patch ports the original fix from xenomai to xenomai-forge, fixing following problems: * a bug in __psos_maybe_short_name so that only 3 characters are retained * the call to __psos_maybe_short_name also needs to be done in the ident functions * the pt_create and pt_ident functions also need to be adapted Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@domain.hid> Signed-off-by: Ronny Meeus <ronny.meeus@domain.hid> --- include/psos/Makefile.am | 2 +- include/psos/Makefile.in | 2 +- include/psos/long_names.h | 14 ++++++++++++++ include/psos/psos.h | 2 ++ lib/psos/init.c | 15 +++++++++++++++ lib/psos/pt.c | 6 ++++++ lib/psos/queue.c | 6 ++++++ lib/psos/rn.c | 5 +++++ lib/psos/sem.c | 6 ++++++ lib/psos/task.c | 5 +++++ 10 files changed, 61 insertions(+), 2 deletions(-) diff --git a/include/psos/Makefile.am b/include/psos/Makefile.am --- a/include/psos/Makefile.am +++ b/include/psos/Makefile.am @@ -1,3 +1,3 @@ includesubdir = $(includedir)/psos -includesub_HEADERS = psos.h +includesub_HEADERS = psos.h long_names.h diff --git a/include/psos/Makefile.in b/include/psos/Makefile.in --- a/include/psos/Makefile.in +++ b/include/psos/Makefile.in @@ -238,7 +238,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ includesubdir = $(includedir)/psos -includesub_HEADERS = psos.h +includesub_HEADERS = psos.h long_names.h all: all-am .SUFFIXES: diff --git a/include/psos/long_names.h b/include/psos/long_names.h new file mode 100644 --- /dev/null +++ b/include/psos/long_names.h @@ -0,0 +1,14 @@ +#ifndef LONG_NAMES_H +#define LONG_NAMES_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +const char *__psos_maybe_short_name(char shrt[5], const char *lng); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LONG_NAMES_H */ diff --git a/include/psos/psos.h b/include/psos/psos.h --- a/include/psos/psos.h +++ b/include/psos/psos.h @@ -371,6 +371,8 @@ u_long tm_wkwhen(u_long date, int psos_task_normalize_priority(unsigned long psos_prio); +extern unsigned psos_long_names; + #ifdef __cplusplus }; #endif /* __cplusplus */ diff --git a/lib/psos/init.c b/lib/psos/init.c --- a/lib/psos/init.c +++ b/lib/psos/init.c @@ -17,6 +17,7 @@ */ #include <stdio.h> +#include <string.h> #include <time.h> #include <stdlib.h> #include <unistd.h> @@ -27,6 +28,7 @@ #include <copperplate/clockobj.h> #include <copperplate/debug.h> #include <psos/psos.h> +#include <psos/long_names.h> #include "tm.h" #include "task.h" #include "sem.h" @@ -34,6 +36,8 @@ #include "pt.h" #include "rn.h" +unsigned psos_long_names; + static unsigned int clock_resolution = 1000000; /* 1ms */ static const struct option psos_options[] = { @@ -105,3 +109,14 @@ static __attribute__ ((constructor)) voi { copperplate_register_skin(&psos_skin); } + +const char *__psos_maybe_short_name(char shrt[5], const char *lng) +{ + if (psos_long_names) + return lng; + + strncpy(shrt, lng, 5 - 1); + shrt[4] = '\0'; + + return (const char *)shrt; +} diff --git a/lib/psos/pt.c b/lib/psos/pt.c --- a/lib/psos/pt.c +++ b/lib/psos/pt.c @@ -26,6 +26,7 @@ #include <copperplate/cluster.h> #include <copperplate/lock.h> #include <psos/psos.h> +#include <psos/long_names.h> #include "pt.h" #define pt_magic 0x8181fefe @@ -127,6 +128,7 @@ u_long pt_create(const char *name, u_long overhead; caddr_t mp; u_long n; + char short_name[5]; if ((uintptr_t)paddr & (sizeof(uintptr_t) - 1)) return ERR_PTADDR; @@ -145,6 +147,7 @@ u_long pt_create(const char *name, if (name == NULL || *name == '\0') sprintf(pt->name, "pt%lu", ++anon_ptids); else { + name = __psos_maybe_short_name(short_name, name); strncpy(pt->name, name, sizeof(pt->name)); pt->name[sizeof(pt->name) - 1] = '\0'; } @@ -289,10 +292,13 @@ u_long pt_ident(const char *name, u_long struct pvclusterobj *cobj; struct service svc; struct psos_pt *pt; + char short_name[5]; if (node) return ERR_NODENO; + name = __psos_maybe_short_name(short_name, name); + COPPERPLATE_PROTECT(svc); cobj = pvcluster_findobj(&psos_pt_table, name); COPPERPLATE_UNPROTECT(svc); diff --git a/lib/psos/queue.c b/lib/psos/queue.c --- a/lib/psos/queue.c +++ b/lib/psos/queue.c @@ -28,6 +28,7 @@ #include <copperplate/panic.h> #include <copperplate/cluster.h> #include <psos/psos.h> +#include <psos/long_names.h> #include "reference.h" #include "task.h" #include "queue.h" @@ -85,6 +86,7 @@ static u_long __q_create(const char *nam struct service svc; int sobj_flags = 0; int ret = SUCCESS; + char short_name[5]; COPPERPLATE_PROTECT(svc); @@ -97,6 +99,7 @@ static u_long __q_create(const char *nam if (name == NULL || *name == '\0') sprintf(q->name, "q%lu", ++anon_qids); else { + name = __psos_maybe_short_name(short_name, name); strncpy(q->name, name, sizeof(q->name)); q->name[sizeof(q->name) - 1] = '\0'; } @@ -197,10 +200,13 @@ static u_long __q_ident(const char *name struct clusterobj *cobj; struct psos_queue *q; struct service svc; + char short_name[5]; if (node) return ERR_NODENO; + name = __psos_maybe_short_name(short_name, name); + COPPERPLATE_PROTECT(svc); cobj = cluster_findobj(&psos_queue_table, name); COPPERPLATE_UNPROTECT(svc); diff --git a/lib/psos/rn.c b/lib/psos/rn.c --- a/lib/psos/rn.c +++ b/lib/psos/rn.c @@ -26,6 +26,7 @@ #include <copperplate/threadobj.h> #include <copperplate/clockobj.h> #include <psos/psos.h> +#include <psos/long_names.h> #include "tm.h" #include "rn.h" @@ -68,6 +69,7 @@ u_long rn_create(const char *name, void int sobj_flags = 0, ret = SUCCESS; struct psos_rn *rn; struct service svc; + char short_name[5]; if ((uintptr_t)saddr & (sizeof(uintptr_t) - 1)) return ERR_RNADDR; @@ -113,6 +115,7 @@ u_long rn_create(const char *name, void if (name == NULL || *name == '\0') sprintf(rn->name, "rn%lu", ++anon_rnids); else { + name = __psos_maybe_short_name(short_name, name); strncpy(rn->name, name, sizeof(rn->name)); rn->name[sizeof(rn->name) - 1] = '\0'; } @@ -190,6 +193,8 @@ u_long rn_ident(const char *name, u_long struct pvclusterobj *cobj; struct psos_rn *rn; struct service svc; + char short_name[5]; + name = __psos_maybe_short_name(short_name, name); COPPERPLATE_PROTECT(svc); cobj = pvcluster_findobj(&psos_rn_table, name); diff --git a/lib/psos/sem.c b/lib/psos/sem.c --- a/lib/psos/sem.c +++ b/lib/psos/sem.c @@ -30,6 +30,7 @@ #include "sem.h" #include "tm.h" #include <psos/psos.h> +#include <psos/long_names.h> #define sem_magic 0x8181fbfb @@ -77,6 +78,7 @@ u_long sm_create(const char *name, struct service svc; int sobj_flags = 0; int ret = SUCCESS; + char short_name[5]; COPPERPLATE_PROTECT(svc); @@ -89,6 +91,7 @@ u_long sm_create(const char *name, if (name == NULL || *name == '\0') sprintf(sem->name, "sm%lu", ++anon_smids); else { + name = __psos_maybe_short_name(short_name, name); strncpy(sem->name, name, sizeof(sem->name)); sem->name[sizeof(sem->name) - 1] = '\0'; } @@ -148,10 +151,13 @@ u_long sm_ident(const char *name, u_long struct clusterobj *cobj; struct psos_sem *sem; struct service svc; + char short_name[5]; if (node) return ERR_NODENO; + name = __psos_maybe_short_name(short_name, name); + COPPERPLATE_PROTECT(svc); cobj = cluster_findobj(&psos_sem_table, name); COPPERPLATE_UNPROTECT(svc); diff --git a/lib/psos/task.c b/lib/psos/task.c --- a/lib/psos/task.c +++ b/lib/psos/task.c @@ -33,6 +33,7 @@ #include <copperplate/clockobj.h> #include <copperplate/cluster.h> #include <psos/psos.h> +#include <psos/long_names.h> #include "task.h" #include "tm.h" @@ -247,6 +248,7 @@ u_long t_create(const char *name, u_long struct syncstate syns; struct service svc; int ret, cprio; + char short_name[5]; ret = check_task_priority(prio, &cprio); if (ret) @@ -276,6 +278,7 @@ u_long t_create(const char *name, u_long if (name == NULL || *name == '\0') sprintf(task->name, "t%lu", ++anon_tids); else { + name = __psos_maybe_short_name(short_name, name); strncpy(task->name, name, sizeof(task->name)); task->name[sizeof(task->name) - 1] = '\0'; } @@ -460,6 +463,7 @@ u_long t_ident(const char *name, u_long struct psos_task *task; struct service svc; int ret = SUCCESS; + char short_name[5]; if (node) return ERR_NODENO; @@ -471,6 +475,7 @@ u_long t_ident(const char *name, u_long if (task == NULL) goto out; } else { + name = __psos_maybe_short_name(short_name, name); cobj = cluster_findobj(&psos_task_table, name); if (cobj == NULL) { ret = ERR_OBJNF; ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 2 of 4] psos: port long_names feature to xenomai-forge 2011-10-19 7:35 ` [Xenomai-help] [PATCH 2 of 4] psos: port long_names feature to xenomai-forge Thomas De Schampheleire @ 2011-10-26 10:21 ` Philippe Gerum 2011-10-26 10:41 ` Thomas De Schampheleire 0 siblings, 1 reply; 22+ messages in thread From: Philippe Gerum @ 2011-10-26 10:21 UTC (permalink / raw) To: Thomas De Schampheleire; +Cc: xenomai On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: > While psos interface accepts 4 character ids, non null terminated, > xenomai uses longer ids which must be null terminated. Revert to > the behaviour of psos interface, while allowing long id strings if > the global variable psos_long_names is set to non-zero. > > This patch ports the original fix from xenomai to xenomai-forge, > fixing following problems: > * a bug in __psos_maybe_short_name so that only 3 characters are > retained > * the call to __psos_maybe_short_name also needs to be done in the > ident functions > * the pt_create and pt_ident functions also need to be adapted > Please merge long_names.h into psos.h, having a separate header for this is way overkill and brings nothing. -- Philippe. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 2 of 4] psos: port long_names feature to xenomai-forge 2011-10-26 10:21 ` Philippe Gerum @ 2011-10-26 10:41 ` Thomas De Schampheleire 2011-10-26 11:57 ` Philippe Gerum 0 siblings, 1 reply; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-26 10:41 UTC (permalink / raw) To: Philippe Gerum; +Cc: xenomai On Wed, Oct 26, 2011 at 12:21 PM, Philippe Gerum <rpm@xenomai.org> wrote: > On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >> >> While psos interface accepts 4 character ids, non null terminated, >> xenomai uses longer ids which must be null terminated. Revert to >> the behaviour of psos interface, while allowing long id strings if >> the global variable psos_long_names is set to non-zero. >> >> This patch ports the original fix from xenomai to xenomai-forge, >> fixing following problems: >> * a bug in __psos_maybe_short_name so that only 3 characters are >> retained >> * the call to __psos_maybe_short_name also needs to be done in the >> ident functions >> * the pt_create and pt_ident functions also need to be adapted >> > > Please merge long_names.h into psos.h, having a separate header for this is > way overkill and brings nothing. It avoids exposing an internal interface to applications through psos.h. If anything, I think we should make a psos_internal.h or whatever, that can host __psos_maybe_short_name among others. ~Thomas ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 2 of 4] psos: port long_names feature to xenomai-forge 2011-10-26 10:41 ` Thomas De Schampheleire @ 2011-10-26 11:57 ` Philippe Gerum 0 siblings, 0 replies; 22+ messages in thread From: Philippe Gerum @ 2011-10-26 11:57 UTC (permalink / raw) To: Thomas De Schampheleire; +Cc: xenomai On 10/26/2011 12:41 PM, Thomas De Schampheleire wrote: > On Wed, Oct 26, 2011 at 12:21 PM, Philippe Gerum<rpm@xenomai.org> wrote: >> On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >>> >>> While psos interface accepts 4 character ids, non null terminated, >>> xenomai uses longer ids which must be null terminated. Revert to >>> the behaviour of psos interface, while allowing long id strings if >>> the global variable psos_long_names is set to non-zero. >>> >>> This patch ports the original fix from xenomai to xenomai-forge, >>> fixing following problems: >>> * a bug in __psos_maybe_short_name so that only 3 characters are >>> retained >>> * the call to __psos_maybe_short_name also needs to be done in the >>> ident functions >>> * the pt_create and pt_ident functions also need to be adapted >>> >> >> Please merge long_names.h into psos.h, having a separate header for this is >> way overkill and brings nothing. > > It avoids exposing an internal interface to applications through psos.h. > If anything, I think we should make a psos_internal.h or whatever, > that can host __psos_maybe_short_name among others. Yes, that would be better. include/psos is really for external stuff anyway. lib/psos/internal.h would make sense. > > ~Thomas > -- Philippe. ^ permalink raw reply [flat|nested] 22+ messages in thread
* [Xenomai-help] [PATCH 3 of 4] psos: add tm_getm function 2011-10-19 7:35 [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire 2011-10-19 7:35 ` [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL Thomas De Schampheleire 2011-10-19 7:35 ` [Xenomai-help] [PATCH 2 of 4] psos: port long_names feature to xenomai-forge Thomas De Schampheleire @ 2011-10-19 7:35 ` Thomas De Schampheleire 2011-10-26 10:22 ` Philippe Gerum 2011-10-19 7:35 ` [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized Thomas De Schampheleire 2011-10-26 9:44 ` [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire 4 siblings, 1 reply; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-19 7:35 UTC (permalink / raw) To: xenomai Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@domain.hid> Signed-off-by: Ronny Meeus <ronny.meeus@domain.hid> --- include/psos/psos.h | 2 ++ lib/psos/tm.c | 7 +++++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/include/psos/psos.h b/include/psos/psos.h --- a/include/psos/psos.h +++ b/include/psos/psos.h @@ -363,6 +363,8 @@ u_long tm_set(u_long date, u_long time, u_long ticks); +u_long tm_getm(unsigned long long *ns); + u_long tm_wkafter(u_long ticks); u_long tm_wkwhen(u_long date, diff --git a/lib/psos/tm.c b/lib/psos/tm.c --- a/lib/psos/tm.c +++ b/lib/psos/tm.c @@ -309,3 +309,10 @@ u_long tm_get(u_long *date_r, u_long *ti return SUCCESS; } + +u_long tm_getm(unsigned long long *ns_r) +{ + *ns_r = clockobj_get_tsc(); + return SUCCESS; +} + ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 3 of 4] psos: add tm_getm function 2011-10-19 7:35 ` [Xenomai-help] [PATCH 3 of 4] psos: add tm_getm function Thomas De Schampheleire @ 2011-10-26 10:22 ` Philippe Gerum 2011-10-26 10:42 ` Thomas De Schampheleire 0 siblings, 1 reply; 22+ messages in thread From: Philippe Gerum @ 2011-10-26 10:22 UTC (permalink / raw) To: Thomas De Schampheleire; +Cc: xenomai On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: > Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid> > Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> > > --- > include/psos/psos.h | 2 ++ > lib/psos/tm.c | 7 +++++++ > 2 files changed, 9 insertions(+), 0 deletions(-) > > diff --git a/include/psos/psos.h b/include/psos/psos.h > --- a/include/psos/psos.h > +++ b/include/psos/psos.h > @@ -363,6 +363,8 @@ u_long tm_set(u_long date, > u_long time, > u_long ticks); > > +u_long tm_getm(unsigned long long *ns); > + > u_long tm_wkafter(u_long ticks); > > u_long tm_wkwhen(u_long date, > diff --git a/lib/psos/tm.c b/lib/psos/tm.c > --- a/lib/psos/tm.c > +++ b/lib/psos/tm.c > @@ -309,3 +309,10 @@ u_long tm_get(u_long *date_r, u_long *ti > > return SUCCESS; > } > + > +u_long tm_getm(unsigned long long *ns_r) > +{ > + *ns_r = clockobj_get_tsc(); > + return SUCCESS; > +} - *ns_r = clockobj_get_tsc(); + *ns_r = clockobj_tsc_to_ns(clockobj_get_tsc()); -- Philippe. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 3 of 4] psos: add tm_getm function 2011-10-26 10:22 ` Philippe Gerum @ 2011-10-26 10:42 ` Thomas De Schampheleire 0 siblings, 0 replies; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-26 10:42 UTC (permalink / raw) To: Philippe Gerum; +Cc: xenomai On Wed, Oct 26, 2011 at 12:22 PM, Philippe Gerum <rpm@xenomai.org> wrote: > On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >> >> Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid> >> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >> >> --- >> include/psos/psos.h | 2 ++ >> lib/psos/tm.c | 7 +++++++ >> 2 files changed, 9 insertions(+), 0 deletions(-) >> >> diff --git a/include/psos/psos.h b/include/psos/psos.h >> --- a/include/psos/psos.h >> +++ b/include/psos/psos.h >> @@ -363,6 +363,8 @@ u_long tm_set(u_long date, >> u_long time, >> u_long ticks); >> >> +u_long tm_getm(unsigned long long *ns); >> + >> u_long tm_wkafter(u_long ticks); >> >> u_long tm_wkwhen(u_long date, >> diff --git a/lib/psos/tm.c b/lib/psos/tm.c >> --- a/lib/psos/tm.c >> +++ b/lib/psos/tm.c >> @@ -309,3 +309,10 @@ u_long tm_get(u_long *date_r, u_long *ti >> >> return SUCCESS; >> } >> + >> +u_long tm_getm(unsigned long long *ns_r) >> +{ >> + *ns_r = clockobj_get_tsc(); >> + return SUCCESS; >> +} > > - *ns_r = clockobj_get_tsc(); > + *ns_r = clockobj_tsc_to_ns(clockobj_get_tsc()); > Ok, thanks. ^ permalink raw reply [flat|nested] 22+ messages in thread
* [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized 2011-10-19 7:35 [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire ` (2 preceding siblings ...) 2011-10-19 7:35 ` [Xenomai-help] [PATCH 3 of 4] psos: add tm_getm function Thomas De Schampheleire @ 2011-10-19 7:35 ` Thomas De Schampheleire 2011-10-26 10:25 ` Philippe Gerum 2011-10-26 9:44 ` [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire 4 siblings, 1 reply; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-19 7:35 UTC (permalink / raw) To: xenomai Assign default 1 to satisfy compiler (tested with gcc 4.4.3) Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@domain.hid> Signed-off-by: Ronny Meeus <ronny.meeus@domain.hid> --- lib/psos/task.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/psos/task.c b/lib/psos/task.c --- a/lib/psos/task.c +++ b/lib/psos/task.c @@ -247,7 +247,7 @@ u_long t_create(const char *name, u_long pthread_attr_t thattr; struct syncstate syns; struct service svc; - int ret, cprio; + int ret, cprio = 1; char short_name[5]; ret = check_task_priority(prio, &cprio); @@ -414,7 +414,7 @@ u_long t_resume(u_long tid) u_long t_setpri(u_long tid, u_long newprio, u_long *oldprio_r) { struct psos_task *task; - int ret, cprio; + int ret, cprio = 1; task = get_psos_task_or_self(tid, &ret); if (task == NULL) ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized 2011-10-19 7:35 ` [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized Thomas De Schampheleire @ 2011-10-26 10:25 ` Philippe Gerum 2011-10-26 11:04 ` Thomas De Schampheleire 0 siblings, 1 reply; 22+ messages in thread From: Philippe Gerum @ 2011-10-26 10:25 UTC (permalink / raw) To: Thomas De Schampheleire; +Cc: xenomai On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: > Assign default 1 to satisfy compiler (tested with gcc 4.4.3) > > Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid> > Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> > > --- > lib/psos/task.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/psos/task.c b/lib/psos/task.c > --- a/lib/psos/task.c > +++ b/lib/psos/task.c > @@ -247,7 +247,7 @@ u_long t_create(const char *name, u_long > pthread_attr_t thattr; > struct syncstate syns; > struct service svc; > - int ret, cprio; > + int ret, cprio = 1; > char short_name[5]; > > ret = check_task_priority(prio,&cprio); > @@ -414,7 +414,7 @@ u_long t_resume(u_long tid) > u_long t_setpri(u_long tid, u_long newprio, u_long *oldprio_r) > { > struct psos_task *task; > - int ret, cprio; > + int ret, cprio = 1; > > task = get_psos_task_or_self(tid,&ret); > if (task == NULL) > Looks like 4.4.3 is wrong, 4.4.4+ does it better and does not choke. Just to make sure the optimizer is given a chance to see the truth, could you try without this patch, but with tagging check_task_priority() as inline instead, with --disable-debug, then with --enable-debug=full switches? TIA, -- Philippe. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized 2011-10-26 10:25 ` Philippe Gerum @ 2011-10-26 11:04 ` Thomas De Schampheleire 2011-10-26 11:58 ` Philippe Gerum 0 siblings, 1 reply; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-26 11:04 UTC (permalink / raw) To: Philippe Gerum; +Cc: xenomai On Wed, Oct 26, 2011 at 12:25 PM, Philippe Gerum <rpm@xenomai.org> wrote: > On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >> >> Assign default 1 to satisfy compiler (tested with gcc 4.4.3) >> >> Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid> >> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >> >> --- >> lib/psos/task.c | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/lib/psos/task.c b/lib/psos/task.c >> --- a/lib/psos/task.c >> +++ b/lib/psos/task.c >> @@ -247,7 +247,7 @@ u_long t_create(const char *name, u_long >> pthread_attr_t thattr; >> struct syncstate syns; >> struct service svc; >> - int ret, cprio; >> + int ret, cprio = 1; >> char short_name[5]; >> >> ret = check_task_priority(prio,&cprio); >> @@ -414,7 +414,7 @@ u_long t_resume(u_long tid) >> u_long t_setpri(u_long tid, u_long newprio, u_long *oldprio_r) >> { >> struct psos_task *task; >> - int ret, cprio; >> + int ret, cprio = 1; >> >> task = get_psos_task_or_self(tid,&ret); >> if (task == NULL) >> > > Looks like 4.4.3 is wrong, 4.4.4+ does it better and does not choke. Just to > make sure the optimizer is given a chance to see the truth, could you try > without this patch, but with tagging check_task_priority() as inline > instead, with --disable-debug, then with --enable-debug=full switches? Without this patch, inlined check_task_prio, --disable-debug: /bin/sh ../../libtool --tag=CC --mode=compile /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc -DHAVE_CONFIG_H -I. -I../../lib/include -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo -MD -MP -MF .deps/libpsos_la-task.Tpo -c -o libpsos_la-task.lo `test -f 'task.c' || echo './'`task.c libtool: compile: /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc -DHAVE_CONFIG_H -I. -I../../lib/include -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo -MD -MP -MF .deps/libpsos_la-task.Tpo -c task.c -fPIC -DPIC -o .libs/libpsos_la-task.o cc1: warnings being treated as errors task.c: In function 't_setpri': task.c:417: error: 'cprio' may be used uninitialized in this function make[3]: *** [libpsos_la-task.lo] Error 1 Without this patch, inlined check_task_prio, --enable-debug=full /bin/sh ../../libtool --tag=CC --mode=compile /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc -DHAVE_CONFIG_H -I. -I../../lib/include -g -D__XENO_DEBUG__ -D__XENO_DEBUG_FULL__ -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo -MD -MP -MF .deps/libpsos_la-task.Tpo -c -o libpsos_la-task.lo `test -f 'task.c' || echo './'`task.c libtool: compile: /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc -DHAVE_CONFIG_H -I. -I../../lib/include -g -D__XENO_DEBUG__ -D__XENO_DEBUG_FULL__ -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo -MD -MP -MF .deps/libpsos_la-task.Tpo -c task.c -fPIC -DPIC -o .libs/libpsos_la-task.o cc1: warnings being treated as errors task.c: In function 't_setpri': task.c:417: error: 'cprio' may be used uninitialized in this function make[3]: *** [libpsos_la-task.lo] Error 1 So, debug or not, compiler keeps complaining. For your reference, this is the change I did instead of the patch: diff --git a/lib/psos/task.c b/lib/psos/task.c --- a/lib/psos/task.c +++ b/lib/psos/task.c @@ -228,7 +228,7 @@ int psos_task_normalize_priority(unsigne return psos_prio; } -static int check_task_priority(u_long psos_prio, int *core_prio) +static inline int check_task_priority(u_long psos_prio, int *core_prio) { if (psos_prio < 1 || psos_prio > 255) /* In theory. */ return ERR_PRIOR; powerpc-linux-gcc (crosstool-NG 1.12.1 - buildroot 2011.08-hgc55c56f04355) 4.4.3 Copyright (C) 2010 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ~Thomas ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized 2011-10-26 11:04 ` Thomas De Schampheleire @ 2011-10-26 11:58 ` Philippe Gerum 2011-10-26 12:32 ` Thomas De Schampheleire 0 siblings, 1 reply; 22+ messages in thread From: Philippe Gerum @ 2011-10-26 11:58 UTC (permalink / raw) To: Thomas De Schampheleire; +Cc: xenomai On 10/26/2011 01:04 PM, Thomas De Schampheleire wrote: > On Wed, Oct 26, 2011 at 12:25 PM, Philippe Gerum<rpm@xenomai.org> wrote: >> On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >>> >>> Assign default 1 to satisfy compiler (tested with gcc 4.4.3) >>> >>> Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid> >>> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >>> >>> --- >>> lib/psos/task.c | 4 ++-- >>> 1 files changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/lib/psos/task.c b/lib/psos/task.c >>> --- a/lib/psos/task.c >>> +++ b/lib/psos/task.c >>> @@ -247,7 +247,7 @@ u_long t_create(const char *name, u_long >>> pthread_attr_t thattr; >>> struct syncstate syns; >>> struct service svc; >>> - int ret, cprio; >>> + int ret, cprio = 1; >>> char short_name[5]; >>> >>> ret = check_task_priority(prio,&cprio); >>> @@ -414,7 +414,7 @@ u_long t_resume(u_long tid) >>> u_long t_setpri(u_long tid, u_long newprio, u_long *oldprio_r) >>> { >>> struct psos_task *task; >>> - int ret, cprio; >>> + int ret, cprio = 1; >>> >>> task = get_psos_task_or_self(tid,&ret); >>> if (task == NULL) >>> >> >> Looks like 4.4.3 is wrong, 4.4.4+ does it better and does not choke. Just to >> make sure the optimizer is given a chance to see the truth, could you try >> without this patch, but with tagging check_task_priority() as inline >> instead, with --disable-debug, then with --enable-debug=full switches? > > Without this patch, inlined check_task_prio, --disable-debug: > /bin/sh ../../libtool --tag=CC --mode=compile > /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc > -DHAVE_CONFIG_H -I. -I../../lib/include -O2 -D_GNU_SOURCE > -D_REENTRANT -Wall -pipe -Wstrict-prototypes -Wmissing-prototypes > -Wno-long-long -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ > -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE > -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo > -MD -MP -MF .deps/libpsos_la-task.Tpo -c -o libpsos_la-task.lo `test > -f 'task.c' || echo './'`task.c > libtool: compile: > /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc > -DHAVE_CONFIG_H -I. -I../../lib/include -O2 -D_GNU_SOURCE -D_REENTRANT > -Wall -pipe -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long > -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ > -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE > -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo > -MD -MP -MF .deps/libpsos_la-task.Tpo -c task.c -fPIC -DPIC -o > .libs/libpsos_la-task.o > cc1: warnings being treated as errors > task.c: In function 't_setpri': > task.c:417: error: 'cprio' may be used uninitialized in this function > make[3]: *** [libpsos_la-task.lo] Error 1 > > Without this patch, inlined check_task_prio, --enable-debug=full > /bin/sh ../../libtool --tag=CC --mode=compile > /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc > -DHAVE_CONFIG_H -I. -I../../lib/include -g -D__XENO_DEBUG__ > -D__XENO_DEBUG_FULL__ -D_GNU_SOURCE -D_REENTRANT -Wall -pipe > -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long > -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ > -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE > -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo > -MD -MP -MF .deps/libpsos_la-task.Tpo -c -o libpsos_la-task.lo `test > -f 'task.c' || echo './'`task.c > libtool: compile: > /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc > -DHAVE_CONFIG_H -I. -I../../lib/include -g -D__XENO_DEBUG__ > -D__XENO_DEBUG_FULL__ -D_GNU_SOURCE -D_REENTRANT -Wall -pipe > -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long > -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ > -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE > -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo > -MD -MP -MF .deps/libpsos_la-task.Tpo -c task.c -fPIC -DPIC -o > .libs/libpsos_la-task.o > cc1: warnings being treated as errors > task.c: In function 't_setpri': > task.c:417: error: 'cprio' may be used uninitialized in this function > make[3]: *** [libpsos_la-task.lo] Error 1 > > > So, debug or not, compiler keeps complaining. > For your reference, this is the change I did instead of the patch: > diff --git a/lib/psos/task.c b/lib/psos/task.c > --- a/lib/psos/task.c > +++ b/lib/psos/task.c > @@ -228,7 +228,7 @@ int psos_task_normalize_priority(unsigne > return psos_prio; > } > > -static int check_task_priority(u_long psos_prio, int *core_prio) > +static inline int check_task_priority(u_long psos_prio, int *core_prio) > { > if (psos_prio< 1 || psos_prio> 255) /* In theory. */ > return ERR_PRIOR; > > > powerpc-linux-gcc (crosstool-NG 1.12.1 - buildroot 2011.08-hgc55c56f04355) 4.4.3 > Copyright (C) 2010 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > ~Thomas > Ok, so I'll merge this. -- Philippe. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized 2011-10-26 11:58 ` Philippe Gerum @ 2011-10-26 12:32 ` Thomas De Schampheleire 0 siblings, 0 replies; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-26 12:32 UTC (permalink / raw) To: Philippe Gerum; +Cc: xenomai On Wed, Oct 26, 2011 at 1:58 PM, Philippe Gerum <rpm@xenomai.org> wrote: > On 10/26/2011 01:04 PM, Thomas De Schampheleire wrote: >> >> On Wed, Oct 26, 2011 at 12:25 PM, Philippe Gerum<rpm@xenomai.org> wrote: >>> >>> On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote: >>>> >>>> Assign default 1 to satisfy compiler (tested with gcc 4.4.3) >>>> >>>> Signed-off-by: Thomas De >>>> Schampheleire<thomas.de.schampheleire@domain.hid> >>>> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >>>> >>>> --- >>>> lib/psos/task.c | 4 ++-- >>>> 1 files changed, 2 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/lib/psos/task.c b/lib/psos/task.c >>>> --- a/lib/psos/task.c >>>> +++ b/lib/psos/task.c >>>> @@ -247,7 +247,7 @@ u_long t_create(const char *name, u_long >>>> pthread_attr_t thattr; >>>> struct syncstate syns; >>>> struct service svc; >>>> - int ret, cprio; >>>> + int ret, cprio = 1; >>>> char short_name[5]; >>>> >>>> ret = check_task_priority(prio,&cprio); >>>> @@ -414,7 +414,7 @@ u_long t_resume(u_long tid) >>>> u_long t_setpri(u_long tid, u_long newprio, u_long *oldprio_r) >>>> { >>>> struct psos_task *task; >>>> - int ret, cprio; >>>> + int ret, cprio = 1; >>>> >>>> task = get_psos_task_or_self(tid,&ret); >>>> if (task == NULL) >>>> >>> >>> Looks like 4.4.3 is wrong, 4.4.4+ does it better and does not choke. Just >>> to >>> make sure the optimizer is given a chance to see the truth, could you try >>> without this patch, but with tagging check_task_priority() as inline >>> instead, with --disable-debug, then with --enable-debug=full switches? >> >> Without this patch, inlined check_task_prio, --disable-debug: >> /bin/sh ../../libtool --tag=CC --mode=compile >> >> /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc >> -DHAVE_CONFIG_H -I. -I../../lib/include -O2 -D_GNU_SOURCE >> -D_REENTRANT -Wall -pipe -Wstrict-prototypes -Wmissing-prototypes >> -Wno-long-long -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ >> -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE >> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo >> -MD -MP -MF .deps/libpsos_la-task.Tpo -c -o libpsos_la-task.lo `test >> -f 'task.c' || echo './'`task.c >> libtool: compile: >> >> /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc >> -DHAVE_CONFIG_H -I. -I../../lib/include -O2 -D_GNU_SOURCE -D_REENTRANT >> -Wall -pipe -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long >> -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ >> -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE >> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo >> -MD -MP -MF .deps/libpsos_la-task.Tpo -c task.c -fPIC -DPIC -o >> .libs/libpsos_la-task.o >> cc1: warnings being treated as errors >> task.c: In function 't_setpri': >> task.c:417: error: 'cprio' may be used uninitialized in this function >> make[3]: *** [libpsos_la-task.lo] Error 1 >> >> Without this patch, inlined check_task_prio, --enable-debug=full >> /bin/sh ../../libtool --tag=CC --mode=compile >> >> /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc >> -DHAVE_CONFIG_H -I. -I../../lib/include -g -D__XENO_DEBUG__ >> -D__XENO_DEBUG_FULL__ -D_GNU_SOURCE -D_REENTRANT -Wall -pipe >> -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long >> -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ >> -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE >> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo >> -MD -MP -MF .deps/libpsos_la-task.Tpo -c -o libpsos_la-task.lo `test >> -f 'task.c' || echo './'`task.c >> libtool: compile: >> >> /repo/tdescham/reborn/buildroot-forge/output/host/usr/bin/powerpc-linux-gcc >> -DHAVE_CONFIG_H -I. -I../../lib/include -g -D__XENO_DEBUG__ >> -D__XENO_DEBUG_FULL__ -D_GNU_SOURCE -D_REENTRANT -Wall -pipe >> -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long >> -Wno-unused-parameter -Werror -D__XENO__ -D__IN_XENO__ >> -Wstrict-prototypes -I../../include -pipe -Os -D_LARGEFILE_SOURCE >> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -MT libpsos_la-task.lo >> -MD -MP -MF .deps/libpsos_la-task.Tpo -c task.c -fPIC -DPIC -o >> .libs/libpsos_la-task.o >> cc1: warnings being treated as errors >> task.c: In function 't_setpri': >> task.c:417: error: 'cprio' may be used uninitialized in this function >> make[3]: *** [libpsos_la-task.lo] Error 1 >> >> >> So, debug or not, compiler keeps complaining. >> For your reference, this is the change I did instead of the patch: >> diff --git a/lib/psos/task.c b/lib/psos/task.c >> --- a/lib/psos/task.c >> +++ b/lib/psos/task.c >> @@ -228,7 +228,7 @@ int psos_task_normalize_priority(unsigne >> return psos_prio; >> } >> >> -static int check_task_priority(u_long psos_prio, int *core_prio) >> +static inline int check_task_priority(u_long psos_prio, int *core_prio) >> { >> if (psos_prio< 1 || psos_prio> 255) /* In theory. */ >> return ERR_PRIOR; >> >> >> powerpc-linux-gcc (crosstool-NG 1.12.1 - buildroot 2011.08-hgc55c56f04355) >> 4.4.3 >> Copyright (C) 2010 Free Software Foundation, Inc. >> This is free software; see the source for copying conditions. There is NO >> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR >> PURPOSE. >> >> ~Thomas >> > > Ok, so I'll merge this. > ok, thanks. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes 2011-10-19 7:35 [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire ` (3 preceding siblings ...) 2011-10-19 7:35 ` [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized Thomas De Schampheleire @ 2011-10-26 9:44 ` Thomas De Schampheleire 2011-10-26 12:47 ` Philippe Gerum 4 siblings, 1 reply; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-26 9:44 UTC (permalink / raw) To: xenomai Hi, On Wed, Oct 19, 2011 at 5:02 PM, Thomas De Schampheleire <patrickdepinguin+xenomai@domain.hid> wrote: > This patch series includes some misc. fixes to xenomai-forge: > > * definition of ERR_OBJTFULL (should also be added to Xenomai proper) > * port long_names feature to xenomai-forge and fix it > * add tm_getm() function (not present in pSOS but present in Xenomai proper) > * fix compiler warning in task.c > > Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@domain.hid> > Signed-off-by: Ronny Meeus <ronny.meeus@domain.hid> > > --- > include/psos/Makefile.am | 2 +- > include/psos/Makefile.in | 2 +- > include/psos/long_names.h | 14 ++++++++++++++ > include/psos/psos.h | 5 +++++ > lib/psos/init.c | 15 +++++++++++++++ > lib/psos/pt.c | 6 ++++++ > lib/psos/queue.c | 6 ++++++ > lib/psos/rn.c | 5 +++++ > lib/psos/sem.c | 6 ++++++ > lib/psos/task.c | 9 +++++++-- > lib/psos/tm.c | 7 +++++++ > 11 files changed, 73 insertions(+), 4 deletions(-) > > > Do you have any comments on this patch series? Thanks, Thomas ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes 2011-10-26 9:44 ` [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire @ 2011-10-26 12:47 ` Philippe Gerum 2011-10-26 12:54 ` Thomas De Schampheleire 0 siblings, 1 reply; 22+ messages in thread From: Philippe Gerum @ 2011-10-26 12:47 UTC (permalink / raw) To: Thomas De Schampheleire; +Cc: xenomai On 10/26/2011 11:44 AM, Thomas De Schampheleire wrote: > Hi, > > On Wed, Oct 19, 2011 at 5:02 PM, Thomas De Schampheleire > <patrickdepinguin+xenomai@domain.hid> wrote: >> This patch series includes some misc. fixes to xenomai-forge: >> >> * definition of ERR_OBJTFULL (should also be added to Xenomai proper) >> * port long_names feature to xenomai-forge and fix it >> * add tm_getm() function (not present in pSOS but present in Xenomai proper) >> * fix compiler warning in task.c >> >> Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid> >> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >> >> --- >> include/psos/Makefile.am | 2 +- >> include/psos/Makefile.in | 2 +- >> include/psos/long_names.h | 14 ++++++++++++++ >> include/psos/psos.h | 5 +++++ >> lib/psos/init.c | 15 +++++++++++++++ >> lib/psos/pt.c | 6 ++++++ >> lib/psos/queue.c | 6 ++++++ >> lib/psos/rn.c | 5 +++++ >> lib/psos/sem.c | 6 ++++++ >> lib/psos/task.c | 9 +++++++-- >> lib/psos/tm.c | 7 +++++++ >> 11 files changed, 73 insertions(+), 4 deletions(-) >> >> >> > > Do you have any comments on this patch series? Merged as discussed, thanks. > > Thanks, > Thomas > > _______________________________________________ > Xenomai-help mailing list > Xenomai-help@domain.hid > https://mail.gna.org/listinfo/xenomai-help > -- Philippe. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes 2011-10-26 12:47 ` Philippe Gerum @ 2011-10-26 12:54 ` Thomas De Schampheleire 0 siblings, 0 replies; 22+ messages in thread From: Thomas De Schampheleire @ 2011-10-26 12:54 UTC (permalink / raw) To: Philippe Gerum; +Cc: xenomai On Wed, Oct 26, 2011 at 2:47 PM, Philippe Gerum <rpm@xenomai.org> wrote: > On 10/26/2011 11:44 AM, Thomas De Schampheleire wrote: >> >> Hi, >> >> On Wed, Oct 19, 2011 at 5:02 PM, Thomas De Schampheleire >> <patrickdepinguin+xenomai@domain.hid> wrote: >>> >>> This patch series includes some misc. fixes to xenomai-forge: >>> >>> * definition of ERR_OBJTFULL (should also be added to Xenomai proper) >>> * port long_names feature to xenomai-forge and fix it >>> * add tm_getm() function (not present in pSOS but present in Xenomai >>> proper) >>> * fix compiler warning in task.c >>> >>> Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hidm> >>> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid> >>> >>> --- >>> include/psos/Makefile.am | 2 +- >>> include/psos/Makefile.in | 2 +- >>> include/psos/long_names.h | 14 ++++++++++++++ >>> include/psos/psos.h | 5 +++++ >>> lib/psos/init.c | 15 +++++++++++++++ >>> lib/psos/pt.c | 6 ++++++ >>> lib/psos/queue.c | 6 ++++++ >>> lib/psos/rn.c | 5 +++++ >>> lib/psos/sem.c | 6 ++++++ >>> lib/psos/task.c | 9 +++++++-- >>> lib/psos/tm.c | 7 +++++++ >>> 11 files changed, 73 insertions(+), 4 deletions(-) >>> >>> >>> >> >> Do you have any comments on this patch series? > > > Merged as discussed, thanks. Thanks for implementing the updates. ~Thomas ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2011-10-26 12:54 UTC | newest] Thread overview: 22+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-10-19 7:35 [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire 2011-10-19 7:35 ` [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL Thomas De Schampheleire 2011-10-26 10:19 ` Philippe Gerum 2011-10-26 10:26 ` Thomas De Schampheleire 2011-10-26 10:33 ` Philippe Gerum 2011-10-26 11:11 ` Thomas De Schampheleire 2011-10-26 12:01 ` Philippe Gerum 2011-10-19 7:35 ` [Xenomai-help] [PATCH 2 of 4] psos: port long_names feature to xenomai-forge Thomas De Schampheleire 2011-10-26 10:21 ` Philippe Gerum 2011-10-26 10:41 ` Thomas De Schampheleire 2011-10-26 11:57 ` Philippe Gerum 2011-10-19 7:35 ` [Xenomai-help] [PATCH 3 of 4] psos: add tm_getm function Thomas De Schampheleire 2011-10-26 10:22 ` Philippe Gerum 2011-10-26 10:42 ` Thomas De Schampheleire 2011-10-19 7:35 ` [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized Thomas De Schampheleire 2011-10-26 10:25 ` Philippe Gerum 2011-10-26 11:04 ` Thomas De Schampheleire 2011-10-26 11:58 ` Philippe Gerum 2011-10-26 12:32 ` Thomas De Schampheleire 2011-10-26 9:44 ` [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire 2011-10-26 12:47 ` Philippe Gerum 2011-10-26 12:54 ` Thomas De Schampheleire
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.