Rev 4614 | Rev 4663 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4614 | Rev 4638 | ||
|---|---|---|---|
| Line 32... | Line 32... | ||
| 32 | */ |
32 | */ |
| 33 | /** @file |
33 | /** @file |
| 34 | */ |
34 | */ |
| 35 | 35 | ||
| 36 | #include <smp/smp.h> |
36 | #include <smp/smp.h> |
| - | 37 | #include <smp/ipi.h> |
|
| 37 | #include <genarch/ofw/ofw_tree.h> |
38 | #include <genarch/ofw/ofw_tree.h> |
| 38 | #include <cpu.h> |
39 | #include <cpu.h> |
| 39 | #include <arch/cpu.h> |
40 | #include <arch/cpu.h> |
| 40 | #include <arch/boot/boot.h> |
41 | #include <arch/boot/boot.h> |
| 41 | #include <arch.h> |
42 | #include <arch.h> |
| Line 45... | Line 46... | ||
| 45 | #include <synch/synch.h> |
46 | #include <synch/synch.h> |
| 46 | #include <synch/waitq.h> |
47 | #include <synch/waitq.h> |
| 47 | #include <print.h> |
48 | #include <print.h> |
| 48 | #include <arch/sun4v/hypercall.h> |
49 | #include <arch/sun4v/hypercall.h> |
| 49 | #include <arch/sun4v/md.h> |
50 | #include <arch/sun4v/md.h> |
| - | 51 | #include <arch/sun4v/ipi.h> |
|
| 50 | #include <time/delay.h> |
52 | #include <time/delay.h> |
| 51 | 53 | ||
| 52 | #define CPU_STATE_RUNNING 2 |
54 | #define CPU_STATE_RUNNING 2 |
| 53 | 55 | ||
| 54 | extern void kernel_image_start(void); |
56 | extern void kernel_image_start(void); |
| Line 70... | Line 72... | ||
| 70 | 72 | ||
| 71 | 73 | ||
| 72 | /** Wake application processors up. */ |
74 | /** Wake application processors up. */ |
| 73 | void kmp(void *arg) |
75 | void kmp(void *arg) |
| 74 | { |
76 | { |
| - | 77 | #if 1 |
|
| 75 | (void) arg; |
78 | (void) arg; |
| 76 | 79 | ||
| 77 | uint64_t myid; |
80 | uint64_t myid; |
| 78 | __hypercall_fast_ret1(0, 0, 0, 0, 0, CPU_MYID, &myid); |
81 | __hypercall_fast_ret1(0, 0, 0, 0, 0, CPU_MYID, &myid); |
| 79 | 82 | ||
| Line 109... | Line 112... | ||
| 109 | ESYNCH_TIMEOUT) |
112 | ESYNCH_TIMEOUT) |
| 110 | printf("%s: waiting for processor (cpuid = %" PRIu32 |
113 | printf("%s: waiting for processor (cpuid = %" PRIu32 |
| 111 | ") timed out\n", __func__, i); |
114 | ") timed out\n", __func__, i); |
| 112 | 115 | ||
| 113 | } |
116 | } |
| - | 117 | #else |
|
| 114 | 118 | ||
| - | 119 | asm volatile ( |
|
| - | 120 | "setx temp_cpu_mondo_handler, %g4, %g6 \n" |
|
| - | 121 | //"setx 0x80246ad8, %g4, %g7 \n" |
|
| - | 122 | "setx 0x80200f80, %g4, %g7 \n" |
|
| - | 123 | ||
| - | 124 | "ldx [%g6], %g4 \n" |
|
| - | 125 | "stxa %g4, [%g7] 0x14 \n" |
|
| - | 126 | "membar #Sync \n" |
|
| - | 127 | ||
| - | 128 | "add %g7, 0x8, %g7 \n" |
|
| - | 129 | "ldx [%g6 + 0x8], %g4 \n" |
|
| - | 130 | "stxa %g4, [%g7] 0x14 \n" |
|
| - | 131 | "membar #Sync \n" |
|
| - | 132 | ||
| - | 133 | "add %g7, 0x8, %g7 \n" |
|
| - | 134 | "ldx [%g6 + 0x10], %g4 \n" |
|
| - | 135 | "stxa %g4, [%g7] 0x14 \n" |
|
| - | 136 | "membar #Sync \n" |
|
| - | 137 | ||
| - | 138 | "add %g7, 0x8, %g7 \n" |
|
| - | 139 | "ldx [%g6 + 0x18], %g4 \n" |
|
| - | 140 | "stxa %g4, [%g7] 0x14 \n" |
|
| - | 141 | "membar #Sync \n" |
|
| - | 142 | ||
| - | 143 | "add %g7, 0x8, %g7 \n" |
|
| - | 144 | "ldx [%g6 + 0x20], %g4 \n" |
|
| - | 145 | "stxa %g4, [%g7] 0x14 \n" |
|
| - | 146 | "membar #Sync \n" |
|
| - | 147 | ||
| - | 148 | "add %g7, 0x8, %g7 \n" |
|
| - | 149 | "ldx [%g6 + 0x28], %g4 \n" |
|
| - | 150 | "stxa %g4, [%g7] 0x14 \n" |
|
| - | 151 | "membar #Sync \n" |
|
| - | 152 | ||
| - | 153 | "add %g7, 0x8, %g7 \n" |
|
| - | 154 | "ldx [%g6 + 0x30], %g4 \n" |
|
| - | 155 | "stxa %g4, [%g7] 0x14 \n" |
|
| - | 156 | "membar #Sync \n" |
|
| - | 157 | ||
| - | 158 | "add %g7, 0x8, %g7 \n" |
|
| - | 159 | "ldx [%g6 + 0x38], %g4 \n" |
|
| - | 160 | "stxa %g4, [%g7] 0x14 \n" |
|
| - | 161 | "membar #Sync \n" |
|
| - | 162 | ||
| - | 163 | "add %g7, 0x8, %g7 \n" |
|
| - | 164 | "ldx [%g6 + 0x40], %g4 \n" |
|
| - | 165 | "stxa %g4, [%g7] 0x14 \n" |
|
| - | 166 | "membar #Sync \n" |
|
| - | 167 | ||
| - | 168 | "flush %i7" |
|
| - | 169 | ||
| - | 170 | ); |
|
| - | 171 | delay(1000); |
|
| - | 172 | printf("Result: %d\n", ipi_unicast_to((void (*)(void)) 1234, 1)); |
|
| - | 173 | if (waitq_sleep_timeout(&ap_completion_wq, 10000000, SYNCH_FLAGS_NONE) == |
|
| - | 174 | ESYNCH_TIMEOUT) |
|
| - | 175 | printf("%s: waiting for processor (cpuid = %" PRIu32 |
|
| - | 176 | ") timed out\n", __func__, 1); |
|
| - | 177 | #endif |
|
| 115 | } |
178 | } |
| 116 | 179 | ||
| 117 | /** @} |
180 | /** @} |
| 118 | */ |
181 | */ |