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.2
11.2Schristos/*	$NetBSD: cerror.S,v 1.2 2011/10/29 16:03:03 christos 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.2Schristos#ifdef PIC
101.2Schristos	.hidden	_C_LABEL(__cerror)
111.2Schristos#endif
121.1Sross
131.1SrossENTRY(__cerror)
141.1Sross#ifdef _REENTRANT
151.1Sross	mflr	%r0
161.1Sross	stwu	%r1,-16(%r1)		# allocate new stack frame
171.1Sross	stw	%r0,20(%r1)
181.1Sross	stw	%r31,8(%r1)
191.1Sross	mr	%r31,%r3		# stash away in callee-saved register
201.1Sross	bl	PIC_PLT(_C_LABEL(__errno))
211.1Sross	stw	%r31,0(%r3)
221.1Sross	lwz	%r0,20(%r1)
231.1Sross	lwz	%r31,8(%r1)
241.1Sross	mtlr	%r0
251.1Sross	la	%r1,16(%r1)
261.1Sross#else
271.1Sross#ifdef PIC
281.1Sross	mflr	%r10
291.1Sross	bl	_GLOBAL_OFFSET_TABLE_@local-4
301.1Sross	mflr	%r4
311.1Sross	lwz	%r4,_C_LABEL(errno)@got(%r4)
321.1Sross	stw	%r3,0(%r4)
331.1Sross	mtlr	%r10
341.1Sross#else
351.1Sross	lis	%r4,_C_LABEL(errno)@ha
361.1Sross	stw	%r3,_C_LABEL(errno)@l(%r4)
371.1Sross#endif /* PIC */
381.1Sross#endif /* _REENTRANT */
391.1Sross	li	%r3,-1
401.1Sross	li	%r4,-1
411.1Sross	blr
42

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