NetBSD/sys/arch/arm26/include/spl.h

94 lines
3.1 KiB
C

/* $NetBSD: spl.h,v 1.1 2000/05/09 21:56:00 bjh21 Exp $ */
/*-
* Copyright (c) 1998 Ben Harris
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* This file is part of NetBSD/arm26 -- a port of NetBSD to ARM2/3 machines. */
/*
* spl.h -- Software priority levels, I think.
*/
#ifndef _ARM26_SPL_H
#define _ARM26_SPL_H
/*
* These are the different SPL states
*
* Each state has an interrupt mask associated with it which
* indicate which interrupts are allowed.
*/
#define IPL_NONE 0
#define IPL_SOFTCLOCK 1
#define IPL_SOFTNET 2
#define IPL_BIO 3
#define IPL_NET 4
#define IPL_TTY 5
#define IPL_IMP 6
#define IPL_AUDIO 7
#define IPL_SERIAL 8
#define IPL_CLOCK 9
#define IPL_STATCLOCK 10
#define IPL_SCHED 11
#define IPL_HIGH 12
#define NIPL IPL_HIGH + 1
#define spl0() splx(IPL_NONE)
#define splsoftnet() raisespl(IPL_SOFTNET)
#define splsoftclock() raisespl(IPL_SOFTCLOCK)
#define spllowersoftclock() lowerspl(IPL_SOFTCLOCK)
#define splsoft() splsoftnet()
#define splbio() raisespl(IPL_BIO)
#define splnet() raisespl(IPL_NET)
#define spltty() raisespl(IPL_TTY)
#define splimp() raisespl(IPL_IMP)
#define splaudio() raisespl(IPL_AUDIO)
#define splclock() raisespl(IPL_CLOCK)
#define splstatclock() raisespl(IPL_STATCLOCK)
#define splhigh() splx(IPL_HIGH)
#define signotify(p) setsoftast()
#ifdef _KERNEL
#ifndef ASSEMBLER
extern int raisespl __P((int));
extern int lowerspl __P((int));
extern int splx __P((int));
void setsoftnet __P((void));
void setsoftast __P((void));
void setsoftclock __P((void));
void setsoftintr __P((u_int intrmask));
extern int current_spl_level; /* XXX tautological name */
void need_resched __P((void));
void need_proftick __P((struct proc *));
#endif /* ASSEMBLER */
#endif /* _KERNEL */
#endif /* ! _ARM26_SPL_H */