Rev 2082 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2082 | Rev 3146 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | return 0; |
67 | return 0; |
68 | } |
68 | } |
69 | 69 | ||
70 | uint64_t current_mid; |
70 | uint64_t current_mid; |
71 | 71 | ||
- | 72 | asm volatile ("ldxa [%1] %2, %0\n" |
|
- | 73 | : "=r" (current_mid) |
|
72 | asm volatile ("ldxa [%1] %2, %0\n" : "=r" (current_mid) : "r" (0), "i" (ASI_UPA_CONFIG)); |
74 | : "r" (0), "i" (ASI_UPA_CONFIG)); |
73 | current_mid >>= UPA_CONFIG_MID_SHIFT; |
75 | current_mid >>= UPA_CONFIG_MID_SHIFT; |
74 | current_mid &= UPA_CONFIG_MID_MASK; |
76 | current_mid &= UPA_CONFIG_MID_MASK; |
75 | 77 | ||
76 | int cpus; |
78 | int cpus; |
77 | 79 | ||
78 | for (cpus = 0; node != 0 && node != -1; node = ofw_get_peer_node(node), cpus++) { |
80 | for (cpus = 0; node != 0 && node != -1; node = ofw_get_peer_node(node), |
- | 81 | cpus++) { |
|
79 | if (ofw_get_property(node, "device_type", type_name, sizeof(type_name)) > 0) { |
82 | if (ofw_get_property(node, "device_type", type_name, |
- | 83 | sizeof(type_name)) > 0) { |
|
80 | if (strcmp(type_name, "cpu") == 0) { |
84 | if (strcmp(type_name, "cpu") == 0) { |
81 | uint32_t mid; |
85 | uint32_t mid; |
82 | 86 | ||
83 | if (ofw_get_property(node, "upa-portid", &mid, sizeof(mid)) <= 0) |
87 | if (ofw_get_property(node, "upa-portid", &mid, |
- | 88 | sizeof(mid)) <= 0) |
|
84 | continue; |
89 | continue; |
85 | 90 | ||
86 | if (current_mid != mid) { |
91 | if (current_mid != mid) { |
87 | /* |
92 | /* |
88 | * Start secondary processor. |
93 | * Start secondary processor. |
89 | */ |
94 | */ |
90 | (void) ofw_call("SUNW,start-cpu", 3, 1, NULL, node, |
95 | (void) ofw_call("SUNW,start-cpu", 3, 1, |
91 | KERNEL_VIRTUAL_ADDRESS, |
96 | NULL, node, KERNEL_VIRTUAL_ADDRESS, |
92 | bootinfo.physmem_start | AP_PROCESSOR); |
97 | bootinfo.physmem_start | |
- | 98 | AP_PROCESSOR); |
|
93 | } |
99 | } |
94 | } |
100 | } |
95 | } |
101 | } |
96 | } |
102 | } |
97 | 103 |