[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v2 4/5] lib/syscall_shim: Provide uk_vsyscall(), uk_vsyscall_r()



Reviewed-by: Gaulthier Gain <gaulthier.gain@xxxxxxxxx>

> On 3 Apr 2020, at 18:29, Simon Kuenzer <simon.kuenzer@xxxxxxxxx> wrote:
> 
> Provide a variant to the general and raw system call function
> uk_syscall() and uk_syscall_r() that accepts a va_list argument instead:
> 
>    long uk_vsyscall(long n, va_list arg);
>    long uk_vsyscall_r(long n, va_list arg);
> 
> Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
> ---
> lib/syscall_shim/include/uk/syscall.h  |  3 +++
> lib/syscall_shim/uk_syscall.c.in_end   | 12 ++++++++++++
> lib/syscall_shim/uk_syscall_r.c.in_end | 12 ++++++++++++
> 3 files changed, 27 insertions(+)
> 
> diff --git a/lib/syscall_shim/include/uk/syscall.h 
> b/lib/syscall_shim/include/uk/syscall.h
> index aafe20a7..dc7bc7ef 100644
> --- a/lib/syscall_shim/include/uk/syscall.h
> +++ b/lib/syscall_shim/include/uk/syscall.h
> @@ -41,6 +41,7 @@
> #include <uk/essentials.h>
> #include <uk/errptr.h>
> #include <errno.h>
> +#include <stdarg.h>
> #include <uk/print.h>
> 
> /*
> @@ -288,6 +289,7 @@ typedef long uk_syscall_arg_t;
> 
> /* System call, returns -1 and sets errno on errors */
> long uk_syscall(long n, ...);
> +long uk_vsyscall(long n, va_list arg);
> 
> /*
>  * Use this variant instead of `uk_syscall()` whenever the system call number
> @@ -299,6 +301,7 @@ long uk_syscall(long n, ...);
> 
> /* Raw system call, returns negative codes on errors */
> long uk_syscall_r(long n, ...);
> +long uk_vsyscall_r(long n, va_list arg);
> 
> /*
>  * Use this variant instead of `uk_syscall_r()` whenever the system call 
> number
> diff --git a/lib/syscall_shim/uk_syscall.c.in_end 
> b/lib/syscall_shim/uk_syscall.c.in_end
> index 79a8b7fd..8a5f8e0b 100644
> --- a/lib/syscall_shim/uk_syscall.c.in_end
> +++ b/lib/syscall_shim/uk_syscall.c.in_end
> @@ -13,3 +13,15 @@ long uk_syscall(long n, ...)
>       va_end(ap);
>       return __uk_syscall(n,a,b,c,d,e,f);
> }
> +
> +long uk_vsyscall(long n, va_list arg)
> +{
> +     long a,b,c,d,e,f;
> +     a=va_arg(arg, long);
> +     b=va_arg(arg, long);
> +     c=va_arg(arg, long);
> +     d=va_arg(arg, long);
> +     e=va_arg(arg, long);
> +     f=va_arg(arg, long);
> +     return __uk_syscall(n,a,b,c,d,e,f);
> +}
> diff --git a/lib/syscall_shim/uk_syscall_r.c.in_end 
> b/lib/syscall_shim/uk_syscall_r.c.in_end
> index ee8a5689..ae74716e 100644
> --- a/lib/syscall_shim/uk_syscall_r.c.in_end
> +++ b/lib/syscall_shim/uk_syscall_r.c.in_end
> @@ -14,6 +14,18 @@ long uk_syscall_r(long n, ...)
>       return __uk_syscall_r(n,a,b,c,d,e,f);
> }
> 
> +long uk_vsyscall_r(long n, va_list arg)
> +{
> +     long a,b,c,d,e,f;
> +     a=va_arg(arg, long);
> +     b=va_arg(arg, long);
> +     c=va_arg(arg, long);
> +     d=va_arg(arg, long);
> +     e=va_arg(arg, long);
> +     f=va_arg(arg, long);
> +     return __uk_syscall_r(n,a,b,c,d,e,f);
> +}
> +
> #if CONFIG_LIBSYSCALL_SHIM_HANDLER
> #include <uk/plat/syscall.h>
> #include <uk/assert.h>
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> Minios-devel mailing list
> Minios-devel@xxxxxxxxxxxxxxxxxxxx
> https://lists.xenproject.org/mailman/listinfo/minios-devel


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.