diff options
author | Robin Getz <robin.getz@analog.com> | 2007-10-29 06:14:15 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-10-29 06:14:15 -0400 |
commit | aa770aa790f3a5f3ff568388d02aea2ef78773ec (patch) | |
tree | c100fc10a4cdbd9bc0104846795babcad915dd71 /arch | |
parent | 7728ec33faf88605fb871b9b0ecf8e45d4359678 (diff) |
Blackfin arch: Fix random crash issue found by Michael.
This is fixes a problem where we could jump to the wrong address. By
doing a "p0 = reti; jump (p0)". If a different, higher level interrupt
came in, just before, rather than returning to the calling function, we
would return to a random place in the kernel.
This very elegant fix from Bernd grabs the return location off the
stack, and places it into P0, so when we do a return, it goes to the
correct place.
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/blackfin/kernel/entry.S | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/blackfin/kernel/entry.S b/arch/blackfin/kernel/entry.S index 65c5ba4260b..65f4e67a65c 100644 --- a/arch/blackfin/kernel/entry.S +++ b/arch/blackfin/kernel/entry.S | |||
@@ -54,9 +54,11 @@ ENTRY(_ret_from_fork) | |||
54 | [sp + PT_IPEND] = r0; | 54 | [sp + PT_IPEND] = r0; |
55 | /* do a 'fake' RTI by jumping to [RETI] | 55 | /* do a 'fake' RTI by jumping to [RETI] |
56 | * to avoid clearing supervisor mode in child | 56 | * to avoid clearing supervisor mode in child |
57 | */ | 57 | */ |
58 | r0 = [sp + PT_PC]; | ||
59 | [sp + PT_P0] = r0; | ||
60 | |||
58 | RESTORE_ALL_SYS | 61 | RESTORE_ALL_SYS |
59 | p0 = reti; | ||
60 | jump (p0); | 62 | jump (p0); |
61 | ENDPROC(_ret_from_fork) | 63 | ENDPROC(_ret_from_fork) |
62 | 64 | ||