This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C function parameter passing in R0~R4

Hi!

Is anyone knows what compiler directive to use to force the parameters passed in by the order of R0, R1, R2 and R3(R0 is the first one, and R3 the last)? I found some functions didn't follow this rule(my armcc version is v4.0.0.524).

Best Regards,

Parents
  • Not sure whether the below information is correct. Maybe our ARM ABI expert Mr. Zeusti can clarify this.


    en.wikipedia.org/.../Calling_convention

    * r0 to r3: used to hold argument values passed to a subroutine ... and also hold results returned from a subroutine.

    If the type of value returned is too large to fit in r0 to r3, or whose size cannot be determined statically at compile time, then the caller must allocate space for that value at run time, and pass a pointer to that space in r0.

Reply
  • Not sure whether the below information is correct. Maybe our ARM ABI expert Mr. Zeusti can clarify this.


    en.wikipedia.org/.../Calling_convention

    * r0 to r3: used to hold argument values passed to a subroutine ... and also hold results returned from a subroutine.

    If the type of value returned is too large to fit in r0 to r3, or whose size cannot be determined statically at compile time, then the caller must allocate space for that value at run time, and pass a pointer to that space in r0.

Children
No data