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

[commits] r4626 - in /fsf/trunk/ports: ./ sysdeps/unix/sysv/linux/arm/ sysdeps/unix/sysv/linux/arm/bits/



Author: eglibc
Date: Sat Dec 22 00:04:37 2007
New Revision: 4626

Log:
Import glibc-ports-mainline for 2007-12-22

Removed:
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/bits/armsigctx.h
Modified:
    fsf/trunk/ports/ChangeLog.arm
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/profil-counter.h
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/register-dump.h
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h

Modified: fsf/trunk/ports/ChangeLog.arm
==============================================================================
--- fsf/trunk/ports/ChangeLog.arm (original)
+++ fsf/trunk/ports/ChangeLog.arm Sat Dec 22 00:04:37 2007
@@ -1,3 +1,14 @@
+2007-12-21  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/profil-counter.h: Use the i386 version.
+	* sysdeps/unix/sysv/linux/arm/register-dump.h (register_dump): Update
+	to use ucontext.
+	(REGISTER_DUMP): Likewise.
+	* sysdeps/unix/sysv/linux/arm/sigcontextinfo.h (SIGCONTEXT,
+	SIGCONTEXT_EXTRA_ARGS, GET_PC, GET_FRAME, GET_STACK): Likewise.
+	(sigaction, __sigaction): Define.
+	* sysdeps/unix/sysv/linux/arm/bits/armsigctx.h: Delete.
+
 2007-10-22  Daniel Jacobowitz  <dan@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/arm/bits/fcntl.h (F_DUPFD_CLOEXEC): Define.

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/profil-counter.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/profil-counter.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/profil-counter.h Sat Dec 22 00:04:37 2007
@@ -1,37 +1,2 @@
-/* Low-level statistical profiling support function.  Linux/ARM version.
-   Copyright (C) 1996, 1997, 1998, 2002 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 <signal.h>
-#include <bits/armsigctx.h>
-
-void
-profil_counter (int signo, int _a2, int _a3, int _a4, union k_sigcontext sc)
-{
-  void *pc;
-  if (sc.v20.magic == SIGCONTEXT_2_0_MAGIC)
-    pc = (void *) sc.v20.reg.ARM_pc;
-  else
-    pc = (void *) sc.v21.arm_pc;
-  profil_count (pc);
-
-  /* This is a hack to prevent the compiler from implementing the
-     above function call as a sibcall.  The sibcall would overwrite
-     the signal context.  */
-  asm volatile ("");
-}
+/* We can use the ix86 version.  */
+#include <sysdeps/unix/sysv/linux/i386/profil-counter.h>

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/register-dump.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/register-dump.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/register-dump.h Sat Dec 22 00:04:37 2007
@@ -20,7 +20,7 @@
 
 #include <sys/uio.h>
 #include <stdio-common/_itoa.h>
-#include <bits/armsigctx.h>
+#include <sys/ucontext.h>
 
 /* We will print the register dump in this format:
 
@@ -45,7 +45,7 @@
 }
 
 static void
-register_dump (int fd, union k_sigcontext *ctx)
+register_dump (int fd, const struct ucontext *ctx)
 {
   char regs[21][8];
   struct iovec iov[97];
@@ -61,53 +61,27 @@
   ++nr
 
   /* Generate strings of register contents.  */
