Skip to contentSkip to conversation

native: Align documentation to code

PATCH In review Jan Kiszka 3 participants 9 messages Jul 19, 2009 – Jul 20, 2009 1 message not in the archive

lore
Share & tools
lore

Jan Kiszka

author
#1 lore raw

PATCH 1/3 native: Align documentation to code

In reply to a message not in the archive

---

 ksrc/skins/native/task.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
ksrc/skins/native/task.c +6 -6
index 161bc1c..ef10eb1 100644
@@ -180,7 +180,7 @@ void __native_task_pkg_cleanup(void)
  * substituted.
  *
  * @param prio The base priority of the new task. This value must
- * range from [1 .. 99] (inclusive) where 1 is the lowest effective
+ * range from [0 .. 99] (inclusive) where 0 is the lowest effective
  * priority.
  *
  * @param mode The task creation mode. The following flags can be
@@ -816,10 +816,10 @@ int rt_task_wait_period(unsigned long *overruns_r)
  *
  * @param task The descriptor address of the affected task.
  *
- * @param prio The new task priority. This value must range from [1
- * .. 99] (inclusive) where 1 is the lowest effective priority.
+ * @param prio The new task priority. This value must range from [0
+ * .. 99] (inclusive) where 0 is the lowest effective priority.
 
- * @return 0 is returned upon success. Otherwise:
+ * @return Upon success, the previously set priority is returned. Otherwise:
  *
  * - -EINVAL is returned if @a task is not a task descriptor, or if @a
  * prio is invalid.
@@ -2155,7 +2155,7 @@ int rt_task_reply(int flowid, RT_TASK_MCB *mcb_s)
  * substituted.
  *
  * @param prio The base priority of the new task. This value must
- * range from [1 .. 99] (inclusive) where 1 is the lowest effective
+ * range from [0 .. 99] (inclusive) where 0 is the lowest effective
  * priority.
  *
  * @param mode The task creation mode. The following flags can be
@@ -2258,7 +2258,7 @@ int rt_task_reply(int flowid, RT_TASK_MCB *mcb_s)
  * enabled for indexing the created task.
  *
  * @param prio The base priority which will be set for the current
- * task. This value must range from [1 .. 99] (inclusive) where 1 is
+ * task. This value must range from [0 .. 99] (inclusive) where 0 is
  * the lowest effective priority.
  *
  * @param mode The task creation mode. The following flags can be
author
#2 lore raw

PATCH 2/3 x86-64: Work around gcc issues with populating syscall registers

In reply to a message not in the archive

gcc-4.1.3 of kubuntu has problem with proper syscall register initialization in rt_task_shadow if TLS is enabled. But it is likely that more compiler versions below 4.3 and more configuration variants are affected.

This patch installs a workaround for these gcc versions which places an optimization barrier before the register variable setup. This forces gcc to actually load the registers.

---

 include/asm-x86/syscall_64.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
include/asm-x86/syscall_64.h +4 -0
index adaa40b..6918ac4 100644
@@ -82,7 +82,11 @@ static inline int __xn_interrupted_p(struct pt_regs *regs)
  * in kernel space.
  */
 
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+#define LOAD_ARGS_0()	asm volatile ("" ::: "memory");
+#else
 #define LOAD_ARGS_0()
+#endif
 #define LOAD_REGS_0
 #define ASM_ARGS_0
 
author
#9 lore raw

PATCH 3/3 x86: Merge syscall_{32|64}.h into syscall.h

In reply to a message not in the archive

---

 include/asm-x86/Makefile.am  |    2 
 include/asm-x86/syscall.h    |  318 ++++++++++++++++++++++++++++++++++++++++++
 include/asm-x86/syscall_32.h |  226 ------------------------------
 include/asm-x86/syscall_64.h |  177 -----------------------
 4 files changed, 316 insertions(+), 407 deletions(-)
 delete mode 100644 include/asm-x86/syscall_32.h
 delete mode 100644 include/asm-x86/syscall_64.h
include/asm-x86/Makefile.am +0 -2
index 43d6e51..ee0db80 100644
@@ -17,8 +17,6 @@ includesub_HEADERS =	\
 	switch_32.h	\
 	switch_64.h	\
 	switch.h	\
-	syscall_32.h	\
-	syscall_64.h	\
 	syscall.h	\
 	system_32.h	\
 	system_64.h	\
include/asm-x86/syscall.h +316 -2

321 lines not on this page · raw message

include/asm-x86/syscall_32.h deleted +0 -226

226 lines not on this page · raw message

include/asm-x86/syscall_64.h deleted +0 -177

177 lines not on this page · raw message

#3 lore raw

Re: [Xenomai-core] [PATCH 2/3] x86-64: Work around gcc issues with populating syscall registers

In reply to Jan Kiszka
Quoted 1 line · Jan Kiszka

+#define LOAD_ARGS_0() asm volatile ("" ::: "memory");

