Cross Reference: cerror.S
xref: /src/lib/libc/arch/powerpc64/sys/cerror.S
  • Home
  • History
  • AnnotateAnnotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /src/lib/libc/arch/powerpc64/sys/
cerror.S revision 1.1
11.1Sross/*	$NetBSD: cerror.S,v 1.1 2006/07/01 16:37:20 ross Exp $	*/
21.1Sross
31.1Sross#include <machine/asm.h>
41.1Sross#include "SYS.h"
51.1Sross
61.1Sross#ifndef _REENTRANT
71.1Sross	.globl	_C_LABEL(errno)
81.1Sross#endif
91.1Sross
101.1SrossENTRY(__cerror)
111.1Sross#ifdef _REENTRANT
121.1Sross	mflr	%r0
131.1Sross	stwu	%r1,-16(%r1)		# allocate new stack frame
141.1Sross	stw	%r0,20(%r1)
151.1Sross	stw	%r31,8(%r1)
161.1Sross	mr	%r31,%r3		# stash away in callee-saved register
171.1Sross	bl	PIC_PLT(_C_LABEL(__errno))
181.1Sross	stw	%r31,0(%r3)
191.1Sross	lwz	%r0,20(%r1)
201.1Sross	lwz	%r31,8(%r1)
211.1Sross	mtlr	%r0
221.1Sross	la	%r1,16(%r1)
231.1Sross#else
241.1Sross#ifdef PIC
251.1Sross	mflr	%r10
261.1Sross	bl	_GLOBAL_OFFSET_TABLE_@local-4
271.1Sross	mflr	%r4
281.1Sross	lwz	%r4,_C_LABEL(errno)@got(%r4)
291.1Sross	stw	%r3,0(%r4)
301.1Sross	mtlr	%r10
311.1Sross#else
321.1Sross	lis	%r4,_C_LABEL(errno)@ha
331.1Sross	stw	%r3,_C_LABEL(errno)@l(%r4)
341.1Sross#endif /* PIC */
351.1Sross#endif /* _REENTRANT */
361.1Sross	li	%r3,-1
371.1Sross	li	%r4,-1
381.1Sross	blr
39

Indexes created Mon Nov 10 17:20:41 GMT 2025