-  if (ctx->v20.magic == SIGCONTEXT_2_0_MAGIC)
-    {
-      hexvalue (ctx->v20.reg.ARM_r0, regs[0], 8);
-      hexvalue (ctx->v20.reg.ARM_r1, regs[1], 8);
-      hexvalue (ctx->v20.reg.ARM_r2, regs[2], 8);
-      hexvalue (ctx->v20.reg.ARM_r3, regs[3], 8);
-      hexvalue (ctx->v20.reg.ARM_r4, regs[4], 8);
-      hexvalue (ctx->v20.reg.ARM_r5, regs[5], 8);
-      hexvalue (ctx->v20.reg.ARM_r6, regs[6], 8);
-      hexvalue (ctx->v20.reg.ARM_r7, regs[7], 8);
-      hexvalue (ctx->v20.reg.ARM_r8, regs[8], 8);
-      hexvalue (ctx->v20.reg.ARM_r9, regs[9], 8);
-      hexvalue (ctx->v20.reg.ARM_r10, regs[10], 8);
-      hexvalue (ctx->v20.reg.ARM_fp, regs[11], 8);
-      hexvalue (ctx->v20.reg.ARM_ip, regs[12], 8);
-      hexvalue (ctx->v20.reg.ARM_sp, regs[13], 8);
-      hexvalue (ctx->v20.reg.ARM_lr, regs[14], 8);
-      hexvalue (ctx->v20.reg.ARM_pc, regs[15], 8);
-      hexvalue (ctx->v20.reg.ARM_cpsr, regs[16], 8);
-      hexvalue (ctx->v20.trap_no, regs[17], 8);
-      hexvalue (ctx->v20.error_code, regs[18], 8);
-      hexvalue (ctx->v20.oldmask, regs[19], 8);
-    }
-  else
-    {
-      hexvalue (ctx->v21.arm_r0, regs[0], 8);
-      hexvalue (ctx->v21.arm_r1, regs[1], 8);
-      hexvalue (ctx->v21.arm_r2, regs[2], 8);
-      hexvalue (ctx->v21.arm_r3, regs[3], 8);
-      hexvalue (ctx->v21.arm_r4, regs[4], 8);
-      hexvalue (ctx->v21.arm_r5, regs[5], 8);
-      hexvalue (ctx->v21.arm_r6, regs[6], 8);
-      hexvalue (ctx->v21.arm_r7, regs[7], 8);
-      hexvalue (ctx->v21.arm_r8, regs[8], 8);
-      hexvalue (ctx->v21.arm_r9, regs[9], 8);
-      hexvalue (ctx->v21.arm_r10, regs[10], 8);
-      hexvalue (ctx->v21.arm_fp, regs[11], 8);
-      hexvalue (ctx->v21.arm_ip, regs[12], 8);
-      hexvalue (ctx->v21.arm_sp, regs[13], 8);
-      hexvalue (ctx->v21.arm_lr, regs[14], 8);
-      hexvalue (ctx->v21.arm_pc, regs[15], 8);
-      hexvalue (ctx->v21.arm_cpsr, regs[16], 8);
-      hexvalue (ctx->v21.trap_no, regs[17], 8);
-      hexvalue (ctx->v21.error_code, regs[18], 8);
-      hexvalue (ctx->v21.oldmask, regs[19], 8);
-      hexvalue (ctx->v21.fault_address, regs[20], 8);
-    }
+  hexvalue (ctx->uc_mcontext.arm_r0, regs[0], 8);
+  hexvalue (ctx->uc_mcontext.arm_r1, regs[1], 8);
+  hexvalue (ctx->uc_mcontext.arm_r2, regs[2], 8);
+  hexvalue (ctx->uc_mcontext.arm_r3, regs[3], 8);
+  hexvalue (ctx->uc_mcontext.arm_r4, regs[4], 8);
+  hexvalue (ctx->uc_mcontext.arm_r5, regs[5], 8);
+  hexvalue (ctx->uc_mcontext.arm_r6, regs[6], 8);
+  hexvalue (ctx->uc_mcontext.arm_r7, regs[7], 8);
+  hexvalue (ctx->uc_mcontext.arm_r8, regs[8], 8);
+  hexvalue (ctx->uc_mcontext.arm_r9, regs[9], 8);
+  hexvalue (ctx->uc_mcontext.arm_r10, regs[10], 8);
+  hexvalue (ctx->uc_mcontext.arm_fp, regs[11], 8);
+  hexvalue (ctx->uc_mcontext.arm_ip, regs[12], 8);
+  hexvalue (ctx->uc_mcontext.arm_sp, regs[13], 8);
+  hexvalue (ctx->uc_mcontext.arm_lr, regs[14], 8);
+  hexvalue (ctx->uc_mcontext.arm_pc, regs[15], 8);
+  hexvalue (ctx->uc_mcontext.arm_cpsr, regs[16], 8);
+  hexvalue (ctx->uc_mcontext.trap_no, regs[17], 8);
+  hexvalue (ctx->uc_mcontext.error_code, regs[18], 8);
+  hexvalue (ctx->uc_mcontext.oldmask, regs[19], 8);
+  hexvalue (ctx->uc_mcontext.fault_address, regs[20], 8);
 
   /* Generate the output.  */
   ADD_STRING ("Register dump:\n\n R0: ");
