Commit c31e0d58 authored by Dan Ellis's avatar Dan Ellis
Browse files

Improved abort handling

Detail:
  * One check for 26-bit mode wan't being made, leading to the runtime reporting
    'Uncaught trap:' when a trap should have been catching the abort.  This
    prevented signal handlers from trapping some aborts.
  * When an abort was occuring in SVC mode, the stack wasn't being flattened,
    resulting in all sorts of nasty things when you tried to carry on from a
    signal handler (probably the main reason why you ever see 'No stack for trap
    handler'). SVC and undefined stacks are now flattened.  Further work should
    be done to restore the state of the OS after an abort, but this probably
    requires a new OS call to tidy itself up adequately.
Admin:
  Built 26-bit versions of the library with new 32-bit compatible entry points and checked abort handling with both sharedclibrary and ansilib.

Version 5.22. Tagged as 'RISC_OSLib-5_22'
parent 0bd39858
......@@ -11,14 +11,14 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.21"
Module_Version SETA 521
Module_MajorVersion SETS "5.22"
Module_Version SETA 522
Module_MinorVersion SETS ""
Module_Date SETS "08 Nov 2000"
Module_ApplicationDate2 SETS "08-Nov-00"
Module_ApplicationDate4 SETS "08-Nov-2000"
Module_Date SETS "20 Nov 2000"
Module_ApplicationDate2 SETS "20-Nov-00"
Module_ApplicationDate4 SETS "20-Nov-2000"
Module_ComponentName SETS "RISC_OSLib"
Module_ComponentPath SETS "RiscOS/Sources/Lib/RISC_OSLib"
Module_FullVersion SETS "5.21"
Module_HelpVersion SETS "5.21 (08 Nov 2000)"
Module_FullVersion SETS "5.22"
Module_HelpVersion SETS "5.22 (20 Nov 2000)"
END
/* (5.21)
/* (5.22)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 5.21
#define Module_MajorVersion_CMHG 5.22
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 08 Nov 2000
#define Module_Date_CMHG 20 Nov 2000
#define Module_MajorVersion "5.21"
#define Module_Version 521
#define Module_MajorVersion "5.22"
#define Module_Version 522
#define Module_MinorVersion ""
#define Module_Date "08 Nov 2000"
#define Module_Date "20 Nov 2000"
#define Module_ApplicationDate2 "08-Nov-00"
#define Module_ApplicationDate4 "08-Nov-2000"
#define Module_ApplicationDate2 "20-Nov-00"
#define Module_ApplicationDate4 "20-Nov-2000"
#define Module_ComponentName "RISC_OSLib"
#define Module_ComponentPath "RiscOS/Sources/Lib/RISC_OSLib"
#define Module_FullVersion "5.21"
#define Module_HelpVersion "5.21 (08 Nov 2000)"
#define Module_FullVersion "5.22"
#define Module_HelpVersion "5.22 (20 Nov 2000)"
......@@ -915,15 +915,25 @@ Aborted Keep
STR r1, [r6, #pc*4] ; PC as user R14
STR r2, [r6, #r0*4]
STREQ r3, [r6, #r12*4]
BEQ AbortFindHandler
BEQ AbortFlattenStacks
LDR r4, [r12, #O_svcStack]
SUB r1, r4, sp
CMP r1, #3 * 4
BCC AbortFindHandler
BCC AbortFlattenStacks
LDMEA r4, {r1, r2, r3}
ADD r4, r6, #10 * 4
STMIA r4, {r1, r2, r3}
; should really fall through to error handler and let the OS clean up,
; but this is a lot better than it was!
AbortFlattenStacks
MRS r4, CPSR ; MRS and MSR here will be NOPs on
ORR r1, r4, #PSR32UNDMode ; ARM2/3, so we'll end up setting
MSR CPSR_c, r1 ; R13_svc twice; just make sure
LDR sp, [r12, #O_undStack] ; we set the real value last.
MSR CPSR_c, r4
LDR sp, [r12, #O_svcStack]
AbortFindHandler Keep
; We can only call an abort handler if we had a stack at the
; time of the abort. If not, we have to say 'uncaught trap'.
......@@ -1173,6 +1183,10 @@ FindAndCallHandlers Keep
FCH_NextFrame
[ {CONFIG}=26
BIC r1, r1, #PSRBits
|
MRS v4, CPSR
TST v4, #2_11100
BICEQ r1, r1, #PSRBits
]
LDMIB v6, {v4, v5}
FCH_NextLanguage Keep
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment