[Glibc-bsd-commits] r4577 - in trunk/glibc-ports/fbtl: . sysdeps/pthread

Petr Salinger ps-guest at alioth.debian.org
Mon Jul 8 12:42:57 UTC 2013


Author: ps-guest
Date: 2013-06-22 18:48:14 +0000 (Sat, 22 Jun 2013)
New Revision: 4577

Modified:
   trunk/glibc-ports/fbtl/allocatestack.c
   trunk/glibc-ports/fbtl/forward.c
   trunk/glibc-ports/fbtl/nptl-init.c
   trunk/glibc-ports/fbtl/pthread_cancel.c
   trunk/glibc-ports/fbtl/pthread_cond_broadcast.c
   trunk/glibc-ports/fbtl/pthread_create.c
   trunk/glibc-ports/fbtl/pthread_mutex_init.c
   trunk/glibc-ports/fbtl/pthread_mutex_lock.c
   trunk/glibc-ports/fbtl/pthread_mutex_timedlock.c
   trunk/glibc-ports/fbtl/pthread_mutex_trylock.c
   trunk/glibc-ports/fbtl/pthread_mutex_unlock.c
   trunk/glibc-ports/fbtl/sem_open.c
   trunk/glibc-ports/fbtl/sysdeps/pthread/createthread.c
   trunk/glibc-ports/fbtl/unwind.c
Log:
comment out linux specific parts, proper one needs work
This line, and those below, will be ignored--

M    forward.c
M    pthread_create.c
M    pthread_mutex_lock.c
M    pthread_cond_broadcast.c
M    pthread_mutex_trylock.c
M    pthread_mutex_init.c
M    sem_open.c
M    unwind.c
M    allocatestack.c
M    pthread_mutex_unlock.c
M    pthread_mutex_timedlock.c
M    sysdeps/pthread/createthread.c
M    nptl-init.c
M    pthread_cancel.c


Modified: trunk/glibc-ports/fbtl/allocatestack.c
===================================================================
--- trunk/glibc-ports/fbtl/allocatestack.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/allocatestack.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -1045,7 +1045,9 @@
 {
   if ((t->cancelhandling & SETXID_BITMASK) == 0)
     return 0;
-
+    
+#warning setxid fixup needed
+#if 0
   int val;
   INTERNAL_SYSCALL_DECL (err);
   val = INTERNAL_SYSCALL (tgkill, err, 3, THREAD_GETMEM (THREAD_SELF, pid),
@@ -1058,6 +1060,7 @@
       return 1;
     }
   else
+#endif  
     return 0;
 }
 
@@ -1066,6 +1069,8 @@
 attribute_hidden
 __nptl_setxid (struct xid_command *cmdp)
 {
+#warning setxid fixup needed
+#if 0
   int signalled;
   int result;
   lll_lock (stack_cache_lock, LLL_PRIVATE);
@@ -1163,6 +1168,7 @@
 
   lll_unlock (stack_cache_lock, LLL_PRIVATE);
   return result;
+#endif  
 }
 
 static inline void __attribute__((always_inline))

Modified: trunk/glibc-ports/fbtl/forward.c
===================================================================
--- trunk/glibc-ports/fbtl/forward.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/forward.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -209,7 +209,7 @@
 		       /* We cannot call abort() here.  */
 #if 1
 #warning the kill syscall have two arguments, not one ...
-#elaborate what to do properly
+#warning elaborate what to do properly
                        asm("hlt"); 
 #else
 		       INTERNAL_SYSCALL_DECL (err);

Modified: trunk/glibc-ports/fbtl/nptl-init.c
===================================================================
--- trunk/glibc-ports/fbtl/nptl-init.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/nptl-init.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -244,6 +244,7 @@
   if (__builtin_expect (pid < 0, 0))
     pid = -pid;
 
