* We need some randomness. Implement a classic Linear Congruential * Generator X_{n+1}=(aX_n+c) mod m. These values are optimized for * m = 2^32, a = 69069 and c = 5. We only return the upper 16 bits * of the random state (in the low bits of our answer) to keep * the maximum randomness. */
| 620 | * the maximum randomness. |
| 621 | */ |
| 622 | static uint32_t |
| 623 | sched_random(void) |
| 624 | { |
| 625 | uint32_t *rndptr; |
| 626 | |
| 627 | rndptr = DPCPU_PTR(randomval); |
| 628 | *rndptr = *rndptr * 69069 + 5; |
| 629 | |
| 630 | return (*rndptr >> 16); |
| 631 | } |
| 632 | |
| 633 | struct cpu_search { |
| 634 | cpuset_t cs_mask; |
no outgoing calls
no test coverage detected