This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Update ARM ucontext.h


Something I've been working on for a bit.  The ARM <sys/ucontext.h>
hasn't matched reality in quite a long time - we couldn't track down
when it last did, in fact.  This new layout has the twin benefits of
matching the kernel and allowing space for coprocessor registers in the
processor context (e.g. VFP).

-- 
Daniel Jacobowitz
CodeSourcery

2006-07-05  Daniel Jacobowitz  <dan@codesourcery.com>

	* sysdeps/unix/sysv/linux/arm/sys/ucontext.h: Include
	<bits/sigcontext.h>.
	(NGREG, mcontext_t, struct ucontext): Update to match the kernel.

Index: glibc/ports/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
===================================================================
--- glibc.orig/ports/sysdeps/unix/sysv/linux/arm/sys/ucontext.h	2006-07-05 12:47:59.000000000 -0400
+++ glibc/ports/sysdeps/unix/sysv/linux/arm/sys/ucontext.h	2006-07-05 12:49:03.000000000 -0400
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2001, 2006 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
@@ -25,10 +25,14 @@
 #include <signal.h>
 #include <sys/procfs.h>
 
+/* We need the signal context definitions even if they are not used
+   included in <signal.h>.  */
+#include <bits/sigcontext.h>
+
 typedef int greg_t;
 
 /* Number of general registers.  */
-#define NGREG	16
+#define NGREG	18
 
 /* Container for all general registers.  */
 typedef elf_gregset_t gregset_t;
@@ -73,22 +77,21 @@ enum
 /* Structure to describe FPU registers.  */
 typedef elf_fpregset_t	fpregset_t;
 
-/* Context to describe whole processor state.  */
-typedef struct
-  {
-    gregset_t gregs;
-    fpregset_t fpregs;
-  } mcontext_t;
+/* Context to describe whole processor state.  This only describes
+   the core registers; coprocessor registers get saved elsewhere
+   (e.g. in uc_regspace, or somewhere unspecified on the stack
+   during non-RT signal handlers).  */
+typedef struct sigcontext mcontext_t;
 
 /* Userlevel context.  */
 typedef struct ucontext
   {
-    unsigned long int uc_flags;
+    unsigned long uc_flags;
     struct ucontext *uc_link;
-    __sigset_t uc_sigmask;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    long int uc_filler[5];
+    __sigset_t uc_sigmask;
+    unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
   } ucontext_t;
 
 #endif /* sys/ucontext.h */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]