[OpenBIOS] [PATCH 5/8] SPARC64: move client interface stack inline to the new Forth context stack
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Sun Nov 22 19:38:41 CET 2015
Rather than having a separate OpenBIOS stack for client interface calls, reuse
the Forth stack by reserving 8K extra beneath the CPU save state area and
using that instead.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
openbios-devel/arch/sparc64/call-client.S | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/openbios-devel/arch/sparc64/call-client.S b/openbios-devel/arch/sparc64/call-client.S
index bad8aa0..66e0809 100644
--- a/openbios-devel/arch/sparc64/call-client.S
+++ b/openbios-devel/arch/sparc64/call-client.S
@@ -148,9 +148,6 @@ restore_cpu_window_##type: \
.data
.align 8
- .skip 16384
-openbios_stack:
-
client_stack:
.xword 0
client_tba:
@@ -200,8 +197,15 @@ sparc64_of_client_interface:
SAVE_WINDOW_STATE(cif)
- /* Move to OpenBIOS stack */
- setx openbios_stack - 2047 - 192, %g6, %g7
+ /* Move to OpenBIOS context stack */
+ setx _fcstack_ptr, %g6, %g7
+ ldx [%g7], %g6
+ setx 0x2000, %g4, %g5
+ sub %g6, %g5, %g6
+ stx %g6, [%g7]
+
+ setx - 2047 - 192, %g6, %g7
+ add %g1, %g7, %g7
mov %g7, %sp
/* Call client inteface */
@@ -211,6 +215,9 @@ sparc64_of_client_interface:
/* Restore windows */
setx _fcstack_ptr, %g6, %g7
ldx [%g7], %g1
+ setx 0x2000, %g4, %g5
+ add %g1, %g5, %g1
+ stx %g1, [%g7]
/* Return value */
stx %o0, [%g1 + 0x30]
--
1.7.10.4
More information about the OpenBIOS
mailing list