g++, at least some verions in the past, chokes on ::: so, you should do : /* */ : /* */ :

Signature · 1 line
					    Gilles.
#4 lore raw

Re: [Xenomai-core] [PATCH 2/3] x86-64: Work around gcc issues with populating syscall registers

Quoted 6 lines · Gilles Chanteperdrix
Quoted 1 line · Jan Kiszka

+#define LOAD_ARGS_0() asm volatile ("" ::: "memory");

g++, at least some verions in the past, chokes on ::: so, you should do : /* */ : /* */ :

I will fix this manually while merging.

Quoted 2 lines
Signature · 1 line
Philippe.
#5 lore raw

Re: [Xenomai-core] [PATCH 2/3] x86-64: Work around gcc issues with populating syscall registers

In reply to Jan Kiszka
Quoted 8 lines · Jan Kiszka

gcc-4.1.3 of kubuntu has problem with proper syscall register initialization in rt_task_shadow if TLS is enabled. But it is likely that more compiler versions below 4.3 and more configuration variants are affected.

This patch installs a workaround for these gcc versions which places an optimization barrier before the register variable setup. This forces gcc to actually load the registers.

I have tried the barrier with arm gcc, it does not work. However, marking the registered clobbered instead of the memory fixes arm gcc 4.3 bug. So, I wonder, would not it make more sense to mark the registers as clobbered by the barrier instead of memory on x86 too?

Signature · 1 line
					    Gilles.
author
#6 lore raw

Re: [Xenomai-core] [PATCH 2/3] x86-64: Work around gcc issues with populating syscall registers

Quoted 6 lines · Gilles Chanteperdrix
Quoted 5 lines · Jan Kiszka

gcc-4.1.3 of kubuntu has problem with proper syscall register initialization in rt_task_shadow if TLS is enabled. But it is likely that more compiler versions below 4.3 and more configuration variants are affected.

Quoted 9 lines
Quoted 3 lines

This patch installs a workaround for these gcc versions which places an optimization barrier before the register variable setup. This forces gcc to actually load the registers.

I have tried the barrier with arm gcc, it does not work. However, marking the registered clobbered instead of the memory fixes arm gcc 4.3 bug. So, I wonder, would not it make more sense to mark the registers as clobbered by the barrier instead of memory on x86 too?

Sounds reasonable. Will give it a try later.

I just noticed that my unification patch includes some unwanted merge artifact, so it requires another round in any case.

Jan

#7 lore raw

Re: [Xenomai-core] [PATCH 2/3] x86-64: Work around gcc issues with populating syscall registers

Quoted 17 lines · Jan Kiszka
Quoted 6 lines · Gilles Chanteperdrix
Quoted 5 lines · Jan Kiszka

gcc-4.1.3 of kubuntu has problem with proper syscall register initialization in rt_task_shadow if TLS is enabled. But it is likely that more compiler versions below 4.3 and more configuration variants are affected.

Quoted 9 lines
Quoted 3 lines

This patch installs a workaround for these gcc versions which places an optimization barrier before the register variable setup. This forces gcc to actually load the registers.

I have tried the barrier with arm gcc, it does not work. However, marking the registered clobbered instead of the memory fixes arm gcc 4.3 bug. So, I wonder, would not it make more sense to mark the registers as clobbered by the barrier instead of memory on x86 too?

Quoted 4 lines

Sounds reasonable. Will give it a try later.

I just noticed that my unification patch includes some unwanted merge artifact, so it requires another round in any case.

So I'm discarding the pending pull request entirely. Please re-submit when ready.

Quoted 3 lines

Jan

Signature · 1 line
Philippe.
author
#8 lore raw

Re: [Xenomai-core] [PATCH 2/3] x86-64: Work around gcc issues with populating syscall registers

Quoted 11 lines · Philippe Gerum
Quoted 10 lines · Jan Kiszka
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka

gcc-4.1.3 of kubuntu has problem with proper syscall register initialization in rt_task_shadow if TLS is enabled. But it is likely that more compiler versions below 4.3 and more configuration variants are affected.

This patch installs a workaround for these gcc versions which places an optimization barrier before the register variable setup. This forces gcc to actually load the registers.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

I have tried the barrier with arm gcc, it does not work. However, marking the registered clobbered instead of the memory fixes arm gcc 4.3 bug. So, I wonder, would not it make more sense to mark the registers as clobbered by the barrier instead of memory on x86 too?

Sounds reasonable. Will give it a try later.

Sounded reasonable - but didn't work. So we have to stick with the original version.

Quoted 6 lines
Quoted 3 lines

I just noticed that my unification patch includes some unwanted merge artifact, so it requires another round in any case.

So I'm discarding the pending pull request entirely. Please re-submit when ready.

I just pushed an updated for patch 3 (removing the original "+r" workaround from the unified version). Please pull now from
git://git.xenomai.org/xenomai-jki.git for-upstream

Jan