smtc.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef _ASM_SMTC_MT_H
  2. #define _ASM_SMTC_MT_H
  3. /*
  4. * Definitions for SMTC multitasking on MIPS MT cores
  5. */
  6. #include <asm/mips_mt.h>
  7. #include <asm/smtc_ipi.h>
  8. /*
  9. * System-wide SMTC status information
  10. */
  11. extern unsigned int smtc_status;
  12. #define SMTC_TLB_SHARED 0x00000001
  13. #define SMTC_MTC_ACTIVE 0x00000002
  14. /*
  15. * TLB/ASID Management information
  16. */
  17. #define MAX_SMTC_TLBS 2
  18. #define MAX_SMTC_ASIDS 256
  19. #if NR_CPUS <= 8
  20. typedef char asiduse;
  21. #else
  22. #if NR_CPUS <= 16
  23. typedef short asiduse;
  24. #else
  25. typedef long asiduse;
  26. #endif
  27. #endif
  28. /*
  29. * VPE Management information
  30. */
  31. #define MAX_SMTC_VPES MAX_SMTC_TLBS /* FIXME: May not always be true. */
  32. extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
  33. struct mm_struct;
  34. struct task_struct;
  35. void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu);
  36. void self_ipi(struct smtc_ipi *);
  37. void smtc_flush_tlb_asid(unsigned long asid);
  38. extern int smtc_build_cpu_map(int startslot);
  39. extern void smtc_prepare_cpus(int cpus);
  40. extern void smtc_smp_finish(void);
  41. extern void smtc_boot_secondary(int cpu, struct task_struct *t);
  42. extern void smtc_cpus_done(void);
  43. extern void smtc_init_secondary(void);
  44. /*
  45. * Sharing the TLB between multiple VPEs means that the
  46. * "random" index selection function is not allowed to
  47. * select the current value of the Index register. To
  48. * avoid additional TLB pressure, the Index registers
  49. * are "parked" with an non-Valid value.
  50. */
  51. #define PARKED_INDEX ((unsigned int)0x80000000)
  52. /*
  53. * Define low-level interrupt mask for IPIs, if necessary.
  54. * By default, use SW interrupt 1, which requires no external
  55. * hardware support, but which works only for single-core
  56. * MIPS MT systems.
  57. */
  58. #ifndef MIPS_CPU_IPI_IRQ
  59. #define MIPS_CPU_IPI_IRQ 1
  60. #endif
  61. #endif /* _ASM_SMTC_MT_H */