[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r4491 - in glibc-package/trunk/debian: . patches/any



Author: sthibault
Date: 2011-02-07 03:08:33 +0000 (Mon, 07 Feb 2011)
New Revision: 4491

Modified:
   glibc-package/trunk/debian/changelog
   glibc-package/trunk/debian/patches/any/submitted-sched_h.diff
Log:
patches/any/submitted-sched_h.diff: Synchronize bits/sched.h with
sysdeps/unix/sysv/linux/bits/sched.h


Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog	2011-02-06 23:38:05 UTC (rev 4490)
+++ glibc-package/trunk/debian/changelog	2011-02-07 03:08:33 UTC (rev 4491)
@@ -1,9 +1,14 @@
 eglibc (2.11.2-12) UNRELEASED; urgency=low
 
+  [ Aurelien Jarno ]
   * Re-enable build failure in case of testsuite regressions.
 
- -- Aurelien Jarno <aurel32@debian.org>  Sun, 06 Feb 2011 21:20:05 +0100
+  [ Samuel Thibault ]
+  * patches/any/submitted-sched_h.diff: Synchronize bits/sched.h with
+    sysdeps/unix/sysv/linux/bits/sched.h
 
+ -- Samuel Thibault <sthibault@debian.org>  Mon, 07 Feb 2011 04:06:43 +0100
+
 eglibc (2.11.2-11) unstable; urgency=low
 
   * patches/kfreebsd/local-sysdeps.diff: remove stub marks for at* 

Modified: glibc-package/trunk/debian/patches/any/submitted-sched_h.diff
===================================================================
--- glibc-package/trunk/debian/patches/any/submitted-sched_h.diff	2011-02-06 23:38:05 UTC (rev 4490)
+++ glibc-package/trunk/debian/patches/any/submitted-sched_h.diff	2011-02-07 03:08:33 UTC (rev 4491)
@@ -1,20 +1,139 @@
-2007-11-02  Aurelien Jarno  <aurelien@aurel32.net>
+2011-01-30  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
-	* bits/sched.h (__CPU_ALLOC_SIZE): Define.
+Synchronize bits/sched.h with ./sysdeps/unix/sysv/linux/bits/sched.h
 
+This brings the variable-size cpu_set_t manipulation macros from
+./sysdeps/unix/sysv/linux/bits/sched.h
+
+* bits/sched.h (__CPU_ZERO, __CPU_SET, __CPU_CLR, __CPU_ISSET,
+__CPU_COUNT): Remove old macros.
+(__CPU_ZERO_S, __CPU_SET_S, __CPU_CLR_S, __CPU_ISSET_S, __CPU_COUNT,
+__CPU_EQUAL_S, __CPU_OP_S, __CPU_ALLOC_SIZE, __CPU_ALLOC, __CPU_FREE): Add
+macros.
+(__sched_cpualloc, __sched_cpufree): Add declarations.
+
 ---
- bits/sched.h |    3 +++
- 1 file changed, 3 insertions(+)
+http://sourceware.org/ml/libc-alpha/2011-01/msg00054.html
 
+ sched.h |   87 ++++++++++++++++++++++++++++++++++++++++++++++++++++------------
+ 1 file changed, 72 insertions(+), 15 deletions(-)
+
+diff --git a/bits/sched.h b/bits/sched.h
+index a068e50..9a22ae3 100644
 --- a/bits/sched.h
 +++ b/bits/sched.h
-@@ -69,6 +69,9 @@
- # define __CPU_ISSET(cpu, cpusetp) \
-   (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
+@@ -1,6 +1,7 @@
+ /* Definitions of constants and data structure for POSIX 1003.1b-1993
+    scheduling interface.
+-   Copyright (C) 1996, 1997, 2001, 2003, 2007 Free Software Foundation, Inc.
++   Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008,2009
++   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
+@@ -56,7 +57,7 @@ struct __sched_param
+ # define __CPU_SETSIZE	1024
+ # define __NCPUBITS	(8 * sizeof (__cpu_mask))
+ 
+-/* Type for array elements in 'cpu_set'.  */
++/* Type for array elements in 'cpu_set_t'.  */
+ typedef unsigned long int __cpu_mask;
+ 
+ /* Basic access functions.  */
+@@ -70,27 +71,83 @@ typedef struct
+ } cpu_set_t;
+ 
+ /* Access functions for CPU masks.  */
+-# define __CPU_ZERO(cpusetp) \
++# if __GNUC_PREREQ (2, 91)
++#  define __CPU_ZERO_S(setsize, cpusetp) \
++  do __builtin_memset (cpusetp, '\0', setsize); while (0)
++# else
++#  define __CPU_ZERO_S(setsize, cpusetp) \
+   do {									      \
+-    unsigned int __i;							      \
+-    cpu_set *__arr = (cpusetp);						      \
+-    for (__i = 0; __i < sizeof (cpu_set) / sizeof (__cpu_mask); ++__i)	      \
+-      __arr->__bits[__i] = 0;						      \
++    size_t __i;								      \
++    size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
++    __cpu_mask *__bits = (cpusetp)->__bits;				      \
++    for (__i = 0; __i < __imax; ++__i)					      \
++      __bits[__i] = 0;							      \
+   } while (0)
+-# define __CPU_SET(cpu, cpusetp) \
+-  ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu))
+-# define __CPU_CLR(cpu, cpusetp) \
+-  ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu))
+-# define __CPU_ISSET(cpu, cpusetp) \
+-  (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0)
++# endif
++# define __CPU_SET_S(cpu, setsize, cpusetp) \
++  (__extension__							      \
++   ({ size_t __cpu = (cpu);						      \
++      __cpu < 8 * (setsize)						      \
++      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
++	 |= __CPUMASK (__cpu))						      \
++      : 0; }))
++# define __CPU_CLR_S(cpu, setsize, cpusetp) \
++  (__extension__							      \
++   ({ size_t __cpu = (cpu);						      \
++      __cpu < 8 * (setsize)						      \
++      ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]		      \
++	 &= ~__CPUMASK (__cpu))						      \
++      : 0; }))
++# define __CPU_ISSET_S(cpu, setsize, cpusetp) \
++  (__extension__							      \
++   ({ size_t __cpu = (cpu);						      \
++      __cpu < 8 * (setsize)						      \
++      ? ((((__const __cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)]      \
++	  & __CPUMASK (__cpu))) != 0					      \
++      : 0; }))
++
++# define __CPU_COUNT_S(setsize, cpusetp) \
++  __sched_cpucount (setsize, cpusetp)
++
++# if __GNUC_PREREQ (2, 91)
++#  define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
++  (__builtin_memcmp (cpusetp1, cpusetp2, setsize) == 0)
++# else
++#  define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \
++  (__extension__							      \
++   ({ __const __cpu_mask *__arr1 = (cpusetp1)->__bits;			      \
++      __const __cpu_mask *__arr2 = (cpusetp2)->__bits;			      \
++      size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
++      size_t __i;							      \
++      for (__i = 0; __i < __imax; ++__i)				      \
++	if (__bits[__i] != __bits[__i])					      \
++	  break;							      \
++      __i == __imax; }))
++# endif
++
++# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \
++  (__extension__							      \
++   ({ cpu_set_t *__dest = (destset);					      \
++      __const __cpu_mask *__arr1 = (srcset1)->__bits;			      \
++      __const __cpu_mask *__arr2 = (srcset2)->__bits;			      \
++      size_t __imax = (setsize) / sizeof (__cpu_mask);			      \
++      size_t __i;							      \
++      for (__i = 0; __i < __imax; ++__i)				      \
++	((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i];    \
++      __dest; }))
++
 +# define __CPU_ALLOC_SIZE(count) \
-+  ((((count) + __NCPUBITS - 1) / __NCPUBITS) * 8)
-+
++  ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask))
++# define __CPU_ALLOC(count) __sched_cpualloc (count)
++# define __CPU_FREE(cpuset) __sched_cpufree (cpuset)
+ 
  __BEGIN_DECLS
  
  extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
+      __THROW;
++extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur;
++extern void __sched_cpufree (cpu_set_t *__set) __THROW;
+ 
+ __END_DECLS
+ 
+-# define __CPU_COUNT(cpusetp) \
+-  __sched_cpucount (sizeof (cpu_set_t), cpusetp)
+ #endif


Reply to: