xref: /openbsd/lib/libc/arch/m88k/sys/sigsuspend.S (revision 83762a71)
1*83762a71Sderaadt/*	$OpenBSD: sigsuspend.S,v 1.14 2023/12/10 16:45:51 deraadt Exp $	*/
21fc27e41Stodd
3443998a4Ssmurph/*-
4443998a4Ssmurph * Copyright (c) 1990 The Regents of the University of California.
5443998a4Ssmurph * All rights reserved.
6443998a4Ssmurph *
7443998a4Ssmurph * This code is derived from software contributed to Berkeley by
8443998a4Ssmurph * the Systems Programming Group of the University of Utah Computer
9443998a4Ssmurph * Science Department.
10443998a4Ssmurph *
11443998a4Ssmurph * Redistribution and use in source and binary forms, with or without
12443998a4Ssmurph * modification, are permitted provided that the following conditions
13443998a4Ssmurph * are met:
14443998a4Ssmurph * 1. Redistributions of source code must retain the above copyright
15443998a4Ssmurph *    notice, this list of conditions and the following disclaimer.
16443998a4Ssmurph * 2. Redistributions in binary form must reproduce the above copyright
17443998a4Ssmurph *    notice, this list of conditions and the following disclaimer in the
18443998a4Ssmurph *    documentation and/or other materials provided with the distribution.
196580fee3Smillert * 3. Neither the name of the University nor the names of its contributors
20443998a4Ssmurph *    may be used to endorse or promote products derived from this software
21443998a4Ssmurph *    without specific prior written permission.
22443998a4Ssmurph *
23443998a4Ssmurph * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24443998a4Ssmurph * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25443998a4Ssmurph * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26443998a4Ssmurph * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27443998a4Ssmurph * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28443998a4Ssmurph * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29443998a4Ssmurph * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30443998a4Ssmurph * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31443998a4Ssmurph * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32443998a4Ssmurph * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33443998a4Ssmurph * SUCH DAMAGE.
34443998a4Ssmurph */
35443998a4Ssmurph
36443998a4Ssmurph#include "SYS.h"
37443998a4Ssmurph
38443998a4Ssmurph/*
399534f5ccSdavid * Sigsuspend actually expects a pointer to the mask. To save
40443998a4Ssmurph * a copyin in the kernel, we do the dereference here and pass it.
41443998a4Ssmurph * This will be fail if we ever have more than 32 signals ie. sizeof
42443998a4Ssmurph * sigset_t != sizeof int.
43443998a4Ssmurph */
44443998a4Ssmurph
45fe38b55cSguentherSYSENTRY_HIDDEN(sigsuspend)
460b514a07Smiod	ld	%r2,%r2,0		/* dereference the pointer mask */
470b514a07Smiod	or	%r13,%r0,SYS_sigsuspend
48*83762a71Sderaadt99:	tb0	0,%r0,450
49*83762a71Sderaadt	PINSYSCALL(SYS_sigsuspend, 99b)
50c90cd26bSmiod	br	CERROR
510b514a07Smiod	jmp.n	%r1
520b514a07Smiod	 or	%r2,%r0,0
53fe38b55cSguentherSYSCALL_END_HIDDEN(sigsuspend)
54