@@ -150,11 +124,8 @@
   ADD_MEM (regs[18], 8);
   ADD_STRING ("   OldMask: ");
   ADD_MEM (regs[19], 8);
-  if (ctx->v20.magic != SIGCONTEXT_2_0_MAGIC)
-    {
-      ADD_STRING ("\n Addr: ");
-      ADD_MEM (regs[20], 8);
-    }
+  ADD_STRING ("\n Addr: ");
+  ADD_MEM (regs[20], 8);
 
   ADD_STRING ("\n");
 
@@ -163,4 +134,4 @@
 }
 
 
-#define REGISTER_DUMP register_dump (fd, &ctx)
+#define REGISTER_DUMP register_dump (fd, ctx)

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h Sat Dec 22 00:04:37 2007
@@ -17,35 +17,34 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <bits/armsigctx.h>
+#include <sys/ucontext.h>
 #include "kernel-features.h"
 
-#define SIGCONTEXT int _a2, int _a3, int _a4, union k_sigcontext
-#define SIGCONTEXT_EXTRA_ARGS _a2, _a3, _a4,
+#define SIGCONTEXT siginfo_t *_si, struct ucontext *
+#define SIGCONTEXT_EXTRA_ARGS _si,
 
 /* The sigcontext structure changed between 2.0 and 2.1 kernels.  On any
    modern system we should be able to assume that the "new" format will be
    in use.  */
-#if __LINUX_KERNEL_VERSION > 131328
 
-#define GET_PC(ctx)	((void *) ctx.v21.arm_pc)
-#define GET_FRAME(ctx)	ADVANCE_STACK_FRAME ((void *) ctx.v21.arm_fp)
-#define GET_STACK(ctx)	((void *) ctx.v21.arm_sp)
-
-#else
-
-#define GET_PC(ctx)	((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
-			 ctx.v20.reg.ARM_pc : ctx.v21.arm_pc))
-#define GET_FRAME(ctx)	\
-	ADVANCE_STACK_FRAME((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
-			 ctx.v20.reg.ARM_fp : ctx.v21.arm_fp))
-#define GET_STACK(ctx)	((void *)((ctx.v20.magic == SIGCONTEXT_2_0_MAGIC) ? \
-			 ctx.v20.reg.ARM_sp : ctx.v21.arm_sp))
-
-#endif
+#define GET_PC(ctx)	((void *) (ctx)->uc_mcontext.arm_pc)
+#define GET_FRAME(ctx)	ADVANCE_STACK_FRAME ((void *) ctx->uc_mcontext.arm_fp)
+#define GET_STACK(ctx)	((void *) (ctx)->uc_mcontext.arm_sp)
 
 #define ADVANCE_STACK_FRAME(frm)	\
 			((struct layout *)frm - 1)
 
 #define CALL_SIGHANDLER(handler, signo, ctx) \
   (handler)((signo), SIGCONTEXT_EXTRA_ARGS (ctx))
+
+/* There is no reliable way to get the sigcontext unless we use a
+   three-argument signal handler.  */
+#define __sigaction(sig, act, oact) ({ \
+  (act)->sa_flags |= SA_SIGINFO; \
+  (__sigaction) (sig, act, oact); \
+})
+
+#define sigaction(sig, act, oact) ({ \
+  (act)->sa_flags |= SA_SIGINFO; \
+  (sigaction) (sig, act, oact); \
+})