mirror of
				https://sourceware.org/git/glibc.git
				synced 2025-11-03 20:53:13 +03:00 
			
		
		
		
	Ported to PowerPC64 running Linux. * sysdeps/powerpc/powerpc64/Dist: New file. * sysdeps/powerpc/powerpc64/Implies: New file. * sysdeps/powerpc/powerpc64/Makefile: New file. * sysdeps/powerpc/powerpc64/__longjmp.S: New file. * sysdeps/powerpc/powerpc64/atomicity.h: New file. * sysdeps/powerpc/powerpc64/backtrace.c: New file. * sysdeps/powerpc/powerpc64/bp-asm.h: New file. * sysdeps/powerpc/powerpc64/bsd-_setjmp.S: New file. * sysdeps/powerpc/powerpc64/bsd-setjmp.S: New file. * sysdeps/powerpc/powerpc64/dl-dtprocnum.h: New file. * sysdeps/powerpc/powerpc64/dl-lookupcfg.h: New file. * sysdeps/powerpc/powerpc64/dl-machine.c: New file. * sysdeps/powerpc/powerpc64/dl-machine.h: New file. * sysdeps/powerpc/powerpc64/memset.S: New file. * sysdeps/powerpc/powerpc64/ppc-mcount.S: New file. * sysdeps/powerpc/powerpc64/register-dump.h: New file. * sysdeps/powerpc/powerpc64/setjmp.S: New file. * sysdeps/powerpc/powerpc64/stpcpy.S: New file. * sysdeps/powerpc/powerpc64/strchr.S: New file. * sysdeps/powerpc/powerpc64/strcmp.S: New file. * sysdeps/powerpc/powerpc64/strcpy.S: New file. * sysdeps/powerpc/powerpc64/strlen.S: New file. * sysdeps/powerpc/powerpc64/elf/bzero.S: New file. * sysdeps/powerpc/powerpc64/elf/start.S: New file. * sysdeps/powerpc/powerpc64/fpu/s_copysign.S: New file. * sysdeps/powerpc/powerpc64/fpu/s_copysignf.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/Versions: New File. * sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/glob64.c: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: New file.
		
			
				
	
	
		
			116 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			116 lines
		
	
	
		
			3.7 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
/* Bounded-pointer definitions for PowerPC64 assembler.
 | 
						|
   Copyright (C) 2000, 2002 Free Software Foundation, Inc.
 | 
						|
   Contributed by Greg McGary <greg@mcgary.org>
 | 
						|
 | 
						|
   This file is part of the GNU C Library.  Its master source is NOT part of
 | 
						|
   the C library, however.  The master source lives in the GNU MP Library.
 | 
						|
 | 
						|
   The GNU C Library is free software; you can redistribute it and/or
 | 
						|
   modify it under the terms of the GNU Library General Public License as
 | 
						|
   published by the Free Software Foundation; either version 2 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
 | 
						|
   Library General Public License for more details.
 | 
						|
 | 
						|
   You should have received a copy of the GNU Library General Public
 | 
						|
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
 | 
						|
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 | 
						|
   Boston, MA 02111-1307, USA.  */
 | 
						|
 | 
						|
#if __BOUNDED_POINTERS__
 | 
						|
 | 
						|
/* Byte offsets of BP components.  */
 | 
						|
# define oVALUE	0
 | 
						|
# define oLOW	4
 | 
						|
# define oHIGH	8
 | 
						|
 | 
						|
/* Don't check bounds, just convert the BP register to its simple
 | 
						|
   pointer value.  */
 | 
						|
 | 
						|
# define DISCARD_BOUNDS(rBP)			\
 | 
						|
	ld	rBP, oVALUE(rBP)
 | 
						|
 | 
						|
/* Check low bound, with the side effect that the BP register is converted
 | 
						|
   its simple pointer value.  Move the high bound into a register for
 | 
						|
   later use.  */
 | 
						|
 | 
						|
# define CHECK_BOUNDS_LOW(rBP, rLOW, rHIGH)	\
 | 
						|
	ld	rHIGH, oHIGH(rBP);		\
 | 
						|
	ld	rLOW, oLOW(rBP);		\
 | 
						|
	ld	rBP, oVALUE(rBP);		\
 | 
						|
	tdllt	rBP, rLOW
 | 
						|
 | 
						|
/* Check the high bound, which is in a register, using the given
 | 
						|
   conditional trap instruction.  */
 | 
						|
 | 
						|
