ARC: syscalls.h reuse common code

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
ARC: Fix syscall args clobbering

STAR 9000678842

Noam tracked down that sched_setaffinity() was misbehaving because
syscall registers args were clobbered by an interim getpid() function call.

Per man gcc, the register variables need to use tmp variables to ensure
that they are not clobbered.

Before:
	register int __ret __asm__("r0") = getpid();

Now:
	int _tmp0 = getpid();
	register int __ret __asm__("r0") = _tmp0;

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>