34,6 → 34,7 |
*/ |
|
#include <smp/smp.h> |
#include <smp/ipi.h> |
#include <genarch/ofw/ofw_tree.h> |
#include <cpu.h> |
#include <arch/cpu.h> |
47,6 → 48,7 |
#include <print.h> |
#include <arch/sun4v/hypercall.h> |
#include <arch/sun4v/md.h> |
#include <arch/sun4v/ipi.h> |
#include <time/delay.h> |
|
#define CPU_STATE_RUNNING 2 |
72,6 → 74,7 |
/** Wake application processors up. */ |
void kmp(void *arg) |
{ |
#if 1 |
(void) arg; |
|
uint64_t myid; |
111,7 → 114,67 |
") timed out\n", __func__, i); |
|
} |
#else |
|
asm volatile ( |
"setx temp_cpu_mondo_handler, %g4, %g6 \n" |
//"setx 0x80246ad8, %g4, %g7 \n" |
"setx 0x80200f80, %g4, %g7 \n" |
|
"ldx [%g6], %g4 \n" |
"stxa %g4, [%g7] 0x14 \n" |
"membar #Sync \n" |
|
"add %g7, 0x8, %g7 \n" |
"ldx [%g6 + 0x8], %g4 \n" |
"stxa %g4, [%g7] 0x14 \n" |
"membar #Sync \n" |
|
"add %g7, 0x8, %g7 \n" |
"ldx [%g6 + 0x10], %g4 \n" |
"stxa %g4, [%g7] 0x14 \n" |
"membar #Sync \n" |
|
"add %g7, 0x8, %g7 \n" |
"ldx [%g6 + 0x18], %g4 \n" |
"stxa %g4, [%g7] 0x14 \n" |
"membar #Sync \n" |
|
"add %g7, 0x8, %g7 \n" |
"ldx [%g6 + 0x20], %g4 \n" |
"stxa %g4, [%g7] 0x14 \n" |
"membar #Sync \n" |
|
"add %g7, 0x8, %g7 \n" |
"ldx [%g6 + 0x28], %g4 \n" |
"stxa %g4, [%g7] 0x14 \n" |
"membar #Sync \n" |
|
"add %g7, 0x8, %g7 \n" |
"ldx [%g6 + 0x30], %g4 \n" |
"stxa %g4, [%g7] 0x14 \n" |
"membar #Sync \n" |
|
"add %g7, 0x8, %g7 \n" |
"ldx [%g6 + 0x38], %g4 \n" |
"stxa %g4, [%g7] 0x14 \n" |
"membar #Sync \n" |
|
"add %g7, 0x8, %g7 \n" |
"ldx [%g6 + 0x40], %g4 \n" |
"stxa %g4, [%g7] 0x14 \n" |
"membar #Sync \n" |
|
"flush %i7" |
|
); |
delay(1000); |
printf("Result: %d\n", ipi_unicast_to((void (*)(void)) 1234, 1)); |
if (waitq_sleep_timeout(&ap_completion_wq, 10000000, SYNCH_FLAGS_NONE) == |
ESYNCH_TIMEOUT) |
printf("%s: waiting for processor (cpuid = %" PRIu32 |
") timed out\n", __func__, 1); |
#endif |
} |
|
/** @} |