cerror.S revision 1.3
11.3Schs/* $NetBSD: cerror.S,v 1.3 2004/07/18 20:44:05 chs Exp $ */ 21.2Sskrll 31.2Sskrll/*- 41.2Sskrll * Copyright (c) 2004 The NetBSD Foundation, Inc. 51.2Sskrll * All rights reserved. 61.2Sskrll * 71.2Sskrll * This code is derived from software contributed to The NetBSD Foundation 81.2Sskrll * by Nick Hudson 91.2Sskrll * 101.2Sskrll * Redistribution and use in source and binary forms, with or without 111.2Sskrll * modification, are permitted provided that the following conditions 121.2Sskrll * are met: 131.2Sskrll * 1. Redistributions of source code must retain the above copyright 141.2Sskrll * notice, this list of conditions and the following disclaimer. 151.2Sskrll * 2. Redistributions in binary form must reproduce the above copyright 161.2Sskrll * notice, this list of conditions and the following disclaimer in the 171.2Sskrll * documentation and/or other materials provided with the distribution. 181.2Sskrll * 3. All advertising materials mentioning features or use of this software 191.2Sskrll * must display the following acknowledgement: 201.2Sskrll * This product includes software developed by the NetBSD 211.2Sskrll * Foundation, Inc. and its contributors. 221.2Sskrll * 4. Neither the name of The NetBSD Foundation nor the names of its 231.2Sskrll * contributors may be used to endorse or promote products derived 241.2Sskrll * from this software without specific prior written permission. 251.2Sskrll * 261.2Sskrll * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 271.2Sskrll * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 281.2Sskrll * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 291.2Sskrll * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 301.2Sskrll * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 311.2Sskrll * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 321.2Sskrll * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 331.2Sskrll * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 341.2Sskrll * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 351.2Sskrll * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 361.2Sskrll * POSSIBILITY OF SUCH DAMAGE. 371.2Sskrll */ 381.1Sskrll 391.1Sskrll#include "SYS.h" 401.1Sskrll 411.1Sskrll#ifdef _REENTRANT 421.1SskrllENTRY(__cerror,HPPA_FRAME_SIZE) 431.1Sskrll#else 441.1SskrllLEAF_ENTRY(__cerror) 451.1Sskrll#endif 461.1Sskrll#ifdef _REENTRANT 471.1Sskrll stw %rp, HPPA_FRAME_CRP(%sp) 481.3Schs stw %t1, HPPA_FRAME_ARG(0)(%sp) 491.1Sskrll ldo HPPA_FRAME_SIZE(%sp),%sp 501.1Sskrll bl __errno, %rp 511.1Sskrll nop 521.1Sskrll ldo -HPPA_FRAME_SIZE(%sp), %sp 531.3Schs ldw HPPA_FRAME_ARG(0)(%sp), %t1 541.1Sskrll ldw HPPA_FRAME_CRP(%sp), %rp 551.3Schs stw %t1, 0(%ret0) 561.1Sskrll#else 571.1Sskrll#ifdef PIC 581.1Sskrll addil LT%errno, %r19 591.1Sskrll ldw RT%errno(%r1), %r1 601.1Sskrll stw %t1, 0(%r1) 611.1Sskrll#else 621.1Sskrll ldil L%errno, %r1 631.1Sskrll stw %t1, R%errno(%r1) 641.1Sskrll#endif 651.1Sskrll#endif 661.1Sskrll ldi -1, %ret0 671.1Sskrll bv %r0(%rp) 681.1Sskrll ldi -1, %ret1 691.1SskrllEXIT(__cerror) 70