[xtensa-cvscommit] linux/arch/xtensa/kernel handlers.S,1.11,1.12
Brought to you by:
zankel
|
From: <ma...@us...> - 2003-02-11 07:24:38
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv18526 Modified Files: handlers.S Log Message: Add kernel exception stack checking. To be conditionalized once things are a bit more stable and we tune for efficiency. Without this, looping exceptions can be difficult to diagnose. Index: handlers.S =================================================================== RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/handlers.S,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** handlers.S 7 Feb 2003 02:03:35 -0000 1.11 --- handlers.S 11 Feb 2003 07:24:35 -0000 1.12 *************** *** 12,16 **** * for more details. * ! * Copyright (C) 2001 - 2002 Tensilica Inc. * * Authors: Marc Gauthier <ma...@te...> <ma...@al...> --- 12,16 ---- * for more details. * ! * Copyright (C) 2001 - 2003 Tensilica Inc. * * Authors: Marc Gauthier <ma...@te...> <ma...@al...> *************** *** 427,430 **** --- 427,431 ---- + /* First-level exit handler for unhandled-late kernel exceptions. * *************** *** 1239,1242 **** --- 1240,1261 ---- ///* slot */ //s32i a2, a1, PT_CPENABLE + + #if 1 + /* Stack overflow check, for debugging: */ + _GET_CURRENT a2 + movi a3, TASK_STRUCT_SIZE + PT_SIZE // (could add sizeof(elf_fpregset_t) as well... + add a3, a2, a3 // a3 = stack overflow check boundary + bgeu a1, a3, 1f // stack ptr in seemingly reasonable distance? + movi a4, panic // too close to task struct for comfort, panic + movi a6, kern_stk_overflow_msg + mov a7, a1 // sp + mov a8, a3 // boundary + callx4 a4 // call panic(msg,sp,boundary) + j 1f // normally doesn't get here, but just in case... + //.rodata + kern_stk_overflow_msg: .asciz "kernel stack overflow (sp=0x%X boundary=0x%X)" + .text + 1: + #endif |