cerror.S revision 1.7
11.7Sdennis/* $NetBSD: cerror.S,v 1.7 2015/01/12 02:48:20 dennis Exp $ */ 21.1Sross 31.7Sdennis/* Now inlined in the syscall stubs. Keep code for a while for mind changes. */ 41.7Sdennis 51.7Sdennis#if 0 61.1Sross#include <machine/asm.h> 71.1Sross#include "SYS.h" 81.1Sross 91.1Sross#ifndef _REENTRANT 101.1Sross .globl _C_LABEL(errno) 111.1Sross#endif 121.5Sjoerg#ifdef __PIC__ 131.4Smatt .protected _C_LABEL(__cerror) 141.2Schristos#endif 151.1Sross 161.1SrossENTRY(__cerror) 171.1Sross#ifdef _REENTRANT 181.1Sross mflr %r0 191.7Sdennis streg %r0,SF_LR(%r1) 201.7Sdennis streg %r31,-8(%r1) 211.7Sdennis stptru %r1,-(SF_SZ+16)(%r1) # allocate new stack frame 221.1Sross mr %r31,%r3 # stash away in callee-saved register 231.1Sross bl PIC_PLT(_C_LABEL(__errno)) 241.6Smatt nop 251.6Smatt stint %r31,0(%r3) 261.6Smatt 271.7Sdennis addi %r1,%r1,(SF_SZ+16) 281.7Sdennis ldreg %r31,-8(%r1) 291.7Sdennis ldreg %r0,SF_LR(%r1) 301.1Sross mtlr %r0 311.1Sross#else 321.7Sdennis lwz %r4,_C_LABEL(errno)@got(%r2) 331.1Sross stw %r3,0(%r4) 341.1Sross#endif /* _REENTRANT */ 351.1Sross li %r3,-1 361.1Sross li %r4,-1 371.1Sross blr 381.6SmattEND(__cerror) 391.7Sdennis#endif /* 0 */ 40