Skip to content

Commit 19fc1ee

Browse files
fkokosinskinashif
authored andcommitted
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 <[email protected]>
1 parent ef87d48 commit 19fc1ee

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

subsys/random/rand32_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
static atomic_val_t _rand32_counter;
3030

31-
#define _RAND32_INC 1000000013U
31+
#define _RAND32_INC 1000000003U
3232

3333
/**
3434
*
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
tests:
22
kernel.memory_protection.stack_random:
33
arch_exclude: posix
4-
platform_exclude: qemu_riscv32
54
tags: kernel memory_protection

0 commit comments

Comments
 (0)