-#define SYSCALL_R(name) \
- .section .text._##name##_r,"ax",@progbits; \
+#define SYSCALL_R(name) SYSCALL_R2(_##name##_r,SYS_##name)
+#define SYSCALL_R_LONG(name) SYSCALL_R2_LONG(_##name##_r,SYS_##name)
+
+#define SYSCALL_R2(name,number) \
+ SYSCALL_R2_BEG(name,number) \
+ SYSCALL_R2_END(name)
+
+
+#define SYSCALL_R2_LONG(name,number) \
+ SYSCALL_R2_BEG(name,number) \
+ lw a3,16(sp); \
+ lw t0,20(sp); \
+ lw t1,24(sp); \
+ SYSCALL_R2_END(name)
+
+#define SYSCALL_R2_BEG(name,number) \
+ .section .text.name,"ax",@progbits; \