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

[commits] r9883 - in /fsf/trunk/ports: ./ sysdeps/hppa/nptl/ sysdeps/unix/sysv/linux/hppa/ sysdeps/unix/sysv/linux/hppa/bits/



Author: eglibc
Date: Thu Feb 18 00:03:36 2010
New Revision: 9883

Log:
Import glibc-ports-mainline for 2010-02-18

Modified:
    fsf/trunk/ports/ChangeLog.hppa
    fsf/trunk/ports/sysdeps/hppa/nptl/tls.h
    fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h
    fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h
    fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/makecontext.c

Modified: fsf/trunk/ports/ChangeLog.hppa
==============================================================================
--- fsf/trunk/ports/ChangeLog.hppa (original)
+++ fsf/trunk/ports/ChangeLog.hppa Thu Feb 18 00:03:36 2010
@@ -1,3 +1,23 @@
+2010-02-17  Matt Turner  <mattst88@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/hppa/bits/socket.h: Actually fix
+	SOCK_CLOEXEC to match O_CLOEXEC.
+
+2010-02-02  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/hppa/bits/mman.h: Define
+	MADV_MERGEABLE and MADV_UNMERGEABLE.
+
+2010-02-02  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/hppa/nptl/tls.h (__set_cr27): Clobber
+	link register r31.
+
+2010-02-02  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/hppa/makecontext.c (__makecontext):
+	Support more than 8 arguments. 
+
 2010-02-01  Kyle McMartin  <kyle@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/hppa/bits/socket.h: Fix value of

Modified: fsf/trunk/ports/sysdeps/hppa/nptl/tls.h
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/nptl/tls.h (original)
+++ fsf/trunk/ports/sysdeps/hppa/nptl/tls.h Thu Feb 18 00:03:36 2010
@@ -1,5 +1,5 @@
 /* Definition for thread-local data handling.  NPTL/hppa version.
-   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2010 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
@@ -140,11 +140,13 @@
   return (struct pthread *) cr27;
 }
 
+/* We write to cr27, clobber r26 as the input argument, and clobber
+   r31 as the link register.  */
 static inline void __set_cr27(struct pthread *cr27)
 {
   asm ( "ble	0xe0(%%sr2, %%r0)\n\t"
 	"copy	%0, %%r26"
-	: : "r" (cr27) : "r26" );
+	: : "r" (cr27) : "r26", "r31" );
 }
 
 /* Get and set the global scope generation counter in struct pthread.  */

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/bits/mman.h Thu Feb 18 00:03:36 2010
@@ -86,6 +86,8 @@
 # define MADV_REMOVE	  9	/* Remove these pages and resources.  */
 # define MADV_DONTFORK	 10	/* Do not inherit across fork.  */
 # define MADV_DOFORK	 11	/* Do inherit across fork.  */
+# define MADV_MERGEABLE   65	/* KSM may merge identical pages */
+# define MADV_UNMERGEABLE 66	/* KSM may not merge identical pages */
 #endif
 
 /* The range 12-64 is reserved for page size specification. */

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/bits/socket.h Thu Feb 18 00:03:36 2010
@@ -62,7 +62,7 @@
   /* Flags to be ORed into the type parameter of socket and socketpair and
      used for the flags parameter of paccept.  */
 
-  SOCK_CLOEXEC = 01000000,	/* Atomically set close-on-exec flag for the
+  SOCK_CLOEXEC = 010000000,	/* Atomically set close-on-exec flag for the
 				   new descriptor(s).  */
 #define SOCK_CLOEXEC SOCK_CLOEXEC
 #undef SOCK_NONBLOCK

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/makecontext.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/makecontext.c (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/hppa/makecontext.c Thu Feb 18 00:03:36 2010
@@ -1,5 +1,5 @@
 /* Create new context.
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Helge Deller <deller@xxxxxx>, 2008.
 
@@ -25,24 +25,21 @@
 #include <sysdep.h>
 #include <ucontext.h>
 
-/* XXX: This implementation only handles integer arguments.  */
+/* POSIX only supports integer arguments.  */
+#define STACK_ALIGN 64
+#define FRAME_SIZE 8
 
 void
 __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
 {
-  unsigned int *sp;
+  unsigned long *sp;
   va_list ap;
   int i;
 
-  if (argc > 8)
-    {
-      fprintf (stderr, _("\
-makecontext: does not know how to handle more than 8 arguments\n"));
-      exit (-1);
-    }
-
-  /* Get stack pointer.  */
-  sp = (unsigned int *) ucp->uc_stack.ss_sp;
+  /* Get stack pointer (64-byte aligned).  */
+  sp = (unsigned long *)((((unsigned long) ucp->uc_stack.ss_sp) 
+			 + FRAME_SIZE + argc + STACK_ALIGN) 
+		        & ~(STACK_ALIGN - 1));
 
   /* Store address to jump to.  */
   ucp->uc_mcontext.sc_gr[2] = (unsigned long) func;
@@ -50,29 +47,27 @@
   va_start (ap, argc);
   /* Handle arguments.  */
   for (i = 0; i < argc; ++i)
-    switch (i)
-      {
-      case 0:
-      case 1:
-      case 2:
-      case 3:
-      	ucp->uc_mcontext.sc_gr[26-i] = va_arg (ap, int);
-	break;
-      case 4:
-      case 5:
-      case 6:
-      case 7:
-	if (sizeof(unsigned long) == 4) {
-		/* 32bit: put arg7-arg4 on stack.  */
-		sp[7-i] = va_arg (ap, int);
-	} else {
-		/* 64bit: r19-r22 are arg7-arg4.  */
-		ucp->uc_mcontext.sc_gr[22+4-i] = va_arg (ap, int);
+    {
+      if (i < 4)
+	{
+	  ucp->uc_mcontext.sc_gr[26-i] = va_arg (ap, int);
+	  continue;
 	}
-	break;
-      }
-  va_end (ap);
 
+      if ((i < 8) && (sizeof(unsigned long) == 8))
+	{
+	  /* 64bit: r19-r22 are arg7-arg4.  */
+	  ucp->uc_mcontext.sc_gr[22+4-i] = va_arg (ap, int);
+	  continue;
+	} 
+
+      /* All other arguments go on the stack.  */
+      sp[-1 * (FRAME_SIZE + 1 + i)] = va_arg (ap, int);
+    }
+  va_end (ap); 
+
+  /* Adjust the stack pointer to last used argument.  */
+  ucp->uc_mcontext.sc_gr[30] = (unsigned long) sp;
 }