1210284Sjmallett/*	$NetBSD$	*/
2232812Sjmallett
3215990Sjmallett/*-
4210284Sjmallett * Copyright (c) 1990 The Regents of the University of California.
5210284Sjmallett * All rights reserved.
6215990Sjmallett *
7215990Sjmallett * This code is derived from software contributed to Berkeley by
8215990Sjmallett * William Jolitz.
9210284Sjmallett *
10215990Sjmallett * Redistribution and use in source and binary forms, with or without
11215990Sjmallett * modification, are permitted provided that the following conditions
12210284Sjmallett * are met:
13215990Sjmallett * 1. Redistributions of source code must retain the above copyright
14215990Sjmallett *    notice, this list of conditions and the following disclaimer.
15215990Sjmallett * 2. Redistributions in binary form must reproduce the above copyright
16215990Sjmallett *    notice, this list of conditions and the following disclaimer in the
17215990Sjmallett *    documentation and/or other materials provided with the distribution.
18232812Sjmallett * 3. Neither the name of the University nor the names of its contributors
19215990Sjmallett *    may be used to endorse or promote products derived from this software
20215990Sjmallett *    without specific prior written permission.
21215990Sjmallett *
22215990Sjmallett * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23215990Sjmallett * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24215990Sjmallett * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25215990Sjmallett * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26215990Sjmallett * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27215990Sjmallett * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28215990Sjmallett * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29232812Sjmallett * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30215990Sjmallett * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31215990Sjmallett * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32215990Sjmallett * SUCH DAMAGE.
33215990Sjmallett *
34215990Sjmallett *	from: @(#)cerror.s	5.1 (Berkeley) 4/23/90
35215990Sjmallett */
36215990Sjmallett
37215990Sjmallett#include <machine/asm.h>
38210284Sjmallett#if defined(SYSLIBC_SCCS) && !defined(lint)
39210284Sjmallett	RCSID("$NetBSD$")
40215990Sjmallett#endif /* SYSLIBC_SCCS and not lint */
41210284Sjmallett
42210284Sjmallett#include "SYS.h"
43210284Sjmallett
44210284Sjmallett	.globl	_C_LABEL(__errno)
45210284Sjmallett	.protected	CERROR
46210284Sjmallett
47210284Sjmallett_ENTRY(CERROR)
48210284Sjmallett	pushl	%eax
49210284Sjmallett#ifdef PIC
50232812Sjmallett	PIC_PROLOGUE
51232812Sjmallett	call	PIC_PLT(_C_LABEL(__errno))
52232812Sjmallett	PIC_EPILOGUE
53232812Sjmallett#else
54210284Sjmallett	call	_C_LABEL(__errno)
55210284Sjmallett#endif /* PIC */
56210284Sjmallett	popl	(%eax)
57210284Sjmallett	movl	$-1,%eax
58210284Sjmallett	movl	$-1,%edx
59210284Sjmallett	ret
60210284Sjmallett