xref: /netbsd-src/sys/arch/mac68k/dev/ncr5380var.h (revision 50a256a3a09f8361dd5d564bc61c4718d51c9a8f)
1*50a256a3Sperry /*	$NetBSD: ncr5380var.h,v 1.5 2005/12/24 23:24:00 perry Exp $	*/
237163421Sbriggs 
337163421Sbriggs /*
437163421Sbriggs  * Copyright (c) 1995 Allen Briggs.  All rights reserved.
537163421Sbriggs  *
637163421Sbriggs  * Redistribution and use in source and binary forms, with or without
737163421Sbriggs  * modification, are permitted provided that the following conditions
837163421Sbriggs  * are met:
937163421Sbriggs  * 1. Redistributions of source code must retain the above copyright
1037163421Sbriggs  *    notice, this list of conditions and the following disclaimer.
1137163421Sbriggs  * 2. Redistributions in binary form must reproduce the above copyright
1237163421Sbriggs  *    notice, this list of conditions and the following disclaimer in the
1337163421Sbriggs  *    documentation and/or other materials provided with the distribution.
1437163421Sbriggs  * 3. All advertising materials mentioning features or use of this software
1537163421Sbriggs  *    must display the following acknowledgement:
1637163421Sbriggs  *	This product includes software developed by Allen Briggs.
1737163421Sbriggs  * 4. The name of the author may not be used to endorse or promote products
1837163421Sbriggs  *    derived from this software without specific prior written permission.
1937163421Sbriggs  *
2037163421Sbriggs  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2137163421Sbriggs  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2237163421Sbriggs  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2337163421Sbriggs  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2437163421Sbriggs  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2537163421Sbriggs  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2637163421Sbriggs  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2737163421Sbriggs  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2837163421Sbriggs  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2937163421Sbriggs  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3037163421Sbriggs  */
3137163421Sbriggs 
3237163421Sbriggs static volatile u_char	*scsi_enable = NULL;
33014b4041Sbriggs static volatile u_char	*scsi_flag   = NULL;
34014b4041Sbriggs 
35*50a256a3Sperry static inline void
scsi_clear_drq(void)367acd68b1Schs scsi_clear_drq(void)
37014b4041Sbriggs {
38014b4041Sbriggs 	int	s;
39014b4041Sbriggs 
40014b4041Sbriggs 	s = splhigh();
41014b4041Sbriggs 	*scsi_flag = 0x80 | V2IF_SCSIDRQ;
42014b4041Sbriggs 	splx(s);
43014b4041Sbriggs }
44014b4041Sbriggs 
45*50a256a3Sperry static inline void
scsi_clear_irq(void)467acd68b1Schs scsi_clear_irq(void)
47014b4041Sbriggs {
48014b4041Sbriggs 	int	s;
49014b4041Sbriggs 
50014b4041Sbriggs 	s = splhigh();
51014b4041Sbriggs 	*scsi_flag = 0x80 | V2IF_SCSIIRQ;
52014b4041Sbriggs 	splx(s);
53014b4041Sbriggs }
5437163421Sbriggs 
55*50a256a3Sperry static inline void
scsi_ienable(void)567acd68b1Schs scsi_ienable(void)
5737163421Sbriggs {
5837163421Sbriggs 	int	s;
5937163421Sbriggs 
6037163421Sbriggs 	s = splhigh();
6137163421Sbriggs 	*scsi_enable = 0x80 | (V2IF_SCSIIRQ | V2IF_SCSIDRQ);
6237163421Sbriggs 	splx(s);
6337163421Sbriggs }
6437163421Sbriggs 
65*50a256a3Sperry static inline void
scsi_idisable(void)667acd68b1Schs scsi_idisable(void)
6737163421Sbriggs {
6837163421Sbriggs 	int	s;
6937163421Sbriggs 
7037163421Sbriggs 	s = splhigh();
7137163421Sbriggs 	*scsi_enable = V2IF_SCSIIRQ | V2IF_SCSIDRQ;
7237163421Sbriggs 	splx(s);
7337163421Sbriggs }
7437163421Sbriggs 
757acd68b1Schs void	pdma_stat(void);
767acd68b1Schs void	pdma_cleanup(void);
777acd68b1Schs void	scsi_show(void);
7837163421Sbriggs 
79