[PATCH 2/2] cobalt/arm: document the syscall convention

Jan Kiszka jan.kiszka at siemens.com
Tue May 25 07:58:46 CEST 2021


On 24.05.21 09:32, Philippe Gerum wrote:
> From: Philippe Gerum <rpm at xenomai.org>
> 
> Signed-off-by: Philippe Gerum <rpm at xenomai.org>
> ---
>  .../arm/include/asm/xenomai/uapi/syscall.h    | 31 ++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/syscall.h b/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/syscall.h
> index c079a358c..9146b732a 100644
> --- a/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/syscall.h
> +++ b/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/syscall.h
> @@ -21,9 +21,38 @@
>  #ifndef _COBALT_ARM_ASM_UAPI_SYSCALL_H
>  #define _COBALT_ARM_ASM_UAPI_SYSCALL_H
>  
> +/*
> + * Argument marshalling for Cobalt syscalls:
> + *
> + * r7 := XENO_ARM_SYSCALL
> + * r0 := Cobalt syscall code (sc_cobalt_xx | __COBALT_SYSCALL_BIT)
> + * r1 := first argument
> + * r2 := second argument
> + * ...
> + * r5 := fifth argument
> + *
> + * r0 := <return value>
> + *
> + * This marshalling is common to the I-pipe and Dovetail-based
> + * configurations so that we have a single ABI convention for both,
> + * enabling us to have a single user build which does not depend on
> + * the pipeline type.  With Dovetail, CONFIG_IPIPE_COMPAT is enabled
> + * to allow this.
> + *
> + * __COBALT_SYSCALL_BIT is a generic marker for Cobalt system calls we
> + * use with all CPU architectures in common code, to distinguish them
> + * from native Linux syscalls. For this reason, it must be present in
> + * the Cobalt syscall code register (r0) as well.

Could we please add the reason for why we have this deviation from the
kernel's ABI on ARM? One sentence is likely enough ("it makes things
much faster" or "needed because of limited free bits" or whatever), and
it would be a perfect place to drop it here.

Thanks,
Jan

> + */
> +
>  #define __xn_syscode(__nr)	(__COBALT_SYSCALL_BIT | (__nr))
>  
> -#define XENO_ARM_SYSCALL        0x000F0042	/* carefully chosen... */
> +/*
> + * A carefully choosen ARM-specific local syscall code denoting a
> + * Cobalt syscall, which the interrupt pipeline looks for in order to
> + * route the request to the real-time core via a dedicated handler.
> + */
> +#define XENO_ARM_SYSCALL        0x000F0042
>  
>  #define XENOMAI_SYSARCH_TSCINFO      4
>  
> 

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux



More information about the Xenomai mailing list