+#if 0
   /* Safety check.  It would be possible to call this function for
      other signals and send a signal from another process.  This is not
      correct and might even be a security problem.  Try to catch as
@@ -252,7 +253,6 @@
       || si->si_pid != pid
       || si->si_code != SI_TKILL)
     return;
-#if 0
   INTERNAL_SYSCALL_DECL (err);
   INTERNAL_SYSCALL_NCS (__xidcmd->syscall_no, err, 3, __xidcmd->id[0],
 			__xidcmd->id[1], __xidcmd->id[2]);

Modified: trunk/glibc-ports/fbtl/pthread_cancel.c
===================================================================
--- trunk/glibc-ports/fbtl/pthread_cancel.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/pthread_cancel.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -75,13 +75,15 @@
 	     a signal handler.  But this is no allowed, pthread_cancel
 	     is not guaranteed to be async-safe.  */
 	  int val;
+#warning kill self needed	  
+#if 0	  
 	  val = INTERNAL_SYSCALL (tgkill, err, 3,
 				  THREAD_GETMEM (THREAD_SELF, pid), pd->tid,
 				  SIGCANCEL);
 
 	  if (INTERNAL_SYSCALL_ERROR_P (val, err))
 	    result = INTERNAL_SYSCALL_ERRNO (val, err);
-
+#endif
 	  break;
 	}
 

Modified: trunk/glibc-ports/fbtl/pthread_cond_broadcast.c
===================================================================
--- trunk/glibc-ports/fbtl/pthread_cond_broadcast.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/pthread_cond_broadcast.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -60,7 +60,8 @@
       if (mut == (void *) ~0l
 	  || PTHREAD_MUTEX_PSHARED (mut) & PTHREAD_MUTEX_PSHARED_BIT)
 	goto wake_all;
-
+# warning wake all every time	
+#if 0
 #if (defined lll_futex_cmp_requeue_pi \
      && defined __ASSUME_REQUEUE_PI)
       int pi_flag = PTHREAD_MUTEX_PRIO_INHERIT_NP | PTHREAD_MUTEX_ROBUST_NP;
@@ -81,7 +82,7 @@
 						  INT_MAX, &mut->__data.__lock,
 						  futex_val, LLL_PRIVATE), 0))
 	  return 0;
-
+#endif
 wake_all:
       lll_futex_wake (&cond->__data.__futex, INT_MAX, pshared);
     }

Modified: trunk/glibc-ports/fbtl/pthread_create.c
===================================================================
--- trunk/glibc-ports/fbtl/pthread_create.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/pthread_create.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -267,12 +267,10 @@
      cancellation signal mask.  */
   if (__builtin_expect (pd->parent_cancelhandling & CANCELING_BITMASK, 0))
     {
-      INTERNAL_SYSCALL_DECL (err);
       sigset_t mask;
       __sigemptyset (&mask);
       __sigaddset (&mask, SIGCANCEL);
-      (void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &mask,
-			       NULL, _NSIG / 8);
+      INLINE_SYSCALL (sigprocmask, 3, SIG_UNBLOCK, &mask, NULL);
     }
 
   /* This is where the try/finally block should be created.  For
@@ -312,11 +310,14 @@
 #endif
     }
 
+#warning call_tls_dtors will be available with 2.18 upload
+#if 0
   /* Call destructors for the thread_local TLS variables.  */
 #ifndef SHARED
   if (&__call_tls_dtors != NULL)
 #endif
     __call_tls_dtors ();
+#endif
 
   /* Run the destructor for the thread-local data.  */
   __nptl_deallocate_tsd ();
@@ -364,6 +365,8 @@
      the breakpoint reports TD_THR_RUN state rather than TD_THR_ZOMBIE.  */
   atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
 
+#warning robust misc
+#if 0
 #ifndef __ASSUME_SET_ROBUST_LIST
   /* If this thread has any robust mutexes locked, handle them now.  */
 # ifdef __PTHREAD_MUTEX_HAVE_PREV
@@ -394,6 +397,7 @@
       while (robust != (void *) &pd->robust_head);
     }
 #endif
+#endif
 
   /* Mark the memory of the stack as usable to the kernel.  We free
      everything except for the space used for the TCB itself.  */
@@ -432,7 +436,7 @@
 
      The exit code is zero since in case all threads exit by calling
      'pthread_exit' the exit status must be 0 (zero).  */
-  __exit_thread_inline (0);
+  __exit_thread (0);
 
   /* NOTREACHED */
   return 0;
