isa.c (15330) | isa.c (15538) |
---|---|
1/*- 2 * Copyright (c) 1991 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 | 1/*- 2 * Copyright (c) 1991 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 |
37 * $Id: isa.c,v 1.68 1996/04/11 21:18:43 bde Exp $ | 37 * $Id: isa.c,v 1.69 1996/04/20 21:22:32 gibbs Exp $ |
38 */ 39 40/* 41 * code to manage AT bus 42 * 43 * 92/08/18 Frank P. MacLachlan (fpm@crash.cts.com): 44 * Fixed uninitialized variable problem and added code to deal 45 * with DMA page boundaries in isa_dmarangecheck(). Fixed word --- 787 unchanged lines hidden (view full) --- 833 */ 834 835static int 836isa_dmarangecheck(caddr_t va, u_int length, int chan) { 837 vm_offset_t phys, priorpage = 0, endva; 838 u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1); 839 840 endva = (vm_offset_t)round_page(va + length); | 38 */ 39 40/* 41 * code to manage AT bus 42 * 43 * 92/08/18 Frank P. MacLachlan (fpm@crash.cts.com): 44 * Fixed uninitialized variable problem and added code to deal 45 * with DMA page boundaries in isa_dmarangecheck(). Fixed word --- 787 unchanged lines hidden (view full) --- 833 */ 834 835static int 836isa_dmarangecheck(caddr_t va, u_int length, int chan) { 837 vm_offset_t phys, priorpage = 0, endva; 838 u_int dma_pgmsk = (chan & 4) ? ~(128*1024-1) : ~(64*1024-1); 839 840 endva = (vm_offset_t)round_page(va + length); |
841 for (; va < (caddr_t) endva ; va += NBPG) { | 841 for (; va < (caddr_t) endva ; va += PAGE_SIZE) { |
842 phys = trunc_page(pmap_extract(pmap_kernel(), (vm_offset_t)va)); 843#define ISARAM_END RAM_END 844 if (phys == 0) 845 panic("isa_dmacheck: no physical page present"); 846 if (phys >= ISARAM_END) 847 return (1); 848 if (priorpage) { | 842 phys = trunc_page(pmap_extract(pmap_kernel(), (vm_offset_t)va)); 843#define ISARAM_END RAM_END 844 if (phys == 0) 845 panic("isa_dmacheck: no physical page present"); 846 if (phys >= ISARAM_END) 847 return (1); 848 if (priorpage) { |
849 if (priorpage + NBPG != phys) | 849 if (priorpage + PAGE_SIZE != phys) |
850 return (1); 851 /* check if crossing a DMA page boundary */ 852 if (((u_int)priorpage ^ (u_int)phys) & dma_pgmsk) 853 return (1); 854 } 855 priorpage = phys; 856 } 857 return (0); --- 233 unchanged lines hidden --- | 850 return (1); 851 /* check if crossing a DMA page boundary */ 852 if (((u_int)priorpage ^ (u_int)phys) & dma_pgmsk) 853 return (1); 854 } 855 priorpage = phys; 856 } 857 return (0); --- 233 unchanged lines hidden --- |