mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-02 03:52:26 +00:00
Replace the existing Apache 2.0 boilerplate header with an SPDX tag throughout the zephyr code tree. This patch was generated via a script run over the master branch. Also updated doc/porting/application.rst that had a dependency on line numbers in a literal include. Manually updated subsys/logging/sys_log.c that had a malformed header in the original file. Also cleanup several cases that already had a SPDX tag and we either got a duplicate or missed updating. Jira: ZEP-1457 Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c Signed-off-by: David B. Kinder <david.b.kinder@intel.com> Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
36 lines
864 B
C
36 lines
864 B
C
/*
|
|
* Copyright (c) 2013-2014 Wind River Systems, Inc.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/**
|
|
* @file
|
|
* @brief Non-random number generator based on x86 CPU timestamp
|
|
*
|
|
* This module provides a non-random implementation of sys_rand32_get(), which
|
|
* is not meant to be used in a final product as a truly random number
|
|
* generator. It was provided to allow testing on a platform that does not (yet)
|
|
* provide a random number generator.
|
|
*/
|
|
|
|
#include <kernel.h>
|
|
#include <arch/cpu.h>
|
|
#include <drivers/rand32.h>
|
|
|
|
/**
|
|
*
|
|
* @brief Get a 32 bit random number
|
|
*
|
|
* The non-random number generator returns values that are based off the
|
|
* CPU's timestamp counter, which means that successive calls will normally
|
|
* display ever-increasing values.
|
|
*
|
|
* @return a 32-bit number
|
|
*/
|
|
|
|
uint32_t sys_rand32_get(void)
|
|
{
|
|
return _do_read_cpu_timestamp32();
|
|
}
|