Annotation of Gnu-Mach/i386/i386at/gpl/linux/linux_dma.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Linux DMA channel management.
                      3:  * Copyright (C) 1995 Shantanu Goel.
                      4:  *
                      5:  * This program is free software; you can redistribute it and/or modify
                      6:  * it under the terms of the GNU General Public License as published by
                      7:  * the Free Software Foundation; either version 2, or (at your option)
                      8:  * any later version.
                      9:  *
                     10:  * This program is distributed in the hope that it will be useful,
                     11:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
                     12:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     13:  * GNU General Public License for more details.
                     14:  *
                     15:  * You should have received a copy of the GNU General Public License
                     16:  * along with this program; if not, write to the Free Software
                     17:  * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
                     18:  */
                     19: 
                     20: #define MACH_INCLUDE
                     21: #include <linux/errno.h>
                     22: #include <asm/dma.h>
                     23: 
                     24: /*
                     25:  * Bitmap of allocated/free DMA channels.
                     26:  */
                     27: static int dma_busy = 0x10;
                     28: 
                     29: /*
                     30:  * Allocate a DMA channel.
                     31:  */
                     32: int
                     33: request_dma(unsigned int drq, const char *name)
                     34: {
                     35:        if (drq > 7)
                     36:                panic("request_dma: bad DRQ number");
                     37:        if (dma_busy & (1 << drq))
                     38:                return (-LINUX_EBUSY);
                     39:        dma_busy |= 1 << drq;
                     40:        return (0);
                     41: }
                     42: 
                     43: /*
                     44:  * Free a DMA channel.
                     45:  */
                     46: void
                     47: free_dma(unsigned int drq)
                     48: {
                     49:        if (drq > 7)
                     50:                panic("free_dma: bad DRQ number");
                     51:        dma_busy &= ~(1 << drq);
                     52: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.