Commit 0e8e4385 authored by Ben Avison's avatar Ben Avison Committed by ROOL
Browse files

Reduce _swi/_swix stack usage

The (previously StrongARM-bracketed) code was overallocating stack space
by 3 words in order to retain compatibility with the now-deleted dynamic
code build variant.

Version 6.13. Tagged as 'RISC_OSLib-6_13'
parent 4ddb0942
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "6.12"
Module_Version SETA 612
Module_MajorVersion SETS "6.13"
Module_Version SETA 613
Module_MinorVersion SETS ""
Module_Date SETS "21 May 2022"
Module_ApplicationDate SETS "21-May-22"
Module_Date SETS "15 Jun 2022"
Module_ApplicationDate SETS "15-Jun-22"
Module_ComponentName SETS "RISC_OSLib"
Module_FullVersion SETS "6.12"
Module_HelpVersion SETS "6.12 (21 May 2022)"
Module_FullVersion SETS "6.13"
Module_HelpVersion SETS "6.13 (15 Jun 2022)"
END
/* (6.12)
/* (6.13)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 6.12
#define Module_MajorVersion_CMHG 6.13
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 21 May 2022
#define Module_Date_CMHG 15 Jun 2022
#define Module_MajorVersion "6.12"
#define Module_Version 612
#define Module_MajorVersion "6.13"
#define Module_Version 613
#define Module_MinorVersion ""
#define Module_Date "21 May 2022"
#define Module_Date "15 Jun 2022"
#define Module_ApplicationDate "21-May-22"
#define Module_ApplicationDate "15-Jun-22"
#define Module_ComponentName "RISC_OSLib"
#define Module_FullVersion "6.12"
#define Module_HelpVersion "6.12 (21 May 2022)"
#define Module_LibraryVersionInfo "6:12"
#define Module_FullVersion "6.13"
#define Module_HelpVersion "6.13 (15 Jun 2022)"
#define Module_LibraryVersionInfo "6:13"
......@@ -28,10 +28,10 @@ DDE SETL {TRUE}
MACRO
$name StoreSWIXFlags
[ {CONFIG}=26
$name STR pc, [sp, #4*4]!
$name STR pc, [sp, #4]!
|
$name MRS lr, CPSR
STR lr, [sp, #4*4]!
STR lr, [sp, #4]!
]
MEND
......@@ -71,7 +71,7 @@ vswix_even_more_tedious
STMDB sp!, {r1, r4-r9, lr} ; save stuff
ADD r14, sp, #8*4 ; r14 -> input args
swix_vswix_common
SUB sp, sp, #5*4 ; so we can use tail code common with dynamic version (and room for regs stash)
SUB sp, sp, #2*4 ; room for regs stash
MOV r12, r0 ; target SWI code
STR fp, [sp] ; stash fp
......@@ -87,7 +87,7 @@ swix_vswix_common
STR r14, [sp, #4] ; stash args ptr
LDR fp, [sp, #0] ; get fp and lr saying something useful in case
LDR lr, [sp, #48] ; SWI aborts or throws an error.
LDR lr, [sp, #(2+7)*4] ; SWI aborts or throws an error.
SWI XOS_CallASWIR12
LDR ip, [sp, #4] ; restore (ip -> args)
B SWIXReturn
......@@ -98,7 +98,7 @@ swix_even_more_tedious
STMDB sp!, {r1, r4-r9, lr} ; save stuff
ADD r14, sp, #8*4 ; r14 -> input args
swi_vswi_common
SUB sp, sp, #5*4 ; so we can use tail code common with dynamic version (and room for regs stash)
SUB sp, sp, #2*4 ; room for regs stash
MOV r12, r0 ; target SWI code
STR fp, [sp] ; stash fp
......@@ -135,7 +135,7 @@ swi_vswi_common
BEQ swi_beyond_a_joke
LDR fp, [sp, #0] ; get fp and lr saying something useful in case
LDR lr, [sp, #48] ; SWI aborts or throws an error.
LDR lr, [sp, #(2+7)*4] ; SWI aborts or throws an error.
SWI XOS_CallASWIR12
LDR ip, [sp, #4] ; restore (ip -> args)
B SWIXReturn
......@@ -143,10 +143,10 @@ swi_vswi_common
swi_beyond_a_joke
;so we have to deal with a return value then
LDR fp, [sp, #0] ; get fp and lr saying something useful in case
LDR lr, [sp, #48] ; SWI aborts or throws an error.
LDR lr, [sp, #(2+7)*4] ; SWI aborts or throws an error.
SWI XOS_CallASWIR12
LDR ip, [sp, #4] ; restore (ip -> args)
StoreSWIXFlags
StoreSWIXFlags ; increments sp by 4
LDR lr, [sp, #1*4]
;right, if R0 is also required as an output param, we'd better sort that first
TST lr,#&80000000
......@@ -230,7 +230,7 @@ SWIReturn2
LDR lr, [sp, #1*4]
B ReturnTail
SWIXReturn
StoreSWIXFlags ; increments sp by 16
StoreSWIXFlags ; increments sp by 4
LDR lr, [sp, #1*4]
BVS VSetReturn
MOVS lr, lr, ASL #1 ; Shift out setting C if R0 to be written, N
......
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