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