This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4 12/17] RISC-V: Linux Syscall Interface


On Sat, 13 Jan 2018, Palmer Dabbelt wrote:

> +  if (INTERNAL_SYSCALL_ERROR_P (ret, err))
> +    {
> +      return __syscall_error (ret);
> +    }

Generically, avoid redundant braces when there's only a single statement 
inside "if".

> +# define internal_syscall2(number, err, arg0, arg1)	    		\
> +({ 									\
> +	long int _sys_result;						\
> +									\
> +	{								\
> +	register long int __a7 asm ("a7") = number;			\
> +	register long int __a0 asm ("a0") = (long int) (arg0);		\
> +	register long int __a1 asm ("a1") = (long int) (arg1);		\
> +	__asm__ volatile ( 						\
> +	"scall\n\t" 							\
> +	: "+r" (__a0)							\
> +	: "r" (__a7), "r"(__a1)						\

Missing space before '(' in asm constraint, ans likewise in other such 
syscall macros.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]