When a C program calls an external routine under z/OS there a specific linkage used depending on the instructions used to call and return from the external routine.
Use Case - 1
Using the standard Branch and Link sequence, GPR14 has the return to address, GPR15 has the entry point address of the routine being called, GPR13 contains the address of a 72 byte register save area that is used to save GPR14, GPR15, GPR0, GPR1, GPR2, GPR3, GPR4, GPR5, GPR6, GPR7, GPR8, GPR9, GPR10, GPR11 AND GPR12, the first 12 bytes of the register save area contain, a 4 byte value that can have multiple meanings, a backward register save area pointer and a forward register save area pointer. It is the responsibility of the called program to save the callers registers in the passed register save area and to acquire a new register save area for its use and load the address of the gotten register save area into r13.
To return to the calling program, the executing program restores, gpr13 and gpr14, gpr15, gpr0-gpr12 from the register save area and then branches to the address in gpr14, registers gpr0 and gpr1 are not restored but can be used to return values to the calling program.
Use Case - 2 Should the called routing opt to use the branch and stack instruction at entry, the callers registers are stored in a linkage stack entry. It is the called programs responsibility to acquire a new registers save area the and load the address of the gotten register save area into r13. On return the called program issues a PR (program return instruction) this restores the callers gpr14, gpr15 and gpr2-gpr13, gpr0 and gpr1 are not restored but can be used to return values to the calling program. The linkage stack entry is freed.
In both use cases above, the the entry and exit linkages differ depending on whether or not the called program is executing as a non-reentrant or reentrant program.
So getting back to the the question that I asked, under z/Linux if a C program were to call an external routine what would the entry and exit linkages look like.
Thank you for any information you might choose to share.
JD