powerpc/book3e: initialize crit/mc/dbg kernel stack pointers

We already allocated critical/machine/debug check exceptions, but
we also should initialize those associated kernel stack pointers
for use by special exceptions in the PACA.

Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
This commit is contained in:
Tiejun Chen 2013-10-23 17:31:21 +08:00 committed by Scott Wood
parent b0b7dcbdf3
commit 160c732433
1 changed files with 12 additions and 6 deletions

View File

@ -552,14 +552,20 @@ static void __init irqstack_early_init(void)
static void __init exc_lvl_early_init(void) static void __init exc_lvl_early_init(void)
{ {
unsigned int i; unsigned int i;
unsigned long sp;
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
critirq_ctx[i] = (struct thread_info *) sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); critirq_ctx[i] = (struct thread_info *)__va(sp);
dbgirq_ctx[i] = (struct thread_info *) paca[i].crit_kstack = __va(sp + THREAD_SIZE);
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE));
mcheckirq_ctx[i] = (struct thread_info *) sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
__va(memblock_alloc(THREAD_SIZE, THREAD_SIZE)); dbgirq_ctx[i] = (struct thread_info *)__va(sp);
paca[i].dbg_kstack = __va(sp + THREAD_SIZE);
sp = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
mcheckirq_ctx[i] = (struct thread_info *)__va(sp);
paca[i].mc_kstack = __va(sp + THREAD_SIZE);
} }
if (cpu_has_feature(CPU_FTR_DEBUG_LVL_EXC)) if (cpu_has_feature(CPU_FTR_DEBUG_LVL_EXC))