This is the mail archive of the mailing list for the glibc 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]

Re: [PATCH] Fix setcontext on ia64

> From  Wed May 28 16:48:36 2003
> I've put those changes in.  Maintaining constants in ucontext_i.h by hand
> is error prone, as you have noticed.  It would be wise to rewrite that to
> use a .sym file (see e.g. linuxthreads/sysdeps/ia64/Makefile for an example
> of how to do it).

Sounds logical to me.  How about this:

diff -Nru libc/sysdeps/unix/sysv/linux/ia64/Makefile libc-rcbilson/sysdeps/unix/sysv/linux/ia64/Makefile
--- libc/sysdeps/unix/sysv/linux/ia64/Makefile	2002-08-24 20:43:37.000000000 -0400
+++ libc-rcbilson/sysdeps/unix/sysv/linux/ia64/Makefile	2003-05-29 16:49:20.000000000 -0400
@@ -4,6 +4,7 @@
 ifeq ($(subdir),stdlib)
 sysdep_routines += __start_context
+gen-as-const-headers += sigcontext-offsets.sym
 ifeq ($(subdir),misc)
diff -Nru libc/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym libc-rcbilson/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym
--- libc/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym	1969-12-31 19:00:00.000000000 -0500
+++ libc-rcbilson/sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym	2003-05-29 16:54:20.000000000 -0400
@@ -0,0 +1,16 @@
+#include <stddef.h>
+#include <sys/ucontext.h>
+SC_NAT	offsetof (struct sigcontext, sc_nat)
+SC_BSP	offsetof (struct sigcontext, sc_ar_bsp)
+SC_RNAT	offsetof (struct sigcontext, sc_ar_rnat)
+SC_UNAT	offsetof (struct sigcontext, sc_ar_unat)
+SC_FPSR	offsetof (struct sigcontext, sc_ar_fpsr)
+SC_PFS	offsetof (struct sigcontext, sc_ar_pfs)
+SC_LC	offsetof (struct sigcontext, sc_ar_lc)
+SC_PR	offsetof (struct sigcontext, sc_pr)
+SC_BR	offsetof (struct sigcontext, sc_br)
+SC_GR	offsetof (struct sigcontext, sc_gr)
+SC_FR	offsetof (struct sigcontext, sc_fr)
+SC_MASK	offsetof (struct sigcontext, sc_mask)
diff -Nru libc/sysdeps/unix/sysv/linux/ia64/ucontext_i.h libc-rcbilson/sysdeps/unix/sysv/linux/ia64/ucontext_i.h
--- libc/sysdeps/unix/sysv/linux/ia64/ucontext_i.h	2003-05-28 16:45:25.000000000 -0400
+++ libc-rcbilson/sysdeps/unix/sysv/linux/ia64/ucontext_i.h	2003-05-29 17:19:19.000000000 -0400
@@ -24,19 +24,7 @@
 #define SIG_UNBLOCK	1
 #define SIG_SETMASK	2
-#define SC_NAT	0x008
-#define SC_BSP	0x048
-#define SC_RNAT	0x050
-#define SC_UNAT	0x060
-#define SC_FPSR	0x068
-#define SC_PFS	0x070
-#define SC_LC	0x078
-#define SC_PR	0x080
-#define SC_BR	0x088
-#define SC_GR	0x0c8
-#define SC_FR	0x1d0
-#define SC_MASK	0xa50
+#include <sigcontext-offsets.h>
 #define rTMP	r16
 #define rPOS	r16

Richard C. Bilson, Research Assistant   | School of Computer Science               | University of Waterloo       | 200 University Avenue West
Office: DC 3548F Ph: (519)888-4567x4822 | Waterloo, Ontario, CANADA N2L 3G1

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