1*4d12bfcdSjoerg/* $NetBSD: cerror.S,v 1.18 2013/09/12 15:36:15 joerg Exp $ */ 26cdbd4c2Sthorpej 375d4ac97Spaulus/*- 475d4ac97Spaulus * Copyright (c) 1990 The Regents of the University of California. 575d4ac97Spaulus * All rights reserved. 675d4ac97Spaulus * 775d4ac97Spaulus * This code is derived from software contributed to Berkeley by 875d4ac97Spaulus * the Systems Programming Group of the University of Utah Computer 975d4ac97Spaulus * Science Department. 1075d4ac97Spaulus * 1175d4ac97Spaulus * Redistribution and use in source and binary forms, with or without 1275d4ac97Spaulus * modification, are permitted provided that the following conditions 1375d4ac97Spaulus * are met: 1475d4ac97Spaulus * 1. Redistributions of source code must retain the above copyright 1575d4ac97Spaulus * notice, this list of conditions and the following disclaimer. 1675d4ac97Spaulus * 2. Redistributions in binary form must reproduce the above copyright 1775d4ac97Spaulus * notice, this list of conditions and the following disclaimer in the 1875d4ac97Spaulus * documentation and/or other materials provided with the distribution. 19eb7c1594Sagc * 3. Neither the name of the University nor the names of its contributors 2075d4ac97Spaulus * may be used to endorse or promote products derived from this software 2175d4ac97Spaulus * without specific prior written permission. 2275d4ac97Spaulus * 2375d4ac97Spaulus * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2475d4ac97Spaulus * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2575d4ac97Spaulus * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2675d4ac97Spaulus * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2775d4ac97Spaulus * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2875d4ac97Spaulus * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2975d4ac97Spaulus * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3075d4ac97Spaulus * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3175d4ac97Spaulus * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3275d4ac97Spaulus * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3375d4ac97Spaulus * SUCH DAMAGE. 3475d4ac97Spaulus */ 3575d4ac97Spaulus 3675d4ac97Spaulus#include "SYS.h" 3775d4ac97Spaulus 386cdbd4c2Sthorpej#if defined(LIBC_SCCS) && !defined(lint) 396cdbd4c2Sthorpej#if 0 406cdbd4c2Sthorpej RCSID("from: @(#)cerror.s 5.1 (Berkeley) 5/12/90") 416cdbd4c2Sthorpej#else 42*4d12bfcdSjoerg RCSID("$NetBSD: cerror.S,v 1.18 2013/09/12 15:36:15 joerg Exp $") 436cdbd4c2Sthorpej#endif 446cdbd4c2Sthorpej#endif /* LIBC_SCCS and not lint */ 456cdbd4c2Sthorpej 469849eb57Skleink#ifdef _REENTRANT 479849eb57Skleink .globl _C_LABEL(__errno) 489849eb57Skleink#else 49d5bc168bSthorpej .globl _C_LABEL(errno) 509849eb57Skleink#endif 51b74f892fSkleink_ENTRY(CERROR) 52cbae3f00Sjtc#ifdef _REENTRANT 5307a0a325Smatt movl %d0,-(%sp) 541d0a4330Sitohy jbsr PIC_PLT(_C_LABEL(__errno)) 5518d5ba61Skleink#ifndef __SVR4_ABI__ 563b435a73Sthorpej movl %d0,%a0 5718d5ba61Skleink#endif 5807a0a325Smatt movl (%sp)+,(%a0) 59f1af62efSjtc#else 60*4d12bfcdSjoerg#ifdef __PIC__ 612d913a7cSmatt GOT_SETUP(%a0) 6207a0a325Smatt movl _C_LABEL(errno)@GOT:w(%a0),%a0 6307a0a325Smatt movl %d0,(%a0) 6475d4ac97Spaulus#else 653b435a73Sthorpej movl %d0,_C_LABEL(errno) 6675d4ac97Spaulus#endif 67cbae3f00Sjtc#endif /* _REENTRANT */ 683b435a73Sthorpej movl #-1,%d0 693b435a73Sthorpej movl #-1,%d1 70c9394f46Sphx#ifdef __SVR4_ABI__ 71c9394f46Sphx movl %d0,%a0 72c9394f46Sphx#endif 7375d4ac97Spaulus rts 742d913a7cSmattEND(CERROR) 75