// We've accessed the next page
if (vaddr > p->stack_min - PageBytes) {
- warn("Increasing stack %#x:%#x to %#x:%#x because of access to %#x",
+ DPRINTF(Stack,
+ "Increasing stack %#x:%#x to %#x:%#x because of access to %#x",
p->stack_min, p->stack_base, p->stack_min - PageBytes,
p->stack_base, vaddr);
p->stack_min -= PageBytes;
fatal("Over max stack size for one thread\n");
p->pTable->allocate(p->stack_min, PageBytes);
} else {
+ warn("Page fault on address %#x\n", vaddr);
FaultBase::invoke(tc);
}
}
process->next_thread_stack_base -= stack_size;
}
- stack_base = roundDown(stack_base, VMPageSize);
+ Addr rounded_stack_base = roundDown(stack_base, VMPageSize);
+ Addr rounded_stack_size = roundUp(stack_size, VMPageSize);
+
+ DPRINTF(SyscallVerbose,
+ "stack_create: allocating stack @ %#x size %#x "
+ "(rounded from %#x, %#x)\n",
+ rounded_stack_base, rounded_stack_size,
+ stack_base, stack_size);
// map memory
- process->pTable->allocate(stack_base, roundUp(stack_size, VMPageSize));
+ process->pTable->allocate(rounded_stack_base, rounded_stack_size);
- argp->address = gtoh(stack_base);
+ argp->address = gtoh(rounded_stack_base);
argp.copyOut(tc->getMemPort());
return 0;
#if !FULL_SYSTEM
void FaultBase::invoke(ThreadContext * tc)
{
- fatal("fault (%s) detected @ PC 0x%08p", name(), tc->readPC());
+ fatal("fault (%s) detected @ PC %p", name(), tc->readPC());
}
#else
void FaultBase::invoke(ThreadContext * tc)