busdma: Panic if the kmalloc_powerof2() fails to meet the dma requirement
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 7 Oct 2012 04:53:42 +0000 (12:53 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 7 Oct 2012 04:53:42 +0000 (12:53 +0800)
sys/platform/pc32/i386/busdma_machdep.c
sys/platform/pc64/x86_64/busdma_machdep.c

index 35be77b..ae451fb 100644 (file)
@@ -511,17 +511,17 @@ check_kmalloc(bus_dma_tag_t dmat, const void *vaddr0, int verify)
        uintptr_t vaddr = (uintptr_t)vaddr0;
 
        if ((vaddr ^ (vaddr + dmat->maxsize - 1)) & ~PAGE_MASK) {
-               if (verify || bootverbose)
-                       kprintf("boundary check failed\n");
                if (verify)
-                       print_backtrace(-1); /* XXX panic */
+                       panic("boundary check failed\n");
+               if (bootverbose)
+                       kprintf("boundary check failed\n");
                maxsize = dmat->maxsize;
        }
        if (vaddr & (dmat->alignment - 1)) {
-               if (verify || bootverbose)
-                       kprintf("alignment check failed\n");
                if (verify)
-                       print_backtrace(-1); /* XXX panic */
+                       panic("alignment check failed\n");
+               if (bootverbose)
+                       kprintf("alignment check failed\n");
                if (dmat->maxsize < dmat->alignment)
                        maxsize = dmat->alignment;
                else
index 151f9bf..3a68b42 100644 (file)
@@ -511,17 +511,17 @@ check_kmalloc(bus_dma_tag_t dmat, const void *vaddr0, int verify)
        uintptr_t vaddr = (uintptr_t)vaddr0;
 
        if ((vaddr ^ (vaddr + dmat->maxsize - 1)) & ~PAGE_MASK) {
-               if (verify || bootverbose)
-                       kprintf("boundary check failed\n");
                if (verify)
-                       print_backtrace(-1); /* XXX panic */
+                       panic("boundary check failed\n");
+               if (bootverbose)
+                       kprintf("boundary check failed\n");
                maxsize = dmat->maxsize;
        }
        if (vaddr & (dmat->alignment - 1)) {
-               if (verify || bootverbose)
-                       kprintf("alignment check failed\n");
                if (verify)
-                       print_backtrace(-1); /* XXX panic */
+                       panic("alignment check failed\n");
+               if (bootverbose)
+                       kprintf("alignment check failed\n");
                if (dmat->maxsize < dmat->alignment)
                        maxsize = dmat->alignment;
                else