Lines 424-432
powermac_smp_timebase_sync(platform_t plat, u_long tb, int ap)
Link Here
|
424 |
if (ap) { |
424 |
if (ap) { |
425 |
/* APs. Hold off until we get a stable timebase. */ |
425 |
/* APs. Hold off until we get a stable timebase. */ |
426 |
critical_enter(); |
426 |
critical_enter(); |
|
|
427 |
mb(); |
427 |
while (!tb_ready) |
428 |
while (!tb_ready) |
428 |
atomic_thread_fence_seq_cst(); |
429 |
atomic_thread_fence_seq_cst(); |
|
|
430 |
mb(); |
429 |
mttb(tb); |
431 |
mttb(tb); |
|
|
432 |
mb(); |
430 |
atomic_add_int(&cpu_done, 1); |
433 |
atomic_add_int(&cpu_done, 1); |
431 |
while (cpu_done < mp_ncpus) |
434 |
while (cpu_done < mp_ncpus) |
432 |
atomic_thread_fence_seq_cst(); |
435 |
atomic_thread_fence_seq_cst(); |
Lines 438-447
powermac_smp_timebase_sync(platform_t plat, u_long tb, int ap)
Link Here
|
438 |
atomic_set_int(&cpu_done, 0); |
441 |
atomic_set_int(&cpu_done, 0); |
439 |
freeze_timebase(powermac_tb_dev, true); |
442 |
freeze_timebase(powermac_tb_dev, true); |
440 |
tb_ready = true; |
443 |
tb_ready = true; |
|
|
444 |
mb(); |
441 |
mttb(tb); |
445 |
mttb(tb); |
|
|
446 |
mb(); |
442 |
atomic_add_int(&cpu_done, 1); |
447 |
atomic_add_int(&cpu_done, 1); |
|
|
448 |
mb(); |
443 |
while (cpu_done < mp_ncpus) |
449 |
while (cpu_done < mp_ncpus) |
444 |
atomic_thread_fence_seq_cst(); |
450 |
atomic_thread_fence_seq_cst(); |
|
|
451 |
mb(); |
445 |
freeze_timebase(powermac_tb_dev, false); |
452 |
freeze_timebase(powermac_tb_dev, false); |
446 |
/* Reset tb_ready so we can resync at runtime */ |
453 |
/* Reset tb_ready so we can resync at runtime */ |
447 |
tb_ready = false; |
454 |
tb_ready = false; |