API: Use stack pointer as API signature search hint in the glue layer.
De-hardcode range in RAM we search for the API signature. Instead use the stack
pointer as a hint to narrow down the range in which the signature could reside
(it is malloc'ed on the U-Boot heap, and is hoped to remain in some proximity
from stack area). Adjust PowerPC code in API demo to the new scheme.
Signed-off-by: Rafal Czubak <rcz@semihalf.com>
Signed-off-by: Rafal Jaworowski <raj@semihalf.com>
diff --git a/api_examples/crt0.S b/api_examples/crt0.S
index 8d4f706..3129a07 100644
--- a/api_examples/crt0.S
+++ b/api_examples/crt0.S
@@ -29,6 +29,9 @@
.globl _start
_start:
+ lis %r11, search_hint@ha
+ addi %r11, %r11, search_hint@l
+ stw %r1, 0(%r11)
b main
@@ -39,12 +42,15 @@
lwz %r11, 0(%r11)
mtctr %r11
bctr
-
+#else
+#error No support for this arch!
+#endif
.globl syscall_ptr
syscall_ptr:
.align 4
.long 0
-#else
-#error No support for this arch!
-#endif
+
+ .globl search_hint
+search_hint:
+ .long 0