# define CHECK_BOUNDS_HIGH(rVALUE, rHIGH, TWLcc) \
 | 
						|
	TWLcc	rVALUE, rHIGH
 | 
						|
 | 
						|
/* Check the high bound, which is stored at the return-value's high
 | 
						|
   bound slot, using the given conditional trap instruction.  */
 | 
						|
 | 
						|
# define CHECK_BOUNDS_HIGH_RTN(rVALUE, rHIGH, TWLcc)	\
 | 
						|
	ld	rHIGH, oHIGH(rRTN);			\
 | 
						|
	TWLcc	rVALUE, rHIGH
 | 
						|
 | 
						|
/* Check both bounds, with the side effect that the BP register is
 | 
						|
   converted to its simple pointer value.  */
 | 
						|
 | 
						|
# define CHECK_BOUNDS_BOTH(rBP, rLOW, rHIGH)	\
 | 
						|
	CHECK_BOUNDS_LOW(rBP, rLOW, rHIGH);	\
 | 
						|
	tdlge	rBP, rHIGH
 | 
						|
 | 
						|
/* Check bounds on a memory region of given length, with the side
 | 
						|
   effect that the BP register is converted to its simple pointer
 | 
						|
   value.  */
 | 
						|
 | 
						|
# define CHECK_BOUNDS_BOTH_WIDE(rBP, rLOW, rHIGH, rLENGTH)	\
 | 
						|
	CHECK_BOUNDS_LOW (rBP, rLOW, rHIGH);			\
 | 
						|
	sub	rHIGH, rHIGH, rLENGTH;				\
 | 
						|
	tdlgt	rBP, rHIGH
 | 
						|
 | 
						|
# define CHECK_BOUNDS_BOTH_WIDE_LIT(rBP, rLOW, rHIGH, LENGTH)	\
 | 
						|
	CHECK_BOUNDS_LOW (rBP, rLOW, rHIGH);			\
 | 
						|
	subi	rHIGH, rHIGH, LENGTH;				\
 | 
						|
	tdlgt	rBP, rHIGH
 | 
						|
 | 
						|
/* Store a pointer value register into the return-value's pointer
 | 
						|
   value slot.  */
 | 
						|
 | 
						|
# define STORE_RETURN_VALUE(rVALUE)		\
 | 
						|
	std	rVALUE, oVALUE(rRTN)
 | 
						|
 | 
						|
/* Store a low and high bounds into the return-value's pointer bounds
 | 
						|
   slots.  */
 | 
						|
 | 
						|
# define STORE_RETURN_BOUNDS(rLOW, rHIGH)	\
 | 
						|
	std	rLOW, oLOW(rRTN);		\
 | 
						|
	std	rHIGH, oHIGH(rRTN)
 | 
						|
 | 
						|
/* Stuff zero value/low/high into the BP addressed by rRTN.  */
 | 
						|
 | 
						|
# define RETURN_NULL_BOUNDED_POINTER		\
 | 
						|
	li	r4, 0;				\
 | 
						|
	STORE_RETURN_VALUE (r4);		\
 | 
						|
	STORE_RETURN_BOUNDS (r4, r4)
 | 
						|
 | 
						|
#else
 | 
						|
 | 
						|
# define DISCARD_BOUNDS(rBP)
 | 
						|
# define CHECK_BOUNDS_LOW(rBP, rLOW, rHIGH)
 | 
						|
# define CHECK_BOUNDS_HIGH(rVALUE, rHIGH, TWLcc)
 | 
						|
# define CHECK_BOUNDS_HIGH_RTN(rVALUE, rHIGH, TWLcc)
 | 
						|
# define CHECK_BOUNDS_BOTH(rBP, rLOW, rHIGH)
 | 
						|
# define CHECK_BOUNDS_BOTH_WIDE(rBP, rLOW, rHIGH, rLENGTH)
 | 
						|
# define CHECK_BOUNDS_BOTH_WIDE_LIT(rBP, rLOW, rHIGH, LENGTH)
 | 
						|
# define STORE_RETURN_VALUE(rVALUE)
 | 
						|
# define STORE_RETURN_BOUNDS(rLOW, rHIGH)
 | 
						|
 | 
						|
# define RETURN_NULL_BOUNDED_POINTER li rRTN, 0
 | 
						|
 | 
						|
#endif
 | 
						|
 |