blob: e56b439b7871708660d76d9ce96b5c73d22a55f9 [file] [log] [blame]
Ralf Baechle41c594a2006-04-05 09:45:45 +01001#ifndef _ASM_SMTC_MT_H
2#define _ASM_SMTC_MT_H
3
4/*
5 * Definitions for SMTC multitasking on MIPS MT cores
6 */
7
8#include <asm/mips_mt.h>
Kevin D. Kissell8531a352008-09-09 21:48:52 +02009#include <asm/smtc_ipi.h>
Ralf Baechle41c594a2006-04-05 09:45:45 +010010
11/*
12 * System-wide SMTC status information
13 */
14
15extern unsigned int smtc_status;
16
Ralf Baechle70342282013-01-22 12:59:30 +010017#define SMTC_TLB_SHARED 0x00000001
18#define SMTC_MTC_ACTIVE 0x00000002
Ralf Baechle41c594a2006-04-05 09:45:45 +010019
20/*
21 * TLB/ASID Management information
22 */
23
24#define MAX_SMTC_TLBS 2
25#define MAX_SMTC_ASIDS 256
26#if NR_CPUS <= 8
27typedef char asiduse;
28#else
29#if NR_CPUS <= 16
30typedef short asiduse;
31#else
32typedef long asiduse;
33#endif
34#endif
35
Steven J. Hill889a4c7b2012-04-09 10:58:39 -050036/*
37 * VPE Management information
38 */
39
40#define MAX_SMTC_VPES MAX_SMTC_TLBS /* FIXME: May not always be true. */
41
Ralf Baechle41c594a2006-04-05 09:45:45 +010042extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS];
43
Ralf Baechleb3920592007-03-04 18:25:51 +000044struct mm_struct;
45struct task_struct;
46
Ralf Baechle41c594a2006-04-05 09:45:45 +010047void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu);
Kevin D. Kissell8531a352008-09-09 21:48:52 +020048void self_ipi(struct smtc_ipi *);
Ralf Baechle41c594a2006-04-05 09:45:45 +010049void smtc_flush_tlb_asid(unsigned long asid);
Kevin D. Kissell8531a352008-09-09 21:48:52 +020050extern int smtc_build_cpu_map(int startslot);
51extern void smtc_prepare_cpus(int cpus);
Ralf Baechle41c594a2006-04-05 09:45:45 +010052extern void smtc_smp_finish(void);
53extern void smtc_boot_secondary(int cpu, struct task_struct *t);
Ralf Baechle39b8d522008-04-28 17:14:26 +010054extern void smtc_cpus_done(void);
Ralf Baechle731f90fa2011-05-28 01:09:02 +010055extern void smtc_init_secondary(void);
Ralf Baechle41c594a2006-04-05 09:45:45 +010056
Kevin D. Kissell8531a352008-09-09 21:48:52 +020057
Ralf Baechle41c594a2006-04-05 09:45:45 +010058/*
59 * Sharing the TLB between multiple VPEs means that the
60 * "random" index selection function is not allowed to
61 * select the current value of the Index register. To
62 * avoid additional TLB pressure, the Index registers
63 * are "parked" with an non-Valid value.
64 */
65
66#define PARKED_INDEX ((unsigned int)0x80000000)
67
Ralf Baechlefe56b952007-08-06 16:35:23 +010068/*
69 * Define low-level interrupt mask for IPIs, if necessary.
70 * By default, use SW interrupt 1, which requires no external
71 * hardware support, but which works only for single-core
72 * MIPS MT systems.
73 */
74#ifndef MIPS_CPU_IPI_IRQ
75#define MIPS_CPU_IPI_IRQ 1
76#endif
77
Ralf Baechle41c594a2006-04-05 09:45:45 +010078#endif /* _ASM_SMTC_MT_H */