All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] Ipipe and Siemens A&D Realtime
@ 2007-04-18 15:07 Krause, Karl-Heinz
  2007-04-18 17:53 ` Jan Kiszka
  0 siblings, 1 reply; 7+ messages in thread
From: Krause, Karl-Heinz @ 2007-04-18 15:07 UTC (permalink / raw)
  To: xenomai, xenomai


[-- Attachment #1.1: Type: text/plain, Size: 1537 bytes --]

Hi Philippe

 

as promised some time ago, I'd like to let you know the result of our work.

Attached are 

-          a few recycled slides from a presentation describing motivation, features and results

-          the patch file for a  adeos-ipipe-2.6.15-i386-1.3-04.patch  patched kernel2.6.15.4 

Since some parts of the kernel functionality (clock registration, realtime capable message queues) and 

most parts of the glibc changes are also of  interest for the  RT_PREEMPT solution we are in contact with 

Thomas Gleixner trying to leverage the work.

An update to newer versions of  kernel and glibc (basically  because of the PI mutexes) is planned for later,

presumably when RT_PREEMPT  has become mainline status.

 

If you need any further information just let me know.

 

Karl-Heinz

 

Karl-Heinz Krause
Siemens AG
Automation and Drives 
Advanced Technologies and Standards
A&D ATS 1
Gleiwitzer Str. 555
90475 Nürnberg, Germany
Tel.: +49 911 895-3179
Fax: +49 911 895-3715
mailto:karl-heinz.krause@domain.hid <mailto:karl-heinz.krause@domain.hid> 

Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Heinrich v. Pierer; 
Vorstand: Klaus Kleinfeld, Vorsitzender; Johannes Feldmayer, Joe Kaeser, 
Rudi Lamprecht, Eduardo Montes, Jürgen Radomski, Erich R. Reinhardt, 
Hermann Requardt, Uriel J. Sharef, Klaus Wucherer
Sitz der Gesellschaft: Berlin und München
Registergericht: Berlin Charlottenburg, HRB 12300, München, HRB 6684
WEEE-Reg.-Nr. DE 23691322

 


[-- Attachment #1.2: Type: text/html, Size: 6740 bytes --]

[-- Attachment #2: aud_glibc.patch --]
[-- Type: application/octet-stream, Size: 120721 bytes --]

diff -Naur glibc-2.3.6_Cs/abilist/libpthread.abilist glibc-2.3.6-AuD/abilist/libpthread.abilist
--- glibc-2.3.6_Cs/abilist/libpthread.abilist	2005-01-20 03:18:22.000000000 +0100
+++ glibc-2.3.6-AuD/abilist/libpthread.abilist	2006-10-06 18:38:04.000000000 +0200
@@ -225,6 +225,10 @@
  pthread_mutex_timedlock F
  pthread_mutexattr_getpshared F
  pthread_mutexattr_setpshared F
+ pthread_mutexattr_getprioceiling F
+ pthread_mutexattr_setprioceiling F
+ pthread_mutexattr_getprotocol F
+ pthread_mutexattr_setprotocol F
  pthread_rwlock_timedrdlock F
  pthread_rwlock_timedwrlock F
  pthread_spin_destroy F
diff -Naur glibc-2.3.6_Cs/abilist/librt.abilist glibc-2.3.6-AuD/abilist/librt.abilist
--- glibc-2.3.6_Cs/abilist/librt.abilist	2005-01-20 03:18:22.000000000 +0100
+++ glibc-2.3.6-AuD/abilist/librt.abilist	2007-02-20 11:51:44.000000000 +0100
@@ -38,6 +38,10 @@
  timer_getoverrun F
  timer_gettime F
  timer_settime F
+ event_create F
+ sigevent_set_notification F
+ register_clock F
+ convtime F
 GLIBC_2.2 i.86-.*-linux.*/notls i.86-.*-linux.*/thread i.86-.*-linux.*/tls ia64-.*-linux.*/tls m68.*-.*-linux.*/notls powerpc-.*-linux.*/notls powerpc-.*-linux.*/thread powerpc-.*-linux.*/tls s390-.*-linux.*/tls s390x-.*-linux.*/tls sh[34].*-.*-linux.*/notls sh[34].*-.*-linux.*/thread sh[34].*-.*-linux.*/tls
  GLIBC_2.2 A
 GLIBC_2.3 powerpc64-.*-linux.*/thread
diff -Naur glibc-2.3.6_Cs/misc/daemon.c glibc-2.3.6-AuD/misc/daemon.c
--- glibc-2.3.6_Cs/misc/daemon.c	2005-01-20 03:18:36.000000000 +0100
+++ glibc-2.3.6-AuD/misc/daemon.c	2007-03-05 16:34:20.000000000 +0100
@@ -46,7 +46,11 @@
 {
 	int fd;
 
+#ifdef CONFIG_NOMMU_USE_LOW_ADDR
+	switch (__vfork()) {
+#else
 	switch (__fork()) {
+#endif
 	case -1:
 		return (-1);
 	case 0:
diff -Naur glibc-2.3.6_Cs/nptl/Makefile glibc-2.3.6-AuD/nptl/Makefile
--- glibc-2.3.6_Cs/nptl/Makefile	2005-11-09 05:04:41.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/Makefile	2006-10-05 10:59:56.000000000 +0200
@@ -56,6 +56,10 @@
 		      pthread_mutexattr_getpshared \
 		      pthread_mutexattr_setpshared \
 		      pthread_mutexattr_gettype pthread_mutexattr_settype \
+		      pthread_mutexattr_getprioceiling \
+		      pthread_mutexattr_setprioceiling \
+		      pthread_mutexattr_getprotocol \
+		      pthread_mutexattr_setprotocol \
 		      pthread_rwlock_init pthread_rwlock_destroy \
 		      pthread_rwlock_rdlock pthread_rwlock_timedrdlock \
 		      pthread_rwlock_wrlock pthread_rwlock_timedwrlock \
diff -Naur glibc-2.3.6_Cs/nptl/pthread_mutexattr_getprioceiling.c glibc-2.3.6-AuD/nptl/pthread_mutexattr_getprioceiling.c
--- glibc-2.3.6_Cs/nptl/pthread_mutexattr_getprioceiling.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/pthread_mutexattr_getprioceiling.c	2006-03-06 18:20:46.000000000 +0100
@@ -0,0 +1,37 @@
+/* Get priority ceiling setting from pthread_mutexattr_t.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <pthreadP.h>
+
+
+int
+pthread_mutexattr_getprioceiling (attr, prioceiling)
+     const pthread_mutexattr_t *attr;
+     int *prioceiling;
+{
+  const struct pthread_mutexattr *iattr;
+
+  iattr = (const struct pthread_mutexattr *) attr;
+
+  *prioceiling = ((iattr->mutexkind & PTHREAD_MUTEXATTR_PRIO_CEILING_MASK)
+		  >> PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT);
+
+  return 0;
+}
diff -Naur glibc-2.3.6_Cs/nptl/pthread_mutexattr_getprotocol.c glibc-2.3.6-AuD/nptl/pthread_mutexattr_getprotocol.c
--- glibc-2.3.6_Cs/nptl/pthread_mutexattr_getprotocol.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/pthread_mutexattr_getprotocol.c	2006-03-06 18:20:46.000000000 +0100
@@ -0,0 +1,37 @@
+/* Get priority protocol setting from pthread_mutexattr_t.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <pthreadP.h>
+
+
+int
+pthread_mutexattr_getprotocol (attr, protocol)
+     const pthread_mutexattr_t *attr;
+     int *protocol;
+{
+  const struct pthread_mutexattr *iattr;
+
+  iattr = (const struct pthread_mutexattr *) attr;
+
+  *protocol = ((iattr->mutexkind & PTHREAD_MUTEXATTR_PROTOCOL_MASK)
+	       >> PTHREAD_MUTEXATTR_PROTOCOL_SHIFT);
+
+  return 0;
+}
diff -Naur glibc-2.3.6_Cs/nptl/pthread_mutexattr_gettype.c glibc-2.3.6-AuD/nptl/pthread_mutexattr_gettype.c
--- glibc-2.3.6_Cs/nptl/pthread_mutexattr_gettype.c	2005-01-20 03:18:36.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/pthread_mutexattr_gettype.c	2006-10-05 13:33:20.000000000 +0200
@@ -31,7 +31,12 @@
 
   /* We use bit 31 to signal whether the mutex is going to be
      process-shared or not.  */
+  /*
+   * m.n. siemens ag mutexkind element is also used for prioceiling and protocol
+   *
   *kind = iattr->mutexkind & ~0x80000000;
+   */
+  *kind = iattr->mutexkind & PTHREAD_MUTEXATTR_TYPE_MASK;
 
   return 0;
 }
diff -Naur glibc-2.3.6_Cs/nptl/pthread_mutexattr_setprioceiling.c glibc-2.3.6-AuD/nptl/pthread_mutexattr_setprioceiling.c
--- glibc-2.3.6_Cs/nptl/pthread_mutexattr_setprioceiling.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/pthread_mutexattr_setprioceiling.c	2006-10-06 18:13:16.000000000 +0200
@@ -0,0 +1,40 @@
+/* Change priority ceiling setting in pthread_mutexattr_t.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <pthreadP.h>
+
+
+int
+pthread_mutexattr_setprioceiling (attr, prioceiling)
+     pthread_mutexattr_t *attr;
+     int prioceiling;
+{
+  if (prioceiling < 0 || __builtin_expect (prioceiling > 255, 0))
+    return EINVAL;
+
+  struct pthread_mutexattr *iattr = (struct pthread_mutexattr *) attr;
+
+  iattr->mutexkind = ((iattr->mutexkind & ~PTHREAD_MUTEXATTR_PRIO_CEILING_MASK)
+		      | (prioceiling << PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT));
+
+  return 0;
+}
+
diff -Naur glibc-2.3.6_Cs/nptl/pthread_mutexattr_setprotocol.c glibc-2.3.6-AuD/nptl/pthread_mutexattr_setprotocol.c
--- glibc-2.3.6_Cs/nptl/pthread_mutexattr_setprotocol.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/pthread_mutexattr_setprotocol.c	2006-10-06 18:13:03.000000000 +0200
@@ -0,0 +1,41 @@
+/* Change priority protocol setting in pthread_mutexattr_t.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <pthreadP.h>
+
+int
+pthread_mutexattr_setprotocol (attr, protocol)
+     pthread_mutexattr_t *attr;
+     int protocol;
+{
+  if (protocol != PTHREAD_PRIO_NONE
+      && protocol != PTHREAD_PRIO_INHERIT
+      && __builtin_expect (protocol != PTHREAD_PRIO_PROTECT, 0))
+    return EINVAL;
+
+  struct pthread_mutexattr *iattr = (struct pthread_mutexattr *) attr;
+
+  iattr->mutexkind = ((iattr->mutexkind & ~PTHREAD_MUTEXATTR_PROTOCOL_MASK)
+		      | (protocol << PTHREAD_MUTEXATTR_PROTOCOL_SHIFT));
+
+  return 0;
+}
+
diff -Naur glibc-2.3.6_Cs/nptl/pthread_mutexattr_settype.c glibc-2.3.6-AuD/nptl/pthread_mutexattr_settype.c
--- glibc-2.3.6_Cs/nptl/pthread_mutexattr_settype.c	2005-01-20 03:18:36.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/pthread_mutexattr_settype.c	2006-10-05 13:33:34.000000000 +0200
@@ -35,7 +35,13 @@
 
   /* We use bit 31 to signal whether the mutex is going to be
      process-shared or not.  */
+  /*
+   * m.n. siemens ag mutexkind element is also used for prioceiling and protocol
+   *
   iattr->mutexkind = (iattr->mutexkind & 0x80000000) | kind;
+   */
+  iattr->mutexkind = ((iattr->mutexkind & ~PTHREAD_MUTEXATTR_TYPE_MASK)
+		      | (kind & PTHREAD_MUTEXATTR_TYPE_MASK));
 
   return 0;
 }
diff -Naur glibc-2.3.6_Cs/nptl/pthread_mutex_getprioceiling.c glibc-2.3.6-AuD/nptl/pthread_mutex_getprioceiling.c
--- glibc-2.3.6_Cs/nptl/pthread_mutex_getprioceiling.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/pthread_mutex_getprioceiling.c	2006-03-06 18:20:46.000000000 +0100
@@ -0,0 +1,33 @@
+/* Get current priority ceiling of pthread_mutex_t.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <pthreadP.h>
+
+
+int
+pthread_mutex_getprioceiling (mutex, prioceiling)
+     const pthread_mutex_t *mutex;
+     int *prioceiling;
+{
+  *prioceiling = (mutex->__data.__kind & PTHREAD_MUTEX_PRIO_CEILING_MASK)
+		 >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT;
+
+  return 0;
+}
diff -Naur glibc-2.3.6_Cs/nptl/pthread_mutex_init.c glibc-2.3.6-AuD/nptl/pthread_mutex_init.c
--- glibc-2.3.6_Cs/nptl/pthread_mutex_init.c	2005-01-20 03:18:36.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/pthread_mutex_init.c	2006-10-05 12:29:48.000000000 +0200
@@ -44,7 +44,13 @@
   memset (mutex, '\0', __SIZEOF_PTHREAD_MUTEX_T);
 
   /* Copy the values from the attribute.  */
+/*
+ *
+ * m.n. siemens ag: mutexattr may also have the shared flag
+ *
   mutex->__data.__kind = imutexattr->mutexkind & ~0x80000000;
+ */
+  mutex->__data.__kind = imutexattr->mutexkind;
 
   /* Default values: mutex not used yet.  */
   // mutex->__count = 0;	already done by memset
diff -Naur glibc-2.3.6_Cs/nptl/pthread_mutex_setprioceiling.c glibc-2.3.6-AuD/nptl/pthread_mutex_setprioceiling.c
--- glibc-2.3.6_Cs/nptl/pthread_mutex_setprioceiling.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/pthread_mutex_setprioceiling.c	2006-03-06 18:20:46.000000000 +0100
@@ -0,0 +1,55 @@
+/* Set current priority ceiling of pthread_mutex_t.
+   Copyright (C) 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2006.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <errno.h>
+#include <pthreadP.h>
+
+
+int
+pthread_mutex_setprioceiling (mutex, prioceiling, old_ceiling)
+     pthread_mutex_t *mutex;
+     int prioceiling;
+     int *old_ceiling;
+{
+  /* The low bits of __kind aren't ever changed after pthread_mutex_init,
+     so we don't need a lock yet.  */
+  if ((mutex->__data.__kind & PTHREAD_MUTEX_PRIO_PROTECT_PRIVATE_NP) == 0)
+    return EINVAL;
+
+  if (prioceiling < 0 || __builtin_expect (prioceiling > 255, 0))
+    return EINVAL;
+
+  /* XXX This needs to lock with TID, but shouldn't obey priority protect
+     protocol.  */
+  /* lll_xxx_mutex_lock (mutex->__data.__lock); */
+
+  if (old_ceiling != NULL)
+    *old_ceiling = (mutex->__data.__kind & PTHREAD_MUTEX_PRIO_CEILING_MASK)
+		   >> PTHREAD_MUTEX_PRIO_CEILING_SHIFT;
+
+  int newkind = (mutex->__data.__kind & ~PTHREAD_MUTEX_PRIO_CEILING_MASK);
+  mutex->__data.__kind = newkind
+			 | (prioceiling << PTHREAD_MUTEX_PRIO_CEILING_SHIFT);
+
+  /* XXX This needs to unlock the above special kind of lock.  */
+  /* lll_xxx_mutex_unlock (mutex->__data.__lock); */
+
+  return 0;
+}
diff -Naur glibc-2.3.6_Cs/nptl/sem_open.c glibc-2.3.6-AuD/nptl/sem_open.c
--- glibc-2.3.6_Cs/nptl/sem_open.c	2005-01-20 03:18:36.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sem_open.c	2006-10-11 17:20:48.000000000 +0200
@@ -233,7 +233,6 @@
 
   /* Determine where the shmfs is mounted.  */
   INTUSE(__pthread_once) (&__namedsem_once, __where_is_shmfs);
-
   /* If we don't know the mount points there is nothing we can do.  Ever.  */
   if (mountpoint.dir == NULL)
     {
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/arm/pthread_spin_lock.c glibc-2.3.6-AuD/nptl/sysdeps/arm/pthread_spin_lock.c
--- glibc-2.3.6_Cs/nptl/sysdeps/arm/pthread_spin_lock.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/arm/pthread_spin_lock.c	2006-12-20 18:37:53.000000000 +0100
@@ -0,0 +1,213 @@
+/* Copyright (C) 2002,2003,2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* 
+ * Manfred.Neugebauer@siemens.com 21-Feb-2006 
+ * extend spinlock for use with threads with static priority
+ */
+
+#include "pthreadP.h"
+#include <pthread-errnos.h>
+
+// ARM cli / sti handling
+#if (0) // m.n. we can't disable irq / fiq at user level with the ARM architecture
+#define __ARM_INTR_DISABLE_FLAG		#0x080
+#define __ARM_FIQ_DISABLE_FLAG		#0x040
+/* disable IRQ (0x080) and FIQ (0x040) */
+#define MY_CLI \
+	asm("\n" \
+	"MRS r0, CPSR\n\t" \
+	"ORR r0, r0, #0x0c0\n\t" \
+	"MSR CPSR, r0\n\t" \
+	: \
+	:);
+
+/* enable IRQ (0x080) and FIQ (0x040) */
+#define MY_STI \
+	asm("\n" \
+	"MRS r0, CPSR\n\t" \
+	"EOR r0, r0, #0x0c0\n\t" \
+	"MSR CPSR, r0\n\t" \
+	: \
+	:);
+
+#else
+
+// arm cli / sti simulation:
+// first approach do an arm specific system call
+#define MY_CLI		asm("svc #0x9f000a");
+#define MY_STI 		asm("svc #0x9f000b");
+
+#endif
+
+int
+pthread_spin_lock (lock)
+     pthread_spinlock_t *lock;
+{
+  int myTid = THREAD_GETMEM (THREAD_SELF, tid);
+  
+  if (lock->__spinMagic != __AUD_SPINLOCK_MAGIC) {
+      return(EINVAL);
+  }
+  if (lock->__spinTaskid == myTid) {
+      return(EDEADLK);
+  }
+  // up to now we only allow private spinlocks
+  if (lock->__spinFlag != PTHREAD_PROCESS_PRIVATE) {
+      return(EINVAL);
+  }
+  // be safe and test for identical process id
+  if (lock->__spinProcessId != __aud_spin_process_id) {
+      return(EINVAL);
+  }
+  // T B D: prevent stacking of spinlocks
+  
+  // be safe and test for the same privileg level
+  if (lock->__spinPrivLevel != __aud_spin_priv_level) {
+       return(EDEADLK);
+  }
+ 
+  // super user application: use cli/sti to handle static priority threads
+  if (lock->__spinPrivLevel == 0) {
+	/* disable IRQ (0x080) and FIQ (0x040) */
+	MY_CLI;
+  }  
+ 
+  // T B D: enable interrupts again, when looping ?
+  asm ("\n"
+       "mov		r1, #0\n\t"
+       "1:\t swp	r2, r1, [%0]\n\t"
+       "teq		r2, #1\n\t"
+       "bne 1b\n\t"
+       : 
+       : "r,r" (&lock->__spinCount) );
+
+//       : 
+//       : "r,r" (lock->__spinCount));
+  lock->__spinTaskid = myTid;
+  
+  return 0;
+}
+
+int
+__aud_pthread_spin_trylock_intern(unsigned long *lockRef);
+
+int
+pthread_spin_trylock (lock)
+     pthread_spinlock_t *lock;
+{
+  int myTid = THREAD_GETMEM (THREAD_SELF, tid);
+  int retVal;
+  
+  if (lock->__spinMagic != __AUD_SPINLOCK_MAGIC) {
+      return(EINVAL);
+  }
+  if (lock->__spinTaskid == myTid) {
+      return(EDEADLK);
+  }
+  // up to now we only allow private spinlocks
+  if (lock->__spinFlag != PTHREAD_PROCESS_PRIVATE) {
+      return(EINVAL);
+  }
+  // be safe and test for identical process id
+  if (lock->__spinProcessId != __aud_spin_process_id) {
+      return(EINVAL);
+  }
+  // T B D: prevent stacking of spinlocks
+  
+  // be safe and test for the same privileg level
+  if (lock->__spinPrivLevel != __aud_spin_priv_level) {
+       return(EDEADLK);
+  }
+ 
+  // super user application: use cli/sti to handle static priority threads
+  if (lock->__spinPrivLevel == 0) {
+	/* disable IRQ (0x080) and FIQ (0x040) */
+	MY_CLI;
+  }
+  
+  retVal = __aud_pthread_spin_trylock_intern(&lock->__spinCount);
+  if (retVal != 0) {
+      // we are super user, be sure we enable interrupts
+      /* enable IRQ (0x080) and FIQ (0x040) */
+      if (lock->__spinPrivLevel == 0) {
+	MY_STI;
+      }
+      return(retVal);
+  }
+  
+  lock->__spinTaskid = myTid;
+  
+  return 0;
+}
+
+int
+pthread_spin_unlock (lock)
+     pthread_spinlock_t *lock;
+{
+  int myTid = THREAD_GETMEM (THREAD_SELF, tid);
+  
+  if (lock->__spinMagic != __AUD_SPINLOCK_MAGIC) {
+errorRetEinval:
+      if (__aud_spin_priv_level == 0) {
+      // we are super user, be sure we enable interrupts
+      /* enable IRQ (0x080) and FIQ (0x040) */
+	MY_STI;
+      }
+      return(EINVAL);
+  }
+  if (lock->__spinTaskid != myTid) {
+errorRetEdeadlk:
+      if (__aud_spin_priv_level == 0) {
+      // we are super user, be sure we enable interrupts
+	/* enable IRQ (0x080) and FIQ (0x040) */
+	MY_STI;
+      }
+      return(EDEADLK);
+  }
+  // up to now we only allow private spinlocks
+  if (lock->__spinFlag != PTHREAD_PROCESS_PRIVATE) {
+      goto errorRetEinval;
+      //return(EINVAL);
+  }
+  // be safe and test for identical process id
+  if (lock->__spinProcessId != __aud_spin_process_id) {
+      goto errorRetEinval;
+      //return(EINVAL);
+  }
+  // T B D: prevent stacking of spinlocks
+  
+  // be safe and test for the same privileg level
+  if (lock->__spinPrivLevel != __aud_spin_priv_level) {
+      goto errorRetEdeadlk;
+      // return(EDEADLK);
+  }
+ 
+  lock->__spinCount = 1;
+  lock->__spinTaskid = -1;
+  
+  // super user application: use cli/sti to handle static priority threads
+  if (lock->__spinPrivLevel == 0) {
+      /* enable IRQ (0x080) and FIQ (0x040) */
+	MY_STI;
+  }
+    
+  return 0;
+}
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/arm/pthread_spin_lock.S glibc-2.3.6-AuD/nptl/sysdeps/arm/pthread_spin_lock.S
--- glibc-2.3.6_Cs/nptl/sysdeps/arm/pthread_spin_lock.S	2005-03-28 17:57:51.000000000 +0200
+++ glibc-2.3.6-AuD/nptl/sysdeps/arm/pthread_spin_lock.S	1970-01-01 01:00:00.000000000 +0100
@@ -1,32 +0,0 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Phil Blundell <pb@nexus.co.uk>, 2004
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <sysdep.h>
-
-	.text
-	.align	4
-
-ENTRY (pthread_spin_lock)
-	mov	r1, #1
-1:	swp	r2, r1, [r0]
-	teq	r2, #0
-	bne	1b
-	mov	r0, #0
-	PSEUDO_RET_NOERRNO
-END (pthread_spin_lock)
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/arm/pthread_spin_lockX.S glibc-2.3.6-AuD/nptl/sysdeps/arm/pthread_spin_lockX.S
--- glibc-2.3.6_Cs/nptl/sysdeps/arm/pthread_spin_lockX.S	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/arm/pthread_spin_lockX.S	2006-10-02 12:09:26.000000000 +0200
@@ -0,0 +1,32 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Phil Blundell <pb@nexus.co.uk>, 2004
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <sysdep.h>
+
+	.text
+	.align	4
+
+ENTRY (pthread_spin_lock)
+	mov	r1, #1
+1:	swp	r2, r1, [r0]
+	teq	r2, #0
+	bne	1b
+	mov	r0, #0
+	PSEUDO_RET_NOERRNO
+END (pthread_spin_lock)
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/arm/pthread_spin_trylock.S glibc-2.3.6-AuD/nptl/sysdeps/arm/pthread_spin_trylock.S
--- glibc-2.3.6_Cs/nptl/sysdeps/arm/pthread_spin_trylock.S	2005-03-28 17:57:51.000000000 +0200
+++ glibc-2.3.6-AuD/nptl/sysdeps/arm/pthread_spin_trylock.S	2006-10-02 14:34:23.000000000 +0200
@@ -25,6 +25,8 @@
 	.text
 	.align	4
 
+#if (0) /* m.n. */
+
 ENTRY (pthread_spin_trylock)
 	mov	r1, #1
 	swp	r2, r1, [r0]
@@ -33,3 +35,16 @@
 	movne	r0, #EBUSY
 	PSEUDO_RET_NOERRNO
 END (pthread_spin_trylock)
+
+#else
+
+ENTRY (__aud_pthread_spin_trylock_intern)
+	mov	r1, #1
+	swp	r2, r1, [r0]
+	teq	r2, #0
+	moveq	r0, #0
+	movne	r0, #EBUSY
+	PSEUDO_RET_NOERRNO
+END (__aud_pthread_spin_trylock_intern)
+
+#endif
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/i386/i486/pthread_spin_trylock.S glibc-2.3.6-AuD/nptl/sysdeps/i386/i486/pthread_spin_trylock.S
--- glibc-2.3.6_Cs/nptl/sysdeps/i386/i486/pthread_spin_trylock.S	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/i386/i486/pthread_spin_trylock.S	2006-02-22 16:10:42.000000000 +0100
@@ -19,7 +19,7 @@
 
 #include <pthread-errnos.h>
 
-
+#if (0) /* m.n. */
 #ifdef UP
 # define LOCK
 #else
@@ -45,3 +45,26 @@
 #endif
 	ret
 	.size	pthread_spin_trylock,.-pthread_spin_trylock
+
+#else
+
+	.globl	__aud_pthread_spin_trylock_intern
+	.type	__aud_pthread_spin_trylock_intern,@function
+	.align	16
+__aud_pthread_spin_trylock_intern:
+	movl	4(%esp), %edx
+	movl	$1, %eax
+	xorl	%ecx, %ecx
+	LOCK
+	cmpxchgl %ecx, (%edx)
+	movl	$EBUSY, %eax
+#ifdef HAVE_CMOV
+	cmovel	%ecx, %eax
+#else
+	jne	0f
+	movl	%ecx, %eax
+0:
+#endif
+	ret
+
+#endif
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/i386/pthread_spin_init.c glibc-2.3.6-AuD/nptl/sysdeps/i386/pthread_spin_init.c
--- glibc-2.3.6_Cs/nptl/sysdeps/i386/pthread_spin_init.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/i386/pthread_spin_init.c	2006-02-22 16:10:54.000000000 +0100
@@ -18,3 +18,56 @@
    02111-1307 USA.  */
 
 /* Not needed.  pthread_spin_init is an alias for pthread_spin_unlock.  */
+
+/* 
+ * Manfred.Neugebauer@siemens.com 21-Feb-2006 
+ * extend spinlock for use with threads with static priority
+ * T B D: initialize __aud_spin_process_id and __aud_spin_priv_level
+ * when starting the application
+ */
+
+ #include "pthreadP.h"
+#include "errno.h"
+#include "unistd.h"
+
+#ifndef LOCK_PREFIX
+# ifdef UP
+#  define LOCK_PREFIX	/* nothing */
+# else
+#  define LOCK_PREFIX	"lock;"
+# endif
+#endif
+
+int __aud_spin_process_id = -1;
+int __aud_spin_priv_level = -1;
+
+int
+pthread_spin_init (__lock, __pshared)
+     pthread_spinlock_t *__lock;
+     int __pshared;
+{
+  if (__aud_spin_process_id == -1) {
+      // get process id and user id once
+      __aud_spin_priv_level = getegid();
+      __aud_spin_process_id = getpid();
+      if (__aud_spin_priv_level == 0) {
+          // when root, allow cli / sti
+          iopl(3);
+      }
+  }
+  // up to now the AuD API only supports private spinlocks
+  if (__pshared != PTHREAD_PROCESS_PRIVATE) {
+      return(EINVAL);
+  }
+  if (__lock->__spinMagic == __AUD_SPINLOCK_MAGIC) {
+      return(EBUSY);
+  }
+
+  __lock->__spinMagic = __AUD_SPINLOCK_MAGIC;
+  __lock->__spinFlag = __pshared;
+  __lock->__spinCount = 1;
+  __lock->__spinPrivLevel = __aud_spin_priv_level;
+  __lock->__spinProcessId = __aud_spin_process_id;
+
+  return 0;
+}
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/i386/pthread_spin_lock.c glibc-2.3.6-AuD/nptl/sysdeps/i386/pthread_spin_lock.c
--- glibc-2.3.6_Cs/nptl/sysdeps/i386/pthread_spin_lock.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/i386/pthread_spin_lock.c	2006-02-22 16:10:56.000000000 +0100
@@ -17,7 +17,13 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+/* 
+ * Manfred.Neugebauer@siemens.com 21-Feb-2006 
+ * extend spinlock for use with threads with static priority
+ */
+
 #include "pthreadP.h"
+#include <pthread-errnos.h>
 
 #ifndef LOCK_PREFIX
 # ifdef UP
@@ -32,6 +38,35 @@
 pthread_spin_lock (lock)
      pthread_spinlock_t *lock;
 {
+  int myTid = THREAD_GETMEM (THREAD_SELF, tid);
+  
+  if (lock->__spinMagic != __AUD_SPINLOCK_MAGIC) {
+      return(EINVAL);
+  }
+  if (lock->__spinTaskid == myTid) {
+      return(EDEADLK);
+  }
+  // up to now we only allow private spinlocks
+  if (lock->__spinFlag != PTHREAD_PROCESS_PRIVATE) {
+      return(EINVAL);
+  }
+  // be safe and test for identical process id
+  if (lock->__spinProcessId != __aud_spin_process_id) {
+      return(EINVAL);
+  }
+  // T B D: prevent stacking of spinlocks
+  
+  // be safe and test for the same privileg level
+  if (lock->__spinPrivLevel != __aud_spin_priv_level) {
+       return(EDEADLK);
+  }
+ 
+  // super user application: use cli/sti to handle static priority threads
+  if (lock->__spinPrivLevel == 0) {
+      asm("cli");
+  }
+    
+  // T B D: enable interrupts again, when looping
   asm ("\n"
        "1:\t" LOCK_PREFIX "decl %0\n\t"
        "jne 2f\n\t"
@@ -42,8 +77,111 @@
        "jg 1b\n\t"
        "jmp 2b\n\t"
        ".previous"
-       : "=m" (*lock)
-       : "m" (*lock));
+       : "=m" (lock->__spinCount)
+       : "m" (lock->__spinCount));
+
+  lock->__spinTaskid = myTid;
+  
+  return 0;
+}
+
+int
+__aud_pthread_spin_trylock_intern(unsigned long *lockRef);
+
+int
+pthread_spin_trylock (lock)
+     pthread_spinlock_t *lock;
+{
+  int myTid = THREAD_GETMEM (THREAD_SELF, tid);
+  int retVal;
+  
+  if (lock->__spinMagic != __AUD_SPINLOCK_MAGIC) {
+      return(EINVAL);
+  }
+  if (lock->__spinTaskid == myTid) {
+      return(EDEADLK);
+  }
+  // up to now we only allow private spinlocks
+  if (lock->__spinFlag != PTHREAD_PROCESS_PRIVATE) {
+      return(EINVAL);
+  }
+  // be safe and test for identical process id
+  if (lock->__spinProcessId != __aud_spin_process_id) {
+      return(EINVAL);
+  }
+  // T B D: prevent stacking of spinlocks
+  
+  // be safe and test for the same privileg level
+  if (lock->__spinPrivLevel != __aud_spin_priv_level) {
+       return(EDEADLK);
+  }
+ 
+  // super user application: use cli/sti to handle static priority threads
+  if (lock->__spinPrivLevel == 0) {
+      asm("cli");
+  }
+  
+  retVal = __aud_pthread_spin_trylock_intern(&lock->__spinCount);
+  if (retVal != 0) {
+      if (lock->__spinPrivLevel == 0) {
+          asm("sti");
+      }
+      return(retVal);
+  }
+  
+  lock->__spinTaskid = myTid;
+  
+  return 0;
+}
 
+int
+pthread_spin_unlock (lock)
+     pthread_spinlock_t *lock;
+{
+  int myTid = THREAD_GETMEM (THREAD_SELF, tid);
+  
+  if (lock->__spinMagic != __AUD_SPINLOCK_MAGIC) {
+errorRetEinval:
+      if (__aud_spin_priv_level == 0) {
+      // we are super user, be sure we enable interrupts
+          asm("sti");
+      }
+      return(EINVAL);
+  }
+  if (lock->__spinTaskid != myTid) {
+errorRetEdeadlk:
+      if (__aud_spin_priv_level == 0) {
+      // we are super user, be sure we enable interrupts
+          asm("sti");
+      }
+      return(EDEADLK);
+  }
+  // up to now we only allow private spinlocks
+  if (lock->__spinFlag != PTHREAD_PROCESS_PRIVATE) {
+      goto errorRetEinval;
+      //return(EINVAL);
+  }
+  // be safe and test for identical process id
+  if (lock->__spinProcessId != __aud_spin_process_id) {
+      goto errorRetEinval;
+      //return(EINVAL);
+  }
+  // T B D: prevent stacking of spinlocks
+  
+  // be safe and test for the same privileg level
+  if (lock->__spinPrivLevel != __aud_spin_priv_level) {
+      goto errorRetEdeadlk;
+      // return(EDEADLK);
+  }
+ 
+  lock->__spinCount = 1;
+  lock->__spinTaskid = -1;
+  
+  // super user application: use cli/sti to handle static priority threads
+  if (lock->__spinPrivLevel == 0) {
+      asm("sti");
+  }
+    
   return 0;
 }
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/i386/pthread_spin_unlock.S glibc-2.3.6-AuD/nptl/sysdeps/i386/pthread_spin_unlock.S
--- glibc-2.3.6_Cs/nptl/sysdeps/i386/pthread_spin_unlock.S	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/i386/pthread_spin_unlock.S	2006-02-21 12:27:34.000000000 +0100
@@ -17,6 +17,10 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+/* 
+ * Manfred.Neugebauer@siemens.com 21-Feb-2006 
+ * extend spinlock for use with threads with static priority
+ */
 	.globl	pthread_spin_unlock
 	.type	pthread_spin_unlock,@function
 	.align	16
@@ -27,6 +31,8 @@
 	ret
 	.size	pthread_spin_unlock,.-pthread_spin_unlock
 
+#if (0) // m.n. no longer valid for a more general approach
 	/* The implementation of pthread_spin_init is identical.  */
 	.globl	pthread_spin_init
 pthread_spin_init = pthread_spin_unlock
+#endif
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/pthread/pthread.h glibc-2.3.6-AuD/nptl/sysdeps/pthread/pthread.h
--- glibc-2.3.6_Cs/nptl/sysdeps/pthread/pthread.h	2005-11-09 05:04:44.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/pthread/pthread.h	2006-10-05 14:09:12.000000000 +0200
@@ -60,6 +60,21 @@
 #endif
 };
 
+/* m.n. siemens ag */
+#define PTHREAD_MUTEXATTR_TYPE_MASK		0x000000ff
+#define PTHREAD_MUTEXATTR_PRIO_CEILING_MASK	0x0000ff00
+#define PTHREAD_MUTEXATTR_PRIO_CEILING_SHIFT	8
+#define PTHREAD_MUTEXATTR_PROTOCOL_MASK		0x00ff0000
+#define PTHREAD_MUTEXATTR_PROTOCOL_SHIFT	16
+#define PTHREAD_MUTEXATTR_SHARED_MASK		0x80000000
+
+enum
+{
+	PTHREAD_PRIO_NONE = 0,
+	PTHREAD_PRIO_INHERIT,
+	PTHREAD_PRIO_PROTECT
+};
+
 /* Mutex initializers.  */
 #define PTHREAD_MUTEX_INITIALIZER \
   { { 0, 0, 0, 0, 0, 0 } }
@@ -728,6 +743,13 @@
      __THROW;
 #endif
 
+/* set / get mutextattr protocol */
+extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t *attr, int *protocol) __THROW;
+extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *attr, int protocol) __THROW;
+
+/* set / get mutexattr_prioceiling */
+extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *attr, int *prioceiling) __THROW;
+extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *attr, int prioceiling) __THROW;
 
 #if defined __USE_UNIX98 || defined __USE_XOPEN2K
 /* Functions for handling read-write locks.  */
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/pthread/pthread_spin_destroy.c glibc-2.3.6-AuD/nptl/sysdeps/pthread/pthread_spin_destroy.c
--- glibc-2.3.6_Cs/nptl/sysdeps/pthread/pthread_spin_destroy.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/pthread/pthread_spin_destroy.c	2006-02-22 16:11:40.000000000 +0100
@@ -17,13 +17,29 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include "pthreadP.h"
+/*
+ * Manfred.Neugebauer@siemens.com 21-Feb-2006
+ * extend for more general use
+ */
 
+#include "pthreadP.h"
+#include "errno.h"
 
 int
-pthread_spin_destroy (lock)
-     pthread_spinlock_t *lock;
+pthread_spin_destroy (__lock)
+     pthread_spinlock_t *__lock;
 {
-  /* Nothing to do.  */
+  if (__lock->__spinMagic != __AUD_SPINLOCK_MAGIC) {
+      return(EINVAL);
+  }
+  if (__lock->__spinCount != 1) {
+      return(EBUSY);
+  } 
+  __lock->__spinMagic = 0;
+  __lock->__spinFlag = -1;
+  __lock->__spinCount = 1;
+  __lock->__spinPrivLevel = -1;
+  __lock-> __spinProcessId = -1;
+
   return 0;
 }
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/pthread/pthread_spin_init.c glibc-2.3.6-AuD/nptl/sysdeps/pthread/pthread_spin_init.c
--- glibc-2.3.6_Cs/nptl/sysdeps/pthread/pthread_spin_init.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/pthread/pthread_spin_init.c	2006-09-29 16:36:12.000000000 +0200
@@ -1,7 +1,6 @@
-/* pthread_spin_init -- initialize a spin lock.  Generic version.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Paul Mackerras <paulus@au.ibm.com>, 2003.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -18,11 +17,49 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include "pthreadP.h"
+/* Not needed.  pthread_spin_init is an alias for pthread_spin_unlock.  */
+
+/* 
+ * Manfred.Neugebauer@siemens.com 21-Feb-2006 
+ * extend spinlock for use with threads with static priority
+ * T B D: initialize __aud_spin_process_id and __aud_spin_priv_level
+ * when starting the application
+ */
+
+ #include "pthreadP.h"
+#include "errno.h"
+#include "unistd.h"
+
+int __aud_spin_process_id = -1;
+int __aud_spin_priv_level = -1;
 
 int
-pthread_spin_init (pthread_spinlock_t *lock, int pshared)
+pthread_spin_init (__lock, __pshared)
+     pthread_spinlock_t *__lock;
+     int __pshared;
 {
-  *lock = 0;
+  if (__aud_spin_process_id == -1) {
+      // get process id and user id once
+      __aud_spin_priv_level = getegid();
+      __aud_spin_process_id = getpid();
+      if (__aud_spin_priv_level == 0) {
+          // when root, allow cli / sti
+          iopl(3);
+      }
+  }
+  // up to now the AuD API only supports private spinlocks
+  if (__pshared != PTHREAD_PROCESS_PRIVATE) {
+      return(EINVAL);
+  }
+  if (__lock->__spinMagic == __AUD_SPINLOCK_MAGIC) {
+      return(EBUSY);
+  }
+
+  __lock->__spinMagic = __AUD_SPINLOCK_MAGIC;
+  __lock->__spinFlag = __pshared;
+  __lock->__spinCount = 1;
+  __lock->__spinPrivLevel = __aud_spin_priv_level;
+  __lock->__spinProcessId = __aud_spin_process_id;
+
   return 0;
 }
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/pthread/pthread_spin_unlock.c glibc-2.3.6-AuD/nptl/sysdeps/pthread/pthread_spin_unlock.c
--- glibc-2.3.6_Cs/nptl/sysdeps/pthread/pthread_spin_unlock.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/pthread/pthread_spin_unlock.c	2006-10-02 14:04:23.000000000 +0200
@@ -21,6 +21,14 @@
 #include "pthreadP.h"
 #include <atomic.h>
 
+/*
+   Siemens AG, m.n. 
+   this subroutine is called in the ARM context
+   we ignore it for the AuD extende implementation
+   see nptl/sysdeps/arm/pthread_spin_lock.c for the AuD implementation ( C based)
+ */
+#if (0)
+
 int
 pthread_spin_unlock (pthread_spinlock_t *lock)
 {
@@ -28,3 +36,5 @@
   *lock = 0;
   return 0;
 }
+
+#endif
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h	2006-05-02 19:39:55.000000000 +0200
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/arm/bits/atomic.h	2006-09-29 16:02:56.000000000 +0200
@@ -37,10 +37,6 @@
 
 void __arm_link_error (void);
 
-#ifdef UP
-
-/* We require kernel assisted barriers for SMP safety, so it is only worth
-   defining this on UP.  */
 #define atomic_exchange_acq(mem, newvalue)				      \
   ({ __typeof (*mem) result;						      \
      if (sizeof (*mem) == 1)						      \
@@ -58,17 +54,6 @@
        }								      \
      result; })
 
-#else
-
-#define atomic_full_barrier() \
-     __asm__ __volatile__						      \
-	     ("mov\tip, #0xffff0fff\n\t"				      \
-	      "mov\tlr, pc\n\t"						      \
-	      "add\tpc, ip, #(0xffff0fa0 - 0xffff0fff)"			      \
-	      : : : "ip", "lr", "cc", "memory");
-
-#endif
-
 /* Atomic compare and exchange.  This sequence relies on the kernel to
    provide a compare and exchange operation which is atomic on the
    current architecture, either via cleverness on pre-ARMv6 or via
@@ -84,6 +69,8 @@
    specify one to work around GCC PR rtl-optimization/21223.  Otherwise
    it may cause a_oldval or a_tmp to be moved to a different register.  */
 
+/* m.n. arm with no mmu: use entry 0x0fc0 */
+#ifdef CONFIG_NOMMU_USE_LOW_ADDR
 #define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
   ({ register __typeof (oldval) a_oldval asm ("r0");			      \
      register __typeof (oldval) a_newval asm ("r1") = (newval);		      \
@@ -96,6 +83,8 @@
 	      "bne\t1f\n\t"						      \
 	      "mov\t%0, %4\n\t"						      \
 	      "mov\t%1, #0xffff0fff\n\t"				      \
+	      "mov\t%1, #0x1000\n\t"					      \
+	      "sub\t%1, #1\n\t"						      \
 	      "mov\tlr, pc\n\t"						      \
 	      "add\tpc, %1, #(0xffff0fc0 - 0xffff0fff)\n\t"		      \
 	      "bcc\t0b\n\t"						      \
@@ -105,6 +94,29 @@
 	      : "r" (a_newval), "r" (a_ptr), "r" (a_oldval2)		      \
 	      : "ip", "lr", "cc", "memory");				      \
      a_tmp; })
+#else
+#define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
+  ({ register __typeof (oldval) a_oldval asm ("r0");			      \
+     register __typeof (oldval) a_newval asm ("r1") = (newval);		      \
+     register __typeof (mem) a_ptr asm ("r2") = (mem);			      \
+     register __typeof (oldval) a_tmp asm ("r3");			      \
+     register __typeof (oldval) a_oldval2 asm ("r4") = (oldval);	      \
+     __asm__ __volatile__						      \
+	     ("0:\tldr\t%1,[%3]\n\t"					      \
+	      "cmp\t%1, %4\n\t"						      \
+	      "bne\t1f\n\t"						      \
+	      "mov\t%0, %4\n\t"						      \
+	      "mov\t%1, #0xffff0fff\n\t"				      \
+	      "mov\tlr, pc\n\t"						      \
+	      "add\tpc, %1, #(0xffff0fc0 - 0xffff0fff)\n\t"		      \
+	      "bcc\t0b\n\t"						      \
+	      "mov\t%1, %4\n\t"						      \
+	      "1:"							      \
+	      : "=&r" (a_oldval), "=&r" (a_tmp)				      \
+	      : "r" (a_newval), "r" (a_ptr), "r" (a_oldval2)		      \
+	      : "ip", "lr", "cc", "memory");				      \
+     a_tmp; })
+#endif
 
 #define __arch_compare_and_exchange_val_64_acq(mem, newval, oldval) \
   ({ __arm_link_error (); oldval; })
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/arm/bits/pthreadtypes.h glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/arm/bits/pthreadtypes.h
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/arm/bits/pthreadtypes.h	2005-03-28 17:57:52.000000000 +0200
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/arm/bits/pthreadtypes.h	2006-10-02 16:42:23.000000000 +0200
@@ -16,6 +16,11 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+/*
+ * Manfred.Neugebauer@siemens.com 21-Feb-2006
+ * extend structure pthread_spinlock_t for a more general use
+ */
+
 #ifndef _BITS_PTHREADTYPES_H
 #define _BITS_PTHREADTYPES_H	1
 
@@ -77,15 +82,15 @@
   {
     int __lock;
     unsigned int __futex;
-    unsigned long long int __total_seq;
-    unsigned long long int __wakeup_seq;
-    unsigned long long int __woken_seq;
+    __extension__ unsigned long long int __total_seq;
+    __extension__ unsigned long long int __wakeup_seq;
+    __extension__ unsigned long long int __woken_seq;
     void *__mutex;
     unsigned int __nwaiters;
     unsigned int __broadcast_seq;
   } __data;
   char __size[__SIZEOF_PTHREAD_COND_T];
-  long long int __align;
+  __extension__ long long int __align;
 } pthread_cond_t;
 
 typedef union
@@ -135,7 +140,19 @@
 
 #ifdef __USE_XOPEN2K
 /* POSIX spinlock data type.  */
-typedef volatile int pthread_spinlock_t;
+/* m.n. extended for AuD use */
+typedef volatile struct 
+{
+  long int __spinMagic;
+  long int __spinFlag;
+  long int __spinCount;
+  long int __spinPrivLevel;
+  long int __spinProcessId;
+  long int __spinTaskid;
+} pthread_spinlock_t;
+#define __AUD_SPINLOCK_MAGIC 0x25091921
+extern int __aud_spin_process_id;
+extern int __aud_spin_priv_level;
 
 
 /* POSIX barriers data type.  The structure of the type is
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h	2005-04-27 22:57:06.000000000 +0200
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h	2006-09-29 16:03:04.000000000 +0200
@@ -109,12 +109,24 @@
 				   header.multiple_threads) == 0, 1)
 # else
 #  define PSEUDO_PROLOGUE
-#  define SINGLE_THREAD_P						\
-  mov	r0, #0xffff0fff;						\
-  mov	lr, pc;								\
-  sub	pc, r0, #31;							\
-  ldr	ip, [r0, #MULTIPLE_THREADS_OFFSET];				\
-  teq	ip, #0
+/* m.n. ARM with no MMU use 0x0fff instead of 0xffff0fff */
+#ifdef CONFIG_NOMMU_USE_LOW_ADDR
+#  define SINGLE_THREAD_P						\
+  mov	r0, #0xffff0fff;						\
+  mov	r0, #0x01000;							\
+  sub	r0, #1;								\
+  mov	lr, pc;								\
+  sub	pc, r0, #31;							\
+  ldr	ip, [r0, #MULTIPLE_THREADS_OFFSET];				\
+  teq	ip, #0
+#else
+#  define SINGLE_THREAD_P						\
+  mov	r0, #0xffff0fff;						\
+  mov	lr, pc;								\
+  sub	pc, r0, #31;							\
+  ldr	ip, [r0, #MULTIPLE_THREADS_OFFSET];				\
+  teq	ip, #0
+#endif
 #  define SINGLE_THREAD_P_PIC(x) SINGLE_THREAD_P
 # endif
 
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/arm/vfork.S glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/arm/vfork.S
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/arm/vfork.S	2005-04-27 22:57:06.000000000 +0200
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/arm/vfork.S	2007-02-28 17:43:34.000000000 +0100
@@ -19,9 +19,13 @@
 #include <tcb-offsets.h>
 
 /* Save the PID value.  */
+/* m.n. ARM with no MMU use 0x0fff instead of 0xffff0fff */
+#ifdef CONFIG_NOMMU_USE_LOW_ADDR
 #define SAVE_PID \
 	str	lr, [sp, #-4]!;		/* Save LR.  */			\
 	mov	r0, #0xffff0fff;	/* Point to the high page.  */	\
+	mov	r0, #0x1000;						\
+	sub	r0, #1;							\
 	mov	lr, pc;			/* Save our return address.  */	\
 	sub	pc, r0, #31;		/* Jump to the TLS entry.  */	\
 	ldr	lr, [sp], #4;		/* Restore LR.  */		\
@@ -30,6 +34,19 @@
 	rsbs	r0, r3, #0;		/* Negate it.  */		\
 	moveq	r0, #0x80000000;	/* Use 0x80000000 if it was 0.  */ \
 	str	r0, [r2, #PID_OFFSET]	/* Store the temporary PID.  */
+#else
+#define SAVE_PID \
+	str	lr, [sp, #-4]!;		/* Save LR.  */			\
+	mov	r0, #0xffff0fff;	/* Point to the high page.  */	\
+	mov	lr, pc;			/* Save our return address.  */	\
+	sub	pc, r0, #31;		/* Jump to the TLS entry.  */	\
+	ldr	lr, [sp], #4;		/* Restore LR.  */		\
+	mov	r2, r0;			/* Save the TLS addr in r2.  */	\
+	ldr	r3, [r2, #PID_OFFSET];	/* Load the saved PID.  */	\
+	rsbs	r0, r3, #0;		/* Negate it.  */		\
+	moveq	r0, #0x80000000;	/* Use 0x80000000 if it was 0.  */ \
+	str	r0, [r2, #PID_OFFSET]	/* Store the temporary PID.  */
+#endif
 
 /* Restore the old PID value in the parent.  */
 #define RESTORE_PID \

diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/convtime.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/convtime.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/convtime.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/convtime.c	2007-02-20 11:43:31.000000000 +0100
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2007 Siemens AG AD ATS 11
+ * file "convtime.c"
+ */
+ 
+/*
+ * initial version 20-Feb-2007
+ */
+ 
+#include <time.h>
+#include <sys/time.h>
+
+struct timespec *convtime(struct timespec *tsp)
+{
+	struct timeval myTimeval;
+	struct timezone myTimezone;
+	
+	if (tsp) {
+		gettimeofday(&myTimeval, &myTimezone);
+		/*
+		 * remark: invalid values will be dectected
+		 * when the information is really used
+		 */
+		tsp->tv_sec += myTimeval.tv_sec;
+		tsp->tv_nsec += myTimeval.tv_usec * 1000;
+		
+		if (tsp->tv_nsec > 1000000) {
+			tsp->tv_nsec -= 1000000;
+			tsp->tv_sec++;
+		}
+	}
+
+	return(tsp);
+}
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/event_create.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/event_create.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/event_create.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/event_create.c	2006-09-29 18:22:05.000000000 +0200
@@ -0,0 +1,69 @@
+
+/******************************************************************************
+ * The event_create() function                                                *
+ *                                                                            *
+ * creates a signalling channel for a device event specified by eventid.      *
+ * The evp argument, if non-NULL, points to a sigevent structure. This        *
+ * structure, allocated by the application, defines the asynchronous          *
+ * notification to occur when the device event occurs. If the evp argument is *
+ * NULL, the effect is as if the evp argument points to a sigevent structure  *
+ * with the sigev_notify member having the value SIGEV_SIGNAL and the         *
+ * sigev_signo having the value SIGALRM.                                      *
+ ******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
+#include <string.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include "rtime_lib.h"
+#include "fast-handlers.h"
+
+ /* The presently used version is only preliminary. */
+
+int event_create (int fildes, struct sigevent * evp, eventid_t eventid)
+{
+	struct rt_ev_desc myEvt;
+	struct sigev* handler = NULL;
+	
+	/* Initialize the handler_area the first time
+	 * timer_create, event_create, timer_delete is called.
+	 */
+	pthread_once (&ha_once, (void (*) (void)) init_handler_area);
+	
+	/* Set up internal  cmd_union element. */ 
+	myEvt.event = (int) eventid;
+	if (evp != NULL)
+	{
+		memcpy((void *) &myEvt.sigevent, (void *) evp, (size_t) sizeof (struct sigevent));
+		if (evp->sigev_notify == SIGEV_THREAD)
+		{
+			if ((handler = setup_handler_notification(evp, &myEvt.sigevent, fildes)) == NULL)
+				return -1;
+			handler->id = eventid;
+		} 	
+	}
+	else
+	{	/* set the default values  */
+		myEvt.sigevent.sigev_notify = SIGEV_SIGNAL;
+		myEvt.sigevent.sigev_signo  = SIGALRM;
+	}	
+	if (ioctl (fildes, AuD_EVENT_CREATE, &myEvt) == -1)
+	{
+		clear_handler_notification(handler);	/* can handle handler == NULL */
+		return -1;				/* errno is set by the ioctl() function */
+	}
+	else
+	{
+		if (myEvt.sigevent.sigev_notify == SIGEV_NONE)	/* equivalent to event_delete */
+			check_handler_notification(fildes, eventid);
+	}	
+	return 0;
+}
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/fast_handlers.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/fast_handlers.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/fast_handlers.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/fast_handlers.c	2007-01-23 14:24:40.000000000 +0100
@@ -0,0 +1,341 @@
+
+/*
+ *
+ * 22-Aug-2006 m.n. synchronize handler thread and creation thread
+ * 23-Jan-2007 m.n. user call back did not have a parameter
+ * 23-Jan-2007 m.n. we have some race conditions between delete and callback
+ *                  we do some tests (T B D: sequence number for events)
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <pthread.h>
+#include <sysdep.h>
+#include <kernel-features.h>
+#include <internaltypes.h>
+#include <nptl/pthreadP.h>
+
+
+#include "rtime_lib.h"
+#include "fast-handlers.h"
+
+
+/* Array containing the descriptors for carrier threads */
+static struct carrier carr_arr[MAX_CARR_THREADS];
+
+/* Array containing the descriptors for event instances to be signalled */
+static struct sigev sigev_arr[MAX_SIG_HANDLERS];
+static unsigned useCntGen = 0;
+
+/* Object for manageing carrier threads and event instances */
+struct gov gov;
+
+/* Once control variable for initialization of the handler area */
+pthread_once_t ha_once = PTHREAD_ONCE_INIT;
+
+/* Setup all the needed structures */
+void init_handler_area (void)
+{
+	int i;
+	struct sched_param spars_lx;
+	struct sched_param spars_rt;
+	
+	/* Initializes all list heads */
+	INIT_LIST_HEAD(&gov.carr.free);
+	INIT_LIST_HEAD(&gov.sigev.free);
+	INIT_LIST_HEAD(&gov.carr.used);
+	INIT_LIST_HEAD(&gov.sigev.used);
+	
+	/* Initialize the handler area mutex */
+	pthread_mutex_init (&gov.lock, NULL);
+		
+	/* Initialize the default attr objects for linux and rt domains */
+	if (pthread_attr_init (&gov.def_attr_lx) != 0)
+		return;
+	if (pthread_attr_init (&gov.def_attr_rt) != 0)
+		return;
+	if (pthread_attr_setinheritsched(&gov.def_attr_lx, PTHREAD_EXPLICIT_SCHED))
+		return;
+	if (pthread_attr_setinheritsched(&gov.def_attr_rt, PTHREAD_EXPLICIT_SCHED))
+		return;
+	if (pthread_attr_setschedpolicy(&gov.def_attr_lx, SCHED_FIFO))
+		return;
+	if (pthread_attr_setschedpolicy(&gov.def_attr_rt, SCHED_FIFO))
+		return;
+	spars_lx.sched_priority = DEF_PRIO_LINUX;		
+	if (pthread_attr_setschedparam (&gov.def_attr_lx, &spars_lx))
+		return;	
+	spars_rt.sched_priority = DEF_PRIO_RT;
+	if (pthread_attr_setschedparam (&gov.def_attr_rt, &spars_rt))
+		return;
+
+	if (pthread_attr_setdetachstate (&gov.def_attr_lx, PTHREAD_CREATE_DETACHED) != 0)
+		return;
+	if (pthread_attr_setdetachstate (&gov.def_attr_rt, PTHREAD_CREATE_DETACHED) != 0)
+		return;
+
+	sigemptyset (&gov.sigset);
+	sigaddset (&gov.sigset, SIGTIMER);		
+	/* 
+	 * Set up the free list for handlers and carriers
+	 * If something went wrong, the lists will be empty
+	 */
+	for (i = 0; i < MAX_SIG_HANDLERS; i++)
+    	list_add_tail ((struct list_head *) &sigev_arr[i].sigev_list,&gov.sigev.free );
+	for (i = 0; i < MAX_CARR_THREADS; i++)
+		list_add_tail((struct list_head *) &carr_arr[i].carr_list, &gov.carr.free);	
+	return ;
+}
+
+/* Waits for the specified signal on rt_sigtimedwait and afterwards 
+ * calls the corresponding handler function */
+void *
+start_carrier_thread (void *carrier_addr)
+{
+	int		retval = 0;
+	siginfo_t 	si;
+	int 		oldtype;
+	sigset_t	ss;
+	struct carrier *myCarr = (struct carrier *) carrier_addr;
+	
+	myCarr->threadActive = 1;
+
+	sigfillset (&ss);
+	pthread_sigmask (SIG_SETMASK, &ss, NULL);			 /* all signals blocked */
+	
+	/* Endless loop of waiting for signals.  
+	 * The loop terminates when the thread gets canceled. */
+	while (1)
+	{
+	
+        /* Allow asynchronous cancellation. */
+        oldtype = LIBC_CANCEL_ASYNC ();
+        
+	    INTERNAL_SYSCALL_DECL (err);
+        /* XXX The size argument hopefully will have to be changed to the
+	       real size of the user-level sigset_t.  */
+	    INTERNAL_SYSCALL (rt_sigtimedwait, err, 4,&gov.sigset, &si, NULL, _NSIG / 8);
+        if (INTERNAL_SYSCALL_ERROR_P (retval, err))
+        {
+       	    errno = EINVAL;
+			return (void *) -1;
+        } 
+	   
+	    /* Restore the old type of cancellation. */
+        LIBC_CANCEL_RESET (oldtype);
+    	if ((si.si_code == SI_TIMER) || (si.si_code == SI_IOEVENT))
+    	{
+			void (*func_ptr) (sigval_t);
+    		sigval_t myVal;
+    		int myId;
+    		int myValid;
+    		struct sigev *requDescr = (struct sigev *) si.si_ptr;
+ 			/* get the parameters */
+ 		    myVal = requDescr->hl_param;
+		    func_ptr = requDescr->handler;
+     		myId = requDescr->id;  // is also event id
+     		/* do some consistency tests */
+     		myValid = 1;
+     		if (si.si_code == SI_IOEVENT) { 
+     			/* events: test if the sequence number is valid */
+     			if (!requDescr->useCnt) {
+     				myValid = 0;
+     			}
+     		}
+     		if (myId != si.si_timerid) {
+     			/* timer / event id is not valid */
+     			myValid = 0;
+     		}
+    		/* Call the user-provided function. */
+		    if (myValid && func_ptr) 
+		    	(*func_ptr) (myVal);
+    	}
+        else if (si.si_code == SI_TKILL)
+  	    {
+   		    pthread_exit (NULL);
+  	    }
+    } /* end while */
+}
+
+
+/* unlinks element from the free list and links it into the used list
+ * return NULL if there is no element available
+ */
+
+struct list_head * get_element(struct dbl_lhd *head)
+{
+	struct list_head* el;
+	struct list_head *list = &head->free;
+	if (list->next != list)
+	{
+		el = list->next;
+		list_del(el);
+		list_add_tail(el, &head->used);
+		return el;
+	}
+	return NULL;
+}
+
+void return_element(struct list_head * el, struct dbl_lhd *head)
+{	
+	list_del (el);
+	list_add_tail(el, &head->free);	
+	return;
+}
+
+struct sigev* setup_handler_notification(struct sigevent *evp, struct sigevent * kevp, int type)
+{
+	pthread_attr_t *		attr;
+	int				prio;
+	size_t				stacksize;
+	struct sched_param 		param;
+	struct carrier *		carr;
+	struct list_head *		iter;
+	struct sigev * 			handler;
+	pthread_t			thr;
+
+
+	if ((attr = evp->sigev_notify_attributes) == NULL)
+	{	/* If attr == NULL use default values. */
+		if (IS_REALTIME)
+			attr = &gov.def_attr_rt;
+		else
+			attr = &gov.def_attr_lx;
+	}
+	/* Get the scheduling priority and the stacksize. */
+	pthread_attr_getschedparam((const pthread_attr_t *) attr, &param);
+	pthread_attr_getstacksize((const pthread_attr_t *) attr, &stacksize);
+	prio = param.sched_priority;
+	
+	pthread_mutex_lock (&gov.lock);	
+	if ((handler = (struct sigev*)get_element(&gov.sigev)) == NULL)	/* Install a new sigev element. */
+	   goto errout_eagain;
+	handler->type = type;
+	handler->carrier = NULL;
+	useCntGen++;
+	if (!useCntGen)
+		useCntGen++;
+	handler->useCnt = useCntGen;  /* prevent use in callback during delete / new create */
+	for (iter = gov.carr.used.next; iter != &gov.carr.used;  iter = iter->next)
+	{
+		carr = (struct carrier *) iter;
+		if ((carr->thread_attr == attr)	&& (carr->prio == prio) && (carr->stacksize == stacksize)) {
+			handler->carrier = carr;
+			goto setup_kevp; 	/* Found matching carrier */ 
+		}
+	}
+	if ((carr = (struct carrier*)get_element(&gov.carr)) == NULL)
+		goto errout_eagain;
+	carr->use_count  = 0;
+	carr->threadActive = 0;
+	carr->prio	   = prio;
+	carr->stacksize  = stacksize;	
+	carr->thread_attr = attr;					
+	handler->carrier = carr;
+	/* Create a new carrier thread */
+	if (pthread_create (&thr, attr,	start_carrier_thread, (void *) handler->carrier) != 0) {
+	   goto errout;	
+	}
+	/*
+	 * we may have the situation that the created thread is not yet running
+	 * due to its priority; let's wait
+	 * we may end up with a better approach later 
+	 */
+	while (!carr->threadActive) {
+		struct timespec myGenSleep;
+		myGenSleep.tv_sec = 0;
+		myGenSleep.tv_nsec =100000000;
+		nanosleep(&myGenSleep, NULL);
+	}
+	
+	handler->carrier->tid = libThreadId2TaskId((struct pthread *)thr);
+	
+setup_kevp:
+	handler->carrier->use_count++;
+	handler->carrier = carr; 
+	handler->hl_param = evp->sigev_value;
+	handler->handler = evp->sigev_notify_function;
+	pthread_mutex_unlock (&gov.lock);
+	/* set up the sigevent object used for the kernel call */ 
+	kevp->sigev_value.sival_ptr = handler;
+	kevp->_sigev_un._tid = handler->carrier->tid;
+	kevp->sigev_notify = SIGEV_THREAD_ID;
+	kevp->sigev_signo = SIGTIMER;	
+	return handler;
+	
+errout_eagain:
+	errno = EAGAIN;
+errout:			
+	pthread_mutex_unlock (&gov.lock);
+	clear_handler_notification(handler);	
+	return NULL;		
+}
+
+void clear_handler_notification(struct sigev *el)
+{
+	if (el == NULL)
+		return;
+	
+	pthread_mutex_lock (&gov.lock);	
+	
+	/* delete information */
+	el->handler = NULL;
+	el->id = -1;	
+	el->useCnt = 0;			
+	if (el->carrier->use_count-- == 1)	/* zero if no thread was created yet */
+	{ 
+		/* To kill the thread we send SIGCANCEL */
+		INTERNAL_SYSCALL_DECL (err);	
+		INTERNAL_SYSCALL (tkill, err, 2, (pid_t) el->carrier->tid, SIGCANCEL);	
+		return_element((struct list_head*)(el->carrier), &gov.carr);
+	}
+	return_element((struct list_head*)el, &gov.sigev);
+	pthread_mutex_unlock (&gov.lock);	
+	
+	return;
+}
+
+void check_handler_notification(int type, int id)
+{
+	struct sigev * candidate;
+	struct list_head *	iter;
+	
+	pthread_mutex_lock (&gov.lock);	
+	for (iter = gov.sigev.used.next; iter != &gov.sigev.used;  iter = iter->next)
+	{
+		candidate = (struct sigev*) iter;
+		if ((candidate->type == type) && (candidate->id == id))
+		{
+			pthread_mutex_unlock (&gov.lock);
+			clear_handler_notification(candidate);
+			return;
+		}
+	}
+	pthread_mutex_unlock (&gov.lock);
+	
+	return;		
+}
+
+#include <fcntl.h>
+#include <sys/ioctl.h>
+
+/* test whether a thread is part of the realtime domain */
+int testAuDrealtime()
+{
+	int retVal;
+	int fd;
+	int threadState = 0;
+	
+	fd = open(AuD_DRIVER_NAME, O_RDWR);
+	if (fd >= 0) {
+		retVal = ioctl(fd, AuD_IS_REALTIME, 0);
+		if (retVal > 0) 
+			threadState = 1;
+		close(fd);
+	}
+	
+	return(threadState);
+}
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/fast-handlers.h glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/fast-handlers.h
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/fast-handlers.h	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/fast-handlers.h	2007-01-23 12:02:00.000000000 +0100
@@ -0,0 +1,106 @@
+/*
+ *
+ * 22-Aug-2006 m.n. add variable threadActive in struct carrier to synchronize
+ *                  handler thread and creation thread
+ */
+ 
+#include <signal.h>
+#include <time.h>
+#include <pthread.h>
+#include <sys/types.h>
+#include <sysdep.h>
+#include <list.h>
+
+#include "rtime_internal.h"
+
+/******** Defines *************************************************************/
+
+#define TRUE				1
+#define FALSE				0
+
+int testAuDrealtime(void);
+#define IS_REALTIME 			testAuDrealtime()
+
+#define TIMER_TYPE			-1
+#define EVENT_TYPE			123
+
+#define DOMAIN_LINUX			0
+#define DOMAIN_RT			1
+
+#define DEF_PRIO_RT			RT_PRIORITY_MIN + 1
+#define DEF_PRIO_LINUX			1
+#define DEF_STACKSIZE 			0x8000
+
+/* Max Number of carrier threads */
+#define MAX_CARR_THREADS	16
+
+/* Max Number of signal handlers */
+#define MAX_SIG_HANDLERS	256
+
+// support call to get taskid from nptl thread reference
+// Note: May have to be changed for other architectures
+static inline int libThreadId2TaskId(struct pthread * th)
+{
+	return(th->tid);
+}
+
+struct dbl_lhd {
+	struct list_head free;
+	struct list_head used;
+};
+
+/* Struct gov centralizes all data for management */
+struct gov
+{
+	struct dbl_lhd			carr;		 	    /* header for free and used list for carriers */
+	struct dbl_lhd			sigev;				/* List header for free and used list for  */
+	pthread_mutex_t			lock;				/* Global lock */
+	pthread_attr_t  		def_attr_lx;		/* Default attr for linux domain */
+	pthread_attr_t    		def_attr_rt;		/* Default attr for rt domain */
+	sigset_t				sigset;				/* Signal set for timer signals */
+};
+
+/* Struct to manage the carrier threads */
+struct carrier
+{
+	struct list_head	carr_list;	/* either linked in free or used list */
+	pthread_attr_t * 	thread_attr;	/* thread attr used for creation */
+	int			use_count;	/* Usage count for this thread */
+	int			threadActive;	/* handler thread is working */
+	pid_t			tid;		/* Thread ID */
+	int			prio;		/* Priority of this thread */
+	int			stacksize;	/* Stacksize of this thread */
+};
+
+/* Struct to manage signalling instances */
+struct sigev
+{
+	struct list_head		sigev_list;	/* either linked in free or used list */
+	int						type;		/* -1: timer; 0: invalid; >0: fd of event device */
+	int						id;			/* timer- or event-ID */
+	unsigned				useCnt;
+	struct carrier *		carrier;	/* Links handler with carrier_thread */
+	void (*handler)(sigval_t sigval);	/* handler to execute */
+	sigval_t				hl_param;	/* parameter for handler */
+};
+
+/* Struct to manage the usage of handlers/carriers */
+struct usage
+{
+	unsigned used;
+	unsigned free;
+	unsigned total;
+};
+
+extern pthread_once_t ha_once;
+
+//* prototypes */
+void *start_carrier_thread (void * arg);
+void init_handler_area (void);
+struct sigev* setup_handler_notification(struct sigevent*, struct sigevent*, int);
+void clear_handler_notification(struct sigev *);
+void check_handler_notification(int, int);
+
+
+
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/get_domain.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/get_domain.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/get_domain.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/get_domain.c	2006-02-01 12:56:12.000000000 +0100
@@ -0,0 +1,22 @@
+
+/****************************************************************************** 
+ * The get_domain() function                                                  *
+ *                                                                            *
+ * shall detect in which domain the current process is runnning.              *
+ *                                                                            *
+ * At this point of time available domains are:                               *
+ *    - DOMAIN_LINUX (0)                                                      *
+ *    - DOMAIN_RT    (1)                                                      *
+ *                                                                            *
+ ******************************************************************************/
+
+#include <stdio.h>
+#include "fast-handlers.h"
+
+
+int get_domain (void)
+{
+	/* This is currently only a dummy function */
+	return DOMAIN_LINUX;
+}
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h	2005-01-20 03:18:38.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h	2006-02-22 16:13:16.000000000 +0100
@@ -16,6 +16,11 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+/*
+ * Manfred.Neugebauer@siemens.com 21-Feb-2006
+ * extend structure pthread_spinlock_t for a more general use
+ */
+
 #ifndef _BITS_PTHREADTYPES_H
 #define _BITS_PTHREADTYPES_H	1
 
@@ -135,7 +140,19 @@
 
 #ifdef __USE_XOPEN2K
 /* POSIX spinlock data type.  */
-typedef volatile int pthread_spinlock_t;
+/* m.n. extended for AuD use */
+typedef volatile struct 
+{
+  long int __spinMagic;
+  long int __spinFlag;
+  long int __spinCount;
+  long int __spinPrivLevel;
+  long int __spinProcessId;
+  long int __spinTaskid;
+} pthread_spinlock_t;
+#define __AUD_SPINLOCK_MAGIC 0x25091921
+extern int __aud_spin_process_id;
+extern int __aud_spin_priv_level;
 
 
 /* POSIX barriers data type.  The structure of the type is
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/i386/i586/dl-sysdep.h glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/i386/i586/dl-sysdep.h
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/i386/i586/dl-sysdep.h	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/i386/i586/dl-sysdep.h	2005-01-20 03:18:38.000000000 +0100
@@ -0,0 +1,61 @@
+/* System-specific settings for dynamic linker code.  IA-32 version.
+   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#ifndef _DL_SYSDEP_H
+#define _DL_SYSDEP_H	1
+
+/* This macro must be defined to either 0 or 1.
+
+   If 1, then an errno global variable hidden in ld.so will work right with
+   all the errno-using libc code compiled for ld.so, and there is never a
+   need to share the errno location with libc.  This is appropriate only if
+   all the libc functions that ld.so uses are called without PLT and always
+   get the versions linked into ld.so rather than the libc ones.  */
+
+#ifdef IS_IN_rtld
+# define RTLD_PRIVATE_ERRNO 1
+#else
+# define RTLD_PRIVATE_ERRNO 0
+#endif
+
+/* Traditionally system calls have been made using int $0x80.  A
+   second method was introduced which, if possible, will use the
+   sysenter/syscall instructions.  To signal the presence and where to
+   find the code the kernel passes an AT_SYSINFO value in the
+   auxiliary vector to the application.  */
+#define NEED_DL_SYSINFO	1
+#define USE_DL_SYSINFO	1
+
+#if defined NEED_DL_SYSINFO && !defined __ASSEMBLER__
+extern void _dl_sysinfo_int80 (void) attribute_hidden;
+# define DL_SYSINFO_DEFAULT (uintptr_t) _dl_sysinfo_int80
+# define DL_SYSINFO_IMPLEMENTATION \
+  asm (".text\n\t"							      \
+       ".type _dl_sysinfo_int80,@function\n\t"				      \
+       ".hidden _dl_sysinfo_int80\n"					      \
+       CFI_STARTPROC "\n"						      \
+       "_dl_sysinfo_int80:\n\t"						      \
+       "int $0x80;\n\t"							      \
+       "ret;\n\t"							      \
+       CFI_ENDPROC "\n"							      \
+       ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80\n\t"		      \
+       ".previous");
+#endif
+
+#endif	/* dl-sysdep.h */
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/i386/pthread_spin_unlock.S glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/i386/pthread_spin_unlock.S
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/i386/pthread_spin_unlock.S	2005-01-20 03:18:38.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/i386/pthread_spin_unlock.S	2006-02-22 16:13:08.000000000 +0100
@@ -1 +1,7 @@
+
+#if (0)
 #include <nptl/sysdeps/i386/pthread_spin_unlock.S>
+#else
+/* see nptl/sysdeps/i386/pthread_spin_lock.c for the AuD implementation ( C based) */
+.int 5
+#endif
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/register_clock.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/register_clock.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/register_clock.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/register_clock.c	2006-09-29 18:28:03.000000000 +0200
@@ -0,0 +1,62 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
+#include <string.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+/******************************************************************************
+ * The register_clock() function                                              *
+ *                                                                            *
+ * enables a device to act as a clock. All subsequent calls needing a clock,  *
+ * thus timer_create(), clock_settime(), clock_gettime() and clock_getres()   *
+ * may specifiy this clockid returned by the register_clock() function.       *
+ * The flags argument specifies the special properties of timers which are    *
+ * created with the clockid returned by the register_clock() function. The    *
+ * flags argument may have the following values:                              *
+ *                                                                            *
+ *    SYNC_TIMER                                                              *
+ *    A timer is not armed automatically by a timer_settime() call. It's      *
+ *    start gets deferred until a subsequent clock_settime() call. This       *
+ *    allows to start                                                         *
+ *****************************************************************************/
+
+
+#include "rtime_lib.h"
+
+
+clockid_t register_clock (int fildes, int flags, struct timespec *res)
+{
+	struct rt_clock_desc myClock;
+	int			ret_clock = 0;
+	
+	myClock.clock_type = flags;
+	
+	/* Clock resolution was specified by the user. */
+	if (res != NULL)
+	{
+		/* Enter the given timespec values in the corresponding cmd_union elements. 
+		 * Validity has not to be checked, it's done by the kernel. */
+		myClock.clock_res.tv_sec  = res->tv_sec;
+		myClock.clock_res.tv_nsec = res->tv_nsec;
+	}
+	
+	/* No clock resolution was specified. */
+	else
+	{
+		myClock.clock_res.tv_sec  = 0;
+		myClock.clock_res.tv_nsec = 0;
+	}
+
+	if ((ret_clock = ioctl (fildes, AuD_REGISTER_CLOCK, &myClock)) == -1)
+	{	
+		/* errno is set by the ioctl() function */
+		return -1;
+	}
+	return (clockid_t) ret_clock;
+}
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/rtime_internal2.h glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/rtime_internal2.h
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/rtime_internal2.h	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/rtime_internal2.h	2006-08-30 10:59:36.000000000 +0200
@@ -0,0 +1,91 @@
+/* 
+ * Copyright (C) 2005 by Siemens AG, AD ATS 11, 90327 Nuernberg, Germany,
+ *               Manfred.Neugebauer@siemens.com, 16-Feb-2005
+ *
+ * common definitions for the interface between kernel / driver and library
+ * to support the AuD API driver related functions
+ * (realtime, synchronous timer, events)
+ * 
+ * file "rtime_internal2.h"
+ * 
+ */
+
+#ifndef _RTIME_INTERNAL2_H_
+#define _RTIME_INTERNAL2_H_
+
+#define SIGTIMER	__SIGRTMIN // T B D: who needs this: khk driver => move to rtime_kernel.h?
+
+/* ioctls for the aud device driver */
+#define AuD_Dev_IOCTL_BASE			0x8000
+#define AuD_REGISTER_PROCESS			(AuD_Dev_IOCTL_BASE + 0x00)
+#define AuD_UNREGISTER_PROCESS			(AuD_Dev_IOCTL_BASE + 0x01)
+#define AuD_PROBE_REALTIME			(AuD_Dev_IOCTL_BASE + 0x02)
+#define AuD_IS_REALTIME				(AuD_Dev_IOCTL_BASE + 0x03)
+#define AuD_DEV_RT_PARAM			(AuD_Dev_IOCTL_BASE + 0x04)
+#define AuD_REGISTER_AND_PROBE_REALTIME		(AuD_Dev_IOCTL_BASE + 0x05)
+#define AuD_TEST_RT				(AuD_Dev_IOCTL_BASE + 0x06)
+#define AuD_SET_DIAGNOSIS			(AuD_Dev_IOCTL_BASE + 0x07)
+#define AuD_GET_VERSION				(AuD_Dev_IOCTL_BASE + 0x08)
+
+/* definitions of ioctl to handle device based API extensions (synch timer, events) */
+#define AuD_API_IOCTL_BASE			0x44410000
+#define AuD_REGISTER_CLOCK			(AuD_API_IOCTL_BASE + 0x08)
+#define AuD_EVENT_CREATE			(AuD_API_IOCTL_BASE + 0x09)
+#define AuD_EVENT_SET_PAR			(AuD_API_IOCTL_BASE + 0x0a)
+
+struct rt_clock_desc {
+	int clock_type;
+	struct timespec clock_res;
+};
+
+struct rt_ev_desc {
+	unsigned event;
+	sigevent_t sigevent;
+};
+
+#define SIGEV_SIGNAL_SV_MAGIC		0x5f6e7d00
+
+// T B D: separate events for Linux and/or realtime?
+
+struct rt_config {
+	int no_of_timers;
+	int no_of_headers;
+	int no_of_fu_req;	// for delegating futex_wake requests to Linux;
+	int buf_size;		// buffer size for delegated write calls
+	int md_prio;		// prio of the migration_to_rt daemon
+	int td_prio;		// prio of the timeout daemon of the realtime domain
+	int dd_prio;		// prio of the delegation daemon futex, other syscalls
+	int cd_prio;		// prio of clock sync daemon for Linux
+	int ed_prio;		// prio of event proxy daemon for Linux
+};
+
+struct exec_rt_kernel {
+	unsigned version;
+	unsigned exec_flags;
+};
+
+struct aud_version {
+	unsigned version_rt;
+	unsigned version_dev;
+};
+
+struct aud_diag {
+	unsigned diag_rt;
+	unsigned diag_dev;
+};
+
+/* diagnostic flags for aud device and realtime driver */ 
+#define RT_FUTEX_VERBOSE_BIT		0x001
+#define RT_WRITE_VERBOSE_BIT		0x002
+#define RT_INIT_VERBOSE_BIT			0x004
+#define RT_SHUTDOWN_VERBOSE_BIT		0x008
+#define RT_CHECK_VERBOSE_BIT		0x010
+#define RT_THREAD_VERBOSE_BIT		0x020
+#define RT_TIMER_VERBOSE_BIT		0x040
+#define RT_EVENT_VERBOSE_BIT		0x080
+#define RT_MIGRATE_VERBOSE_BIT		0x100
+#define RT_FAULT_VERBOSE_BIT		0x200
+#define RT_SYSCALL_VERBOSE_BIT		0x400
+#define AUD_DEV_VERBOSE_BIT			0x800
+
+#endif //_RTIME_INTERNAL2_H_
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/rtime_internal.h glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/rtime_internal.h
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/rtime_internal.h	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/rtime_internal.h	2006-10-20 18:32:42.000000000 +0200
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2004 by Siemens AG, AD ATS 11, 90327 Nuernberg, Germany,
+ *               Manfred.Neugebauer@siemens.com, 23-Feb-2004
+ *
+ * These are the internal definitions to work with a realtime subsystem
+ * 
+ */
+
+#ifndef _RTIME_INTERNAL_H_
+#define _RTIME_INTERNAL_H_
+
+#define __RT_PRIORITY_MAX	99
+
+#define __LINUX_PRIORITY_MIN	0
+#define __LINUX_PRIORITY_DIST	3
+#define RT_P0			__LINUX_PRIORITY_MIN + 0 * __LINUX_PRIORITY_DIST
+#define RT_P1			__LINUX_PRIORITY_MIN + 1 * __LINUX_PRIORITY_DIST
+#define RT_P2			__LINUX_PRIORITY_MIN + 2 * __LINUX_PRIORITY_DIST
+#define RT_P3			__LINUX_PRIORITY_MIN + 3 * __LINUX_PRIORITY_DIST
+#define RT_P4			__LINUX_PRIORITY_MIN + 4 * __LINUX_PRIORITY_DIST
+#define RT_P5			__LINUX_PRIORITY_MIN + 5 * __LINUX_PRIORITY_DIST
+#define RT_P6			__LINUX_PRIORITY_MIN + 6 * __LINUX_PRIORITY_DIST
+#define RT_P7			__LINUX_PRIORITY_MIN + 7 * __LINUX_PRIORITY_DIST
+#define RT_P8			__LINUX_PRIORITY_MIN + 8 * __LINUX_PRIORITY_DIST
+#define RT_P9			__LINUX_PRIORITY_MIN + 9 * __LINUX_PRIORITY_DIST
+#define RT_P10			__LINUX_PRIORITY_MIN + 10 * __LINUX_PRIORITY_DIST
+#define RT_P11			__LINUX_PRIORITY_MIN + 11 * __LINUX_PRIORITY_DIST
+#define RT_P12			__LINUX_PRIORITY_MIN + 12 * __LINUX_PRIORITY_DIST
+#define RT_P13			__LINUX_PRIORITY_MIN + 13 * __LINUX_PRIORITY_DIST
+#define RT_P14			__LINUX_PRIORITY_MIN + 14 * __LINUX_PRIORITY_DIST
+#define RT_P15			__LINUX_PRIORITY_MIN + 15 * __LINUX_PRIORITY_DIST
+#define RT_P16			__RT_PRIORITY_MAX - 15
+#define RT_P17			__RT_PRIORITY_MAX - 14
+#define RT_P18			__RT_PRIORITY_MAX - 13
+#define RT_P19			__RT_PRIORITY_MAX - 12
+#define RT_P20			__RT_PRIORITY_MAX - 11
+#define RT_P21			__RT_PRIORITY_MAX - 10
+#define RT_P22			__RT_PRIORITY_MAX - 9
+#define RT_P23			__RT_PRIORITY_MAX - 8
+#define RT_P24			__RT_PRIORITY_MAX - 7
+#define RT_P25			__RT_PRIORITY_MAX - 6
+#define RT_P26			__RT_PRIORITY_MAX - 5
+#define RT_P27			__RT_PRIORITY_MAX - 4
+#define RT_P28			__RT_PRIORITY_MAX - 3
+#define RT_P29			__RT_PRIORITY_MAX - 2
+#define RT_P30			__RT_PRIORITY_MAX - 1
+#define RT_P31			__RT_PRIORITY_MAX - 0
+
+#define RT_PRIORITY_MIN		RT_P16
+
+#define AuD_DRIVER_NAME			"/dev/auddriver"
+
+/* 
+ * The flags RT_SOFT and RT_HARD are used in ioctl and aud_rt_hdr.state.   
+ * The remainder are flags in aud_rt_hdr.state only
+ */
+
+#define RT_SOFT 				0x0010
+#define RT_HARD					0x0020
+
+#define RT_INSTALLED	 		0x0040
+#define RT_SHUTDOWN				0x0100
+#define RT_FAILED				0x0200
+#define RT_MASK					(RT_SOFT | RT_HARD)
+
+/*
+ * prefered definitions of a set of realtime signals 
+ */
+#define SIGRT0			__SIGRTMIN + 8
+#define SIGRT1			__SIGRTMIN + 9
+#define SIGRT2			__SIGRTMIN + 10
+#define SIGRT3			__SIGRTMIN + 11
+#define SIGRT4			__SIGRTMIN + 12
+#define SIGRT5			__SIGRTMIN + 13
+#define SIGRT6			__SIGRTMIN + 14
+#define SIGRT7			__SIGRTMIN + 15
+#define SIGRT8			__SIGRTMIN + 16
+#define SIGRT9			__SIGRTMIN + 17
+#define SIGRT10			__SIGRTMIN + 18
+#define SIGRT11			__SIGRTMIN + 19
+#define SIGRT12			__SIGRTMIN + 20
+#define SIGRT13			__SIGRTMIN + 21
+#define SIGRT14			__SIGRTMIN + 22
+#define SIGRT15			__SIGRTMIN + 23
+
+#define EXEC_T_STRUCT_VERSION	0x01072006
+
+typedef struct rt_exec_t_struct {
+	unsigned version;
+	unsigned exec_flags;
+} rt_exec_t;
+
+#define AuD_CLOCK_SYNC_TYPE	0x0008
+
+/* The final definition of this data type may look different. 
+ * It'll be used for the event_create() function. */
+typedef unsigned int eventid_t;
+
+// from "asm-generic/siginfo.h" user segment
+// open issue: is '-8' a valid information?
+#define SI_IOEVENT	(-8)
+#define si_eventid		_sifields._timer._tid
+
+			// add on to siginfo.h for A&D API	
+#define SIGEV_SIGNAL_SV			(SIGEV_THREAD_ID | 0x10)
+			// end A&D API add on
+
+#endif //_RTIME_INTERNAL_H_
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/rtime_lib.h glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/rtime_lib.h
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/rtime_lib.h	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/rtime_lib.h	2006-08-15 12:11:18.000000000 +0200
@@ -0,0 +1,22 @@
+/* 
+ * Copyright (C) 2005 by Siemens AG, AD ATS 11, 90327 Nuernberg, Germany,
+ *               Manfred.Neugebauer@siemens.com, 16-Feb-2005
+ *
+ * definitions for the kernel (realtime) driver interface to support
+ * the AuD API driver related functions
+ * (realtime, synchronous timer, events)
+ * ==> entry for the library part
+ * 
+ * file "rtime_lib.h"
+ * 
+ */
+
+#ifndef _RTIME_LIB_H_
+#define _RTIME_LIB_H_
+
+#define AuD_DRIVER_VERBOSE "AuDDrvVerbose"
+
+/* we have common defines with rtime_kernel.h */
+#include "rtime_internal2.h"
+
+#endif //_RTIME_LIB_H_
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/sigevent_set_notification.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/sigevent_set_notification.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/sigevent_set_notification.c	1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/sigevent_set_notification.c	2007-01-24 14:22:21.000000000 +0100
@@ -0,0 +1,39 @@
+
+/******************************************************************************
+ * The sigevent_set_notification() function                                   *
+ *                                                                            *
+ * refines the signal delivery attributes of a sigevent object.               *
+ *                                                                            *	
+ ******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
+
+#include "fast-handlers.h"
+
+/* Header file rtime_kernel.h has to be included first in order to use the 
+ * notification type SIGEV_SIGNAL_SV. 
+ * Eventually this has to go into siginfo.h */
+#include "rtime_lib.h"
+
+
+int sigevent_set_notification (struct sigevent * evp, int cycle, int signo, pthread_t thread) 
+{
+	/* Set given signo in sigevent structure */
+	evp->sigev_signo = signo;
+	
+	/* Set the notification type for super vision (SV) */
+	evp->sigev_notify = SIGEV_SIGNAL_SV;
+	
+	/* Provide the argument cycle for the kernel */
+	evp->sigev_value.sival_int = cycle;
+    
+	/* Reference to specified thread */
+	//evp->_sigev_un._tid = ((struct pthread *)thread)->tid;
+	evp->_sigev_un._tid = libThreadId2TaskId((struct pthread *) thread);
+    
+	return 0;	
+}
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_create.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_create.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_create.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_create.c	2007-01-23 16:33:16.000000000 +0100
@@ -1,229 +1,46 @@
-/* Copyright (C) 2003,2004 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
 
+/****************************************************************************** 
+                                         *
+ ******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <pthread.h>
 #include <signal.h>
-#include <stdlib.h>
-#include <string.h>
 #include <time.h>
 #include <sysdep.h>
 #include <kernel-features.h>
 #include <internaltypes.h>
-#include <nptl/pthreadP.h>
-#include "kernel-posix-timers.h"
+#include "fast-handlers.h"
+
 
 
-#ifdef __NR_timer_create
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_create (clockid_t clock_id, struct sigevent *evp,
-				timer_t *timerid);
-#  define timer_create static compat_timer_create
-#  include <nptl/sysdeps/pthread/timer_create.c>
-#  undef timer_create
-
-/* Nonzero if the system calls are not available.  */
-int __no_posix_timers attribute_hidden;
-# endif
-
-# ifdef timer_create_alias
-#  define timer_create timer_create_alias
-# endif
-
-
-int
-timer_create (clock_id, evp, timerid)
-     clockid_t clock_id;
-     struct sigevent *evp;
-     timer_t *timerid;
+int timer_create (clockid_t clock_id, struct sigevent * evp, timer_t * timerid)
 {
-# undef timer_create
-# ifndef __ASSUME_POSIX_TIMERS
-  if  (__no_posix_timers >= 0)
-# endif
-    {
-      /* If the user wants notification via a thread we need to handle
-	 this special.  */
-      if (evp == NULL
-	  || __builtin_expect (evp->sigev_notify != SIGEV_THREAD, 1))
-	{
-	  struct sigevent local_evp;
+	struct sigev * 		handler = NULL;
+	struct sigevent		k_sig_event, *kevp;
 
-	  /* We avoid allocating too much memory by basically
-	     using struct timer as a derived class with the
-	     first two elements being in the superclass.  We only
-	     need these two elements here.  */
-	  struct timer *newp = (struct timer *) malloc (offsetof (struct timer,
-								  thrfunc));
-	  if (newp == NULL)
-	    /* No more memory.  */
-	    return -1;
-
-	  if (evp == NULL)
-	    {
-	      /* The kernel has to pass up the timer ID which is a
-		 userlevel object.  Therefore we cannot leave it up to
-		 the kernel to determine it.  */
-	      local_evp.sigev_notify = SIGEV_SIGNAL;
-	      local_evp.sigev_signo = SIGALRM;
-	      local_evp.sigev_value.sival_ptr = newp;
-
-	      evp = &local_evp;
-	    }
-
-	  kernel_timer_t ktimerid;
-	  int retval = INLINE_SYSCALL (timer_create, 3, clock_id, evp,
-				       &ktimerid);
-
-# ifndef __ASSUME_POSIX_TIMERS
-	  if (retval != -1 || errno != ENOSYS)
-# endif
-	    {
-# ifndef __ASSUME_POSIX_TIMERS
-	      __no_posix_timers = 1;
-# endif
-
-	      if (retval != -1)
-		{
-		  newp->sigev_notify = (evp != NULL
-					? evp->sigev_notify : SIGEV_SIGNAL);
-		  newp->ktimerid = ktimerid;
-
-		  *timerid = (timer_t) newp;
-		}
-	      else
-		{
-		  /* Cannot allocate the timer, fail.  */
-		  free (newp);
-		  retval = -1;
-		}
-
-	      return retval;
-	    }
-
-	  free (newp);
-
-# ifndef __ASSUME_POSIX_TIMERS
-	  /* When we come here the syscall does not exist.  Make sure we
-	     do not try to use it again.  */
-	  __no_posix_timers = -1;
-# endif
-	}
-      else
+	/* Initialize the handler_area the first time
+	 * timer_create, event_create, timer_delete is called.
+	 */
+	pthread_once (&ha_once, (void (*) (void)) init_handler_area);
+	
+	kevp = evp;
+	if (evp->sigev_notify == SIGEV_THREAD)
 	{
-# ifndef __ASSUME_POSIX_TIMERS
-	  /* Make sure we have the necessary kernel support.  */
-	  if (__no_posix_timers == 0)
-	    {
-	      INTERNAL_SYSCALL_DECL (err);
-	      struct timespec ts;
-	      int res;
-	      res = INTERNAL_SYSCALL (clock_getres, err, 2,
-				      CLOCK_REALTIME, &ts);
-	      __no_posix_timers = (INTERNAL_SYSCALL_ERROR_P (res, err)
-				   ? -1 : 1);
-	    }
-
-	  if (__no_posix_timers > 0)
-# endif
-	    {
-	      /* Create the helper thread.  */
-	      pthread_once (&__helper_once, __start_helper_thread);
-	      if (__helper_tid == 0)
-		{
-		  /* No resources to start the helper thread.  */
-		  __set_errno (EAGAIN);
-		  return -1;
-		}
-
-	      struct timer *newp;
-	      newp = (struct timer *) malloc (sizeof (struct timer));
-	      if (newp == NULL)
-		return -1;
-
-	      /* Copy the thread parameters the user provided.  */
-	      newp->sival = evp->sigev_value;
-	      newp->thrfunc = evp->sigev_notify_function;
-
-	      /* We cannot simply copy the thread attributes since the
-		 implementation might keep internal information for
-		 each instance.  */
-	      (void) pthread_attr_init (&newp->attr);
-	      if (evp->sigev_notify_attributes != NULL)
-		{
-		  struct pthread_attr *nattr;
-		  struct pthread_attr *oattr;
-
-		  nattr = (struct pthread_attr *) &newp->attr;
-		  oattr = (struct pthread_attr *) evp->sigev_notify_attributes;
-
-		  nattr->schedparam = oattr->schedparam;
-		  nattr->schedpolicy = oattr->schedpolicy;
-		  nattr->flags = oattr->flags;
-		  nattr->guardsize = oattr->guardsize;
-		  nattr->stackaddr = oattr->stackaddr;
-		  nattr->stacksize = oattr->stacksize;
-		}
-
-	      /* In any case set the detach flag.  */
-	      (void) pthread_attr_setdetachstate (&newp->attr,
-						  PTHREAD_CREATE_DETACHED);
-
-	      /* Create the event structure for the kernel timer.  */
-	      struct sigevent sev;
-	      sev.sigev_value.sival_ptr = newp;
-	      sev.sigev_signo = SIGTIMER;
-	      sev.sigev_notify = SIGEV_SIGNAL | SIGEV_THREAD_ID;
-	      /* This is the thread ID of the helper thread.  */
-	      sev._sigev_un._pad[0] = __helper_tid;
-
-	      /* Create the timer.  */
-	      INTERNAL_SYSCALL_DECL (err);
-	      int res;
-	      res = INTERNAL_SYSCALL (timer_create, err, 3, clock_id, &sev,
-				      &newp->ktimerid);
-	      if (! INTERNAL_SYSCALL_ERROR_P (res, err))
-		{
-		  *timerid = (timer_t) newp;
-		  return 0;
-		}
-
-	      /* Free the resources.  */
-	      free (newp);
-
-	      __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
-
-	      return -1;
-	    }
+		if ((handler = setup_handler_notification(evp, &k_sig_event, TIMER_TYPE)) == NULL)
+			return -1; 							/* errno is set by setup_handler_notification() */
+		kevp = &k_sig_event;					/* we have to use the modified sigevent object */	
 	}
-    }
-
-# ifndef __ASSUME_POSIX_TIMERS
-  /* Compatibility code.  */
-  return compat_timer_create (clock_id, evp, timerid);
-# endif
+	/* The kernel handles the default values if evp */
+	if (INLINE_SYSCALL (timer_create, 3, clock_id, kevp, timerid) != 0)
+	{	
+		clear_handler_notification(handler);					/* can handle handler == NULL */
+		return -1;
+	}	
+	if (handler != NULL)
+		handler->id = (int)*timerid;				
+return 0;
 }
-#else
-# ifdef timer_create_alias
-#  define timer_create timer_create_alias
-# endif
-/* The new system calls are not available.  Use the userlevel
-   implementation.  */
-# include <nptl/sysdeps/pthread/timer_create.c>
-#endif
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_delete.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_delete.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_delete.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_delete.c	2006-07-14 17:51:40.000000000 +0200
@@ -1,94 +1,28 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
+/****************************************************************************** 
+                                         *
+ ******************************************************************************/
 
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
 #include <time.h>
 #include <sysdep.h>
 #include <kernel-features.h>
-#include "kernel-posix-timers.h"
-
+#include <internaltypes.h>
+#include "fast-handlers.h"
 
-#ifdef __NR_timer_delete
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_delete (timer_t timerid);
-#  define timer_delete static compat_timer_delete
-#  include <nptl/sysdeps/pthread/timer_delete.c>
-#  undef timer_delete
-# endif
 
-# ifdef timer_delete_alias
-#  define timer_delete timer_delete_alias
-# endif
-
-
-int
-timer_delete (timerid)
-     timer_t timerid;
+int timer_delete (timer_t timerid)		   /* Delete the kernel timer object. */	
 {
-# undef timer_delete
-# ifndef __ASSUME_POSIX_TIMERS
-  if (__no_posix_timers >= 0)
-# endif
-    {
-      struct timer *kt = (struct timer *) timerid;
-
-      /* Delete the kernel timer object.  */
-      int res = INLINE_SYSCALL (timer_delete, 1, kt->ktimerid);
-
-      if (res == 0)
+    if (INLINE_SYSCALL (timer_delete, 1, timerid) != 0)
 	{
-# ifndef __ASSUME_POSIX_TIMERS
-	  /* We know the syscall support is available.  */
-	  __no_posix_timers = 1;
-# endif
-
-	  /* Free the memory.  */
-	  (void) free (kt);
-
-	  return 0;
-	}
-
-      /* The kernel timer is not known or something else bad happened.
-	 Return the error.  */
-# ifndef __ASSUME_POSIX_TIMERS
-      if (errno != ENOSYS)
-	{
-	  __no_posix_timers = 1;
-# endif
-	  return -1;
-# ifndef __ASSUME_POSIX_TIMERS
+		/* errno is set by the INLINE_SYSCALL */
+		return -1;
 	}
-
-      __no_posix_timers = -1;
-# endif
-    }
-
-# ifndef __ASSUME_POSIX_TIMERS
-  return compat_timer_delete (timerid);
-# endif
+	check_handler_notification(TIMER_TYPE, (int) timerid);
+	return 0;
 }
-#else
-# ifdef timer_delete_alias
-#  define timer_delete timer_delete_alias
-# endif
-/* The new system calls are not available.  Use the userlevel
-   implementation.  */
-# include <nptl/sysdeps/pthread/timer_delete.c>
-#endif
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_getoverr.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_getoverr.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_getoverr.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_getoverr.c	2006-10-05 14:50:08.000000000 +0200
@@ -17,65 +17,19 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/*
+ * m.n. siemens ag, this call is not part of the AuD API
+ * we provide this error stub to handle linking of posix test programs
+ */
 #include <errno.h>
 #include <time.h>
 #include <sysdep.h>
 #include <kernel-features.h>
 #include "kernel-posix-timers.h"
 
-
-#ifdef __NR_timer_getoverrun
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_getoverrun (timer_t timerid);
-#  define timer_getoverrun static compat_timer_getoverrun
-#  include <nptl/sysdeps/pthread/timer_getoverr.c>
-#  undef timer_getoverrun
-# endif
-
-# ifdef timer_getoverrun_alias
-#  define timer_getoverrun timer_getoverrun_alias
-# endif
-
-
 int
 timer_getoverrun (timerid)
      timer_t timerid;
 {
-# undef timer_getoverrun
-# ifndef __ASSUME_POSIX_TIMERS
-  if (__no_posix_timers >= 0)
-# endif
-    {
-      struct timer *kt = (struct timer *) timerid;
-
-      /* Get the information from the kernel.  */
-      int res = INLINE_SYSCALL (timer_getoverrun, 1, kt->ktimerid);
-
-# ifndef __ASSUME_POSIX_TIMERS
-      if (res != -1 || errno != ENOSYS)
-	{
-	  /* We know the syscall support is available.  */
-	  __no_posix_timers = 1;
-# endif
-	  return res;
-# ifndef __ASSUME_POSIX_TIMERS
-	}
-# endif
-
-# ifndef __ASSUME_POSIX_TIMERS
-      __no_posix_timers = -1;
-# endif
-    }
-
-# ifndef __ASSUME_POSIX_TIMERS
-  return compat_timer_getoverrun (timerid);
-# endif
+	return(ENOSYS);
 }
-#else
-# ifdef timer_getoverrun_alias
-#  define timer_getoverrun timer_getoverrun_alias
-# endif
-/* The new system calls are not available.  Use the userlevel
-   implementation.  */
-# include <nptl/sysdeps/pthread/timer_getoverr.c>
-#endif
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_gettime.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_gettime.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_gettime.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_gettime.c	2006-02-01 12:56:18.000000000 +0100
@@ -1,83 +1,28 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
 
-#include <errno.h>
+/****************************************************************************** 
+                                         *
+ ******************************************************************************/
+
+#include <stdio.h>
 #include <stdlib.h>
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
 #include <time.h>
 #include <sysdep.h>
 #include <kernel-features.h>
-#include "kernel-posix-timers.h"
+#include <internaltypes.h>
 
 
-#ifdef __NR_timer_gettime
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_gettime (timer_t timerid, struct itimerspec *value);
-#  define timer_gettime static compat_timer_gettime
-#  include <nptl/sysdeps/pthread/timer_gettime.c>
-#  undef timer_gettime
-# endif
-
-# ifdef timer_gettime_alias
-#  define timer_gettime timer_gettime_alias
-# endif
-
-
-int
-timer_gettime (timerid, value)
-     timer_t timerid;
-     struct itimerspec *value;
+
+int timer_gettime (timer_t timerid, struct itimerspec * value)
 {
-# undef timer_gettime
-# ifndef __ASSUME_POSIX_TIMERS
-  if (__no_posix_timers >= 0)
-# endif
-    {
-      struct timer *kt = (struct timer *) timerid;
-
-      /* Delete the kernel timer object.  */
-      int res = INLINE_SYSCALL (timer_gettime, 2, kt->ktimerid, value);
-
-# ifndef __ASSUME_POSIX_TIMERS
-      if (res != -1 || errno != ENOSYS)
-	{
-	  /* We know the syscall support is available.  */
-	  __no_posix_timers = 1;
-# endif
-	  return res;
-# ifndef __ASSUME_POSIX_TIMERS
+	int retval = 0;	
+    if ((retval = INLINE_SYSCALL (timer_gettime, 2, timerid, value)) != 0)
+	{	
+		/* errno is set by the INLINE_SYSCALL */
+		return -1;/* errno is set by the function thread_alloc() */
 	}
-# endif
-
-# ifndef __ASSUME_POSIX_TIMERS
-      __no_posix_timers = -1;
-# endif
-    }
-
-# ifndef __ASSUME_POSIX_TIMERS
-  return compat_timer_gettime (timerid, value);
-# endif
+	return 0;
 }
-#else
-# ifdef timer_gettime_alias
-#  define timer_gettime timer_gettime_alias
-# endif
-/* The new system calls are not available.  Use the userlevel
-   implementation.  */
-# include <nptl/sysdeps/pthread/timer_gettime.c>
-#endif
+
diff -Naur glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_settime.c glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_settime.c
--- glibc-2.3.6_Cs/nptl/sysdeps/unix/sysv/linux/timer_settime.c	2005-01-20 03:18:37.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/sysdeps/unix/sysv/linux/timer_settime.c	2006-02-01 12:56:18.000000000 +0100
@@ -1,88 +1,29 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
+/****************************************************************************** 
+                                         *
+ ******************************************************************************/
 
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <errno.h>
+#include <pthread.h>
+#include <signal.h>
 #include <time.h>
 #include <sysdep.h>
 #include <kernel-features.h>
-#include "kernel-posix-timers.h"
-
+#include <internaltypes.h>
 
-#ifdef __NR_timer_settime
-# ifndef __ASSUME_POSIX_TIMERS
-static int compat_timer_settime (timer_t timerid, int flags,
-				 const struct itimerspec *value,
-				 struct itimerspec *ovalue);
-#  define timer_settime static compat_timer_settime
-#  include <nptl/sysdeps/pthread/timer_settime.c>
-#  undef timer_settime
-# endif
 
-# ifdef timer_settime_alias
-#  define timer_settime timer_settime_alias
-# endif
 
-
-int
-timer_settime (timerid, flags, value, ovalue)
-     timer_t timerid;
-     int flags;
-     const struct itimerspec *value;
-     struct itimerspec *ovalue;
+int timer_settime (timer_t timerid, int flags, const struct itimerspec * value, struct itimerspec * ovalue)
 {
-# undef timer_settime
-# ifndef __ASSUME_POSIX_TIMERS
-  if (__no_posix_timers >= 0)
-# endif
-    {
-      struct timer *kt = (struct timer *) timerid;
-
-      /* Delete the kernel timer object.  */
-      int res = INLINE_SYSCALL (timer_settime, 4, kt->ktimerid, flags,
-				value, ovalue);
-
-# ifndef __ASSUME_POSIX_TIMERS
-      if (res != -1 || errno != ENOSYS)
-	{
-	  /* We know the syscall support is available.  */
-	  __no_posix_timers = 1;
-# endif
-	  return res;
-# ifndef __ASSUME_POSIX_TIMERS
+	int retval = 0;
+    /* Set the time of the next expiration of the timer specified by timerid. */
+    if ((retval = INLINE_SYSCALL (timer_settime, 4, timerid, 
+    						      flags, value, ovalue)) != 0)
+	{		
+		/* errno is set by the INLINE_SYSCALL */
+		return -1;
 	}
-# endif
-
-# ifndef __ASSUME_POSIX_TIMERS
-      __no_posix_timers = -1;
-# endif
-    }
-
-# ifndef __ASSUME_POSIX_TIMERS
-  return compat_timer_settime (timerid, flags, value, ovalue);
-# endif
+	return 0;
 }
-#else
-# ifdef timer_settime_alias
-#  define timer_settime timer_settime_alias
-# endif
-/* The new system calls are not available.  Use the userlevel
-   implementation.  */
-# include <nptl/sysdeps/pthread/timer_settime.c>
-#endif
diff -Naur glibc-2.3.6_Cs/nptl/Versions glibc-2.3.6-AuD/nptl/Versions
--- glibc-2.3.6_Cs/nptl/Versions	2005-01-20 03:18:36.000000000 +0100
+++ glibc-2.3.6-AuD/nptl/Versions	2006-10-06 18:37:31.000000000 +0200
@@ -150,6 +150,9 @@
 
   GLIBC_2.2 {
     pthread_mutexattr_getpshared; pthread_mutexattr_setpshared;
+    # m.n. siemens ag: ad api
+    pthread_mutexattr_getprioceiling; pthread_mutexattr_setprioceiling;
+    pthread_mutexattr_getprotocol; pthread_mutexattr_setprotocol;
 
     pthread_condattr_getpshared; pthread_condattr_setpshared;
 
diff -Naur glibc-2.3.6_Cs/rt/Makefile glibc-2.3.6-AuD/rt/Makefile
--- glibc-2.3.6_Cs/rt/Makefile	2005-01-20 03:18:40.000000000 +0100
+++ glibc-2.3.6-AuD/rt/Makefile	2007-02-20 11:28:23.000000000 +0100
@@ -19,6 +19,18 @@
 #
 #	Sub-makefile for real-time portion of the library.
 #
+
+#
+# m.n. 31-Jan-2006
+# add:		fast_handlers event_create register_clock sigevent_set_notification
+# remove: 	timer_getoverr
+#
+
+#
+# m.n. 20-Feb-2007
+# add:		convtime
+#
+
 subdir	:= rt
 
 headers	:= aio.h mqueue.h bits/mqueue.h
@@ -31,7 +43,9 @@
 		  clock_getres clock_gettime clock_settime		\
 		  clock_nanosleep
 timer-routines := timer_create timer_delete timer_getoverr		\
-		  timer_gettime timer_settime
+		  timer_gettime timer_settime fast_handlers		\
+		  event_create register_clock sigevent_set_notification \
+		  convtime
 shm-routines   := shm_open shm_unlink
 mq-routines    := mq_open mq_close mq_unlink mq_getattr mq_setattr	\
 		  mq_notify mq_send mq_receive mq_timedsend		\
diff -Naur glibc-2.3.6_Cs/rt/Versions glibc-2.3.6-AuD/rt/Versions
--- glibc-2.3.6_Cs/rt/Versions	2005-01-20 03:18:40.000000000 +0100
+++ glibc-2.3.6-AuD/rt/Versions	2007-02-20 19:30:03.000000000 +0100
@@ -14,8 +14,12 @@
     shm_open; shm_unlink;
 
     # t*
+    # m.n. skip timer_getoverrun
     timer_create; timer_delete; timer_getoverrun; timer_gettime;
     timer_settime;
+    # m.n. add AuD API
+    event_create; sigevent_set_notification; register_clock;
+    convtime;
   }
   GLIBC_2.3.4 {
     # m*
diff -Naur glibc-2.3.6_Cs/sysdeps/generic/libc-start.c glibc-2.3.6-AuD/sysdeps/generic/libc-start.c
--- glibc-2.3.6_Cs/sysdeps/generic/libc-start.c	2005-11-09 05:04:59.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/generic/libc-start.c	2007-02-15 14:09:46.000000000 +0100
@@ -176,6 +176,7 @@
   if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
     GLRO(dl_debug_printf) ("\ninitialize program: %s\n\n", argv[0]);
 #endif
+
   if (init)
     (*init) (
 #ifdef INIT_MAIN_ARGS
@@ -239,3 +240,10 @@
 
   exit (result);
 }
+
+int printAddress(char *string, unsigned ref)
+{
+//asm("swi 0x9f0080");
+return(1);
+}
+
diff -Naur glibc-2.3.6_Cs/sysdeps/generic/libc-tls.c glibc-2.3.6-AuD/sysdeps/generic/libc-tls.c
--- glibc-2.3.6_Cs/sysdeps/generic/libc-tls.c	2005-11-09 05:04:59.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/generic/libc-tls.c	2007-02-19 14:19:08.000000000 +0100
@@ -106,11 +106,12 @@
   GL(dl_tls_static_nelem) = GL(dl_tls_max_dtv_idx);
 }
 
+extern const char *_dl_platform;
 void
 __libc_setup_tls (size_t tcbsize, size_t tcbalign)
 {
   void *tlsblock;
-  size_t memsz = 0;
+  size_t memsz = 256;  // m.n. make sure that we always allocate tls memory */
   size_t filesz = 0;
   void *initimage = NULL;
   size_t align = 0;
@@ -125,6 +126,7 @@
 	{
 	  /* Remember the values we need.  */
 	  memsz = phdr->p_memsz;
+//m.n.	  memsz += phdr->p_memsz;
 	  filesz = phdr->p_filesz;
 	  initimage = (void *) phdr->p_vaddr;
 	  align = phdr->p_align;
@@ -157,7 +159,7 @@
   tcb_offset = roundup (memsz + GL(dl_tls_static_size), tcbalign);
   tlsblock = __sbrk (tcb_offset + tcbsize + max_align);
 # elif TLS_DTV_AT_TP
-  tcb_offset = roundup (tcbsize, align ?: 1);
+  tcb_offset = roundup (tcbsize, align ? : 1);  
   tlsblock = __sbrk (tcb_offset + memsz + max_align
 		     + TLS_PRE_TCB_SIZE + GL(dl_tls_static_size));
   tlsblock += TLS_PRE_TCB_SIZE;
@@ -166,7 +168,6 @@
      is defined add another #elif here and in the following #ifs.  */
 #  error "Either TLS_TCB_AT_TP or TLS_DTV_AT_TP must be defined"
 # endif
-
   /* Align the TLS block.  */
   tlsblock = (void *) (((uintptr_t) tlsblock + max_align - 1)
 		       & ~(max_align - 1));
@@ -190,7 +191,6 @@
   memcpy (static_dtv[2].pointer, initimage, filesz);
 
   /* Install the pointer to the dtv.  */
-
   /* Initialize the thread pointer.  */
 # if TLS_TCB_AT_TP
   INSTALL_DTV ((char *) tlsblock + tcb_offset, static_dtv);
@@ -256,6 +256,20 @@
 __pthread_initialize_minimal (void)
 {
   __libc_setup_tls (TLS_INIT_TCB_SIZE, TLS_INIT_TCB_ALIGN);
+
+  /*
+   * m.n. siemens ag: we need an extended minimal tls init:
+   * pid and tid are are required by e.g., raise()
+   */
+  /* We must prevent gcc from being clever and move any of the
+     following code ahead of the __libc_setup_tls call.  This function
+     will initialize the thread register which is subsequently
+     used.  */
+  __asm __volatile ("");
+  /* Minimal initialization of the thread descriptor.  */
+  struct pthread *pd = THREAD_SELF;
+  INTERNAL_SYSCALL_DECL (err);
+  pd->pid = pd->tid = INTERNAL_SYSCALL (set_tid_address, err, 1, &pd->tid);
 }
 
 #elif defined NONTLS_INIT_TP
@@ -270,3 +284,4 @@
 }
 
 #endif
+
diff -Naur glibc-2.3.6_Cs/sysdeps/posix/clock_getres.c glibc-2.3.6-AuD/sysdeps/posix/clock_getres.c
--- glibc-2.3.6_Cs/sysdeps/posix/clock_getres.c	2005-01-20 03:18:46.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/posix/clock_getres.c	2006-10-10 17:39:01.000000000 +0200
@@ -70,7 +70,11 @@
 	  != CLOCK_THREAD_CPUTIME_ID)
 #endif
 	{
+#ifdef SYSDEP_GETRES  // m.n. siemens ag: support sync clock
+	goto doSyscallGetres;
+#else
 	  __set_errno (EINVAL);
+#endif
 	  break;
 	}
 
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/arm/sysdep.S glibc-2.3.6-AuD/sysdeps/unix/arm/sysdep.S
--- glibc-2.3.6_Cs/sysdeps/unix/arm/sysdep.S	2006-01-06 17:15:35.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/arm/sysdep.S	2007-02-02 18:57:50.000000000 +0100
@@ -1,6 +1,4 @@
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2002, 2003,
-   2004, 2005
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,95,96,97,98,2002,03 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -47,6 +45,11 @@
 	mov r1, r0
 
 	mov r0, #0xffff0fff
+#ifdef CONFIG_NOMMU_USE_LOW_ADDR
+/* m.n. arm without mmu needs an entry at the first memory page */
+	mov r0, #0x1000
+	sub r0, #0x1
+#endif
 	mov lr, pc
 	sub pc, r0, #31
 
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/clock_gettime.c glibc-2.3.6-AuD/sysdeps/unix/clock_gettime.c
--- glibc-2.3.6_Cs/sysdeps/unix/clock_gettime.c	2005-01-20 03:18:49.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/clock_gettime.c	2006-07-18 07:59:26.000000000 +0200
@@ -15,6 +15,10 @@
    License along with the GNU C Library; if not, write to the Free
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
+/*
+ * Manfred.Neugebauer, Siemens AG, AD ATS 11, 90327 Nuernberg, Germany, 30-March-2004
+ * 	allow a system call with an arbitrary clock id
+ */
 
 #include <errno.h>
 #include <stdint.h>
@@ -71,7 +75,11 @@
 	  != CLOCK_THREAD_CPUTIME_ID)
 #endif
 	{
+#ifdef SYSDEP_GETTIME
+	goto doSyscallGettime;
+#else
 	  __set_errno (EINVAL);
+#endif
 	  break;
 	}
 
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/clock_settime.c glibc-2.3.6-AuD/sysdeps/unix/clock_settime.c
--- glibc-2.3.6_Cs/sysdeps/unix/clock_settime.c	2005-01-20 03:18:49.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/clock_settime.c	2006-07-18 08:07:14.000000000 +0200
@@ -15,6 +15,10 @@
    License along with the GNU C Library; if not, write to the Free
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
+/*
+ * Manfred.Neugebauer, Siemens AG, AD ATS 11, 90327 Nuernberg, Germany, 30-March-2004
+ * 	allow a system call with an arbitrary clock id
+ */
 
 #include <errno.h>
 #include <time.h>
@@ -75,7 +79,11 @@
 	  != CLOCK_THREAD_CPUTIME_ID)
 #endif
 	{
+#ifdef SYSDEP_SETTIME
+	goto doSyscallSettime;
+#else
 	  __set_errno (EINVAL);
+#endif
 	  retval = -1;
 	  break;
 	}
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S
--- glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S	2005-11-03 15:44:57.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/arm/aeabi_read_tp.S	2007-02-01 13:45:07.000000000 +0100
@@ -41,11 +41,16 @@
    equivalent helper function (which clobbers fewer registers than
    a normal function call) in a high page of memory; tail call to the
    helper.  */
-
+/* m.n. arm without mmu can"t access top memory */
 	.hidden __aeabi_read_tp
 ENTRY (__aeabi_read_tp)
 	mov	r0, #0xffff0fff
+#ifdef CONFIG_NOMMU_USE_LOW_ADDR
+	ldr	r0, __aeabi_read_tp_offset
+#endif
 	sub	pc, r0, #31
+__aeabi_read_tp_offset:
+.int	0x0fff
 END (__aeabi_read_tp)
 
 #endif
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S
--- glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S	2006-01-06 17:15:36.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/arm/eabi/sigrestorer.S	2006-09-21 14:47:46.000000000 +0200
@@ -36,7 +36,8 @@
 	.pad #12
 	nop
 ENTRY(__default_sa_restorer)
-	mov	r7, $SYS_ify(sigreturn)
+/*	mov	r7, SYS_ify(sigreturn) */
+	ldr	r7, = SYS_ify(sigreturn) /* m.n. assembler problem ?? */
 	swi	0x0
 	.fnend
 
@@ -47,7 +48,8 @@
 	.pad #168
 	nop
 ENTRY(__default_rt_sa_restorer)
-	mov	r7, $SYS_ify(rt_sigreturn)
+/*	mov	r7, $SYS_ify(rt_sigreturn) */
+	ldr	r7, = SYS_ify(rt_sigreturn) /*  m.n. assembler problem ?? */
 	swi	0x0
 	.fnend
 
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h
--- glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h	2006-03-24 20:31:33.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/arm/eabi/sysdep.h	2006-09-29 17:11:16.000000000 +0200
@@ -26,7 +26,7 @@
 #include <arm/sysdep.h>
 
 #if __NR_SYSCALL_BASE != 0
-# error Kernel headers are too old
+//m.n.# error Kernel headers are too old
 #endif
 
 /* Don't use stime, even if the kernel headers define it.  We have
@@ -70,7 +70,8 @@
 
    The assembler will convert the literal pool load to a move for most
    syscalls.  */
-
+
+// m.n. we have problems with linux kernel 2.6.14 header files
 #undef	DO_CALL
 #define DO_CALL(syscall_name, args)		\
     DOARGS_##args				\
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/arm/sysdep.h glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/arm/sysdep.h
--- glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/arm/sysdep.h	2006-01-06 17:15:35.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/arm/sysdep.h	2006-10-06 15:02:38.000000000 +0200
@@ -205,7 +205,7 @@
 #define INTERNAL_SYSCALL_DECL(err) do { } while (0)
 
 #undef INTERNAL_SYSCALL_RAW
-#define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\
+#define INTERNAL_SYSCALL_RAWx(name, err, nr, args...)		\
   ({ unsigned int _sys_result;					\
      {								\
        register int _a1 asm ("a1");				\
@@ -218,13 +218,19 @@
      }								\
      (int) _sys_result; })
 
+// m.n. we have two versions of INTERNAL_SYSCALL_RAW: one here
+//      the other in subdirectory sysdeps/unix/sysv/linux/eabi
+//      the last one uses r7 to pass the kernel call id
+//      we are not yet sure whether we can use it
+//      so we stay with the old idea and give RAW a separate name
+//      to prevent overwriting
 #undef INTERNAL_SYSCALL
 #define INTERNAL_SYSCALL(name, err, nr, args...)		\
-	INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args)
+	INTERNAL_SYSCALL_RAWx(SYS_ify(name), err, nr, args)
 
 #undef INTERNAL_SYSCALL_ARM
 #define INTERNAL_SYSCALL_ARM(name, err, nr, args...)		\
-	INTERNAL_SYSCALL_RAW(__ARM_NR_##name, err, nr, args)
+	INTERNAL_SYSCALL_RAWx(__ARM_NR_##name, err, nr, args)
 
 #undef INTERNAL_SYSCALL_ERROR_P
 #define INTERNAL_SYSCALL_ERROR_P(val, err) \
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/bits/stat.h glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/bits/stat.h
--- glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/bits/stat.h	2005-01-20 03:18:50.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/bits/stat.h	2006-10-25 18:24:10.000000000 +0200
@@ -125,7 +125,7 @@
     unsigned long int st_ctimensec;	/* Nsecs of last status change.  */
 #endif
     __ino64_t st_ino;			/* File serial number.		*/
-  };
+  } __attribute__((packed)); /* m.n. for ARM */
 #endif
 
 /* Tell code we have these members.  */
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/clock_getres.c glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/clock_getres.c
--- glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/clock_getres.c	2005-01-20 03:18:49.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/clock_getres.c	2006-10-10 17:50:52.000000000 +0200
@@ -27,6 +27,7 @@
 # define SYSDEP_GETRES \
   case CLOCK_REALTIME:							      \
   case CLOCK_MONOTONIC:							      \
+    doSyscallGetres:						      		\
     retval = INLINE_SYSCALL (clock_getres, 2, clock_id, res);		      \
     break
 #elif defined __NR_clock_getres
@@ -35,11 +36,14 @@
 
 /* The REALTIME and MONOTONIC clock might be available.  Try the
    syscall first.  */
+/* m.n. siemens ag: support sync clock */
 # define SYSDEP_GETRES \
   case CLOCK_REALTIME:							      \
   case CLOCK_MONOTONIC:							      \
     {									      \
-      int e = EINVAL;							      \
+      int e;							      \
+    doSyscallGetres:						      		\
+      e = EINVAL;							      \
 									      \
       if (!__libc_missing_posix_timers)					      \
 	{								      \
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/clock_gettime.c glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/clock_gettime.c
--- glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/clock_gettime.c	2005-01-20 03:18:49.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/clock_gettime.c	2006-07-18 07:49:38.000000000 +0200
@@ -15,6 +15,10 @@
    License along with the GNU C Library; if not, write to the Free
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
+/*
+ * Manfred.Neugebauer, Siemens AG, AD ATS 11, 90327 Nuernberg, Germany, 30-March-2004
+ * 	allow a system call with an arbitrary clock id
+ */
 
 #include <sysdep.h>
 
@@ -27,6 +31,7 @@
 # define SYSDEP_GETTIME \
   case CLOCK_REALTIME:							      \
   case CLOCK_MONOTONIC:							      \
+    doSyscallGettime:						      		\
     retval = INLINE_SYSCALL (clock_gettime, 2, clock_id, tp);		      \
     break
 #elif defined __NR_clock_gettime
@@ -40,6 +45,7 @@
   case CLOCK_MONOTONIC:							      \
     {									      \
       int e = EINVAL;							      \
+    doSyscallGettime:						      		\
 									      \
       if (!__libc_missing_posix_timers)					      \
 	{								      \
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/clock_settime.c glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/clock_settime.c
--- glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/clock_settime.c	2005-01-20 03:18:49.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/clock_settime.c	2006-07-18 07:52:26.000000000 +0200
@@ -15,6 +15,10 @@
    License along with the GNU C Library; if not, write to the Free
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
+/*
+ * Manfred.Neugebauer, Siemens AG, AD ATS 11, 90327 Nuernberg, Germany, 30-March-2004
+ * 	allow a system call with an arbitrary clock id
+ */
 
 #include <sysdep.h>
 
@@ -26,6 +30,7 @@
    kernel.  */
 # define SYSDEP_SETTIME \
   case CLOCK_REALTIME:							      \
+    doSyscallSettime:						      		\
     retval = INLINE_SYSCALL (clock_settime, 2, clock_id, tp);		      \
     break
 #elif defined __NR_clock_settime
@@ -37,6 +42,7 @@
   case CLOCK_REALTIME:							      \
     {									      \
       int e = EINVAL;							      \
+    doSyscallSettime:						      		\
 									      \
       if (!__libc_missing_posix_timers)					      \
 	{								      \
diff -Naur glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/i386/sysdep.h
--- glibc-2.3.6_Cs/sysdeps/unix/sysv/linux/i386/sysdep.h	2005-11-09 05:05:53.000000000 +0100
+++ glibc-2.3.6-AuD/sysdeps/unix/sysv/linux/i386/sysdep.h	2007-01-24 11:43:21.000000000 +0100
@@ -37,8 +37,10 @@
 #undef SYS_ify
 #define SYS_ify(syscall_name)	__NR_##syscall_name
 
+// m.n. we also want to have the fast kernel access for timer functions
+// we add "defined IS_IN_librt"
 #if defined USE_DL_SYSINFO \
-    && (!defined NOT_IN_libc || defined IS_IN_libpthread)
+    && (!defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt)  
 # define I386_USE_SYSENTER	1
 #else
 # undef I386_USE_SYSENTER

[-- Attachment #3: aud-realtime.ppt --]
[-- Type: application/vnd.ms-powerpoint, Size: 248832 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-04-20 15:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-18 15:07 [Xenomai-core] Ipipe and Siemens A&D Realtime Krause, Karl-Heinz
2007-04-18 17:53 ` Jan Kiszka
2007-04-19  8:54   ` Krause, Karl-Heinz
2007-04-19 12:39     ` Jan Kiszka
2007-04-19 16:09       ` Krause, Karl-Heinz
2007-04-19 18:13         ` Philippe Gerum
2007-04-20 15:30           ` Krause, Karl-Heinz

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.