summaryrefslogtreecommitdiffstats
path: root/sys/mips/cavium
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2011-10-04 17:49:19 +0000
committermarcel <marcel@FreeBSD.org>2011-10-04 17:49:19 +0000
commit0e47b3099e941dd8d4d46ad6e6865cde72e064bf (patch)
tree001e84e6c6bdc1073227116381020901792fb506 /sys/mips/cavium
parent661ede82860570b8530e911f9fc20086c5cc2938 (diff)
downloadFreeBSD-src-0e47b3099e941dd8d4d46ad6e6865cde72e064bf.zip
FreeBSD-src-0e47b3099e941dd8d4d46ad6e6865cde72e064bf.tar.gz
Partially revert r224661:
octeon_ap_boot is not a bitmask. It holds the CPU Id of the AP currently being started. As such there's no need to make it a 64-bit integral and we're not limited to 64 CPUs. Reported by: jmallet Obtained from: Andre Duane
Diffstat (limited to 'sys/mips/cavium')
-rw-r--r--sys/mips/cavium/asm_octeon.S4
-rw-r--r--sys/mips/cavium/octeon_mp.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/sys/mips/cavium/asm_octeon.S b/sys/mips/cavium/asm_octeon.S
index 1ef5083..94ac875 100644
--- a/sys/mips/cavium/asm_octeon.S
+++ b/sys/mips/cavium/asm_octeon.S
@@ -50,12 +50,12 @@ LEAF(octeon_ap_wait)
jal platform_processor_id
nop
-1: lld t0, octeon_ap_boot
+1: ll t0, octeon_ap_boot
bne v0, t0, 1b
nop
move t0, zero
- scd t0, octeon_ap_boot
+ sc t0, octeon_ap_boot
beqz t0, 1b
nop
diff --git a/sys/mips/cavium/octeon_mp.c b/sys/mips/cavium/octeon_mp.c
index 2bc268e..5cd73e8 100644
--- a/sys/mips/cavium/octeon_mp.c
+++ b/sys/mips/cavium/octeon_mp.c
@@ -46,8 +46,7 @@ __FBSDID("$FreeBSD$");
/* XXX */
extern cvmx_bootinfo_t *octeon_bootinfo;
-/* NOTE: this 64-bit mask (and many others) limits MAXCPU to 64 */
-uint64_t octeon_ap_boot = ~0ULL;
+unsigned octeon_ap_boot = ~0;
void
platform_ipi_send(int cpuid)
@@ -139,11 +138,11 @@ platform_start_ap(int cpuid)
DELAY(2000); /* Give it a moment to start */
}
- if (atomic_cmpset_64(&octeon_ap_boot, ~0, cpuid) == 0)
+ if (atomic_cmpset_32(&octeon_ap_boot, ~0, cpuid) == 0)
return (-1);
for (;;) {
DELAY(1000);
- if (atomic_cmpset_64(&octeon_ap_boot, 0, ~0) != 0)
+ if (atomic_cmpset_32(&octeon_ap_boot, 0, ~0) != 0)
return (0);
printf("Waiting for cpu%d to start\n", cpuid);
}
OpenPOWER on IntegriCloud