Changeset a35b458 in mainline for kernel/arch/sparc64/src/smp
- Timestamp:
- 2018-03-02T20:10:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- kernel/arch/sparc64/src/smp
- Files:
-
- 4 edited
-
sun4u/ipi.c (modified) (7 diffs)
-
sun4u/smp.c (modified) (6 diffs)
-
sun4v/ipi.c (modified) (1 diff)
-
sun4v/smp.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/smp/sun4u/ipi.c
r3061bc1 ra35b458 97 97 * we explicitly disable preemption. 98 98 */ 99 99 100 100 preemption_disable(); 101 101 102 102 status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0); 103 103 if (status & INTR_DISPATCH_STATUS_BUSY) 104 104 panic("Interrupt Dispatch Status busy bit set\n"); 105 105 106 106 assert(!(pstate_read() & PSTATE_IE_BIT)); 107 107 108 108 do { 109 109 set_intr_w_data(func); … … 111 111 (mid << INTR_VEC_DISPATCH_MID_SHIFT) | 112 112 VA_INTR_W_DISPATCH, 0); 113 113 114 114 membar(); 115 115 116 116 do { 117 117 status = asi_u64_read(ASI_INTR_DISPATCH_STATUS, 0); 118 118 } while (status & INTR_DISPATCH_STATUS_BUSY); 119 119 120 120 done = !(status & INTR_DISPATCH_STATUS_NACK); 121 121 if (!done) { … … 128 128 } 129 129 } while (!done); 130 130 131 131 preemption_enable(); 132 132 } … … 147 147 { 148 148 unsigned int i; 149 149 150 150 void (* func)(void); 151 151 152 152 switch (ipi) { 153 153 case IPI_TLB_SHOOTDOWN: … … 158 158 break; 159 159 } 160 160 161 161 /* 162 162 * As long as we don't support hot-plugging … … 165 165 * without locking. 166 166 */ 167 167 168 168 for (i = 0; i < config.cpu_active; i++) { 169 169 if (&cpus[i] == CPU) … … 187 187 { 188 188 assert(&cpus[cpu_id] != CPU); 189 189 190 190 if (ipi == IPI_SMP_CALL) { 191 191 cross_call(cpus[cpu_id].arch.mid, smp_call_ipi_recv); -
kernel/arch/sparc64/src/smp/sun4u/smp.c
r3061bc1 ra35b458 62 62 ofw_tree_node_t *node; 63 63 unsigned int cnt = 0; 64 64 65 65 if (is_us() || is_us_iii()) { 66 66 node = ofw_tree_find_child_by_device_type(cpus_parent(), "cpu"); … … 76 76 } 77 77 } 78 78 79 79 config.cpu_count = max(1, cnt); 80 80 } … … 89 89 uint32_t mid; 90 90 ofw_tree_property_t *prop; 91 91 92 92 /* 'upa-portid' for US, 'portid' for US-III, 'cpuid' for US-IV */ 93 93 prop = ofw_tree_getprop(node, "upa-portid"); … … 96 96 if ((!prop) || (!prop->value)) 97 97 prop = ofw_tree_getprop(node, "cpuid"); 98 98 99 99 if (!prop || prop->value == NULL) 100 100 return; 101 101 102 102 mid = *((uint32_t *) prop->value); 103 103 if (CPU->arch.mid == mid) … … 105 105 106 106 waking_up_mid = mid; 107 107 108 108 if (waitq_sleep_timeout(&ap_completion_wq, 1000000, 109 109 SYNCH_FLAGS_NONE, NULL) == ETIMEOUT) … … 117 117 ofw_tree_node_t *node; 118 118 int i; 119 119 120 120 if (is_us() || is_us_iii()) { 121 121 node = ofw_tree_find_child_by_device_type(cpus_parent(), "cpu"); -
kernel/arch/sparc64/src/smp/sun4v/ipi.c
r3061bc1 ra35b458 96 96 { 97 97 void (* func)(void); 98 98 99 99 switch (ipi) { 100 100 case IPI_TLB_SHOOTDOWN: -
kernel/arch/sparc64/src/smp/sun4v/smp.c
r3061bc1 ra35b458 359 359 if (__hypercall_fast1(CPU_STOP, cpuid) != EOK) 360 360 return false; 361 361 362 362 /* wait for the CPU to stop */ 363 363 uint64_t state; … … 365 365 while (state == CPU_STATE_RUNNING) 366 366 __hypercall_fast_ret1(cpuid, 0, 0, 0, 0, CPU_STATE, &state); 367 367 368 368 /* make the CPU run again and execute HelenOS code */ 369 369 if (__hypercall_fast4(CPU_START, cpuid, … … 372 372 return false; 373 373 #endif 374 374 375 375 if (waitq_sleep_timeout(&ap_completion_wq, 10000000, 376 376 SYNCH_FLAGS_NONE, NULL) == ETIMEOUT) 377 377 printf("%s: waiting for processor (cpuid = %" PRIu64 ") timed out\n", 378 378 __func__, cpuid); 379 379 380 380 return true; 381 381 }
Note:
See TracChangeset
for help on using the changeset viewer.
