Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __ASM_UM_ARCHRANDOM_H__
0003 #define __ASM_UM_ARCHRANDOM_H__
0004 
0005 #include <linux/types.h>
0006 
0007 /* This is from <os.h>, but better not to #include that in a global header here. */
0008 ssize_t os_getrandom(void *buf, size_t len, unsigned int flags);
0009 
0010 static inline size_t __must_check arch_get_random_longs(unsigned long *v, size_t max_longs)
0011 {
0012     ssize_t ret;
0013 
0014     ret = os_getrandom(v, max_longs * sizeof(*v), 0);
0015     if (ret < 0)
0016         return 0;
0017     return ret / sizeof(*v);
0018 }
0019 
0020 static inline size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
0021 {
0022     return 0;
0023 }
0024 
0025 #endif