[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZszrzRbL-eks6A3I@zx2c4.com>
Date: Mon, 26 Aug 2024 22:55:41 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Adhemerval Zanella <adhemerval.zanella@...aro.org>
Cc: Theodore Ts'o <tytso@....edu>, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-arch@...r.kernel.org,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Eric Biggers <ebiggers@...nel.org>,
Christophe Leroy <christophe.leroy@...roup.eu>
Subject: Re: [PATCH] aarch64: vdso: Wire up getrandom() vDSO implementation
On Mon, Aug 26, 2024 at 06:10:40PM +0000, Adhemerval Zanella wrote:
> +static __always_inline ssize_t getrandom_syscall(void *buffer, size_t len, unsigned int flags)
> +{
> + register long int x8 asm ("x8") = __NR_getrandom;
> + register long int x0 asm ("x0") = (long int) buffer;
> + register long int x1 asm ("x1") = (long int) len;
> + register long int x2 asm ("x2") = (long int) flags;
> +
> + asm ("svc 0" : "=r"(x0) : "r"(x8), "0"(x0), "r"(x1), "r"(x2));
> +
> + return x0;
> +}
More generally, it might be best to follow the format used by
arch/arm64/include/asm/vdso/gettimeofday.h.
Powered by blists - more mailing lists