[OpenBIOS] [PATCH 3/8] SPARC64: switch client interface over to use new Forth context stack
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Sun Nov 22 19:38:39 CET 2015
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
openbios-devel/arch/sparc64/call-client.S | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/openbios-devel/arch/sparc64/call-client.S b/openbios-devel/arch/sparc64/call-client.S
index 0223168..bad8aa0 100644
--- a/openbios-devel/arch/sparc64/call-client.S
+++ b/openbios-devel/arch/sparc64/call-client.S
@@ -10,7 +10,6 @@
*/
#define SAVE_WINDOW_STATE(type) \
- setx client_window, %g6, %g1; \
rdpr %cwp, %g7; \
stx %g7, [%g1]; \
rdpr %cansave, %g7; \
@@ -85,8 +84,6 @@ save_cpu_window_##type: \
#define RESTORE_WINDOW_STATE(type) \
- setx client_window, %g6, %g1; \
- \
/* Get the number of windows in %g6 */ \
rdpr %ver, %g6; \
and %g6, 0xf, %g6; \
@@ -196,6 +193,11 @@ sparc64_of_client_interface:
stx %sp, [%g7]
/* Save windows */
+ setx _fcstack_ptr, %g6, %g7
+ ldx [%g7], %g1
+ add %g1, -0x510, %g1
+ stx %g1, [%g7]
+
SAVE_WINDOW_STATE(cif)
/* Move to OpenBIOS stack */
@@ -206,12 +208,19 @@ sparc64_of_client_interface:
call of_client_interface
ldx [%g1 + 0x30], %o0
- setx client_window, %g6, %g1
- stx %o0, [%g1 + 0x30]
-
/* Restore windows */
+ setx _fcstack_ptr, %g6, %g7
+ ldx [%g7], %g1
+
+ /* Return value */
+ stx %o0, [%g1 + 0x30]
+
RESTORE_WINDOW_STATE(cif)
-
+
+ add %g1, 0x510, %g1
+ setx _fcstack_ptr, %g6, %g7
+ stx %g1, [%g7]
+
/* Restore stack */
setx client_stack, %g6, %g7
ldx [%g7], %sp
--
1.7.10.4
More information about the OpenBIOS
mailing list