Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 May 2020 17:52:26 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r361419 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <202005231752.04NHqQRC047117@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: manu
Date: Sat May 23 17:52:25 2020
New Revision: 361419
URL: https://svnweb.freebsd.org/changeset/base/361419

Log:
  linuxkpi: Add prandom_u32_max
  
  This is just a wrapper around arc4random_uniform
  Needed by DRM v5.3
  
  Sponsored-by: The FreeBSD Foundation
  Reviewed by:	cem, hselasky
  Differential Revision:	https://reviews.freebsd.org/D24961

Modified:
  head/sys/compat/linuxkpi/common/include/linux/random.h

Modified: head/sys/compat/linuxkpi/common/include/linux/random.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/random.h	Sat May 23 17:51:06 2020	(r361418)
+++ head/sys/compat/linuxkpi/common/include/linux/random.h	Sat May 23 17:52:25 2020	(r361419)
@@ -62,4 +62,10 @@ get_random_long(void)
 	return (val);
 }
 
+static inline u32
+prandom_u32_max(u32 max)
+{
+	return (arc4random_uniform(max));
+}
+
 #endif /* _LINUX_RANDOM_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005231752.04NHqQRC047117>