summaryrefslogtreecommitdiff
path: root/sys/arch/macppc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-10-15 23:23:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-10-15 23:23:52 +0000
commit402af595bcaa120a104360ebebeb3d8f5eac8859 (patch)
tree246ce2dffcd538c7674e8ed19b552cbadd811192 /sys/arch/macppc
parent01ed2ea8940e2739cafb585b7d5f8d8db553c397 (diff)
make random(9) return per-cpu values (by saving the seed in the cpuinfo),
which are uniform for the profclock on each cpu in a SMP system (but using a different seed for each cpu). on all cpus, avoid seeding with a value out of the [0, 2^31-1] range (since that is not stable) ok kettenis drahn
Diffstat (limited to 'sys/arch/macppc')
-rw-r--r--sys/arch/macppc/macppc/cpu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/macppc/macppc/cpu.c b/sys/arch/macppc/macppc/cpu.c
index 1c7e58ea528..d443aa4f15a 100644
--- a/sys/arch/macppc/macppc/cpu.c
+++ b/sys/arch/macppc/macppc/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.58 2008/09/18 03:56:25 drahn Exp $ */
+/* $OpenBSD: cpu.c,v 1.59 2008/10/15 23:23:49 deraadt Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom
@@ -672,6 +672,7 @@ cpu_boot_secondary_processors(void)
ci = &cpu_info[i];
if (ci->ci_cpuid == 0)
continue;
+ ci->ci_randseed = random();
sched_init_cpu(ci);