From nobody Sun Dec 24 08:23:16 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SyYvT328dz54HB6; Sun, 24 Dec 2023 08:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SyYvT13FLz4YFt; Sun, 24 Dec 2023 08:23:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703406197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2QS8m4ZgCueUrQVksfZqrcYHxrH2LANe4nrZaQ6BPKo=; b=st/rD6DhFGClTPF7VUKaxkFGHjt0E9d/7oGx9oCpiP4emQ7sGt5xBcA7IjyzXhVjt19awV 0pS9r24l//PWhEZNWSZZUc+GsO8vJRZ0tZhVzMGJ1/czc3q/MkqI2cRxTEaOgXa1LVTCZA LR8O3iJ4qY4y4VKCGxfbhI1b5Q3igjKGBW6SENY6XWVdF6Yx/pCxeYSKWxm2CnUxH9bucG BrVnT16q/3MhQw6LKo+qMSbfQT0wvGID4O3GPLtYizOTaeOZ8fBkv8b77IlUVbYNh8Vt3o tXdWO3M/O9+RlR9EsZz3GuUvD9Zu5XFwwiIOWsI+D2y7IQWUkKE2fwXIOZV+sQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703406197; a=rsa-sha256; cv=none; b=iAY0YBEeZHzfWuvND36z9SdRqBohS9tyRZRB43ClXHjAkhOQlnw90GW9COnOGrxu2owuuh p9+5cBKbZSS2ZSHi6RiN3zFsOuHHd6gWb/Iq2njaAX7+JrUGs1OO1YiRwy/6T2O56Au80G nCPGWpZnC9bQ6dFJPMilQ5Gf7+RuFFt9vQYSaYp/4j/k7JEMLD5qiIYXJ2/NS1/3l6/gu6 EzWPuKFGdwwaj9fH8uchg7ALzldMPdUM8v2/9ZTC26DCAsz0oWR+tWVJiFWRXSOSC/6sUe nBG3hPmzlmQKySREGFyLp+PYHxzOJ4LDU0EmUf2jmhmTnlRP2bUr+Y/sxLsOnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703406197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2QS8m4ZgCueUrQVksfZqrcYHxrH2LANe4nrZaQ6BPKo=; b=IzGgJKfuO/vsvywOy0HDnXZ0l8v9ZrkmBVTfP5Ae1BjxObL9BJitF0Sr09bV2SjkDQCKNR MbkFRLJ5Hni9T4wVsKFsjyw1N74NFmR32JuGeA1Vcp5xGRNmZnH1lZAgpBQ8bZxgOF3euT WNR8fMXiYWyOKv8g8OeEqjlj25iBtUay0TuBfmJkdwLPV/PiOey5F8QfcARjGT/0DAipvm 6D4mNgDSDBAdQwFRtOmf3UBeNcXQ4rc+dROlWvllcQJbfDNhQ4796XooFaC1CbR/j6aYQz SSWn3glYktvuBfPNL9t31LaQxuhs6yIKcntpneyiQVY4fUKd+76gtHdDxBnQHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SyYvS6cjzz5Tg; Sun, 24 Dec 2023 08:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BO8NG4G087472; Sun, 24 Dec 2023 08:23:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BO8NGLn087469; Sun, 24 Dec 2023 08:23:16 GMT (envelope-from git) Date: Sun, 24 Dec 2023 08:23:16 GMT Message-Id: <202312240823.3BO8NGLn087469@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Vladimir Kondratyev Subject: git: 7f88d742e578 - main - LinuxKPI: Add get_random_u64() function List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f88d742e578c4cef4e26ce10b9a936e58237964 Auto-Submitted: auto-generated The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=7f88d742e578c4cef4e26ce10b9a936e58237964 commit 7f88d742e578c4cef4e26ce10b9a936e58237964 Author: Vladimir Kondratyev AuthorDate: 2023-12-24 08:20:00 +0000 Commit: Vladimir Kondratyev CommitDate: 2023-12-24 08:20:00 +0000 LinuxKPI: Add get_random_u64() function Sponsored by: Serenity Cyber Security, LLC Reviewed by: manu, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D42816 --- sys/compat/linuxkpi/common/include/linux/random.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/random.h b/sys/compat/linuxkpi/common/include/linux/random.h index 5335cca8251c..e87d4412ea4e 100644 --- a/sys/compat/linuxkpi/common/include/linux/random.h +++ b/sys/compat/linuxkpi/common/include/linux/random.h @@ -87,6 +87,15 @@ get_random_long(void) return (val); } +static inline uint64_t +get_random_u64(void) +{ + uint64_t val; + + get_random_bytes(&val, sizeof(val)); + return (val); +} + static __inline uint32_t prandom_u32(void) {