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

[commits] r2079 - in /fsf/trunk/libc: ./ iconv/ libio/bits/ nptl/ nptl/sysdeps/x86_64/ sysdeps/unix/sysv/linux/ sysdeps/unix/sysv/linu...



Author: eglibc
Date: Thu Apr 26 00:01:24 2007
New Revision: 2079

Log:
Import glibc-mainline for 2007-04-26

Added:
    fsf/trunk/libc/sysdeps/unix/sysv/linux/sched_getcpu.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/iconv/gconv_charset.h
    fsf/trunk/libc/iconv/iconv_open.c
    fsf/trunk/libc/libio/bits/stdio.h
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/x86_64/tcb-offsets.sym
    fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
    fsf/trunk/libc/sysdeps/unix/sysv/linux/Versions
    fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Thu Apr 26 00:01:24 2007
@@ -1,3 +1,29 @@
+2007-04-25  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/bits/sched.h: Declare sched_getcpu.
+	* sysdeps/unix/sysv/linux/sched_getcpu.c: New file.
+	* sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S: New file.
+	* sysdeps/unix/sysv/linux/Versions: Export sched_getcpu for
+	GLIBC_2.6.
+	* sysdeps/unix/sysv/linux/Makefile [subdir=posix] (sysdep_routines):
+	Add sched_getcpu.
+
+2007-04-25  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/check_pf.c (make_request): Return -1 instead
+	of 0 after the out_fail label.
+
+2007-04-25  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #4406]
+	* iconv/gconv_charset.h (strip): Allow ':'
+	* iconv/iconv_open.c (iconv_open): Adjust comment.
+
+2007-04-25  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* libio/bits/stdio.h (fgetc_unlocked): Add extern inline optimized
+	version.
+
 2007-04-23  Jakub Jelinek  <jakub@xxxxxxxxxx>
 
 	[BZ #4381]

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Thu Apr 26 00:01:24 2007
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2007-2-1
+GNU C Library NEWS -- history of user-visible changes.  2007-4-25
 Copyright (C) 1992-2006, 2007 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -7,7 +7,7 @@
 
 Version 2.6
 
-* New Linux interfaces: epoll_pwait.
+* New Linux interfaces: epoll_pwait, sched_getcpu.
 
 * New generic interfaces: strerror_l.
 

Modified: fsf/trunk/libc/iconv/gconv_charset.h
==============================================================================
--- fsf/trunk/libc/iconv/gconv_charset.h (original)
+++ fsf/trunk/libc/iconv/gconv_charset.h Thu Apr 26 00:01:24 2007
@@ -1,5 +1,5 @@
 /* Charset name normalization.
-   Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2001,2002,2003,2004,2005,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2001.
 
@@ -30,7 +30,7 @@
   while (*s != '\0')
     {
       if (__isalnum_l (*s, _nl_C_locobj_ptr)
-	  || *s == '_' || *s == '-' || *s == '.' || *s == ',')
+	  || *s == '_' || *s == '-' || *s == '.' || *s == ',' || *s == ':')
 	*wp++ = __toupper_l (*s, _nl_C_locobj_ptr);
       else if (*s == '/')
 	{

Modified: fsf/trunk/libc/iconv/iconv_open.c
==============================================================================
--- fsf/trunk/libc/iconv/iconv_open.c (original)
+++ fsf/trunk/libc/iconv/iconv_open.c Thu Apr 26 00:01:24 2007
@@ -1,5 +1,5 @@
 /* Get descriptor for character set conversion.
-   Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1997,1998,1999,2000,2001,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -38,7 +38,7 @@
   int res;
 
   /* Normalize the name.  We remove all characters beside alpha-numeric,
-     '_', '-', '/', and '.'.  */
+     '_', '-', '/', '.', and ':'.  */
   tocode_len = strlen (tocode);
   tocode_conv = (char *) alloca (tocode_len + 3);
   strip (tocode_conv, tocode);

Modified: fsf/trunk/libc/libio/bits/stdio.h
==============================================================================
--- fsf/trunk/libc/libio/bits/stdio.h (original)
+++ fsf/trunk/libc/libio/bits/stdio.h Thu Apr 26 00:01:24 2007
@@ -42,6 +42,16 @@
 {
   return _IO_getc (stdin);
 }
+
+
+# ifdef __USE_MISC
+/* Faster version when locking is not necessary.  */
+__STDIO_INLINE int
+fgetc_unlocked (FILE *__fp)
+{
+  return _IO_getc_unlocked (__fp);
+}
+# endif /* misc */
 
 
 # if defined __USE_POSIX || defined __USE_MISC

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Thu Apr 26 00:01:24 2007
@@ -1,3 +1,8 @@
+2007-04-25  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/x86_64/tls.h (tcbhead_t): Add vgetcpu_cache.
+	* sysdeps/x86_64/tcb-offsets.sym: Add VGETCPU_CACHE_OFFSET.
+
 2007-04-06  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* tst-locale1.c: Avoid warnings.

Modified: fsf/trunk/libc/nptl/sysdeps/x86_64/tcb-offsets.sym
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/x86_64/tcb-offsets.sym (original)
+++ fsf/trunk/libc/nptl/sysdeps/x86_64/tcb-offsets.sym Thu Apr 26 00:01:24 2007
@@ -11,3 +11,4 @@
 MUTEX_FUTEX		offsetof (pthread_mutex_t, __data.__lock)
 MULTIPLE_THREADS_OFFSET	offsetof (tcbhead_t, multiple_threads)
 POINTER_GUARD		offsetof (tcbhead_t, pointer_guard)
+VGETCPU_CACHE_OFFSET	offsetof (tcbhead_t, vgetcpu_cache)

Modified: fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/x86_64/tls.h Thu Apr 26 00:01:24 2007
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  nptl/x86_64 version.
-   Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002,2003,2004,2005,2006,2007 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
@@ -42,7 +42,7 @@
 
 typedef struct
 {
-  void *tcb;		/* Pointer to the TCB.  Not necessary the
+  void *tcb;		/* Pointer to the TCB.  Not necessarily the
 			   thread descriptor used by libpthread.  */
   dtv_t *dtv;
   void *self;		/* Pointer to the thread descriptor.  */
@@ -50,6 +50,7 @@
   uintptr_t sysinfo;
   uintptr_t stack_guard;
   uintptr_t pointer_guard;
+  unsigned long int vgetcpu_cache[2];
 } tcbhead_t;
 
 #else /* __ASSEMBLER__ */

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
==============================================================================
Binary files - no diff available.

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/Versions
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/Versions (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/Versions Thu Apr 26 00:01:24 2007
@@ -127,7 +127,7 @@
     splice; tee; vmsplice;
   }
   GLIBC_2.6 {
-    epoll_pwait; sync_file_range;
+    epoll_pwait; sync_file_range; sched_getcpu;
   }
   GLIBC_PRIVATE {
     # functions used in other libraries

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/bits/sched.h Thu Apr 26 00:01:24 2007
@@ -77,6 +77,9 @@
 
 /* Unshare the specified resources.  */
 extern int unshare (int __flags) __THROW;
+
+/* Get index of currently used CPU.  */
+extern int sched_getcpu (void) __THROW;
 #endif
 
 __END_DECLS

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c Thu Apr 26 00:01:24 2007
@@ -226,7 +226,7 @@
 out_fail:
   if (use_malloc)
     free (buf);
-  return 0;
+  return -1;
 }
 
 

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/sched_getcpu.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/sched_getcpu.c (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/sched_getcpu.c Thu Apr 26 00:01:24 2007
@@ -1,0 +1,37 @@
+/* Copyright (C) 2007 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.  */
+
+#include <sched.h>
+#include <sysdep.h>
+
+
+int
+sched_getcpu (void)
+{
+#ifdef __NR_getcpu
+  unsigned int cpu;
+  INTERNAL_SYSCALL_DECL (err);
+  int r = INTERNAL_SYSCALL (getcpu, err, &cpu, NULL, NULL);
+
+  return (INTERNAL_SYSCALL_ERROR (r, err)
+	  ? INTERNAL_SYSCALL_ERRNO (r, err) : cpu);
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
+}

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S Thu Apr 26 00:01:24 2007
@@ -1,0 +1,50 @@
+/* Copyright (C) 2007 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.  */
+
+#include <sysdep.h>
+#include <tls.h>
+#define _ERRNO_H	1
+#include <bits/errno.h>
+
+/* For the calculation see asm/vsyscall.h.  */
+#define VSYSCALL_ADDR_vgetcpu	0xffffffffff600800
+
+
+ENTRY (sched_getcpu)
+	/* Align stack and create local variable for result.  */
+	sub	$0x8, %rsp
+	cfi_adjust_cfa_offset(8)
+
+	movq	%rsp, %rdi
+	xorl	%esi, %esi
+	movl	$VGETCPU_CACHE_OFFSET, %edx
+	addq	%fs:0, %rdx
+
+	movq	$VSYSCALL_ADDR_vgetcpu, %rax
+	callq	*%rax
+
+	cmpq	$-4095, %rdi
+	jae	SYSCALL_ERROR_LABEL
+
+	movl	(%rsp), %eax
+
+L(pseudo_end):
+	add	$0x8, %rsp
+	cfi_adjust_cfa_offset(-8)
+	ret
+PSEUDO_END(sched_getcpu)