smtc.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
  29. struct mm_struct;
  30. struct task_struct;
  31. void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu);
  32. void self_ipi(struct smtc_ipi *);
  33. void smtc_flush_tlb_asid(unsigned long asid);
  34. extern int smtc_build_cpu_map(int startslot);
  35. extern void smtc_prepare_cpus(int cpus);
  36. extern void smtc_smp_finish(void);
  37. extern void smtc_boot_secondary(int cpu, struct task_struct *t);
  38. extern void smtc_cpus_done(void);
  39. extern void smtc_init_secondary(void);
  40. /*
  41. * Sharing the TLB between multiple VPEs means that the
  42. * "random" index selection function is not allowed to
  43. * select the current value of the Index register. To
  44. * avoid additional TLB pressure, the Index registers
  45. * are "parked" with an non-Valid value.
  46. */
  47. #define PARKED_INDEX ((unsigned int)0x80000000)
  48. /*
  49. * Define low-level interrupt mask for IPIs, if necessary.
  50. * By default, use SW interrupt 1, which requires no external
  51. * hardware support, but which works only for single-core
  52. * MIPS MT systems.
  53. */
  54. #ifndef MIPS_CPU_IPI_IRQ
  55. #define MIPS_CPU_IPI_IRQ 1
  56. #endif
  57. #endif /* _ASM_SMTC_MT_H */