@@ -459,7 +463,12 @@
       if (cpusetsize > 0)
 	{
 	  cpu_set_t *cpuset;
+#if 0	  
 	  if (__glibc_likely (__libc_use_alloca (cpusetsize)))
+#else
+#warning wait for 2.18	  
+	  if ((__libc_use_alloca (cpusetsize)))
+#endif	  
 	    cpuset = __alloca (cpusetsize);
 	  else
 	    {
@@ -539,6 +548,8 @@
   THREAD_COPY_POINTER_GUARD (pd);
 #endif
 
+#warning scheduling parameters
+#if 0
   /* Determine scheduling parameters for the thread.  */
   if (__builtin_expect ((iattr->flags & ATTR_FLAG_NOTINHERITSCHED) != 0, 0)
       && (iattr->flags & (ATTR_FLAG_SCHED_SET | ATTR_FLAG_POLICY_SET)) != 0)
@@ -583,6 +594,7 @@
 	  goto out;
 	}
     }
+#endif
 
   /* Pass the descriptor to the caller.  */
   *newthread = (pthread_t) pd;

Modified: trunk/glibc-ports/fbtl/pthread_mutex_init.c
===================================================================
--- trunk/glibc-ports/fbtl/pthread_mutex_init.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/pthread_mutex_init.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -56,7 +56,7 @@
     {
     case PTHREAD_PRIO_NONE << PTHREAD_MUTEXATTR_PROTOCOL_SHIFT:
       break;
-
+#if 0
     case PTHREAD_PRIO_INHERIT << PTHREAD_MUTEXATTR_PROTOCOL_SHIFT:
 #ifndef __ASSUME_FUTEX_LOCK_PI
       if (__builtin_expect (tpi_supported == 0, 0))
@@ -78,6 +78,9 @@
       if (imutexattr->mutexkind & PTHREAD_MUTEXATTR_FLAG_ROBUST)
 	return ENOTSUP;
       break;
+#else
+	return ENOTSUP;
+#endif      
     }
 
   /* Clear the whole variable.  */

Modified: trunk/glibc-ports/fbtl/pthread_mutex_lock.c
===================================================================
--- trunk/glibc-ports/fbtl/pthread_mutex_lock.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/pthread_mutex_lock.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -138,6 +138,9 @@
 static int
 __pthread_mutex_lock_full (pthread_mutex_t *mutex)
 {
+#if 1
+  return EINVAL;
+#else
   int oldval;
   pid_t id = THREAD_GETMEM (THREAD_SELF, tid);
 
@@ -475,6 +478,7 @@
   LIBC_PROBE (mutex_acquired, 1, mutex);
 
   return 0;
+#endif  
 }
 #ifndef __pthread_mutex_lock
 strong_alias (__pthread_mutex_lock, pthread_mutex_lock)

Modified: trunk/glibc-ports/fbtl/pthread_mutex_timedlock.c
===================================================================
--- trunk/glibc-ports/fbtl/pthread_mutex_timedlock.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/pthread_mutex_timedlock.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -112,6 +112,7 @@
 	}
       break;
 
+#if 0
     case PTHREAD_MUTEX_ROBUST_RECURSIVE_NP:
     case PTHREAD_MUTEX_ROBUST_ERRORCHECK_NP:
     case PTHREAD_MUTEX_ROBUST_NORMAL_NP:
@@ -475,7 +476,7 @@
 	mutex->__data.__count = 1;
       }
       break;
-
+#endif
     default:
       /* Correct code cannot set any other type.  */
       return EINVAL;

Modified: trunk/glibc-ports/fbtl/pthread_mutex_trylock.c
===================================================================
--- trunk/glibc-ports/fbtl/pthread_mutex_trylock.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/pthread_mutex_trylock.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -69,7 +69,7 @@
       ++mutex->__data.__nusers;
 
       return 0;
-
+#if 0
     case PTHREAD_MUTEX_ROBUST_RECURSIVE_NP:
     case PTHREAD_MUTEX_ROBUST_ERRORCHECK_NP:
     case PTHREAD_MUTEX_ROBUST_NORMAL_NP:
@@ -370,7 +370,7 @@
 	return 0;
       }
       break;
-
+#endif
     default:
       /* Correct code cannot set any other type.  */
       return EINVAL;

