Lines Matching defs:spu

33 #include <asm/spu.h>
64 static inline void acquire_spu_lock(struct spu *spu)
73 static inline void release_spu_lock(struct spu *spu)
81 static inline int check_spu_isolate(struct spu_state *csa, struct spu *spu)
83 struct spu_problem __iomem *prob = spu->problem;
97 static inline void disable_interrupts(struct spu_state *csa, struct spu *spu)
110 spin_lock_irq(&spu->register_lock);
112 csa->priv1.int_mask_class0_RW = spu_int_mask_get(spu, 0);
113 csa->priv1.int_mask_class1_RW = spu_int_mask_get(spu, 1);
114 csa->priv1.int_mask_class2_RW = spu_int_mask_get(spu, 2);
116 spu_int_mask_set(spu, 0, 0ul);
117 spu_int_mask_set(spu, 1, 0ul);
118 spu_int_mask_set(spu, 2, 0ul);
120 spin_unlock_irq(&spu->register_lock);
127 set_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags);
128 clear_bit(SPU_CONTEXT_FAULT_PENDING, &spu->flags);
129 synchronize_irq(spu->irqs[0]);
130 synchronize_irq(spu->irqs[1]);
131 synchronize_irq(spu->irqs[2]);
134 static inline void set_watchdog_timer(struct spu_state *csa, struct spu *spu)
147 static inline void inhibit_user_access(struct spu_state *csa, struct spu *spu)
158 static inline void set_switch_pending(struct spu_state *csa, struct spu *spu)
167 static inline void save_mfc_cntl(struct spu_state *csa, struct spu *spu)
169 struct spu_priv2 __iomem *priv2 = spu->priv2;
201 static inline void save_spu_runcntl(struct spu_state *csa, struct spu *spu)
203 struct spu_problem __iomem *prob = spu->problem;
212 static inline void save_mfc_sr1(struct spu_state *csa, struct spu *spu)
217 csa->priv1.mfc_sr1_RW = spu_mfc_sr1_get(spu);
220 static inline void save_spu_status(struct spu_state *csa, struct spu *spu)
222 struct spu_problem __iomem *prob = spu->problem;
247 struct spu *spu)
249 struct spu_priv2 __iomem *priv2 = spu->priv2;
263 static inline void halt_mfc_decr(struct spu_state *csa, struct spu *spu)
265 struct spu_priv2 __iomem *priv2 = spu->priv2;
276 static inline void save_timebase(struct spu_state *csa, struct spu *spu)
286 struct spu *spu)
294 static inline void do_mfc_mssync(struct spu_state *csa, struct spu *spu)
296 struct spu_problem __iomem *prob = spu->problem;
307 static inline void issue_mfc_tlbie(struct spu_state *csa, struct spu *spu)
315 spu_tlb_invalidate(spu);
320 struct spu *spu)
333 static inline void save_mfc_queues(struct spu_state *csa, struct spu *spu)
335 struct spu_priv2 __iomem *priv2 = spu->priv2;
366 static inline void save_ppu_querymask(struct spu_state *csa, struct spu *spu)
368 struct spu_problem __iomem *prob = spu->problem;
377 static inline void save_ppu_querytype(struct spu_state *csa, struct spu *spu)
379 struct spu_problem __iomem *prob = spu->problem;
388 static inline void save_ppu_tagstatus(struct spu_state *csa, struct spu *spu)
390 struct spu_problem __iomem *prob = spu->problem;
401 static inline void save_mfc_csr_tsq(struct spu_state *csa, struct spu *spu)
403 struct spu_priv2 __iomem *priv2 = spu->priv2;
413 static inline void save_mfc_csr_cmd(struct spu_state *csa, struct spu *spu)
415 struct spu_priv2 __iomem *priv2 = spu->priv2;
425 static inline void save_mfc_csr_ato(struct spu_state *csa, struct spu *spu)
427 struct spu_priv2 __iomem *priv2 = spu->priv2;
436 static inline void save_mfc_tclass_id(struct spu_state *csa, struct spu *spu)
442 csa->priv1.mfc_tclass_id_RW = spu_mfc_tclass_id_get(spu);
445 static inline void set_mfc_tclass_id(struct spu_state *csa, struct spu *spu)
452 spu_mfc_tclass_id_set(spu, 0x10000000);
456 static inline void purge_mfc_queue(struct spu_state *csa, struct spu *spu)
458 struct spu_priv2 __iomem *priv2 = spu->priv2;
470 static inline void wait_purge_complete(struct spu_state *csa, struct spu *spu)
472 struct spu_priv2 __iomem *priv2 = spu->priv2;
483 static inline void setup_mfc_sr1(struct spu_state *csa, struct spu *spu)
496 spu_mfc_sr1_set(spu, (MFC_STATE1_MASTER_RUN_CONTROL_MASK |
501 static inline void save_spu_npc(struct spu_state *csa, struct spu *spu)
503 struct spu_problem __iomem *prob = spu->problem;
511 static inline void save_spu_privcntl(struct spu_state *csa, struct spu *spu)
513 struct spu_priv2 __iomem *priv2 = spu->priv2;
521 static inline void reset_spu_privcntl(struct spu_state *csa, struct spu *spu)
523 struct spu_priv2 __iomem *priv2 = spu->priv2;
533 static inline void save_spu_lslr(struct spu_state *csa, struct spu *spu)
535 struct spu_priv2 __iomem *priv2 = spu->priv2;
543 static inline void reset_spu_lslr(struct spu_state *csa, struct spu *spu)
545 struct spu_priv2 __iomem *priv2 = spu->priv2;
555 static inline void save_spu_cfg(struct spu_state *csa, struct spu *spu)
557 struct spu_priv2 __iomem *priv2 = spu->priv2;
565 static inline void save_pm_trace(struct spu_state *csa, struct spu *spu)
573 static inline void save_mfc_rag(struct spu_state *csa, struct spu *spu)
580 spu_resource_allocation_groupID_get(spu);
582 spu_resource_allocation_enable_get(spu);
585 static inline void save_ppu_mb_stat(struct spu_state *csa, struct spu *spu)
587 struct spu_problem __iomem *prob = spu->problem;
595 static inline void save_ppu_mb(struct spu_state *csa, struct spu *spu)
597 struct spu_problem __iomem *prob = spu->problem;
605 static inline void save_ppuint_mb(struct spu_state *csa, struct spu *spu)
607 struct spu_priv2 __iomem *priv2 = spu->priv2;
615 static inline void save_ch_part1(struct spu_state *csa, struct spu *spu)
617 struct spu_priv2 __iomem *priv2 = spu->priv2;
641 static inline void save_spu_mb(struct spu_state *csa, struct spu *spu)
643 struct spu_priv2 __iomem *priv2 = spu->priv2;
659 static inline void save_mfc_cmd(struct spu_state *csa, struct spu *spu)
661 struct spu_priv2 __iomem *priv2 = spu->priv2;
672 static inline void reset_ch(struct spu_state *csa, struct spu *spu)
674 struct spu_priv2 __iomem *priv2 = spu->priv2;
692 static inline void resume_mfc_queue(struct spu_state *csa, struct spu *spu)
694 struct spu_priv2 __iomem *priv2 = spu->priv2;
703 static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu,
720 spu_invalidate_slbs(spu);
721 spu_setup_kernel_slbs(spu, csa->lscsa, code, code_size);
724 static inline void set_switch_active(struct spu_state *csa, struct spu *spu)
735 if (test_bit(SPU_CONTEXT_FAULT_PENDING, &spu->flags))
737 clear_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags);
741 static inline void enable_interrupts(struct spu_state *csa, struct spu *spu)
754 spin_lock_irq(&spu->register_lock);
755 spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
756 spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
757 spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
758 spu_int_mask_set(spu, 0, 0ul);
759 spu_int_mask_set(spu, 1, class1_mask);
760 spu_int_mask_set(spu, 2, 0ul);
761 spin_unlock_irq(&spu->register_lock);
764 static inline int send_mfc_dma(struct spu *spu, unsigned long ea,
769 struct spu_problem __iomem *prob = spu->problem;
798 static inline void save_ls_16kb(struct spu_state *csa, struct spu *spu)
811 send_mfc_dma(spu, addr, ls_offset, size, tag, rclass, cmd);
814 static inline void set_spu_npc(struct spu_state *csa, struct spu *spu)
816 struct spu_problem __iomem *prob = spu->problem;
831 static inline void set_signot1(struct spu_state *csa, struct spu *spu)
833 struct spu_problem __iomem *prob = spu->problem;
849 static inline void set_signot2(struct spu_state *csa, struct spu *spu)
851 struct spu_problem __iomem *prob = spu->problem;
867 static inline void send_save_code(struct spu_state *csa, struct spu *spu)
880 send_mfc_dma(spu, addr, ls_offset, size, tag, rclass, cmd);
883 static inline void set_ppu_querymask(struct spu_state *csa, struct spu *spu)
885 struct spu_problem __iomem *prob = spu->problem;
896 static inline void wait_tag_complete(struct spu_state *csa, struct spu *spu)
898 struct spu_problem __iomem *prob = spu->problem;
914 spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
915 spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
919 static inline void wait_spu_stopped(struct spu_state *csa, struct spu *spu)
921 struct spu_problem __iomem *prob = spu->problem;
933 spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
934 spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
938 static inline int check_save_status(struct spu_state *csa, struct spu *spu)
940 struct spu_problem __iomem *prob = spu->problem;
953 static inline void terminate_spu_app(struct spu_state *csa, struct spu *spu)
962 struct spu *spu)
964 struct spu_priv2 __iomem *priv2 = spu->priv2;
976 struct spu *spu)
978 struct spu_priv2 __iomem *priv2 = spu->priv2;
989 static inline int suspend_spe(struct spu_state *csa, struct spu *spu)
991 struct spu_problem __iomem *prob = spu->problem;
1031 static inline void clear_spu_status(struct spu_state *csa, struct spu *spu)
1033 struct spu_problem __iomem *prob = spu->problem;
1042 spu_mfc_sr1_set(spu,
1054 spu_mfc_sr1_set(spu,
1065 static inline void reset_ch_part1(struct spu_state *csa, struct spu *spu)
1067 struct spu_priv2 __iomem *priv2 = spu->priv2;
1090 static inline void reset_ch_part2(struct spu_state *csa, struct spu *spu)
1092 struct spu_priv2 __iomem *priv2 = spu->priv2;
1111 struct spu *spu)
1203 struct spu *spu)
1226 static inline void restore_mfc_rag(struct spu_state *csa, struct spu *spu)
1232 spu_resource_allocation_groupID_set(spu,
1234 spu_resource_allocation_enable_set(spu,
1238 static inline void send_restore_code(struct spu_state *csa, struct spu *spu)
1251 send_mfc_dma(spu, addr, ls_offset, size, tag, rclass, cmd);
1254 static inline void setup_decr(struct spu_state *csa, struct spu *spu)
1279 static inline void setup_ppu_mb(struct spu_state *csa, struct spu *spu)
1287 static inline void setup_ppuint_mb(struct spu_state *csa, struct spu *spu)
1295 static inline int check_restore_status(struct spu_state *csa, struct spu *spu)
1297 struct spu_problem __iomem *prob = spu->problem;
1310 static inline void restore_spu_privcntl(struct spu_state *csa, struct spu *spu)
1312 struct spu_priv2 __iomem *priv2 = spu->priv2;
1321 static inline void restore_status_part1(struct spu_state *csa, struct spu *spu)
1323 struct spu_problem __iomem *prob = spu->problem;
1341 static inline void restore_status_part2(struct spu_state *csa, struct spu *spu)
1343 struct spu_problem __iomem *prob = spu->problem;
1368 static inline void restore_ls_16kb(struct spu_state *csa, struct spu *spu)
1381 send_mfc_dma(spu, addr, ls_offset, size, tag, rclass, cmd);
1384 static inline void suspend_mfc(struct spu_state *csa, struct spu *spu)
1386 struct spu_priv2 __iomem *priv2 = spu->priv2;
1396 static inline void clear_interrupts(struct spu_state *csa, struct spu *spu)
1406 spin_lock_irq(&spu->register_lock);
1407 spu_int_mask_set(spu, 0, 0ul);
1408 spu_int_mask_set(spu, 1, 0ul);
1409 spu_int_mask_set(spu, 2, 0ul);
1410 spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
1411 spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
1412 spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
1413 spin_unlock_irq(&spu->register_lock);
1416 static inline void restore_mfc_queues(struct spu_state *csa, struct spu *spu)
1418 struct spu_priv2 __iomem *priv2 = spu->priv2;
1450 static inline void restore_ppu_querymask(struct spu_state *csa, struct spu *spu)
1452 struct spu_problem __iomem *prob = spu->problem;
1461 static inline void restore_ppu_querytype(struct spu_state *csa, struct spu *spu)
1463 struct spu_problem __iomem *prob = spu->problem;
1472 static inline void restore_mfc_csr_tsq(struct spu_state *csa, struct spu *spu)
1474 struct spu_priv2 __iomem *priv2 = spu->priv2;
1484 static inline void restore_mfc_csr_cmd(struct spu_state *csa, struct spu *spu)
1486 struct spu_priv2 __iomem *priv2 = spu->priv2;
1497 static inline void restore_mfc_csr_ato(struct spu_state *csa, struct spu *spu)
1499 struct spu_priv2 __iomem *priv2 = spu->priv2;
1507 static inline void restore_mfc_tclass_id(struct spu_state *csa, struct spu *spu)
1512 spu_mfc_tclass_id_set(spu, csa->priv1.mfc_tclass_id_RW);
1516 static inline void set_llr_event(struct spu_state *csa, struct spu *spu)
1539 static inline void restore_decr_wrapped(struct spu_state *csa, struct spu *spu)
1557 static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu)
1559 struct spu_priv2 __iomem *priv2 = spu->priv2;
1576 static inline void restore_ch_part2(struct spu_state *csa, struct spu *spu)
1578 struct spu_priv2 __iomem *priv2 = spu->priv2;
1599 static inline void restore_spu_lslr(struct spu_state *csa, struct spu *spu)
1601 struct spu_priv2 __iomem *priv2 = spu->priv2;
1610 static inline void restore_spu_cfg(struct spu_state *csa, struct spu *spu)
1612 struct spu_priv2 __iomem *priv2 = spu->priv2;
1621 static inline void restore_pm_trace(struct spu_state *csa, struct spu *spu)
1629 static inline void restore_spu_npc(struct spu_state *csa, struct spu *spu)
1631 struct spu_problem __iomem *prob = spu->problem;
1640 static inline void restore_spu_mb(struct spu_state *csa, struct spu *spu)
1642 struct spu_priv2 __iomem *priv2 = spu->priv2;
1657 static inline void check_ppu_mb_stat(struct spu_state *csa, struct spu *spu)
1659 struct spu_problem __iomem *prob = spu->problem;
1671 static inline void check_ppuint_mb_stat(struct spu_state *csa, struct spu *spu)
1673 struct spu_priv2 __iomem *priv2 = spu->priv2;
1682 spu_int_stat_clear(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
1687 static inline void restore_mfc_sr1(struct spu_state *csa, struct spu *spu)
1692 spu_mfc_sr1_set(spu, csa->priv1.mfc_sr1_RW);
1696 static inline void set_int_route(struct spu_state *csa, struct spu *spu)
1698 struct spu_context *ctx = spu->ctx;
1700 spu_cpu_affinity_set(spu, ctx->last_ran);
1704 struct spu *spu)
1711 static inline void restore_spu_runcntl(struct spu_state *csa, struct spu *spu)
1713 struct spu_problem __iomem *prob = spu->problem;
1725 static inline void restore_mfc_cntl(struct spu_state *csa, struct spu *spu)
1727 struct spu_priv2 __iomem *priv2 = spu->priv2;
1741 * state of the spu.
1745 static inline void enable_user_access(struct spu_state *csa, struct spu *spu)
1755 static inline void reset_switch_active(struct spu_state *csa, struct spu *spu)
1763 static inline void reenable_interrupts(struct spu_state *csa, struct spu *spu)
1768 spin_lock_irq(&spu->register_lock);
1769 spu_int_mask_set(spu, 0, csa->priv1.int_mask_class0_RW);
1770 spu_int_mask_set(spu, 1, csa->priv1.int_mask_class1_RW);
1771 spu_int_mask_set(spu, 2, csa->priv1.int_mask_class2_RW);
1772 spin_unlock_irq(&spu->register_lock);
1775 static int quiece_spu(struct spu_state *prev, struct spu *spu)
1787 if (check_spu_isolate(prev, spu)) { /* Step 2. */
1790 disable_interrupts(prev, spu); /* Step 3. */
1791 set_watchdog_timer(prev, spu); /* Step 4. */
1792 inhibit_user_access(prev, spu); /* Step 5. */
1793 if (check_spu_isolate(prev, spu)) { /* Step 6. */
1796 set_switch_pending(prev, spu); /* Step 7. */
1797 save_mfc_cntl(prev, spu); /* Step 8. */
1798 save_spu_runcntl(prev, spu); /* Step 9. */
1799 save_mfc_sr1(prev, spu); /* Step 10. */
1800 save_spu_status(prev, spu); /* Step 11. */
1801 save_mfc_stopped_status(prev, spu); /* Step 12. */
1802 halt_mfc_decr(prev, spu); /* Step 13. */
1803 save_timebase(prev, spu); /* Step 14. */
1804 remove_other_spu_access(prev, spu); /* Step 15. */
1805 do_mfc_mssync(prev, spu); /* Step 16. */
1806 issue_mfc_tlbie(prev, spu); /* Step 17. */
1807 handle_pending_interrupts(prev, spu); /* Step 18. */
1812 static void save_csa(struct spu_state *prev, struct spu *spu)
1819 save_mfc_queues(prev, spu); /* Step 19. */
1820 save_ppu_querymask(prev, spu); /* Step 20. */
1821 save_ppu_querytype(prev, spu); /* Step 21. */
1822 save_ppu_tagstatus(prev, spu); /* NEW. */
1823 save_mfc_csr_tsq(prev, spu); /* Step 22. */
1824 save_mfc_csr_cmd(prev, spu); /* Step 23. */
1825 save_mfc_csr_ato(prev, spu); /* Step 24. */
1826 save_mfc_tclass_id(prev, spu); /* Step 25. */
1827 set_mfc_tclass_id(prev, spu); /* Step 26. */
1828 save_mfc_cmd(prev, spu); /* Step 26a - moved from 44. */
1829 purge_mfc_queue(prev, spu); /* Step 27. */
1830 wait_purge_complete(prev, spu); /* Step 28. */
1831 setup_mfc_sr1(prev, spu); /* Step 30. */
1832 save_spu_npc(prev, spu); /* Step 31. */
1833 save_spu_privcntl(prev, spu); /* Step 32. */
1834 reset_spu_privcntl(prev, spu); /* Step 33. */
1835 save_spu_lslr(prev, spu); /* Step 34. */
1836 reset_spu_lslr(prev, spu); /* Step 35. */
1837 save_spu_cfg(prev, spu); /* Step 36. */
1838 save_pm_trace(prev, spu); /* Step 37. */
1839 save_mfc_rag(prev, spu); /* Step 38. */
1840 save_ppu_mb_stat(prev, spu); /* Step 39. */
1841 save_ppu_mb(prev, spu); /* Step 40. */
1842 save_ppuint_mb(prev, spu); /* Step 41. */
1843 save_ch_part1(prev, spu); /* Step 42. */
1844 save_spu_mb(prev, spu); /* Step 43. */
1845 reset_ch(prev, spu); /* Step 45. */
1848 static void save_lscsa(struct spu_state *prev, struct spu *spu)
1856 resume_mfc_queue(prev, spu); /* Step 46. */
1858 setup_mfc_slbs(prev, spu, spu_save_code, sizeof(spu_save_code));
1859 set_switch_active(prev, spu); /* Step 48. */
1860 enable_interrupts(prev, spu); /* Step 49. */
1861 save_ls_16kb(prev, spu); /* Step 50. */
1862 set_spu_npc(prev, spu); /* Step 51. */
1863 set_signot1(prev, spu); /* Step 52. */
1864 set_signot2(prev, spu); /* Step 53. */
1865 send_save_code(prev, spu); /* Step 54. */
1866 set_ppu_querymask(prev, spu); /* Step 55. */
1867 wait_tag_complete(prev, spu); /* Step 56. */
1868 wait_spu_stopped(prev, spu); /* Step 57. */
1871 static void force_spu_isolate_exit(struct spu *spu)
1873 struct spu_problem __iomem *prob = spu->problem;
1874 struct spu_priv2 __iomem *priv2 = spu->priv2;
1882 spu_mfc_sr1_set(spu, MFC_STATE1_MASTER_RUN_CONTROL_MASK);
1903 static void stop_spu_isolate(struct spu *spu)
1905 struct spu_problem __iomem *prob = spu->problem;
1912 force_spu_isolate_exit(spu);
1916 static void harvest(struct spu_state *prev, struct spu *spu)
1924 disable_interrupts(prev, spu); /* Step 2. */
1925 inhibit_user_access(prev, spu); /* Step 3. */
1926 terminate_spu_app(prev, spu); /* Step 4. */
1927 set_switch_pending(prev, spu); /* Step 5. */
1928 stop_spu_isolate(spu); /* NEW. */
1929 remove_other_spu_access(prev, spu); /* Step 6. */
1930 suspend_mfc_and_halt_decr(prev, spu); /* Step 7. */
1931 wait_suspend_mfc_complete(prev, spu); /* Step 8. */
1932 if (!suspend_spe(prev, spu)) /* Step 9. */
1933 clear_spu_status(prev, spu); /* Step 10. */
1934 do_mfc_mssync(prev, spu); /* Step 11. */
1935 issue_mfc_tlbie(prev, spu); /* Step 12. */
1936 handle_pending_interrupts(prev, spu); /* Step 13. */
1937 purge_mfc_queue(prev, spu); /* Step 14. */
1938 wait_purge_complete(prev, spu); /* Step 15. */
1939 reset_spu_privcntl(prev, spu); /* Step 16. */
1940 reset_spu_lslr(prev, spu); /* Step 17. */
1941 setup_mfc_sr1(prev, spu); /* Step 18. */
1942 spu_invalidate_slbs(spu); /* Step 19. */
1943 reset_ch_part1(prev, spu); /* Step 20. */
1944 reset_ch_part2(prev, spu); /* Step 21. */
1945 enable_interrupts(prev, spu); /* Step 22. */
1946 set_switch_active(prev, spu); /* Step 23. */
1947 set_mfc_tclass_id(prev, spu); /* Step 24. */
1948 resume_mfc_queue(prev, spu); /* Step 25. */
1951 static void restore_lscsa(struct spu_state *next, struct spu *spu)
1959 set_watchdog_timer(next, spu); /* Step 26. */
1960 setup_spu_status_part1(next, spu); /* Step 27. */
1961 setup_spu_status_part2(next, spu); /* Step 28. */
1962 restore_mfc_rag(next, spu); /* Step 29. */
1964 setup_mfc_slbs(next, spu, spu_restore_code, sizeof(spu_restore_code));
1965 set_spu_npc(next, spu); /* Step 31. */
1966 set_signot1(next, spu); /* Step 32. */
1967 set_signot2(next, spu); /* Step 33. */
1968 setup_decr(next, spu); /* Step 34. */
1969 setup_ppu_mb(next, spu); /* Step 35. */
1970 setup_ppuint_mb(next, spu); /* Step 36. */
1971 send_restore_code(next, spu); /* Step 37. */
1972 set_ppu_querymask(next, spu); /* Step 38. */
1973 wait_tag_complete(next, spu); /* Step 39. */
1974 wait_spu_stopped(next, spu); /* Step 40. */
1977 static void restore_csa(struct spu_state *next, struct spu *spu)
1984 restore_spu_privcntl(next, spu); /* Step 41. */
1985 restore_status_part1(next, spu); /* Step 42. */
1986 restore_status_part2(next, spu); /* Step 43. */
1987 restore_ls_16kb(next, spu); /* Step 44. */
1988 wait_tag_complete(next, spu); /* Step 45. */
1989 suspend_mfc(next, spu); /* Step 46. */
1990 wait_suspend_mfc_complete(next, spu); /* Step 47. */
1991 issue_mfc_tlbie(next, spu); /* Step 48. */
1992 clear_interrupts(next, spu); /* Step 49. */
1993 restore_mfc_queues(next, spu); /* Step 50. */
1994 restore_ppu_querymask(next, spu); /* Step 51. */
1995 restore_ppu_querytype(next, spu); /* Step 52. */
1996 restore_mfc_csr_tsq(next, spu); /* Step 53. */
1997 restore_mfc_csr_cmd(next, spu); /* Step 54. */
1998 restore_mfc_csr_ato(next, spu); /* Step 55. */
1999 restore_mfc_tclass_id(next, spu); /* Step 56. */
2000 set_llr_event(next, spu); /* Step 57. */
2001 restore_decr_wrapped(next, spu); /* Step 58. */
2002 restore_ch_part1(next, spu); /* Step 59. */
2003 restore_ch_part2(next, spu); /* Step 60. */
2004 restore_spu_lslr(next, spu); /* Step 61. */
2005 restore_spu_cfg(next, spu); /* Step 62. */
2006 restore_pm_trace(next, spu); /* Step 63. */
2007 restore_spu_npc(next, spu); /* Step 64. */
2008 restore_spu_mb(next, spu); /* Step 65. */
2009 check_ppu_mb_stat(next, spu); /* Step 66. */
2010 check_ppuint_mb_stat(next, spu); /* Step 67. */
2011 spu_invalidate_slbs(spu); /* Modified Step 68. */
2012 restore_mfc_sr1(next, spu); /* Step 69. */
2013 set_int_route(next, spu); /* NEW */
2014 restore_other_spu_access(next, spu); /* Step 70. */
2015 restore_spu_runcntl(next, spu); /* Step 71. */
2016 restore_mfc_cntl(next, spu); /* Step 72. */
2017 enable_user_access(next, spu); /* Step 73. */
2018 reset_switch_active(next, spu); /* Step 74. */
2019 reenable_interrupts(next, spu); /* Step 75. */
2022 static int __do_spu_save(struct spu_state *prev, struct spu *spu)
2038 rc = quiece_spu(prev, spu); /* Steps 2-16. */
2043 harvest(prev, spu);
2049 save_csa(prev, spu); /* Steps 17-43. */
2050 save_lscsa(prev, spu); /* Steps 44-53. */
2051 return check_save_status(prev, spu); /* Step 54. */
2054 static int __do_spu_restore(struct spu_state *next, struct spu *spu)
2069 restore_lscsa(next, spu); /* Steps 24-39. */
2070 rc = check_restore_status(next, spu); /* Step 40. */
2080 restore_csa(next, spu);
2088 * @spu: pointer to SPU iomem structure.
2092 int spu_save(struct spu_state *prev, struct spu *spu)
2096 acquire_spu_lock(spu); /* Step 1. */
2097 rc = __do_spu_save(prev, spu); /* Steps 2-53. */
2098 release_spu_lock(spu);
2101 __func__, spu->number, rc);
2110 * @spu: pointer to SPU iomem structure.
2116 int spu_restore(struct spu_state *new, struct spu *spu)
2120 acquire_spu_lock(spu);
2121 harvest(NULL, spu);
2122 spu->slb_replace = 0;
2123 rc = __do_spu_restore(new, spu);
2124 release_spu_lock(spu);
2127 __func__, spu->number, rc);