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