diff options
Diffstat (limited to 'arch/tile/kernel/process.c')
-rw-r--r-- | arch/tile/kernel/process.c | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 44cdc4aa59e8..16ed58948757 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c | |||
@@ -187,16 +187,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
187 | memset(&p->thread.dma_async_tlb, 0, sizeof(struct async_tlb)); | 187 | memset(&p->thread.dma_async_tlb, 0, sizeof(struct async_tlb)); |
188 | #endif | 188 | #endif |
189 | 189 | ||
190 | #if CHIP_HAS_SN_PROC() | ||
191 | /* Likewise, the new thread is not running static processor code. */ | ||
192 | p->thread.sn_proc_running = 0; | ||
193 | memset(&p->thread.sn_async_tlb, 0, sizeof(struct async_tlb)); | ||
194 | #endif | ||
195 | |||
196 | #if CHIP_HAS_PROC_STATUS_SPR() | ||
197 | /* New thread has its miscellaneous processor state bits clear. */ | 190 | /* New thread has its miscellaneous processor state bits clear. */ |
198 | p->thread.proc_status = 0; | 191 | p->thread.proc_status = 0; |
199 | #endif | ||
200 | 192 | ||
201 | #ifdef CONFIG_HARDWALL | 193 | #ifdef CONFIG_HARDWALL |
202 | /* New thread does not own any networks. */ | 194 | /* New thread does not own any networks. */ |
@@ -378,15 +370,11 @@ static void save_arch_state(struct thread_struct *t) | |||
378 | t->system_save[2] = __insn_mfspr(SPR_SYSTEM_SAVE_0_2); | 370 | t->system_save[2] = __insn_mfspr(SPR_SYSTEM_SAVE_0_2); |
379 | t->system_save[3] = __insn_mfspr(SPR_SYSTEM_SAVE_0_3); | 371 | t->system_save[3] = __insn_mfspr(SPR_SYSTEM_SAVE_0_3); |
380 | t->intctrl_0 = __insn_mfspr(SPR_INTCTRL_0_STATUS); | 372 | t->intctrl_0 = __insn_mfspr(SPR_INTCTRL_0_STATUS); |
381 | #if CHIP_HAS_PROC_STATUS_SPR() | ||
382 | t->proc_status = __insn_mfspr(SPR_PROC_STATUS); | 373 | t->proc_status = __insn_mfspr(SPR_PROC_STATUS); |
383 | #endif | ||
384 | #if !CHIP_HAS_FIXED_INTVEC_BASE() | 374 | #if !CHIP_HAS_FIXED_INTVEC_BASE() |
385 | t->interrupt_vector_base = __insn_mfspr(SPR_INTERRUPT_VECTOR_BASE_0); | 375 | t->interrupt_vector_base = __insn_mfspr(SPR_INTERRUPT_VECTOR_BASE_0); |
386 | #endif | 376 | #endif |
387 | #if CHIP_HAS_TILE_RTF_HWM() | ||
388 | t->tile_rtf_hwm = __insn_mfspr(SPR_TILE_RTF_HWM); | 377 | t->tile_rtf_hwm = __insn_mfspr(SPR_TILE_RTF_HWM); |
389 | #endif | ||
390 | #if CHIP_HAS_DSTREAM_PF() | 378 | #if CHIP_HAS_DSTREAM_PF() |
391 | t->dstream_pf = __insn_mfspr(SPR_DSTREAM_PF); | 379 | t->dstream_pf = __insn_mfspr(SPR_DSTREAM_PF); |
392 | #endif | 380 | #endif |
@@ -407,15 +395,11 @@ static void restore_arch_state(const struct thread_struct *t) | |||
407 | __insn_mtspr(SPR_SYSTEM_SAVE_0_2, t->system_save[2]); | 395 | __insn_mtspr(SPR_SYSTEM_SAVE_0_2, t->system_save[2]); |
408 | __insn_mtspr(SPR_SYSTEM_SAVE_0_3, t->system_save[3]); | 396 | __insn_mtspr(SPR_SYSTEM_SAVE_0_3, t->system_save[3]); |
409 | __insn_mtspr(SPR_INTCTRL_0_STATUS, t->intctrl_0); | 397 | __insn_mtspr(SPR_INTCTRL_0_STATUS, t->intctrl_0); |
410 | #if CHIP_HAS_PROC_STATUS_SPR() | ||
411 | __insn_mtspr(SPR_PROC_STATUS, t->proc_status); | 398 | __insn_mtspr(SPR_PROC_STATUS, t->proc_status); |
412 | #endif | ||
413 | #if !CHIP_HAS_FIXED_INTVEC_BASE() | 399 | #if !CHIP_HAS_FIXED_INTVEC_BASE() |
414 | __insn_mtspr(SPR_INTERRUPT_VECTOR_BASE_0, t->interrupt_vector_base); | 400 | __insn_mtspr(SPR_INTERRUPT_VECTOR_BASE_0, t->interrupt_vector_base); |
415 | #endif | 401 | #endif |
416 | #if CHIP_HAS_TILE_RTF_HWM() | ||
417 | __insn_mtspr(SPR_TILE_RTF_HWM, t->tile_rtf_hwm); | 402 | __insn_mtspr(SPR_TILE_RTF_HWM, t->tile_rtf_hwm); |
418 | #endif | ||
419 | #if CHIP_HAS_DSTREAM_PF() | 403 | #if CHIP_HAS_DSTREAM_PF() |
420 | __insn_mtspr(SPR_DSTREAM_PF, t->dstream_pf); | 404 | __insn_mtspr(SPR_DSTREAM_PF, t->dstream_pf); |
421 | #endif | 405 | #endif |
@@ -424,26 +408,11 @@ static void restore_arch_state(const struct thread_struct *t) | |||
424 | 408 | ||
425 | void _prepare_arch_switch(struct task_struct *next) | 409 | void _prepare_arch_switch(struct task_struct *next) |
426 | { | 410 | { |
427 | #if CHIP_HAS_SN_PROC() | ||
428 | int snctl; | ||
429 | #endif | ||
430 | #if CHIP_HAS_TILE_DMA() | 411 | #if CHIP_HAS_TILE_DMA() |
431 | struct tile_dma_state *dma = ¤t->thread.tile_dma_state; | 412 | struct tile_dma_state *dma = ¤t->thread.tile_dma_state; |
432 | if (dma->enabled) | 413 | if (dma->enabled) |
433 | save_tile_dma_state(dma); | 414 | save_tile_dma_state(dma); |
434 | #endif | 415 | #endif |
435 | #if CHIP_HAS_SN_PROC() | ||
436 | /* | ||
437 | * Suspend the static network processor if it was running. | ||
438 | * We do not suspend the fabric itself, just like we don't | ||
439 | * try to suspend the UDN. | ||
440 | */ | ||
441 | snctl = __insn_mfspr(SPR_SNCTL); | ||
442 | current->thread.sn_proc_running = | ||
443 | (snctl & SPR_SNCTL__FRZPROC_MASK) == 0; | ||
444 | if (current->thread.sn_proc_running) | ||
445 | __insn_mtspr(SPR_SNCTL, snctl | SPR_SNCTL__FRZPROC_MASK); | ||
446 | #endif | ||
447 | } | 416 | } |
448 | 417 | ||
449 | 418 | ||
@@ -471,17 +440,6 @@ struct task_struct *__sched _switch_to(struct task_struct *prev, | |||
471 | /* Restore other arch state. */ | 440 | /* Restore other arch state. */ |
472 | restore_arch_state(&next->thread); | 441 | restore_arch_state(&next->thread); |
473 | 442 | ||
474 | #if CHIP_HAS_SN_PROC() | ||
475 | /* | ||
476 | * Restart static network processor in the new process | ||
477 | * if it was running before. | ||
478 | */ | ||
479 | if (next->thread.sn_proc_running) { | ||
480 | int snctl = __insn_mfspr(SPR_SNCTL); | ||
481 | __insn_mtspr(SPR_SNCTL, snctl & ~SPR_SNCTL__FRZPROC_MASK); | ||
482 | } | ||
483 | #endif | ||
484 | |||
485 | #ifdef CONFIG_HARDWALL | 443 | #ifdef CONFIG_HARDWALL |
486 | /* Enable or disable access to the network registers appropriately. */ | 444 | /* Enable or disable access to the network registers appropriately. */ |
487 | hardwall_switch_tasks(prev, next); | 445 | hardwall_switch_tasks(prev, next); |
@@ -523,7 +481,7 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags) | |||
523 | schedule(); | 481 | schedule(); |
524 | return 1; | 482 | return 1; |
525 | } | 483 | } |
526 | #if CHIP_HAS_TILE_DMA() || CHIP_HAS_SN_PROC() | 484 | #if CHIP_HAS_TILE_DMA() |
527 | if (thread_info_flags & _TIF_ASYNC_TLB) { | 485 | if (thread_info_flags & _TIF_ASYNC_TLB) { |
528 | do_async_page_fault(regs); | 486 | do_async_page_fault(regs); |
529 | return 1; | 487 | return 1; |