subsys/random: change parameters for timer-based PRNG

PR #36996 disabled running mem_protect/stack_random test on qemu_riscv32
platform because of this test consistently failing on said platform.
This test starts new threads in equal time intervals, and because of
that we get repeating values after performing the modulus operation when
calculating the stack pointer address.

This can be solved by changing the value of the _RAND32_INC constant
that is used to increase the value returned by the timer-based PRNG.

This commit decreases the value of the mentioned constant from
1000000013U to 1000000003U.

Fixes #37006.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
This commit is contained in:
Filip Kokosinski 2021-08-06 14:06:02 +02:00 committed by Anas Nashif
commit 19fc1ee77c
2 changed files with 1 additions and 2 deletions

View file

@ -28,7 +28,7 @@
*/
static atomic_val_t _rand32_counter;
#define _RAND32_INC 1000000013U
#define _RAND32_INC 1000000003U
/**
*

View file

@ -1,5 +1,4 @@
tests:
kernel.memory_protection.stack_random:
arch_exclude: posix
platform_exclude: qemu_riscv32
tags: kernel memory_protection