intr.h revision 1.7
11.7Suwe/*	$NetBSD: intr.h,v 1.7 2003/10/25 03:45:03 uwe Exp $	*/
21.5Such
31.5Such/*-
41.5Such * Copyright (c) 2002 The NetBSD Foundation, Inc.
51.5Such * All rights reserved.
61.5Such *
71.5Such * Redistribution and use in source and binary forms, with or without
81.5Such * modification, are permitted provided that the following conditions
91.5Such * are met:
101.5Such * 1. Redistributions of source code must retain the above copyright
111.5Such *    notice, this list of conditions and the following disclaimer.
121.5Such * 2. Redistributions in binary form must reproduce the above copyright
131.5Such *    notice, this list of conditions and the following disclaimer in the
141.5Such *    documentation and/or other materials provided with the distribution.
151.5Such * 3. All advertising materials mentioning features or use of this software
161.5Such *    must display the following acknowledgement:
171.5Such *        This product includes software developed by the NetBSD
181.5Such *        Foundation, Inc. and its contributors.
191.5Such * 4. Neither the name of The NetBSD Foundation nor the names of its
201.5Such *    contributors may be used to endorse or promote products derived
211.5Such *    from this software without specific prior written permission.
221.5Such *
231.5Such * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
241.5Such * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
251.5Such * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
261.5Such * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
271.5Such * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
281.5Such * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
291.5Such * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
301.5Such * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
311.5Such * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
321.5Such * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
331.5Such * POSSIBILITY OF SUCH DAMAGE.
341.5Such */
351.5Such
361.2Such#ifndef _HPCSH_INTR_H_
371.2Such#define _HPCSH_INTR_H_
381.1Sitojun
391.5Such#include <sh3/intr.h>
401.1Sitojun
411.7Suwe/*
421.7Suwe * See sys/arch/sh3/sh3/interrupt.c
431.7Suwe * This was 8 for TMU0, TMU1, TMU2, SCIF * 4, HD6446x.
441.7Suwe *
451.7Suwe * For now bump this to 16 so that it's possible to do experiments
461.7Suwe * with new drivers without hitting this limit.
471.7Suwe */
481.7Suwe#define _INTR_N		16
491.5Such
501.5Such#define	IPL_BIO		9	/* block I/O */
511.6Such#define	IPL_NET		10	/* network */
521.6Such#define	IPL_TTY		11	/* terminal */
531.6Such#define	IPL_SERIAL	11	/* serial */
541.5Such#define	IPL_CLOCK	14	/* clock */
551.5Such#define	IPL_HIGH	15	/* everything */
561.5Such
571.6Such#include <hpcsh/dev/hd6446x/hd6446xintcvar.h>
581.6Such
591.6Such#define	splsoftclock()		hd6446x_intr_raise(IPL_SOFTCLOCK << 4)
601.6Such#define	splsoftnet()		hd6446x_intr_raise(IPL_SOFTNET << 4)
611.6Such#define	splsoftserial()		hd6446x_intr_raise(IPL_SOFTSERIAL << 4)
621.6Such#define	splbio()		hd6446x_intr_raise(IPL_BIO << 4)
631.6Such#define	splnet()		hd6446x_intr_raise(IPL_NET << 4)
641.6Such#define	spltty()		hd6446x_intr_raise(IPL_TTY << 4)
651.5Such#define	splvm()			spltty()
661.6Such#define	splserial()		hd6446x_intr_raise(IPL_SERIAL << 4)
671.6Such#define	splclock()		hd6446x_intr_raise(IPL_CLOCK << 4)
681.5Such#define	splstatclock()		splclock()
691.5Such#define	splsched()		splclock()
701.6Such#define	splhigh()		hd6446x_intr_raise(IPL_HIGH << 4)
711.5Such#define	spllock()		splhigh()
721.1Sitojun
731.6Such#define	spl0()			hd6446x_intr_resume(0)
741.6Such#define	splx(x)			hd6446x_intr_resume(x)
751.1Sitojun
761.6Such#define	spllowersoftclock()	hd6446x_intr_resume(IPL_SOFTCLOCK << 4)
771.1Sitojun
781.5Such#endif /* !_HPCSH_INTR_H_ */
79