This was implemented previously in i386/amd64 (r177853) and sparc64 (r223228).
The original log message was:
Replace function _umtx_op with _umtx_op_err, the later function directly
returns errno, because errno can be mucked by user's signal handler and
most of pthread api heavily depends on errno to be correct, this change
should improve stability of the thread library.
This version of my patch does additional cleanup that might not be necessary. i386/amd64 and sparc64 don't check for this. It's possible (but I haven't figured out how to prove) that the contract with the kernel means that r3 will always be 0 on return to userspace for the non error condition, but since the same register (along with r4) is also used for aux returns as per cpu_set_syscall_retval(), I figured better safe than sorry. If that's not applicable to _umtx_op (i.e. if those never use the aux return stuff), I can take that back out and just blr after the sc.