From owner-freebsd-hackers Mon Mar 8 10:28:59 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from midten.fast.no (midten.fast.no [195.139.251.11]) by hub.freebsd.org (Postfix) with ESMTP id D260814F26; Mon, 8 Mar 1999 10:28:45 -0800 (PST) (envelope-from tegge@fast.no) Received: from fast.no (IDENT:tegge@midten.fast.no [195.139.251.11]) by midten.fast.no (8.9.1/8.9.1) with ESMTP id TAA70476; Mon, 8 Mar 1999 19:27:59 +0100 (CET) Message-Id: <199903081827.TAA70476@midten.fast.no> To: mike@smith.net.au Cc: henrich@flnet.com, freebsd-hackers@FreeBSD.ORG, freebsd-smp@FreeBSD.ORG Subject: Re: Erorr: isa_dmainit(2, 1024) failed From: Tor.Egge@fast.no In-Reply-To: Your message of "Mon, 08 Mar 1999 09:40:28 -0800" References: <199903081740.JAA06967@dingo.cdrom.com> X-Mailer: Mew version 1.70 on Emacs 19.34.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Mar__8_19:22:22_1999)--" Content-Transfer-Encoding: 7bit Date: Mon, 08 Mar 1999 19:27:59 +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG ----Next_Part(Mon_Mar__8_19:22:22_1999)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit > > How does one fix this? :) > > With a text editor. Find the code that does it wrong, change it and > recompile. Send us the diffs when you're done. > > Actually, fixing it "right" will be very difficult. I suspect that the > ISA DMA code will need a statically-allocated buffer to overcome this. I've been using the appended patch to use SoundBlaster AWE64 Gold on a machine with 512 MB memory. - Tor Egge ----Next_Part(Mon_Mar__8_19:22:22_1999)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Index: sys/i386/include/pmap.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/pmap.h,v retrieving revision 1.58 diff -u -r1.58 pmap.h --- pmap.h 1999/03/02 16:20:39 1.58 +++ pmap.h 1999/03/03 15:24:59 @@ -265,6 +285,7 @@ void putfmtrr __P((void)); void pmap_setdevram __P((unsigned long long, unsigned)); void pmap_setvidram __P((void)); +int pmap_defer_avail __P((vm_offset_t)); #endif /* KERNEL */ Index: sys/i386/i386/pmap.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/pmap.c,v retrieving revision 1.223 diff -u -r1.223 pmap.c --- pmap.c 1999/02/19 14:25:33 1.223 +++ pmap.c 1999/02/26 04:25:22 @@ -71,6 +71,7 @@ #include "opt_disable_pse.h" #include "opt_pmap.h" #include "opt_msgbuf.h" +#include "isa.h" #include #include @@ -3411,6 +3623,16 @@ return val; } +int +pmap_defer_avail(vm_offset_t pa) +{ +#if NISA > 0 + if (pa >= 0x0 && pa < 0x1000000) + return 1; +#endif + return 0; +} + void pmap_activate(struct proc *p) { Index: sys/i386/i386/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.326 diff -u -r1.326 machdep.c --- machdep.c 1999/02/13 17:45:15 1.326 +++ machdep.c 1999/02/18 15:20:53 @@ -1544,7 +1545,9 @@ * so that we keep going. The first bad page * will terminate the loop. */ - if (phys_avail[pa_indx] == target_page) { + if (phys_avail[pa_indx] == target_page && + pmap_defer_avail(target_page) == + pmap_defer_avail(target_page - PAGE_SIZE)) { phys_avail[pa_indx] += PAGE_SIZE; if (speculative_mprobe == TRUE && phys_avail[pa_indx] >= (64*1024*1024)) Index: sys/vm/vm_page.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_page.c,v retrieving revision 1.127 diff -u -r1.127 vm_page.c --- vm_page.c 1999/02/24 21:26:26 1.127 +++ vm_page.c 1999/02/26 04:10:32 @@ -201,11 +203,13 @@ register vm_page_t m; register struct vm_page **bucket; vm_size_t npages, page_range; + vm_size_t tmpnpages; register vm_offset_t new_start; int i; vm_offset_t pa; int nblocks; vm_offset_t first_managed_page; + int pass; /* the biggest memory array is the second group of pages */ vm_offset_t start; @@ -324,22 +328,30 @@ cnt.v_page_count = 0; cnt.v_free_count = 0; - for (i = 0; phys_avail[i + 1] && npages > 0; i += 2) { - if (i == biggestone) - pa = ptoa(first_managed_page); - else - pa = phys_avail[i]; - while (pa < phys_avail[i + 1] && npages-- > 0) { - ++cnt.v_page_count; - ++cnt.v_free_count; - m = PHYS_TO_VM_PAGE(pa); - m->phys_addr = pa; - m->flags = 0; - m->pc = (pa >> PAGE_SHIFT) & PQ_L2_MASK; - m->queue = m->pc + PQ_FREE; - TAILQ_INSERT_TAIL(vm_page_queues[m->queue].pl, m, pageq); - ++(*vm_page_queues[m->queue].lcnt); - pa += PAGE_SIZE; + for (pass = 0; pass < 2; pass++) { + tmpnpages = npages; + for (i = 0; phys_avail[i + 1] && npages > 0; i += 2) { + if (i == biggestone) + pa = ptoa(first_managed_page); + else + pa = phys_avail[i]; + while (pa < phys_avail[i + 1] && tmpnpages-- > 0) { + if (pass != pmap_defer_avail(pa)) { + pa += PAGE_SIZE; + continue; + } + ++cnt.v_page_count; + ++cnt.v_free_count; + m = PHYS_TO_VM_PAGE(pa); + m->phys_addr = pa; + m->flags = 0; + m->pc = (pa >> PAGE_SHIFT) & PQ_L2_MASK; + m->queue = m->pc + PQ_FREE; + TAILQ_INSERT_TAIL(vm_page_queues[m->queue].pl, + m, pageq); + ++(*vm_page_queues[m->queue].lcnt); + pa += PAGE_SIZE; + } } } return (mapped); ----Next_Part(Mon_Mar__8_19:22:22_1999)---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message