smtc.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. /*
  8. * System-wide SMTC status information
  9. */
  10. extern unsigned int smtc_status;
  11. #define SMTC_TLB_SHARED 0x00000001
  12. #define SMTC_MTC_ACTIVE 0x00000002
  13. /*
  14. * TLB/ASID Management information
  15. */
  16. #define MAX_SMTC_TLBS 2
  17. #define MAX_SMTC_ASIDS 256
  18. #if NR_CPUS <= 8
  19. typedef char asiduse;
  20. #else
  21. #if NR_CPUS <= 16
  22. typedef short asiduse;
  23. #else
  24. typedef long asiduse;
  25. #endif
  26. #endif
  27. extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
  28. struct mm_struct;
  29. struct task_struct;
  30. void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu);
  31. void smtc_flush_tlb_asid(unsigned long asid);
  32. extern int mipsmt_build_cpu_map(int startslot);
  33. extern void mipsmt_prepare_cpus(void);
  34. extern void smtc_smp_finish(void);
  35. extern void smtc_boot_secondary(int cpu, struct task_struct *t);
  36. /*
  37. * Sharing the TLB between multiple VPEs means that the
  38. * "random" index selection function is not allowed to
  39. * select the current value of the Index register. To
  40. * avoid additional TLB pressure, the Index registers
  41. * are "parked" with an non-Valid value.
  42. */
  43. #define PARKED_INDEX ((unsigned int)0x80000000)
  44. #endif /* _ASM_SMTC_MT_H */