* Initialize the per-cpu storage from an updated linker-set region. */
| 247 | * Initialize the per-cpu storage from an updated linker-set region. |
| 248 | */ |
| 249 | void |
| 250 | dpcpu_copy(void *s, int size) |
| 251 | { |
| 252 | #ifdef SMP |
| 253 | uintptr_t dpcpu; |
| 254 | int i; |
| 255 | |
| 256 | CPU_FOREACH(i) { |
| 257 | dpcpu = dpcpu_off[i]; |
| 258 | if (dpcpu == 0) |
| 259 | continue; |
| 260 | memcpy((void *)(dpcpu + (uintptr_t)s), s, size); |
| 261 | } |
| 262 | #else |
| 263 | memcpy((void *)(dpcpu_off[0] + (uintptr_t)s), s, size); |
| 264 | #endif |
| 265 | } |
| 266 | |
| 267 | /* |
| 268 | * Destroy a struct pcpu. |
no test coverage detected