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