From nobody Sun Sep 1 13:28:00 2024 X-Original-To: dev-commits-src-all@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 4WxXkm71Trz5VD4W; Sun, 01 Sep 2024 13:28:00 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WxXkm6LRhz4Kbq; Sun, 1 Sep 2024 13:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725197280; 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=lO2HsRT02a38qbss9Hn2BfR0krBU/ZviwCfS8s6ZJIA=; b=hxf6MFMvQRiNUFTzvPu6qa6WVR5fpXx8BItTdyrOlO54h2mSRQh/vaK+hOxXlqbpEI4epG PB4F+EEkDleJlryTnCBUpO8CLRr+e2xCFH3r6GZAmPrGnrJ/5Flr+BkDeK2hSJB6sToREQ 152Z7wts5/sIIx96lt4q7XCph2V9YIfCBiWjFSWO/xgethIL9xD2ysDHT4cF0LUctzX2XS BuNzs/b6blva8rE7NP4mqFCtTRV7Wxjwxx2LRonlZjkqWYwQfHfXSflZQlpjoUPIppXHN4 2vZmzpWrUEKTc6WQzfYQKxBfhPnqLIZW5lfuhAvLxWk2YNy2k2b9806dT0HFnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725197280; a=rsa-sha256; cv=none; b=hf89goTcZ/+IU59xtriJK0cKZVcn4RHR2HTqmY30De6Hd4hSwAONeQm9gvTvCgujNEabhf GaSDI0O9gnM+tQKJ3cTkdrZSQDXElad5VkVeDfMXVnTLh910Nz9vNpSg7YbnAIYA7EShMz kO8iPU5C0MNShstBW/qQ2DMUwHWHIC99YZ+I0DjxZ9L9yJichlZzoMiVPtfLtVU2Y6RfbT OsMOGe7p1NR3Zs3zLtrq70eahCBAeXIiov4XFAgDG/P7tj2Dzm4Gon+6z1Yn96ankRamL6 DFkKEBuKcACsQyeuP8Sx6GhiH0zUNC6w+JCsXfGSg69UFx8lrxdyHAoc3m3goQ== 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=1725197280; 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=lO2HsRT02a38qbss9Hn2BfR0krBU/ZviwCfS8s6ZJIA=; b=EWj0LTl8pPOnxlNYYKLZMWW+bDX0UTzLMW40Op37ZAYYR5qqRNJjfh84JAQE4VgHW5rEYt CxHxfBCpU6RujPJifU2yy+Rzt45aa76UowIha6BxCu4xy7y596n/YJRubremHiCay6diuu w54JPL/KCDFgZp721lkXgHxSzHwHPAvRPc1NrcLsPUU9REXHTFLxx9Rhj/Jn8EE8X8DL6i lSQXxx/nxWAj1vpSUV6DPTg/zFroDPQBpooMpcmZ+aW3kU/+LkNkHW6hyqFdfLTPTHmsuw 37xILxVBkmZrPFE++xih0hYBlFwDTYkm7moaH0YB3U+ung/qer2eMFTkeAWu4w== 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 4WxXkm5ybxzW4f; Sun, 1 Sep 2024 13:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 481DS0S4030705; Sun, 1 Sep 2024 13:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 481DS0Ji030702; Sun, 1 Sep 2024 13:28:00 GMT (envelope-from git) Date: Sun, 1 Sep 2024 13:28:00 GMT Message-Id: <202409011328.481DS0Ji030702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: f29e915bc0d2 - main - LinuxKPI: add get_random_u8() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f29e915bc0d216a87f222a208caeb2172c93e4ea Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f29e915bc0d216a87f222a208caeb2172c93e4ea commit f29e915bc0d216a87f222a208caeb2172c93e4ea Author: Bjoern A. Zeeb AuthorDate: 2024-08-27 21:20:09 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-08-31 21:32:11 +0000 LinuxKPI: add get_random_u8() Add a get_random_u8() implementation following the u36 and u64 versions. We'll likely want to macro-ify them in the future and add all the types which makes sense just to be done. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46464 --- 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 808c5bc55974..893ee2b7b728 100644 --- a/sys/compat/linuxkpi/common/include/linux/random.h +++ b/sys/compat/linuxkpi/common/include/linux/random.h @@ -54,6 +54,15 @@ get_random_int(void) return (val); } +static inline uint8_t +get_random_u8(void) +{ + uint8_t val; + + get_random_bytes(&val, sizeof(val)); + return (val); +} + #define get_random_u32() get_random_int() /*