Modified: trunk/glibc-ports/fbtl/pthread_mutex_unlock.c
===================================================================
--- trunk/glibc-ports/fbtl/pthread_mutex_unlock.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/pthread_mutex_unlock.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -84,6 +84,9 @@
 internal_function
 __pthread_mutex_unlock_full (pthread_mutex_t *mutex, int decr)
 {
+#if 1
+      return EINVAL;
+#else
   int newowner = 0;
 
   switch (PTHREAD_MUTEX_TYPE (mutex))
@@ -287,6 +290,7 @@
 
   LIBC_PROBE (mutex_release, 1, mutex);
   return 0;
+#endif  
 }
 
 

Modified: trunk/glibc-ports/fbtl/sem_open.c
===================================================================
--- trunk/glibc-ports/fbtl/sem_open.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/sem_open.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -31,7 +31,9 @@
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/statfs.h>
+#if 0
 #include <linux_fsinfo.h>
+#endif
 #include "semaphoreP.h"
 
 
@@ -47,7 +49,8 @@
 /* Protect the `mountpoint' variable above.  */
 pthread_once_t __namedsem_once attribute_hidden = PTHREAD_ONCE_INIT;
 
-
+#warning TODO - or ENOSYS
+#if 0
 /* Determine where the shmfs is mounted (if at all).  */
 void
 attribute_hidden
@@ -222,10 +225,15 @@
   return result;
 }
 
+#endif
 
 sem_t *
 sem_open (const char *name, int oflag, ...)
 {
+#if 1
+      __set_errno (ENOSYS);
+      return SEM_FAILED;
+#else      
   char *finalname;
   sem_t *result = SEM_FAILED;
   int fd;
@@ -405,4 +413,5 @@
     }
 
   return result;
+#endif  
 }

Modified: trunk/glibc-ports/fbtl/sysdeps/pthread/createthread.c
===================================================================
--- trunk/glibc-ports/fbtl/sysdeps/pthread/createthread.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/sysdeps/pthread/createthread.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -91,7 +91,8 @@
       /* We have to translate error codes.  */
       return errno == ENOMEM ? EAGAIN : errno;
     }
-
+#warning set scheduling parameters
+#if 0
   /* Now we have the possibility to set scheduling parameters etc.  */
   if (__builtin_expect (stopped != 0, 0))
     {
@@ -133,6 +134,7 @@
 	    goto err_out;
 	}
     }
+#endif
 
   /* We now have for sure more than one thread.  The main thread might
      not yet have the flag set.  No need to set the global variable
@@ -178,10 +180,15 @@
 
      The termination signal is chosen to be zero which means no signal
      is sent.  */
+#if 1
+#define clone_flags 123456
+#warning clone
+#else
   int clone_flags = (CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGNAL
 		     | CLONE_SETTLS | CLONE_PARENT_SETTID
 		     | CLONE_CHILD_CLEARTID | CLONE_SYSVSEM
 		     | 0);
+#endif		     
 
   if (__builtin_expect (THREAD_GETMEM (THREAD_SELF, report_events), 0))
     {

Modified: trunk/glibc-ports/fbtl/unwind.c
===================================================================
--- trunk/glibc-ports/fbtl/unwind.c	2013-06-22 18:46:37 UTC (rev 4576)
+++ trunk/glibc-ports/fbtl/unwind.c	2013-06-22 18:48:14 UTC (rev 4577)
@@ -103,10 +103,17 @@
 {
   /* When we get here a C++ catch block didn't rethrow the object.  We
      cannot handle this case and therefore abort.  */
+#if 0     // does not work due to multiple macro expansions
 # define STR_N_LEN(str) str, strlen (str)
   INTERNAL_SYSCALL_DECL (err);
   INTERNAL_SYSCALL (write, err, 3, STDERR_FILENO,
 		    STR_N_LEN ("FATAL: exception not rethrown\n"));
+#else
+# define UNWIND_FAILED_MSG "FATAL: exception not rethrown\n" 
+  INTERNAL_SYSCALL_DECL (err);
+  INTERNAL_SYSCALL (write, err, 3, STDERR_FILENO,
+                    UNWIND_FAILED_MSG, strlen(UNWIND_FAILED_MSG));
+#endif
   abort ();
 }
 




More information about the Glibc-bsd-commits mailing list