mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
arch: set current regs firstly in undefinedinsn
Need to save the regs firstly in case syslog triggers another crash. Otherwise we may loose the register contents for the first exception. Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
@@ -42,6 +42,12 @@
|
|||||||
|
|
||||||
void arm_undefinedinsn(uint32_t *regs)
|
void arm_undefinedinsn(uint32_t *regs)
|
||||||
{
|
{
|
||||||
|
/* Save the saved processor context in current_regs where it can be
|
||||||
|
* accessed for register dumps and possibly context switching.
|
||||||
|
*/
|
||||||
|
|
||||||
|
up_set_current_regs(regs);
|
||||||
|
|
||||||
if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
|
if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
|
||||||
{
|
{
|
||||||
_alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
|
_alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
|
||||||
@@ -52,7 +58,5 @@ void arm_undefinedinsn(uint32_t *regs)
|
|||||||
_alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
|
_alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
|
||||||
}
|
}
|
||||||
|
|
||||||
up_set_current_regs(regs);
|
|
||||||
|
|
||||||
PANIC_WITH_REGS("panic", regs);
|
PANIC_WITH_REGS("panic", regs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,12 @@
|
|||||||
|
|
||||||
uint32_t *arm_undefinedinsn(uint32_t *regs)
|
uint32_t *arm_undefinedinsn(uint32_t *regs)
|
||||||
{
|
{
|
||||||
|
/* Save the saved processor context in current_regs where it can be
|
||||||
|
* accessed for register dumps and possibly context switching.
|
||||||
|
*/
|
||||||
|
|
||||||
|
up_set_current_regs(regs);
|
||||||
|
|
||||||
if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
|
if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
|
||||||
{
|
{
|
||||||
_alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
|
_alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
|
||||||
@@ -52,8 +58,6 @@ uint32_t *arm_undefinedinsn(uint32_t *regs)
|
|||||||
_alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
|
_alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
|
||||||
}
|
}
|
||||||
|
|
||||||
up_set_current_regs(regs);
|
|
||||||
|
|
||||||
PANIC_WITH_REGS("panic", regs);
|
PANIC_WITH_REGS("panic", regs);
|
||||||
return regs; /* To keep the compiler happy */
|
return regs; /* To keep the compiler happy */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,12 @@
|
|||||||
|
|
||||||
uint32_t *arm_undefinedinsn(uint32_t *regs)
|
uint32_t *arm_undefinedinsn(uint32_t *regs)
|
||||||
{
|
{
|
||||||
|
/* Save the saved processor context in current_regs where it can be
|
||||||
|
* accessed for register dumps and possibly context switching.
|
||||||
|
*/
|
||||||
|
|
||||||
|
up_set_current_regs(regs);
|
||||||
|
|
||||||
if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
|
if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
|
||||||
{
|
{
|
||||||
_alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
|
_alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
|
||||||
@@ -52,8 +58,6 @@ uint32_t *arm_undefinedinsn(uint32_t *regs)
|
|||||||
_alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
|
_alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
|
||||||
}
|
}
|
||||||
|
|
||||||
up_set_current_regs(regs);
|
|
||||||
|
|
||||||
PANIC_WITH_REGS("panic", regs);
|
PANIC_WITH_REGS("panic", regs);
|
||||||
return regs; /* To keep the compiler happy */
|
return regs; /* To keep the compiler happy */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,12 @@
|
|||||||
|
|
||||||
uint32_t *arm_undefinedinsn(uint32_t *regs)
|
uint32_t *arm_undefinedinsn(uint32_t *regs)
|
||||||
{
|
{
|
||||||
|
/* Save the saved processor context in current_regs where it can be
|
||||||
|
* accessed for register dumps and possibly context switching.
|
||||||
|
*/
|
||||||
|
|
||||||
|
up_set_current_regs(regs);
|
||||||
|
|
||||||
if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
|
if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
|
||||||
{
|
{
|
||||||
_alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
|
_alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
|
||||||
@@ -52,8 +58,6 @@ uint32_t *arm_undefinedinsn(uint32_t *regs)
|
|||||||
_alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
|
_alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
|
||||||
}
|
}
|
||||||
|
|
||||||
up_set_current_regs(regs);
|
|
||||||
|
|
||||||
PANIC_WITH_REGS("panic", regs);
|
PANIC_WITH_REGS("panic", regs);
|
||||||
return regs; /* To keep the compiler happy */
|
return regs; /* To keep the compiler happy */
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user