#
1843d346 |
|
23-Jul-2018 |
Nick Maniscalco <maniscalco@google.com> |
[kernel] Change rand() to return only non-negative values This particular rand() is used only in tests and the kernel heap. Typical rand() implementations return a value between 0 and RAND_MAX. Prior to this change, rand() could return negative values. Rewrite kernel's rand() to behave like musl's. Remove unused rand_add_entropy function. Add atomic_cmpxchg_u64_relaxed and atomic_store_u64_relaxed, which are used to implement rand(). Tested: Ran "k ut all" and "k thread_tests". ZX-2400 #comment non-negative rand() Change-Id: I8a2d3e006c308f1465e6b85b5f1aa8dca9d776a0
|