Mercurial > illumos > illumos-gate
changeset 3791:4893821e03ad
6533109 nucleus text overflow check is incorrect
author | kchow |
---|---|
date | Fri, 09 Mar 2007 15:42:52 -0800 |
parents | 129fe0da02b8 |
children | 57ba782523b7 |
files | usr/src/uts/sun4/os/startup.c |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/sun4/os/startup.c Fri Mar 09 13:52:20 2007 -0800 +++ b/usr/src/uts/sun4/os/startup.c Fri Mar 09 15:42:52 2007 -0800 @@ -919,7 +919,7 @@ */ PRM_DEBUG(e_text); modtext = (caddr_t)roundup((uintptr_t)e_text, MMU_PAGESIZE); - if (((uintptr_t)modtext & MMU_PAGEMASK4M) != (uintptr_t)s_text) + if (((uintptr_t)e_text & MMU_PAGEMASK4M) != (uintptr_t)s_text) prom_panic("nucleus text overflow"); modtext_sz = (caddr_t)roundup((uintptr_t)modtext, MMU_PAGESIZE4M) - modtext; @@ -966,11 +966,11 @@ modtext_sz > MODTEXT_SM_CAP) { extra_etpg = mmu_btop(modtext_sz - MODTEXT_SM_CAP); modtext_sz = MODTEXT_SM_CAP; - } else - extra_etpg = 0; + extra_etva = modtext + modtext_sz; + } + PRM_DEBUG(extra_etpg); PRM_DEBUG(modtext_sz); - extra_etva = modtext + modtext_sz; PRM_DEBUG(extra_etva); /* @@ -3227,8 +3227,8 @@ (void *)limit, (void *)(limit + PAGESIZE), VM_NOSLEEP | VM_BESTFIT | VM_PANIC); - *text_arena = vmem_create("module_text", modtext, modtext_sz, - sizeof (uintptr_t), segkmem_alloc, segkmem_free, + *text_arena = vmem_create("module_text", modtext_sz ? modtext : NULL, + modtext_sz, sizeof (uintptr_t), segkmem_alloc, segkmem_free, heaptext_arena, 0, VM_SLEEP); *data_arena = vmem_create("module_data", moddata, MODDATA, 1, segkmem_alloc, segkmem_free, heap32_arena, 0, VM_SLEEP);