• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/arch/powerpc/platforms/cell/spufs/

Lines Matching defs:spu

47 #include <asm/spu.h>
71 static inline void acquire_spu_lock(struct spu *spu)
80 static inline void release_spu_lock(struct spu *spu)
88 static inline int check_spu_isolate(struct spu_state *csa, struct spu *spu)
90 struct spu_problem __iomem *prob = spu->problem;
104 static inline void disable_interrupts(struct spu_state *csa, struct spu *spu)
117 spin_lock_irq(&spu->register_lock);
119 csa->priv1.int_mask_class0_RW = spu_int_mask_get(spu, 0);
120 csa->priv1.int_mask_class1_RW = spu_int_mask_get(spu, 1);
121 csa->priv1.int_mask_class2_RW = spu_int_mask_get(spu, 2);
123 spu_int_mask_set(spu, 0, 0ul);
124 spu_int_mask_set(spu, 1, 0ul);
125 spu_int_mask_set(spu, 2, 0ul);
127 spin_unlock_irq(&spu->register_lock);
134 set_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags);
135 clear_bit(SPU_CONTEXT_FAULT_PENDING, &spu->flags);
136 synchronize_irq(spu->irqs[0]);
137 synchronize_irq(spu->irqs[1]);
138 synchronize_irq(spu->irqs[2]);
141 static inline void set_watchdog_timer(struct spu_state *csa, struct spu *spu)
154 static inline void inhibit_user_access(struct spu_state *csa, struct spu *spu)
165 static inline void set_switch_pending(struct spu_state *csa, struct spu *spu)
174 static inline void save_mfc_cntl(struct spu_state *csa, struct spu *spu)
176 struct spu_priv2 __iomem *priv2 = spu->priv2;
208 static inline void save_spu_runcntl(struct spu_state *csa, struct spu *spu)
210 struct spu_problem __iomem *prob = spu->problem;
219 static inline void save_mfc_sr1(struct spu_state *csa, struct spu *spu)
224 csa->priv1.mfc_sr1_RW = spu_mfc_sr1_get(spu);
227 static inline void save_spu_status(struct spu_state *csa, struct spu *spu)
229 struct spu_problem __iomem *prob = spu->problem;
254 struct spu *spu)
256 struct spu_priv2 __iomem *priv2 = spu->priv2;
270 static inline void halt_mfc_decr(struct spu_state *csa, struct spu *spu)
272 struct spu_priv2 __iomem *priv2 = spu->priv2;
283 static inline void save_timebase(struct spu_state *csa, struct spu *spu)
293 struct spu *spu)
301 static inline void do_mfc_mssync(struct spu_state *csa, struct spu *spu)
303 struct spu_problem __iomem *prob = spu->problem;
314 static inline void issue_mfc_tlbie(struct spu_state *csa, struct spu *spu)
322 spu_tlb_invalidate(spu);
327 struct spu *spu)
340 static inline void save_mfc_queues(struct spu_state *csa, struct spu *spu)
342 struct spu_priv2 __iomem *priv2 = spu->priv2;
373 static inline void save_ppu_querymask(struct spu_state *csa, struct spu *spu)
375 struct spu_problem __iomem *prob = spu->problem;
384 static inline void save_ppu_querytype(struct spu_state *csa, struct spu *spu)
386 struct spu_problem __iomem *prob = spu->problem;
395 static inline void save_ppu_tagstatus(struct spu_state *csa, struct spu *spu)
397 struct spu_problem __iomem *prob = spu->problem;
408 static inline void save_mfc_csr_tsq(struct spu_state *csa, struct spu *spu)
410 struct spu_priv2 __iomem *priv2 = spu->priv2;
420 static inline void save_mfc_csr_cmd(struct spu_state *csa, struct spu *spu)
422 struct spu_priv2 __iomem *priv2 = spu->priv2;
432 static inline void save_mfc_csr_ato(struct spu_state *csa, struct spu *spu)
434 struct spu_priv2 __iomem *priv2 = spu->priv2;
443 static inline void save_mfc_tclass_id(struct spu_state *csa, struct spu *spu)
449 csa->priv1.mfc_tclass_id_RW = spu_mfc_tclass_id_get(spu);
452 static inline void set_mfc_tclass_id(struct spu_state *csa, struct spu *spu)
459 spu_mfc_tclass_id_set(spu, 0x10000000);
463 static inline void purge_mfc_queue(struct spu_state *csa, struct spu *spu)
465 struct spu_priv2 __iomem *priv2 = spu->priv2;
477 static inline void wait_purge_complete(struct spu_state *csa, struct spu *spu)
479 struct spu_priv2 __iomem *priv2 = spu->priv2;
490 static inline void setup_mfc_sr1(struct spu_state *csa, struct spu *spu)
503 spu_mfc_sr1_set(spu, (MFC_STATE1_MASTER_RUN_CONTROL_MASK |
508 static inline void save_spu_npc(struct spu_state *csa, struct spu *spu)
510 struct spu_problem __iomem *prob = spu->problem;
518 static inline void save_spu_privcntl(struct spu_state *csa, struct spu *spu)
520 struct spu_priv2 __iomem *priv2 = spu->priv2;
528 static inline void reset_spu_privcntl(struct spu_state *csa, struct spu *spu)
530 struct spu_priv2 __iomem *priv2 = spu->priv2;
540 static inline void save_spu_lslr(struct spu_state *csa, struct spu *spu)
542 struct spu_priv2 __iomem *priv2 = spu->priv2;
550 static inline void reset_spu_lslr(struct spu_state *csa, struct spu *spu)
552 struct spu_priv2 __iomem *priv2 = spu->priv2;
562 static inline void save_spu_cfg(struct spu_state *csa, struct spu *spu)
564 struct spu_priv2 __iomem *priv2 = spu->priv2;
572 static inline void save_pm_trace(struct spu_state *csa, struct spu *spu)
580 static inline void save_mfc_rag(struct spu_state *csa, struct spu *spu)
587 spu_resource_allocation_groupID_get(spu);
589 spu_resource_allocation_enable_get(spu);
592 static inline void save_ppu_mb_stat(struct spu_state *csa, struct spu *spu)
594 struct spu_problem __iomem *prob = spu->problem;
602 static inline void save_ppu_mb(struct spu_state *csa, struct spu *spu)
604 struct spu_problem __iomem *prob = spu->problem;
612 static inline void save_ppuint_mb(struct spu_state *csa, struct spu *spu)
614 struct spu_priv2 __iomem *priv2 = spu->priv2;
622 static inline void save_ch_part1(struct spu_state *csa, struct spu *spu)
624 struct spu_priv2 __iomem *priv2 = spu->priv2;
648 static inline void save_spu_mb(struct spu_state *csa, struct spu *spu)
650 struct spu_priv2 __iomem *priv2 = spu->priv2;
666 static inline void save_mfc_cmd(struct spu_state *csa, struct spu *spu)
668 struct spu_priv2 __iomem *priv2 = spu->priv2;
679 static inline void reset_ch(struct spu_state *csa, struct spu *spu)
681 struct spu_priv2 __iomem *priv2 = spu->priv2;
699 static inline void resume_mfc_queue(struct spu_state *csa, struct spu *spu)
701 struct spu_priv2 __iomem *priv2 = spu->priv2;
710 static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu,
727 spu_invalidate_slbs(spu);
728 spu_setup_kernel_slbs(spu, csa->lscsa, code, code_size);
731 static inline void set_switch_active(struct spu_state *csa, struct spu *spu)
742 if (test_bit(SPU_CONTEXT_FAULT_PENDING, &spu->flags))
744 clear_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags);
748 static inline void enable_interrupts(struct spu_state *csa, struct spu *spu)
761 spin_lock_irq(&spu->register_lock);
762 spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
763 spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
764 spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
765 spu_int_mask_set(spu, 0, 0ul);
766 spu_int_mask_set(spu, 1, class1_mask);
767 spu_int_mask_set(spu, 2, 0ul);
768 spin_unlock_irq(&spu->register_lock);
771 static inline int send_mfc_dma(struct spu *spu, unsigned long ea,
776 struct spu_problem __iomem *prob = spu->problem;
805 static inline void save_ls_16kb(struct spu_state *csa, struct spu *spu)
818 send_mfc_dma(spu, addr, ls_offset, size, tag, rclass, cmd);
821 static inline void set_spu_npc(struct spu_state *csa, struct spu *spu)
823 struct spu_problem __iomem *prob = spu->problem;
838 static inline void set_signot1(struct spu_state *csa, struct spu *spu)
840 struct spu_problem __iomem *prob = spu->problem;
856 static inline void set_signot2(struct spu_state *csa, struct spu *spu)
858 struct spu_problem __iomem *prob = spu->problem;
874 static inline void send_save_code(struct spu_state *csa, struct spu *spu)
887 send_mfc_dma(spu, addr, ls_offset, size, tag, rclass, cmd);
890 static inline void set_ppu_querymask(struct spu_state *csa, struct spu *spu)
892 struct spu_problem __iomem *prob = spu->problem;
903 static inline void wait_tag_complete(struct spu_state *csa, struct spu *spu)
905 struct spu_problem __iomem *prob = spu->problem;
921 spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
922 spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
926 static inline void wait_spu_stopped(struct spu_state *csa, struct spu *spu)
928 struct spu_problem __iomem *prob = spu->problem;
940 spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
941 spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
945 static inline int check_save_status(struct spu_state *csa, struct spu *spu)
947 struct spu_problem __iomem *prob = spu->problem;
960 static inline void terminate_spu_app(struct spu_state *csa, struct spu *spu)
969 struct spu *spu)
971 struct spu_priv2 __iomem *priv2 = spu->priv2;
983 struct spu *spu)
985 struct spu_priv2 __iomem *priv2 = spu->priv2;
996 static inline int suspend_spe(struct spu_state *csa, struct spu *spu)
998 struct spu_problem __iomem *prob = spu->problem;
1038 static inline void clear_spu_status(struct spu_state *csa, struct spu *spu)
1040 struct spu_problem __iomem *prob = spu->problem;
1049 spu_mfc_sr1_set(spu,
1061 spu_mfc_sr1_set(spu,
1072 static inline void reset_ch_part1(struct spu_state *csa, struct spu *spu)
1074 struct spu_priv2 __iomem *priv2 = spu->priv2;
1097 static inline void reset_ch_part2(struct spu_state *csa, struct spu *spu)
1099 struct spu_priv2 __iomem *priv2 = spu->priv2;
1118 struct spu *spu)
1210 struct spu *spu)
1233 static inline void restore_mfc_rag(struct spu_state *csa, struct spu *spu)
1239 spu_resource_allocation_groupID_set(spu,
1241 spu_resource_allocation_enable_set(spu,
1245 static inline void send_restore_code(struct spu_state *csa, struct spu *spu)
1258 send_mfc_dma(spu, addr, ls_offset, size, tag, rclass, cmd);
1261 static inline void setup_decr(struct spu_state *csa, struct spu *spu)
1286 static inline void setup_ppu_mb(struct spu_state *csa, struct spu *spu)
1294 static inline void setup_ppuint_mb(struct spu_state *csa, struct spu *spu)
1302 static inline int check_restore_status(struct spu_state *csa, struct spu *spu)
1304 struct spu_problem __iomem *prob = spu->problem;
1317 static inline void restore_spu_privcntl(struct spu_state *csa, struct spu *spu)
1319 struct spu_priv2 __iomem *priv2 = spu->priv2;
1328 static inline void restore_status_part1(struct spu_state *csa, struct spu *spu)
1330 struct spu_problem __iomem *prob = spu->problem;
1348 static inline void restore_status_part2(struct spu_state *csa, struct spu *spu)
1350 struct spu_problem __iomem *prob = spu->problem;
1375 static inline void restore_ls_16kb(struct spu_state *csa, struct spu *spu)
1388 send_mfc_dma(spu, addr, ls_offset, size, tag, rclass, cmd);
1391 static inline void suspend_mfc(struct spu_state *csa, struct spu *spu)
1393 struct spu_priv2 __iomem *priv2 = spu->priv2;
1403 static inline void clear_interrupts(struct spu_state *csa, struct spu *spu)
1413 spin_lock_irq(&spu->register_lock);
1414 spu_int_mask_set(spu, 0, 0ul);
1415 spu_int_mask_set(spu, 1, 0ul);
1416 spu_int_mask_set(spu, 2, 0ul);
1417 spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
1418 spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
1419 spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
1420 spin_unlock_irq(&spu->register_lock);
1423 static inline void restore_mfc_queues(struct spu_state *csa, struct spu *spu)
1425 struct spu_priv2 __iomem *priv2 = spu->priv2;
1457 static inline void restore_ppu_querymask(struct spu_state *csa, struct spu *spu)
1459 struct spu_problem __iomem *prob = spu->problem;
1468 static inline void restore_ppu_querytype(struct spu_state *csa, struct spu *spu)
1470 struct spu_problem __iomem *prob = spu->problem;
1479 static inline void restore_mfc_csr_tsq(struct spu_state *csa, struct spu *spu)
1481 struct spu_priv2 __iomem *priv2 = spu->priv2;
1491 static inline void restore_mfc_csr_cmd(struct spu_state *csa, struct spu *spu)
1493 struct spu_priv2 __iomem *priv2 = spu->priv2;
1504 static inline void restore_mfc_csr_ato(struct spu_state *csa, struct spu *spu)
1506 struct spu_priv2 __iomem *priv2 = spu->priv2;
1514 static inline void restore_mfc_tclass_id(struct spu_state *csa, struct spu *spu)
1519 spu_mfc_tclass_id_set(spu, csa->priv1.mfc_tclass_id_RW);
1523 static inline void set_llr_event(struct spu_state *csa, struct spu *spu)
1546 static inline void restore_decr_wrapped(struct spu_state *csa, struct spu *spu)
1564 static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu)
1566 struct spu_priv2 __iomem *priv2 = spu->priv2;
1583 static inline void restore_ch_part2(struct spu_state *csa, struct spu *spu)
1585 struct spu_priv2 __iomem *priv2 = spu->priv2;
1606 static inline void restore_spu_lslr(struct spu_state *csa, struct spu *spu)
1608 struct spu_priv2 __iomem *priv2 = spu->priv2;
1617 static inline void restore_spu_cfg(struct spu_state *csa, struct spu *spu)
1619 struct spu_priv2 __iomem *priv2 = spu->priv2;
1628 static inline void restore_pm_trace(struct spu_state *csa, struct spu *spu)
1636 static inline void restore_spu_npc(struct spu_state *csa, struct spu *spu)
1638 struct spu_problem __iomem *prob = spu->problem;
1647 static inline void restore_spu_mb(struct spu_state *csa, struct spu *spu)
1649 struct spu_priv2 __iomem *priv2 = spu->priv2;
1664 static inline void check_ppu_mb_stat(struct spu_state *csa, struct spu *spu)
1666 struct spu_problem __iomem *prob = spu->problem;
1679 static inline void check_ppuint_mb_stat(struct spu_state *csa, struct spu *spu)
1681 struct spu_priv2 __iomem *priv2 = spu->priv2;
1691 spu_int_stat_clear(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
1696 static inline void restore_mfc_sr1(struct spu_state *csa, struct spu *spu)
1701 spu_mfc_sr1_set(spu, csa->priv1.mfc_sr1_RW);
1705 static inline void set_int_route(struct spu_state *csa, struct spu *spu)
1707 struct spu_context *ctx = spu->ctx;
1709 spu_cpu_affinity_set(spu, ctx->last_ran);
1713 struct spu *spu)
1720 static inline void restore_spu_runcntl(struct spu_state *csa, struct spu *spu)
1722 struct spu_problem __iomem *prob = spu->problem;
1734 static inline void restore_mfc_cntl(struct spu_state *csa, struct spu *spu)
1736 struct spu_priv2 __iomem *priv2 = spu->priv2;
1750 * state of the spu.
1754 static inline void enable_user_access(struct spu_state *csa, struct spu *spu)
1764 static inline void reset_switch_active(struct spu_state *csa, struct spu *spu)
1772 static inline void reenable_interrupts(struct spu_state *csa, struct spu *spu)
1777 spin_lock_irq(&spu->register_lock);
1778 spu_int_mask_set(spu, 0, csa->priv1.int_mask_class0_RW);
1779 spu_int_mask_set(spu, 1, csa->priv1.int_mask_class1_RW);
1780 spu_int_mask_set(spu, 2, csa->priv1.int_mask_class2_RW);
1781 spin_unlock_irq(&spu->register_lock);
1784 static int quiece_spu(struct spu_state *prev, struct spu *spu)
1796 if (check_spu_isolate(prev, spu)) { /* Step 2. */
1799 disable_interrupts(prev, spu); /* Step 3. */
1800 set_watchdog_timer(prev, spu); /* Step 4. */
1801 inhibit_user_access(prev, spu); /* Step 5. */
1802 if (check_spu_isolate(prev, spu)) { /* Step 6. */
1805 set_switch_pending(prev, spu); /* Step 7. */
1806 save_mfc_cntl(prev, spu); /* Step 8. */
1807 save_spu_runcntl(prev, spu); /* Step 9. */
1808 save_mfc_sr1(prev, spu); /* Step 10. */
1809 save_spu_status(prev, spu); /* Step 11. */
1810 save_mfc_stopped_status(prev, spu); /* Step 12. */
1811 halt_mfc_decr(prev, spu); /* Step 13. */
1812 save_timebase(prev, spu); /* Step 14. */
1813 remove_other_spu_access(prev, spu); /* Step 15. */
1814 do_mfc_mssync(prev, spu); /* Step 16. */
1815 issue_mfc_tlbie(prev, spu); /* Step 17. */
1816 handle_pending_interrupts(prev, spu); /* Step 18. */
1821 static void save_csa(struct spu_state *prev, struct spu *spu)
1828 save_mfc_queues(prev, spu); /* Step 19. */
1829 save_ppu_querymask(prev, spu); /* Step 20. */
1830 save_ppu_querytype(prev, spu); /* Step 21. */
1831 save_ppu_tagstatus(prev, spu); /* NEW. */
1832 save_mfc_csr_tsq(prev, spu); /* Step 22. */
1833 save_mfc_csr_cmd(prev, spu); /* Step 23. */
1834 save_mfc_csr_ato(prev, spu); /* Step 24. */
1835 save_mfc_tclass_id(prev, spu); /* Step 25. */
1836 set_mfc_tclass_id(prev, spu); /* Step 26. */
1837 save_mfc_cmd(prev, spu); /* Step 26a - moved from 44. */
1838 purge_mfc_queue(prev, spu); /* Step 27. */
1839 wait_purge_complete(prev, spu); /* Step 28. */
1840 setup_mfc_sr1(prev, spu); /* Step 30. */
1841 save_spu_npc(prev, spu); /* Step 31. */
1842 save_spu_privcntl(prev, spu); /* Step 32. */
1843 reset_spu_privcntl(prev, spu); /* Step 33. */
1844 save_spu_lslr(prev, spu); /* Step 34. */
1845 reset_spu_lslr(prev, spu); /* Step 35. */
1846 save_spu_cfg(prev, spu); /* Step 36. */
1847 save_pm_trace(prev, spu); /* Step 37. */
1848 save_mfc_rag(prev, spu); /* Step 38. */
1849 save_ppu_mb_stat(prev, spu); /* Step 39. */
1850 save_ppu_mb(prev, spu); /* Step 40. */
1851 save_ppuint_mb(prev, spu); /* Step 41. */
1852 save_ch_part1(prev, spu); /* Step 42. */
1853 save_spu_mb(prev, spu); /* Step 43. */
1854 reset_ch(prev, spu); /* Step 45. */
1857 static void save_lscsa(struct spu_state *prev, struct spu *spu)
1865 resume_mfc_queue(prev, spu); /* Step 46. */
1867 setup_mfc_slbs(prev, spu, spu_save_code, sizeof(spu_save_code));
1868 set_switch_active(prev, spu); /* Step 48. */
1869 enable_interrupts(prev, spu); /* Step 49. */
1870 save_ls_16kb(prev, spu); /* Step 50. */
1871 set_spu_npc(prev, spu); /* Step 51. */
1872 set_signot1(prev, spu); /* Step 52. */
1873 set_signot2(prev, spu); /* Step 53. */
1874 send_save_code(prev, spu); /* Step 54. */
1875 set_ppu_querymask(prev, spu); /* Step 55. */
1876 wait_tag_complete(prev, spu); /* Step 56. */
1877 wait_spu_stopped(prev, spu); /* Step 57. */
1880 static void force_spu_isolate_exit(struct spu *spu)
1882 struct spu_problem __iomem *prob = spu->problem;
1883 struct spu_priv2 __iomem *priv2 = spu->priv2;
1891 spu_mfc_sr1_set(spu, MFC_STATE1_MASTER_RUN_CONTROL_MASK);
1912 static void stop_spu_isolate(struct spu *spu)
1914 struct spu_problem __iomem *prob = spu->problem;
1921 force_spu_isolate_exit(spu);
1925 static void harvest(struct spu_state *prev, struct spu *spu)
1933 disable_interrupts(prev, spu); /* Step 2. */
1934 inhibit_user_access(prev, spu); /* Step 3. */
1935 terminate_spu_app(prev, spu); /* Step 4. */
1936 set_switch_pending(prev, spu); /* Step 5. */
1937 stop_spu_isolate(spu); /* NEW. */
1938 remove_other_spu_access(prev, spu); /* Step 6. */
1939 suspend_mfc_and_halt_decr(prev, spu); /* Step 7. */
1940 wait_suspend_mfc_complete(prev, spu); /* Step 8. */
1941 if (!suspend_spe(prev, spu)) /* Step 9. */
1942 clear_spu_status(prev, spu); /* Step 10. */
1943 do_mfc_mssync(prev, spu); /* Step 11. */
1944 issue_mfc_tlbie(prev, spu); /* Step 12. */
1945 handle_pending_interrupts(prev, spu); /* Step 13. */
1946 purge_mfc_queue(prev, spu); /* Step 14. */
1947 wait_purge_complete(prev, spu); /* Step 15. */
1948 reset_spu_privcntl(prev, spu); /* Step 16. */
1949 reset_spu_lslr(prev, spu); /* Step 17. */
1950 setup_mfc_sr1(prev, spu); /* Step 18. */
1951 spu_invalidate_slbs(spu); /* Step 19. */
1952 reset_ch_part1(prev, spu); /* Step 20. */
1953 reset_ch_part2(prev, spu); /* Step 21. */
1954 enable_interrupts(prev, spu); /* Step 22. */
1955 set_switch_active(prev, spu); /* Step 23. */
1956 set_mfc_tclass_id(prev, spu); /* Step 24. */
1957 resume_mfc_queue(prev, spu); /* Step 25. */
1960 static void restore_lscsa(struct spu_state *next, struct spu *spu)
1968 set_watchdog_timer(next, spu); /* Step 26. */
1969 setup_spu_status_part1(next, spu); /* Step 27. */
1970 setup_spu_status_part2(next, spu); /* Step 28. */
1971 restore_mfc_rag(next, spu); /* Step 29. */
1973 setup_mfc_slbs(next, spu, spu_restore_code, sizeof(spu_restore_code));
1974 set_spu_npc(next, spu); /* Step 31. */
1975 set_signot1(next, spu); /* Step 32. */
1976 set_signot2(next, spu); /* Step 33. */
1977 setup_decr(next, spu); /* Step 34. */
1978 setup_ppu_mb(next, spu); /* Step 35. */
1979 setup_ppuint_mb(next, spu); /* Step 36. */
1980 send_restore_code(next, spu); /* Step 37. */
1981 set_ppu_querymask(next, spu); /* Step 38. */
1982 wait_tag_complete(next, spu); /* Step 39. */
1983 wait_spu_stopped(next, spu); /* Step 40. */
1986 static void restore_csa(struct spu_state *next, struct spu *spu)
1993 restore_spu_privcntl(next, spu); /* Step 41. */
1994 restore_status_part1(next, spu); /* Step 42. */
1995 restore_status_part2(next, spu); /* Step 43. */
1996 restore_ls_16kb(next, spu); /* Step 44. */
1997 wait_tag_complete(next, spu); /* Step 45. */
1998 suspend_mfc(next, spu); /* Step 46. */
1999 wait_suspend_mfc_complete(next, spu); /* Step 47. */
2000 issue_mfc_tlbie(next, spu); /* Step 48. */
2001 clear_interrupts(next, spu); /* Step 49. */
2002 restore_mfc_queues(next, spu); /* Step 50. */
2003 restore_ppu_querymask(next, spu); /* Step 51. */
2004 restore_ppu_querytype(next, spu); /* Step 52. */
2005 restore_mfc_csr_tsq(next, spu); /* Step 53. */
2006 restore_mfc_csr_cmd(next, spu); /* Step 54. */
2007 restore_mfc_csr_ato(next, spu); /* Step 55. */
2008 restore_mfc_tclass_id(next, spu); /* Step 56. */
2009 set_llr_event(next, spu); /* Step 57. */
2010 restore_decr_wrapped(next, spu); /* Step 58. */
2011 restore_ch_part1(next, spu); /* Step 59. */
2012 restore_ch_part2(next, spu); /* Step 60. */
2013 restore_spu_lslr(next, spu); /* Step 61. */
2014 restore_spu_cfg(next, spu); /* Step 62. */
2015 restore_pm_trace(next, spu); /* Step 63. */
2016 restore_spu_npc(next, spu); /* Step 64. */
2017 restore_spu_mb(next, spu); /* Step 65. */
2018 check_ppu_mb_stat(next, spu); /* Step 66. */
2019 check_ppuint_mb_stat(next, spu); /* Step 67. */
2020 spu_invalidate_slbs(spu); /* Modified Step 68. */
2021 restore_mfc_sr1(next, spu); /* Step 69. */
2022 set_int_route(next, spu); /* NEW */
2023 restore_other_spu_access(next, spu); /* Step 70. */
2024 restore_spu_runcntl(next, spu); /* Step 71. */
2025 restore_mfc_cntl(next, spu); /* Step 72. */
2026 enable_user_access(next, spu); /* Step 73. */
2027 reset_switch_active(next, spu); /* Step 74. */
2028 reenable_interrupts(next, spu); /* Step 75. */
2031 static int __do_spu_save(struct spu_state *prev, struct spu *spu)
2047 rc = quiece_spu(prev, spu); /* Steps 2-16. */
2052 harvest(prev, spu);
2058 save_csa(prev, spu); /* Steps 17-43. */
2059 save_lscsa(prev, spu); /* Steps 44-53. */
2060 return check_save_status(prev, spu); /* Step 54. */
2063 static int __do_spu_restore(struct spu_state *next, struct spu *spu)
2078 restore_lscsa(next, spu); /* Steps 24-39. */
2079 rc = check_restore_status(next, spu); /* Step 40. */
2089 restore_csa(next, spu);
2097 * @spu: pointer to SPU iomem structure.
2101 int spu_save(struct spu_state *prev, struct spu *spu)
2105 acquire_spu_lock(spu); /* Step 1. */
2106 rc = __do_spu_save(prev, spu); /* Steps 2-53. */
2107 release_spu_lock(spu);
2110 __func__, spu->number, rc);
2119 * @spu: pointer to SPU iomem structure.
2125 int spu_restore(struct spu_state *new, struct spu *spu)
2129 acquire_spu_lock(spu);
2130 harvest(NULL, spu);
2131 spu->slb_replace = 0;
2132 rc = __do_spu_restore(new, spu);
2133 release_spu_lock(spu);
2136 __func__, spu->number, rc);