This is the mail archive of the libc-hacker@sourceware.cygnus.com 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]

Re: glibc 2.0 and glibc 2.1 ppc development


> cc: "Kevin B. Hendricks" <kbhend@dogwood.tyler.wm.edu>, libc-alpha@cygnus.com
> Date: Sun, 09 Aug 1998 17:21:23 +0100
> From: Philip Blundell <philb@gnu.org>

> >as I don't think this is PPC specific, I cc'ed it to libc-alpha. A quick
> >browse in the glibc-2.1 sources showed that no platform seems to save the 
> >condition code in jmp_buf. So this is probably a issue with kaffe on all 
> >platforms.
> 
> The ABI on many platforms states that the condition codes are not preserved 
> across function calls, so there is no need to save them.  On machines where 
> the codes do have to be preserved they are indeed saved in the jmp_buf.

Patch for ppc follows. I haven't fully tested it yet.

-- 
Geoffrey Keating <geoffk@ozemail.com.au>

===File ~/patches/glibc-15.diff=============================
1998-08-07  Geoff Keating  <geoffk@ozemail.com.au>

	* sysdeps/powerpc/bits/setjmp.h: Use word to save condition
	registers.
	* sysdeps/powerpc/setjmp.S: Save condition registers.
	* sysdeps/powerpc/__longjmp.S: Restore condition registers.

--- glibc-2.0.95/sysdeps/powerpc/bits/setjmp.h~	Sat May  9 05:23:45 1998
+++ glibc-2.0.95/sysdeps/powerpc/bits/setjmp.h	Fri Aug  7 12:45:33 1998
@@ -28,11 +28,11 @@
    either representation. */
 
 #if defined __USE_MISC || defined _ASM
-# define JB_GPR1   0   /* also known as the stack pointer */
+# define JB_GPR1   0  /* Also known as the stack pointer */
 # define JB_GPR2   1
-# define JB_LR     2
+# define JB_LR     2  /* The address we will return to */
 # define JB_GPRS   3  /* GPRs 14 through 31 are saved, 18 in total */
-# define JB_UNUSED 21 /* it's sometimes faster to store doubles word-aligned */
+# define JB_CR     21 /* Condition code registers. */
 # define JB_FPRS   22 /* FPRs 14 through 31 are saved, 18*2 words total */
 #endif
 
--- glibc-2.0.95/sysdeps/powerpc/__longjmp.S~	Mon Dec 29 02:10:18 1997
+++ glibc-2.0.95/sysdeps/powerpc/__longjmp.S	Fri Aug  7 12:56:02 1998
@@ -45,12 +45,14 @@ ENTRY (__longjmp)
 	lfd %f21,((JB_FPRS+7*2)*4)(%r3)
 	lwz %r22,((JB_GPRS+8)*4)(%r3)
 	lfd %f22,((JB_FPRS+8*2)*4)(%r3)
+	lwz %r0,(JB_CR*4)(%r3)
 	lwz %r23,((JB_GPRS+9)*4)(%r3)
 	lfd %f23,((JB_FPRS+9*2)*4)(%r3)
 	lwz %r24,((JB_GPRS+10)*4)(%r3)
 	lfd %f24,((JB_FPRS+10*2)*4)(%r3)
 	lwz %r25,((JB_GPRS+11)*4)(%r3)
 	lfd %f25,((JB_FPRS+11*2)*4)(%r3)
+	mtcrf 0xFF,%r0
 	lwz %r26,((JB_GPRS+12)*4)(%r3)
 	lfd %f26,((JB_FPRS+12*2)*4)(%r3)
 	lwz %r27,((JB_GPRS+13)*4)(%r3)
--- glibc-2.0.95/sysdeps/powerpc/setjmp.S~	Mon Dec 29 02:10:52 1997
+++ glibc-2.0.95/sysdeps/powerpc/setjmp.S	Fri Aug  7 12:45:46 1998
@@ -31,8 +31,10 @@ ENTRY (__sigsetjmp)
 	stw  %r0,(JB_LR*4)(3)
 	stw  %r15,((JB_GPRS+1)*4)(3)
 	stfd %f15,((JB_FPRS+1*2)*4)(3)
+	mfcr %r0
 	stw  %r16,((JB_GPRS+2)*4)(3)
 	stfd %f16,((JB_FPRS+2*2)*4)(3)
+	stw  %r0,(JB_CR*4)(3)
 	stw  %r17,((JB_GPRS+3)*4)(3)
 	stfd %f17,((JB_FPRS+3*2)*4)(3)
 	stw  %r18,((JB_GPRS+4)*4)(3)
============================================================


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