When you're trampoline is invoked and the routine to be called returns a structure what do you return to the caller of the trampoline? For S/390 when you are returned a structure, you pass a hidden parameter to the callee which points to an area on the stack it can use to return the data. So I make room on the stack, point (in S/390's case) R2 to it and call the routine. On return that area contains what I'd expect. Now, how do I return this information to my caller (which has passed me a pointer to retval)? I thought I'd move the structure from the stack to the area addressed by retval but, apparently, that's not correct. Do the other architectures simply use retval as the "hidden" parameter so the caller puts the data directly there?

Neale Ferguson

 

Reply via email to