diff options
author | Thomas Huth <thuth@redhat.com> | 2015-09-15 10:36:21 +0200 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2015-09-17 11:45:32 +1000 |
commit | 882bbc2734b44d53cd0910cf6474d6833652e706 (patch) | |
tree | ed65df2fab61ab29565e5d7c27e626c5fe1edc1a /slof/entry.S | |
parent | 811277ac91f674a9273e2b529791e9b75350f3e8 (diff) | |
download | SLOF-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.S | 9 |
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 |