| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | #ifndef _ASM_SMTC_MT_H
 | 
					
						
							|  |  |  | #define _ASM_SMTC_MT_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * Definitions for SMTC multitasking on MIPS MT cores | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <asm/mips_mt.h>
 | 
					
						
							| 
									
										
										
										
											2008-09-09 21:48:52 +02:00
										 |  |  | #include <asm/smtc_ipi.h>
 | 
					
						
							| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * System-wide SMTC status information | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | extern unsigned int smtc_status; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-22 12:59:30 +01:00
										 |  |  | #define SMTC_TLB_SHARED 0x00000001
 | 
					
						
							|  |  |  | #define SMTC_MTC_ACTIVE 0x00000002
 | 
					
						
							| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * TLB/ASID Management information | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define MAX_SMTC_TLBS 2
 | 
					
						
							|  |  |  | #define MAX_SMTC_ASIDS 256
 | 
					
						
							|  |  |  | #if NR_CPUS <= 8
 | 
					
						
							|  |  |  | typedef char asiduse; | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | #if NR_CPUS <= 16
 | 
					
						
							|  |  |  | typedef short asiduse; | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | typedef long asiduse; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-04-09 10:58:39 -05:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * VPE Management information | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define MAX_SMTC_VPES	MAX_SMTC_TLBS	/* FIXME: May not always be true. */
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | extern asiduse smtc_live_asid[MAX_SMTC_TLBS][MAX_SMTC_ASIDS]; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-04 18:25:51 +00:00
										 |  |  | struct mm_struct; | 
					
						
							|  |  |  | struct task_struct; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu); | 
					
						
							| 
									
										
										
										
											2008-09-09 21:48:52 +02:00
										 |  |  | void self_ipi(struct smtc_ipi *); | 
					
						
							| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | void smtc_flush_tlb_asid(unsigned long asid); | 
					
						
							| 
									
										
										
										
											2008-09-09 21:48:52 +02:00
										 |  |  | extern int smtc_build_cpu_map(int startslot); | 
					
						
							|  |  |  | extern void smtc_prepare_cpus(int cpus); | 
					
						
							| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | extern void smtc_smp_finish(void); | 
					
						
							|  |  |  | extern void smtc_boot_secondary(int cpu, struct task_struct *t); | 
					
						
							| 
									
										
										
										
											2008-04-28 17:14:26 +01:00
										 |  |  | extern void smtc_cpus_done(void); | 
					
						
							| 
									
										
										
										
											2011-05-28 01:09:02 +01:00
										 |  |  | extern void smtc_init_secondary(void); | 
					
						
							| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-09-09 21:48:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Sharing the TLB between multiple VPEs means that the | 
					
						
							|  |  |  |  * "random" index selection function is not allowed to | 
					
						
							|  |  |  |  * select the current value of the Index register. To | 
					
						
							|  |  |  |  * avoid additional TLB pressure, the Index registers | 
					
						
							|  |  |  |  * are "parked" with an non-Valid value. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PARKED_INDEX	((unsigned int)0x80000000)
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-08-06 16:35:23 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Define low-level interrupt mask for IPIs, if necessary. | 
					
						
							|  |  |  |  * By default, use SW interrupt 1, which requires no external | 
					
						
							|  |  |  |  * hardware support, but which works only for single-core | 
					
						
							|  |  |  |  * MIPS MT systems. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #ifndef MIPS_CPU_IPI_IRQ
 | 
					
						
							|  |  |  | #define MIPS_CPU_IPI_IRQ 1
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-05 09:45:45 +01:00
										 |  |  | #endif /*  _ASM_SMTC_MT_H */
 |