cerror.S revision 1.6
11.6Sskrll/*	$NetBSD: cerror.S,v 1.6 2020/05/05 06:20:55 skrll 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 *
191.2Sskrll * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
201.2Sskrll * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
211.2Sskrll * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
221.2Sskrll * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
231.2Sskrll * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
241.2Sskrll * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
251.2Sskrll * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
261.2Sskrll * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
271.2Sskrll * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
281.2Sskrll * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
291.2Sskrll * POSSIBILITY OF SUCH DAMAGE.
301.2Sskrll */
311.1Sskrll
321.1Sskrll#include "SYS.h"
331.1Sskrll
341.1Sskrll#ifdef _REENTRANT
351.1SskrllENTRY(__cerror,HPPA_FRAME_SIZE)
361.1Sskrll#else
371.1SskrllLEAF_ENTRY(__cerror)
381.1Sskrll#endif
391.1Sskrll#ifdef _REENTRANT
401.1Sskrll	stw	%rp, HPPA_FRAME_CRP(%sp)
411.3Schs	stw	%t1, HPPA_FRAME_ARG(0)(%sp)
421.1Sskrll	ldo	HPPA_FRAME_SIZE(%sp),%sp
431.1Sskrll	bl	__errno, %rp
441.6Sskrll	 nop
451.1Sskrll	ldo	-HPPA_FRAME_SIZE(%sp), %sp
461.3Schs	ldw	HPPA_FRAME_ARG(0)(%sp), %t1
471.1Sskrll	ldw	HPPA_FRAME_CRP(%sp), %rp
481.3Schs	stw	%t1, 0(%ret0)
491.1Sskrll#else
501.5Sjoerg#ifdef __PIC__
511.1Sskrll	addil	LT%errno, %r19
521.1Sskrll	ldw	RT%errno(%r1), %r1
531.1Sskrll	stw	%t1, 0(%r1)
541.1Sskrll#else
551.1Sskrll	ldil	L%errno, %r1
561.1Sskrll	stw	%t1, R%errno(%r1)
571.1Sskrll#endif
581.1Sskrll#endif
591.1Sskrll	ldi	-1, %ret0
601.1Sskrll	bv	%r0(%rp)
611.6Sskrll	 ldi	-1, %ret1
621.1SskrllEXIT(__cerror)
63