Permalink
Browse files

busdma: Panic if the kmalloc_powerof2() fails to meet the dma require…

…ment
  • Loading branch information...
1 parent 8e469b9 commit cd12dbe89814861db12480fa250d9ee570701751 Sepherosa Ziehau committed Oct 7, 2012
Showing with 12 additions and 12 deletions.
  1. +6 −6 sys/platform/pc32/i386/busdma_machdep.c
  2. +6 −6 sys/platform/pc64/x86_64/busdma_machdep.c
@@ -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
@@ -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

0 comments on commit cd12dbe

Please sign in to comment.