xref: /netbsd/sys/dev/pci/bktr/bktr_os.h (revision bf9ec67e)
1 /*	$NetBSD: bktr_os.h,v 1.5 2001/03/16 19:32:35 ross Exp $	*/
2 
3 /* FreeBSD: src/sys/dev/bktr/bktr_os.h,v 1.4 2000/04/16 07:56:58 roger Exp */
4 
5 /*
6  * This is part of the Driver for Video Capture Cards (Frame grabbers)
7  * and TV Tuner cards using the Brooktree Bt848, Bt848A, Bt849A, Bt878, Bt879
8  * chipset.
9  * Copyright Roger Hardiman and Amancio Hasty.
10  *
11  * bktr_os : This has all the Operating System dependant code.
12  *
13  */
14 
15 /*
16  * 1. Redistributions of source code must retain the
17  * Copyright (c) 1997 Amancio Hasty, 1999 Roger Hardiman
18  * All rights reserved.
19  *
20  * Redistribution and use in source and binary forms, with or without
21  * modification, are permitted provided that the following conditions
22  * are met:
23  * 1. Redistributions of source code must retain the above copyright
24  *    notice, this list of conditions and the following disclaimer.
25  * 2. Redistributions in binary form must reproduce the above copyright
26  *    notice, this list of conditions and the following disclaimer in the
27  *    documentation and/or other materials provided with the distribution.
28  * 3. All advertising materials mentioning features or use of this software
29  *    must display the following acknowledgement:
30  *	This product includes software developed by Amancio Hasty and
31  *      Roger Hardiman
32  * 4. The name of the author may not be used to endorse or promote products
33  *    derived from this software without specific prior written permission.
34  *
35  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
36  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
37  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38  * DISCLAIMED.	IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
39  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
40  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
41  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
42  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
43  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
44  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
45  * POSSIBILITY OF SUCH DAMAGE.
46  */
47 
48 
49 /******************************/
50 /* *** Memory Allocation  *** */
51 /******************************/
52 #if (defined(__FreeBSD__) || defined(__bsdi__))
53 vm_offset_t     get_bktr_mem( int unit, unsigned size );
54 #endif
55 
56 #if defined(__NetBSD__)
57 vaddr_t         get_bktr_mem(bktr_ptr_t, bus_dmamap_t *, unsigned size);
58 void            free_bktr_mem(bktr_ptr_t, bus_dmamap_t, vaddr_t);
59 #endif
60 
61 #if defined(__OpenBSD__)
62 vm_offset_t     get_bktr_mem(bktr_ptr_t, bus_dmamap_t *, unsigned size);
63 void            free_bktr_mem(bktr_ptr_t, bus_dmamap_t, vm_offset_t);
64 #endif
65 
66 /************************************/
67 /* *** Interrupt Enable/Disable *** */
68 /************************************/
69 #define DECLARE_INTR_MASK(s)	int s
70 #define DISABLE_INTR(s)		s = spltty()
71 #define ENABLE_INTR(s)		splx(s)
72