11.23Sandvar/*	$NetBSD: intr.h,v 1.23 2023/08/17 14:19:49 andvar Exp $	*/
21.1Spooka
31.1Spooka/*
41.18Spooka * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
51.1Spooka *
61.1Spooka * Redistribution and use in source and binary forms, with or without
71.1Spooka * modification, are permitted provided that the following conditions
81.1Spooka * are met:
91.1Spooka * 1. Redistributions of source code must retain the above copyright
101.1Spooka *    notice, this list of conditions and the following disclaimer.
111.1Spooka * 2. Redistributions in binary form must reproduce the above copyright
121.1Spooka *    notice, this list of conditions and the following disclaimer in the
131.1Spooka *    documentation and/or other materials provided with the distribution.
141.1Spooka *
151.1Spooka * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
161.1Spooka * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
171.1Spooka * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
181.1Spooka * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
191.1Spooka * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
201.1Spooka * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
211.1Spooka * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
221.1Spooka * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
231.1Spooka * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
241.1Spooka * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
251.1Spooka * SUCH DAMAGE.
261.1Spooka */
271.1Spooka
281.1Spooka#ifndef _SYS_RUMP_INTR_H_
291.1Spooka#define _SYS_RUMP_INTR_H_
301.1Spooka
311.14Spooka#ifndef _LOCORE
321.14Spooka
331.5Sadtypedef uint8_t ipl_t;
341.5Sadtypedef struct {
351.5Sad        ipl_t _ipl;
361.5Sad} ipl_cookie_t;
371.5Sad
381.22Schristosstatic __inline ipl_cookie_t
391.17Spookamakeiplcookie(ipl_t ipl)
401.15She{
411.15She	ipl_cookie_t c;
421.15She	c._ipl = ipl;
431.15She	return c;
441.15She}
451.15She
461.14Spooka#endif /* !_LOCORE */
471.14Spooka
481.16Spooka#define spllower(x) ((void)x)
491.1Spooka#define splraise(x) 0
501.19Sskrll#define splsoftserial() 0
511.16Spooka#define splsoftnet() 0
521.16Spooka#define splsoftclock() 0
531.16Spooka#define splhigh() 0
541.16Spooka#define splsched() 0
551.16Spooka#define splvm() 0
561.16Spooka#define splx(x) ((void)x)
571.9Spooka#define spl0() ((void)0)
581.1Spooka
591.20Smartin/*
601.23Sandvar * IPL_* does not mean anything to a run-to-completion rump kernel,
611.20Smartin * but we sometimes assert a "not higher than" condition, so we assign
621.20Smartin * different values (following spl(9)).
631.20Smartin */
641.1Spooka#define IPL_NONE 0
651.17Spooka#define	IPL_SOFTCLOCK 1
661.20Smartin#define	IPL_SOFTBIO 2
671.20Smartin#define	IPL_SOFTNET 3
681.20Smartin#define IPL_SOFTSERIAL 4
691.20Smartin#define IPL_VM 5
701.20Smartin#define IPL_SCHED 6
711.20Smartin#define IPL_HIGH 7
721.1Spooka
731.21Smartin#define	splraiseipl(COOKIE)	0
741.21Smartin
751.1Spooka#endif /* _SYS_RUMP_INTR_H_ */
76