aboutsummaryrefslogtreecommitdiff
path: root/slof/entry.S
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2015-09-15 10:36:21 +0200
committerAlexey Kardashevskiy <aik@ozlabs.ru>2015-09-17 11:45:32 +1000
commit882bbc2734b44d53cd0910cf6474d6833652e706 (patch)
treeed65df2fab61ab29565e5d7c27e626c5fe1edc1a /slof/entry.S
parent811277ac91f674a9273e2b529791e9b75350f3e8 (diff)
downloadSLOF-882bbc2734b44d53cd0910cf6474d6833652e706.zip
SLOF-882bbc2734b44d53cd0910cf6474d6833652e706.tar.gz
SLOF-882bbc2734b44d53cd0910cf6474d6833652e706.tar.bz2
slof: Change call_c() function to a proper assembler function
Using inline assembly for the call_c() function does not work properly: Recent versions of the GCC compiler save some registers to negative offsets on the stack before executing the inline assembler code (to the so-called "red zone", which is OK according to the ABI), since the compiler does not know that this assembler code jumps to another function. However that other function might also put some values on the stack, which can destroy the saved values, causing weird effects or crashes. To be on the save side, move the jump code to a proper assembler file instead, so we do not have to make any bogus assumptions for the inline assembly anymore. This fixes the issue with "Cannot open file : fbuffer.fs" etc. messages that occured with GCC versions >= 4.9 Signed-off-by: Thomas Huth <thuth@redhat.com> Acked-by: Segher Boessenkool <segher@kernel.crashing.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'slof/entry.S')
-rw-r--r--slof/entry.S9
1 files changed, 9 insertions, 0 deletions
diff --git a/slof/entry.S b/slof/entry.S
index dcff57b..d3d29f8 100644
--- a/slof/entry.S
+++ b/slof/entry.S
@@ -207,4 +207,13 @@ call_client:
li 3, -1 # client app return
blr
+
+ # Call another function via pointer in r6
+ # (arguments can be provided in r3 to r5)
+ # Destination function should jump back to lr
+C_ENTRY(call_c)
+ mtctr r6
+ bctr
+
+
.lcomm the_system_stack, STACKSIZE, 16