| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /* | 
					
						
							|  |  |  |  *  PARISC TLB and cache flushing support | 
					
						
							|  |  |  |  *  Copyright (C) 2000-2001 Hewlett-Packard (John Marvin) | 
					
						
							|  |  |  |  *  Copyright (C) 2001 Matthew Wilcox (willy at parisc-linux.org) | 
					
						
							|  |  |  |  *  Copyright (C) 2002 Richard Hirst (rhirst with parisc-linux.org) | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *    This program is free software; you can redistribute it and/or modify
 | 
					
						
							|  |  |  |  *    it under the terms of the GNU General Public License as published by | 
					
						
							|  |  |  |  *    the Free Software Foundation; either version 2, or (at your option)
 | 
					
						
							|  |  |  |  *    any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *    This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
					
						
							|  |  |  |  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  *    GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *    You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  *    along with this program; if not, write to the Free Software
 | 
					
						
							|  |  |  |  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  |  * NOTE: fdc,fic, and pdc instructions that use base register modification | 
					
						
							|  |  |  |  *       should only use index and base registers that are not shadowed, | 
					
						
							|  |  |  |  *       so that the fast path emulation in the non access miss handler | 
					
						
							|  |  |  |  *       can be used. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.level	2.0w | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	.level	2.0 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <asm/psw.h> | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | #include <asm/assembly.h> | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #include <asm/pgtable.h> | 
					
						
							|  |  |  | #include <asm/cache.h> | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | #include <linux/linkage.h> | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-22 14:36:31 -04:00
										 |  |  | 	.text | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.align	128
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENTRY(flush_tlb_all_local) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* | 
					
						
							|  |  |  | 	 * The pitlbe and pdtlbe instructions should only be used to | 
					
						
							|  |  |  | 	 * flush the entire tlb. Also, there needs to be no intervening | 
					
						
							|  |  |  | 	 * tlb operations, e.g. tlb misses, so the operation needs | 
					
						
							|  |  |  | 	 * to happen in real mode with all interruptions disabled. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	/* pcxt_ssm_bug	- relied upon translation! PA 2.0 Arch. F-4 and F-5 */ | 
					
						
							| 
									
										
										
										
											2006-04-20 20:40:23 +00:00
										 |  |  | 	rsm		PSW_SM_I, %r19		/* save I-bit state */ | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	load32		PA(1f), %r1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	rsm		PSW_SM_Q, %r0		/* prep to load iia queue */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	mtctl		%r0, %cr17		/* Clear IIASQ tail */ | 
					
						
							|  |  |  | 	mtctl		%r0, %cr17		/* Clear IIASQ head */ | 
					
						
							|  |  |  | 	mtctl		%r1, %cr18		/* IIAOQ head */ | 
					
						
							|  |  |  | 	ldo		4(%r1), %r1 | 
					
						
							|  |  |  | 	mtctl		%r1, %cr18		/* IIAOQ tail */ | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	load32		REAL_MODE_PSW, %r1 | 
					
						
							|  |  |  | 	mtctl           %r1, %ipsw | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	rfi | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-20 20:40:23 +00:00
										 |  |  | 1:      load32		PA(cache_info), %r1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* Flush Instruction Tlb */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	LDREG		ITLB_SID_BASE(%r1), %r20 | 
					
						
							|  |  |  | 	LDREG		ITLB_SID_STRIDE(%r1), %r21 | 
					
						
							|  |  |  | 	LDREG		ITLB_SID_COUNT(%r1), %r22 | 
					
						
							|  |  |  | 	LDREG		ITLB_OFF_BASE(%r1), %arg0 | 
					
						
							|  |  |  | 	LDREG		ITLB_OFF_STRIDE(%r1), %arg1 | 
					
						
							|  |  |  | 	LDREG		ITLB_OFF_COUNT(%r1), %arg2 | 
					
						
							|  |  |  | 	LDREG		ITLB_LOOP(%r1), %arg3 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(=)		-1, %arg3, fitoneloop	/* Preadjust and test */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	movb,<,n	%arg3, %r31, fitdone	/* If loop < 0, skip */ | 
					
						
							|  |  |  | 	copy		%arg0, %r28		/* Init base addr */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fitmanyloop:					/* Loop if LOOP >= 2 */ | 
					
						
							|  |  |  | 	mtsp		%r20, %sr1 | 
					
						
							|  |  |  | 	add		%r21, %r20, %r20	/* increment space */ | 
					
						
							|  |  |  | 	copy		%arg2, %r29		/* Init middle loop count */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fitmanymiddle:					/* Loop if LOOP >= 2 */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r31, fitmanymiddle	/* Adjusted inner loop decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pitlbe		0(%sr1, %r28) | 
					
						
							|  |  |  | 	pitlbe,m	%arg1(%sr1, %r28)	/* Last pitlbe and addr adjust */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r29, fitmanymiddle	/* Middle loop decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	copy		%arg3, %r31		/* Re-init inner loop count */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	movb,tr		%arg0, %r28, fitmanyloop /* Re-init base addr */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(<=),n	-1, %r22, fitdone	/* Outer loop count decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | fitoneloop:					/* Loop if LOOP = 1 */ | 
					
						
							|  |  |  | 	mtsp		%r20, %sr1 | 
					
						
							|  |  |  | 	copy		%arg0, %r28		/* init base addr */ | 
					
						
							|  |  |  | 	copy		%arg2, %r29		/* init middle loop count */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fitonemiddle:					/* Loop if LOOP = 1 */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r29, fitonemiddle	/* Middle loop count decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pitlbe,m	%arg1(%sr1, %r28)	/* pitlbe for one loop */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r22, fitoneloop	/* Outer loop count decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	add		%r21, %r20, %r20		/* increment space */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fitdone: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Flush Data Tlb */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	LDREG		DTLB_SID_BASE(%r1), %r20 | 
					
						
							|  |  |  | 	LDREG		DTLB_SID_STRIDE(%r1), %r21 | 
					
						
							|  |  |  | 	LDREG		DTLB_SID_COUNT(%r1), %r22 | 
					
						
							|  |  |  | 	LDREG		DTLB_OFF_BASE(%r1), %arg0 | 
					
						
							|  |  |  | 	LDREG		DTLB_OFF_STRIDE(%r1), %arg1 | 
					
						
							|  |  |  | 	LDREG		DTLB_OFF_COUNT(%r1), %arg2 | 
					
						
							|  |  |  | 	LDREG		DTLB_LOOP(%r1), %arg3 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(=)		-1, %arg3, fdtoneloop	/* Preadjust and test */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	movb,<,n	%arg3, %r31, fdtdone	/* If loop < 0, skip */ | 
					
						
							|  |  |  | 	copy		%arg0, %r28		/* Init base addr */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fdtmanyloop:					/* Loop if LOOP >= 2 */ | 
					
						
							|  |  |  | 	mtsp		%r20, %sr1 | 
					
						
							|  |  |  | 	add		%r21, %r20, %r20	/* increment space */ | 
					
						
							|  |  |  | 	copy		%arg2, %r29		/* Init middle loop count */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fdtmanymiddle:					/* Loop if LOOP >= 2 */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r31, fdtmanymiddle	/* Adjusted inner loop decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pdtlbe		0(%sr1, %r28) | 
					
						
							|  |  |  | 	pdtlbe,m	%arg1(%sr1, %r28)	/* Last pdtlbe and addr adjust */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r29, fdtmanymiddle	/* Middle loop decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	copy		%arg3, %r31		/* Re-init inner loop count */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	movb,tr		%arg0, %r28, fdtmanyloop /* Re-init base addr */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(<=),n	-1, %r22,fdtdone	/* Outer loop count decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | fdtoneloop:					/* Loop if LOOP = 1 */ | 
					
						
							|  |  |  | 	mtsp		%r20, %sr1 | 
					
						
							|  |  |  | 	copy		%arg0, %r28		/* init base addr */ | 
					
						
							|  |  |  | 	copy		%arg2, %r29		/* init middle loop count */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fdtonemiddle:					/* Loop if LOOP = 1 */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r29, fdtonemiddle	/* Middle loop count decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pdtlbe,m	%arg1(%sr1, %r28)	/* pdtlbe for one loop */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r22, fdtoneloop	/* Outer loop count decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	add		%r21, %r20, %r20	/* increment space */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | fdtdone: | 
					
						
							|  |  |  | 	/* | 
					
						
							|  |  |  | 	 * Switch back to virtual mode | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	/* pcxt_ssm_bug */ | 
					
						
							|  |  |  | 	rsm		PSW_SM_I, %r0 | 
					
						
							|  |  |  | 	load32		2f, %r1 | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	rsm		PSW_SM_Q, %r0		/* prep to load iia queue */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	mtctl		%r0, %cr17		/* Clear IIASQ tail */ | 
					
						
							|  |  |  | 	mtctl		%r0, %cr17		/* Clear IIASQ head */ | 
					
						
							|  |  |  | 	mtctl		%r1, %cr18		/* IIAOQ head */ | 
					
						
							|  |  |  | 	ldo		4(%r1), %r1 | 
					
						
							|  |  |  | 	mtctl		%r1, %cr18		/* IIAOQ tail */ | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	load32		KERNEL_PSW, %r1 | 
					
						
							|  |  |  | 	or		%r1, %r19, %r1	/* I-bit to state on entry */ | 
					
						
							|  |  |  | 	mtctl		%r1, %ipsw	/* restore I-bit (entire PSW) */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	rfi | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 2:      bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	.exit | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENDPROC(flush_tlb_all_local) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	.import cache_info,data | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENTRY(flush_instruction_cache_local) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-04-20 20:40:23 +00:00
										 |  |  | 	load32		cache_info, %r1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* Flush Instruction Cache */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	LDREG		ICACHE_BASE(%r1), %arg0 | 
					
						
							|  |  |  | 	LDREG		ICACHE_STRIDE(%r1), %arg1 | 
					
						
							|  |  |  | 	LDREG		ICACHE_COUNT(%r1), %arg2 | 
					
						
							|  |  |  | 	LDREG		ICACHE_LOOP(%r1), %arg3 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	rsm		PSW_SM_I, %r22		/* No mmgt ops during loop*/ | 
					
						
							|  |  |  | 	mtsp		%r0, %sr1 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(=)		-1, %arg3, fioneloop	/* Preadjust and test */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	movb,<,n	%arg3, %r31, fisync	/* If loop < 0, do sync */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fimanyloop:					/* Loop if LOOP >= 2 */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r31, fimanyloop	/* Adjusted inner loop decr */ | 
					
						
							| 
									
										
										
										
											2005-10-21 22:55:51 -04:00
										 |  |  | 	fice            %r0(%sr1, %arg0) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	fice,m		%arg1(%sr1, %arg0)	/* Last fice and addr adjust */ | 
					
						
							|  |  |  | 	movb,tr		%arg3, %r31, fimanyloop	/* Re-init inner loop count */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(<=),n	-1, %arg2, fisync	/* Outer loop decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | fioneloop:					/* Loop if LOOP = 1 */ | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	/* Some implementations may flush with a single fice instruction */ | 
					
						
							|  |  |  | 	cmpib,COND(>>=),n	15, %arg2, fioneloop2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fioneloop1: | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	addib,COND(>)	-16, %arg2, fioneloop1 | 
					
						
							|  |  |  | 	fice,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Check if done */ | 
					
						
							|  |  |  | 	cmpb,COND(=),n	%arg2, %r0, fisync	/* Predict branch taken */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fioneloop2: | 
					
						
							|  |  |  | 	addib,COND(>)	-1, %arg2, fioneloop2	/* Outer loop count decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	fice,m		%arg1(%sr1, %arg0)	/* Fice for one loop */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fisync: | 
					
						
							|  |  |  | 	sync | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	mtsm		%r22			/* restore I-bit */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENDPROC(flush_instruction_cache_local) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | 	.import cache_info, data | 
					
						
							|  |  |  | ENTRY(flush_data_cache_local) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	load32		cache_info, %r1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* Flush Data Cache */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	LDREG		DCACHE_BASE(%r1), %arg0 | 
					
						
							|  |  |  | 	LDREG		DCACHE_STRIDE(%r1), %arg1 | 
					
						
							|  |  |  | 	LDREG		DCACHE_COUNT(%r1), %arg2 | 
					
						
							|  |  |  | 	LDREG		DCACHE_LOOP(%r1), %arg3 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	rsm		PSW_SM_I, %r22		/* No mmgt ops during loop*/ | 
					
						
							|  |  |  | 	mtsp		%r0, %sr1 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(=)		-1, %arg3, fdoneloop	/* Preadjust and test */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	movb,<,n	%arg3, %r31, fdsync	/* If loop < 0, do sync */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fdmanyloop:					/* Loop if LOOP >= 2 */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r31, fdmanyloop	/* Adjusted inner loop decr */ | 
					
						
							| 
									
										
										
										
											2005-10-21 22:55:51 -04:00
										 |  |  | 	fdce		%r0(%sr1, %arg0) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	fdce,m		%arg1(%sr1, %arg0)	/* Last fdce and addr adjust */ | 
					
						
							|  |  |  | 	movb,tr		%arg3, %r31, fdmanyloop	/* Re-init inner loop count */ | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(<=),n	-1, %arg2, fdsync	/* Outer loop decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | fdoneloop:					/* Loop if LOOP = 1 */ | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	/* Some implementations may flush with a single fdce instruction */ | 
					
						
							|  |  |  | 	cmpib,COND(>>=),n	15, %arg2, fdoneloop2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fdoneloop1: | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 	addib,COND(>)	-16, %arg2, fdoneloop1 | 
					
						
							|  |  |  | 	fdce,m		%arg1(%sr1, %arg0) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Check if done */ | 
					
						
							|  |  |  | 	cmpb,COND(=),n	%arg2, %r0, fdsync	/* Predict branch taken */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fdoneloop2: | 
					
						
							|  |  |  | 	addib,COND(>)	-1, %arg2, fdoneloop2	/* Outer loop count decr */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	fdce,m		%arg1(%sr1, %arg0)	/* Fdce for one loop */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fdsync: | 
					
						
							|  |  |  | 	syncdma | 
					
						
							|  |  |  | 	sync | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	mtsm		%r22			/* restore I-bit */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENDPROC(flush_data_cache_local) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	.align	16
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | /* Macros to serialize TLB purge operations on SMP.  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.macro	tlb_lock	la,flags,tmp | 
					
						
							|  |  |  | #ifdef CONFIG_SMP | 
					
						
							|  |  |  | 	ldil		L%pa_tlb_lock,%r1 | 
					
						
							|  |  |  | 	ldo		R%pa_tlb_lock(%r1),\la | 
					
						
							|  |  |  | 	rsm		PSW_SM_I,\flags | 
					
						
							|  |  |  | 1:	LDCW		0(\la),\tmp | 
					
						
							|  |  |  | 	cmpib,<>,n	0,\tmp,3f | 
					
						
							|  |  |  | 2:	ldw		0(\la),\tmp | 
					
						
							|  |  |  | 	cmpb,<>		%r0,\tmp,1b | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	b,n		2b | 
					
						
							|  |  |  | 3: | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 	.endm | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.macro	tlb_unlock	la,flags,tmp | 
					
						
							|  |  |  | #ifdef CONFIG_SMP | 
					
						
							|  |  |  | 	ldi		1,\tmp | 
					
						
							|  |  |  | 	stw		\tmp,0(\la) | 
					
						
							|  |  |  | 	mtsm		\flags | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 	.endm | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Clear page using kernel mapping.  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ENTRY(clear_page_asm) | 
					
						
							|  |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef CONFIG_64BIT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Unroll the loop.  */ | 
					
						
							|  |  |  | 	ldi		(PAGE_SIZE / 128), %r1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1: | 
					
						
							|  |  |  | 	std		%r0, 0(%r26) | 
					
						
							|  |  |  | 	std		%r0, 8(%r26) | 
					
						
							|  |  |  | 	std		%r0, 16(%r26) | 
					
						
							|  |  |  | 	std		%r0, 24(%r26) | 
					
						
							|  |  |  | 	std		%r0, 32(%r26) | 
					
						
							|  |  |  | 	std		%r0, 40(%r26) | 
					
						
							|  |  |  | 	std		%r0, 48(%r26) | 
					
						
							|  |  |  | 	std		%r0, 56(%r26) | 
					
						
							|  |  |  | 	std		%r0, 64(%r26) | 
					
						
							|  |  |  | 	std		%r0, 72(%r26) | 
					
						
							|  |  |  | 	std		%r0, 80(%r26) | 
					
						
							|  |  |  | 	std		%r0, 88(%r26) | 
					
						
							|  |  |  | 	std		%r0, 96(%r26) | 
					
						
							|  |  |  | 	std		%r0, 104(%r26) | 
					
						
							|  |  |  | 	std		%r0, 112(%r26) | 
					
						
							|  |  |  | 	std		%r0, 120(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Note reverse branch hint for addib is taken.  */ | 
					
						
							|  |  |  | 	addib,COND(>),n	-1, %r1, 1b | 
					
						
							|  |  |  | 	ldo		128(%r26), %r26 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* | 
					
						
							|  |  |  | 	 * Note that until (if) we start saving the full 64-bit register | 
					
						
							|  |  |  | 	 * values on interrupt, we can't use std on a 32 bit kernel. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	ldi		(PAGE_SIZE / 64), %r1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1: | 
					
						
							|  |  |  | 	stw		%r0, 0(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 4(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 8(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 12(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 16(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 20(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 24(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 28(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 32(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 36(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 40(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 44(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 48(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 52(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 56(%r26) | 
					
						
							|  |  |  | 	stw		%r0, 60(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	addib,COND(>),n	-1, %r1, 1b | 
					
						
							|  |  |  | 	ldo		64(%r26), %r26 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							|  |  |  | ENDPROC(clear_page_asm) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* Copy page using kernel mapping.  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ENTRY(copy_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	/* PA8x00 CPUs can consume 2 loads or 1 store per cycle. | 
					
						
							|  |  |  | 	 * Unroll the loop by hand and arrange insn appropriately. | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	 * Prefetch doesn't improve performance on rp3440. | 
					
						
							|  |  |  | 	 * GCC probably can do this just as well... | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	 */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-18 00:04:50 -07:00
										 |  |  | 	ldi		(PAGE_SIZE / 128), %r1 | 
					
						
							| 
									
										
										
										
											2006-04-20 20:40:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 1:	ldd		0(%r25), %r19 | 
					
						
							|  |  |  | 	ldd		8(%r25), %r20 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	ldd		16(%r25), %r21 | 
					
						
							|  |  |  | 	ldd		24(%r25), %r22 | 
					
						
							|  |  |  | 	std		%r19, 0(%r26) | 
					
						
							|  |  |  | 	std		%r20, 8(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		32(%r25), %r19 | 
					
						
							|  |  |  | 	ldd		40(%r25), %r20 | 
					
						
							|  |  |  | 	std		%r21, 16(%r26) | 
					
						
							|  |  |  | 	std		%r22, 24(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		48(%r25), %r21 | 
					
						
							|  |  |  | 	ldd		56(%r25), %r22 | 
					
						
							|  |  |  | 	std		%r19, 32(%r26) | 
					
						
							|  |  |  | 	std		%r20, 40(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		64(%r25), %r19 | 
					
						
							|  |  |  | 	ldd		72(%r25), %r20 | 
					
						
							|  |  |  | 	std		%r21, 48(%r26) | 
					
						
							|  |  |  | 	std		%r22, 56(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		80(%r25), %r21 | 
					
						
							|  |  |  | 	ldd		88(%r25), %r22 | 
					
						
							|  |  |  | 	std		%r19, 64(%r26) | 
					
						
							|  |  |  | 	std		%r20, 72(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		 96(%r25), %r19 | 
					
						
							|  |  |  | 	ldd		104(%r25), %r20 | 
					
						
							|  |  |  | 	std		%r21, 80(%r26) | 
					
						
							|  |  |  | 	std		%r22, 88(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		112(%r25), %r21 | 
					
						
							|  |  |  | 	ldd		120(%r25), %r22 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	ldo		128(%r25), %r25 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	std		%r19, 96(%r26) | 
					
						
							|  |  |  | 	std		%r20, 104(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	std		%r21, 112(%r26) | 
					
						
							|  |  |  | 	std		%r22, 120(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	/* Note reverse branch hint for addib is taken.  */ | 
					
						
							|  |  |  | 	addib,COND(>),n	-1, %r1, 1b | 
					
						
							|  |  |  | 	ldo		128(%r26), %r26 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* | 
					
						
							|  |  |  | 	 * This loop is optimized for PCXL/PCXL2 ldw/ldw and stw/stw | 
					
						
							|  |  |  | 	 * bundles (very restricted rules for bundling). | 
					
						
							|  |  |  | 	 * Note that until (if) we start saving | 
					
						
							|  |  |  | 	 * the full 64 bit register values on interrupt, we can't | 
					
						
							|  |  |  | 	 * use ldd/std on a 32 bit kernel. | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2005-10-21 22:55:34 -04:00
										 |  |  | 	ldw		0(%r25), %r19 | 
					
						
							| 
									
										
										
										
											2007-10-18 00:04:50 -07:00
										 |  |  | 	ldi		(PAGE_SIZE / 64), %r1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 1: | 
					
						
							|  |  |  | 	ldw		4(%r25), %r20 | 
					
						
							|  |  |  | 	ldw		8(%r25), %r21 | 
					
						
							|  |  |  | 	ldw		12(%r25), %r22 | 
					
						
							|  |  |  | 	stw		%r19, 0(%r26) | 
					
						
							|  |  |  | 	stw		%r20, 4(%r26) | 
					
						
							|  |  |  | 	stw		%r21, 8(%r26) | 
					
						
							|  |  |  | 	stw		%r22, 12(%r26) | 
					
						
							|  |  |  | 	ldw		16(%r25), %r19 | 
					
						
							|  |  |  | 	ldw		20(%r25), %r20 | 
					
						
							|  |  |  | 	ldw		24(%r25), %r21 | 
					
						
							|  |  |  | 	ldw		28(%r25), %r22 | 
					
						
							|  |  |  | 	stw		%r19, 16(%r26) | 
					
						
							|  |  |  | 	stw		%r20, 20(%r26) | 
					
						
							|  |  |  | 	stw		%r21, 24(%r26) | 
					
						
							|  |  |  | 	stw		%r22, 28(%r26) | 
					
						
							|  |  |  | 	ldw		32(%r25), %r19 | 
					
						
							|  |  |  | 	ldw		36(%r25), %r20 | 
					
						
							|  |  |  | 	ldw		40(%r25), %r21 | 
					
						
							|  |  |  | 	ldw		44(%r25), %r22 | 
					
						
							|  |  |  | 	stw		%r19, 32(%r26) | 
					
						
							|  |  |  | 	stw		%r20, 36(%r26) | 
					
						
							|  |  |  | 	stw		%r21, 40(%r26) | 
					
						
							|  |  |  | 	stw		%r22, 44(%r26) | 
					
						
							|  |  |  | 	ldw		48(%r25), %r19 | 
					
						
							|  |  |  | 	ldw		52(%r25), %r20 | 
					
						
							|  |  |  | 	ldw		56(%r25), %r21 | 
					
						
							|  |  |  | 	ldw		60(%r25), %r22 | 
					
						
							|  |  |  | 	stw		%r19, 48(%r26) | 
					
						
							|  |  |  | 	stw		%r20, 52(%r26) | 
					
						
							| 
									
										
										
										
											2005-10-21 22:55:34 -04:00
										 |  |  | 	ldo		64(%r25), %r25 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	stw		%r21, 56(%r26) | 
					
						
							|  |  |  | 	stw		%r22, 60(%r26) | 
					
						
							|  |  |  | 	ldo		64(%r26), %r26 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>),n	-1, %r1, 1b | 
					
						
							| 
									
										
										
										
											2005-10-21 22:55:34 -04:00
										 |  |  | 	ldw		0(%r25), %r19 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | ENDPROC(copy_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  |  * NOTE: Code in clear_user_page has a hard coded dependency on the | 
					
						
							|  |  |  |  *       maximum alias boundary being 4 Mb. We've been assured by the | 
					
						
							|  |  |  |  *       parisc chip designers that there will not ever be a parisc | 
					
						
							|  |  |  |  *       chip with a larger alias boundary (Never say never :-) ). | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *       Subtle: the dtlb miss handlers support the temp alias region by | 
					
						
							|  |  |  |  *       "knowing" that if a dtlb miss happens within the temp alias | 
					
						
							|  |  |  |  *       region it must have occurred while in clear_user_page. Since | 
					
						
							|  |  |  |  *       this routine makes use of processor local translations, we | 
					
						
							|  |  |  |  *       don't want to insert them into the kernel page table. Instead, | 
					
						
							|  |  |  |  *       we load up some general registers (they need to be registers | 
					
						
							|  |  |  |  *       which aren't shadowed) with the physical page numbers (preshifted | 
					
						
							|  |  |  |  *       for tlb insertion) needed to insert the translations. When we | 
					
						
							|  |  |  |  *       miss on the translation, the dtlb miss handler inserts the | 
					
						
							|  |  |  |  *       translation into the tlb using these values: | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  *          %r26 physical page (shifted for tlb insert) of "to" translation | 
					
						
							|  |  |  |  *          %r23 physical page (shifted for tlb insert) of "from" translation | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-02 20:41:45 +00:00
										 |  |  |         /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ | 
					
						
							|  |  |  |         #define PAGE_ADD_SHIFT  (PAGE_SHIFT-12) | 
					
						
							|  |  |  |         .macro          convert_phys_for_tlb_insert20  phys | 
					
						
							|  |  |  |         extrd,u         \phys, 56-PAGE_ADD_SHIFT, 32-PAGE_ADD_SHIFT, \phys | 
					
						
							|  |  |  | #if _PAGE_SIZE_ENCODING_DEFAULT | 
					
						
							|  |  |  |         depdi           _PAGE_SIZE_ENCODING_DEFAULT, 63, (63-58), \phys | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 	.endm | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	/* | 
					
						
							|  |  |  | 	 * We can't do this since copy_user_page is used to bring in | 
					
						
							|  |  |  | 	 * file data that might have instructions. Since the data would | 
					
						
							|  |  |  | 	 * then need to be flushed out so the i-fetch can see it, it | 
					
						
							|  |  |  | 	 * makes more sense to just copy through the kernel translation | 
					
						
							|  |  |  | 	 * and flush it. | 
					
						
							|  |  |  | 	 * | 
					
						
							|  |  |  | 	 * I'm still keeping this around because it may be possible to | 
					
						
							|  |  |  | 	 * use it if more information is passed into copy_user_page(). | 
					
						
							|  |  |  | 	 * Have to do some measurements to see if it is worthwhile to | 
					
						
							|  |  |  | 	 * lobby for such a change. | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	 * | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	 */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENTRY(copy_user_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	/* Convert virtual `to' and `from' addresses to physical addresses. | 
					
						
							|  |  |  | 	   Move `from' physical address to non shadowed register.  */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	ldil		L%(__PAGE_OFFSET), %r1 | 
					
						
							|  |  |  | 	sub		%r26, %r1, %r26 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	sub		%r25, %r1, %r23 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%(TMPALIAS_MAP_START), %r28 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | #if (TMPALIAS_MAP_START >= 0x80000000) | 
					
						
							|  |  |  | 	depdi		0, 31,32, %r28		/* clear any sign extension */ | 
					
						
							|  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2013-05-02 20:41:45 +00:00
										 |  |  | 	convert_phys_for_tlb_insert20 %r26	/* convert phys addr to tlb insert format */ | 
					
						
							|  |  |  | 	convert_phys_for_tlb_insert20 %r23	/* convert phys addr to tlb insert format */ | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	depd		%r24,63,22, %r28	/* Form aliased virtual address 'to' */ | 
					
						
							| 
									
										
										
										
											2013-05-16 20:51:41 +00:00
										 |  |  | 	depdi		0, 63,PAGE_SHIFT, %r28	/* Clear any offset bits */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	copy		%r28, %r29 | 
					
						
							|  |  |  | 	depdi		1, 41,1, %r29		/* Form aliased virtual address 'from' */ | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	extrw,u		%r26, 24,25, %r26	/* convert phys addr to tlb insert format */ | 
					
						
							|  |  |  | 	extrw,u		%r23, 24,25, %r23	/* convert phys addr to tlb insert format */ | 
					
						
							|  |  |  | 	depw		%r24, 31,22, %r28	/* Form aliased virtual address 'to' */ | 
					
						
							| 
									
										
										
										
											2013-05-16 20:51:41 +00:00
										 |  |  | 	depwi		0, 31,PAGE_SHIFT, %r28	/* Clear any offset bits */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	copy		%r28, %r29 | 
					
						
							|  |  |  | 	depwi		1, 9,1, %r29		/* Form aliased virtual address 'from' */ | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Purge any old translations */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | #ifdef CONFIG_PA20 | 
					
						
							|  |  |  | 	pdtlb,l		0(%r28) | 
					
						
							|  |  |  | 	pdtlb,l		0(%r29) | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	tlb_lock	%r20,%r21,%r22 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pdtlb		0(%r28) | 
					
						
							|  |  |  | 	pdtlb		0(%r29) | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	tlb_unlock	%r20,%r21,%r22 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifdef CONFIG_64BIT | 
					
						
							|  |  |  | 	/* PA8x00 CPUs can consume 2 loads or 1 store per cycle. | 
					
						
							|  |  |  | 	 * Unroll the loop by hand and arrange insn appropriately. | 
					
						
							|  |  |  | 	 * GCC probably can do this just as well. | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	ldd		0(%r29), %r19 | 
					
						
							|  |  |  | 	ldi		(PAGE_SIZE / 128), %r1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1:	ldd		8(%r29), %r20 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		16(%r29), %r21 | 
					
						
							|  |  |  | 	ldd		24(%r29), %r22 | 
					
						
							|  |  |  | 	std		%r19, 0(%r28) | 
					
						
							|  |  |  | 	std		%r20, 8(%r28) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		32(%r29), %r19 | 
					
						
							|  |  |  | 	ldd		40(%r29), %r20 | 
					
						
							|  |  |  | 	std		%r21, 16(%r28) | 
					
						
							|  |  |  | 	std		%r22, 24(%r28) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		48(%r29), %r21 | 
					
						
							|  |  |  | 	ldd		56(%r29), %r22 | 
					
						
							|  |  |  | 	std		%r19, 32(%r28) | 
					
						
							|  |  |  | 	std		%r20, 40(%r28) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		64(%r29), %r19 | 
					
						
							|  |  |  | 	ldd		72(%r29), %r20 | 
					
						
							|  |  |  | 	std		%r21, 48(%r28) | 
					
						
							|  |  |  | 	std		%r22, 56(%r28) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		80(%r29), %r21 | 
					
						
							|  |  |  | 	ldd		88(%r29), %r22 | 
					
						
							|  |  |  | 	std		%r19, 64(%r28) | 
					
						
							|  |  |  | 	std		%r20, 72(%r28) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		 96(%r29), %r19 | 
					
						
							|  |  |  | 	ldd		104(%r29), %r20 | 
					
						
							|  |  |  | 	std		%r21, 80(%r28) | 
					
						
							|  |  |  | 	std		%r22, 88(%r28) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldd		112(%r29), %r21 | 
					
						
							|  |  |  | 	ldd		120(%r29), %r22 | 
					
						
							|  |  |  | 	std		%r19, 96(%r28) | 
					
						
							|  |  |  | 	std		%r20, 104(%r28) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldo		128(%r29), %r29 | 
					
						
							|  |  |  | 	std		%r21, 112(%r28) | 
					
						
							|  |  |  | 	std		%r22, 120(%r28) | 
					
						
							|  |  |  | 	ldo		128(%r28), %r28 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* conditional branches nullify on forward taken branch, and on | 
					
						
							|  |  |  | 	 * non-taken backward branch. Note that .+4 is a backwards branch. | 
					
						
							|  |  |  | 	 * The ldd should only get executed if the branch is taken. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	addib,COND(>),n	-1, %r1, 1b		/* bundle 10 */ | 
					
						
							|  |  |  | 	ldd		0(%r29), %r19		/* start next loads */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	ldi		(PAGE_SIZE / 64), %r1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* | 
					
						
							|  |  |  | 	 * This loop is optimized for PCXL/PCXL2 ldw/ldw and stw/stw | 
					
						
							|  |  |  | 	 * bundles (very restricted rules for bundling). It probably | 
					
						
							|  |  |  | 	 * does OK on PCXU and better, but we could do better with | 
					
						
							|  |  |  | 	 * ldd/std instructions. Note that until (if) we start saving | 
					
						
							|  |  |  | 	 * the full 64 bit register values on interrupt, we can't | 
					
						
							|  |  |  | 	 * use ldd/std on a 32 bit kernel. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 1:	ldw		0(%r29), %r19 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	ldw		4(%r29), %r20 | 
					
						
							|  |  |  | 	ldw		8(%r29), %r21 | 
					
						
							|  |  |  | 	ldw		12(%r29), %r22 | 
					
						
							|  |  |  | 	stw		%r19, 0(%r28) | 
					
						
							|  |  |  | 	stw		%r20, 4(%r28) | 
					
						
							|  |  |  | 	stw		%r21, 8(%r28) | 
					
						
							|  |  |  | 	stw		%r22, 12(%r28) | 
					
						
							|  |  |  | 	ldw		16(%r29), %r19 | 
					
						
							|  |  |  | 	ldw		20(%r29), %r20 | 
					
						
							|  |  |  | 	ldw		24(%r29), %r21 | 
					
						
							|  |  |  | 	ldw		28(%r29), %r22 | 
					
						
							|  |  |  | 	stw		%r19, 16(%r28) | 
					
						
							|  |  |  | 	stw		%r20, 20(%r28) | 
					
						
							|  |  |  | 	stw		%r21, 24(%r28) | 
					
						
							|  |  |  | 	stw		%r22, 28(%r28) | 
					
						
							|  |  |  | 	ldw		32(%r29), %r19 | 
					
						
							|  |  |  | 	ldw		36(%r29), %r20 | 
					
						
							|  |  |  | 	ldw		40(%r29), %r21 | 
					
						
							|  |  |  | 	ldw		44(%r29), %r22 | 
					
						
							|  |  |  | 	stw		%r19, 32(%r28) | 
					
						
							|  |  |  | 	stw		%r20, 36(%r28) | 
					
						
							|  |  |  | 	stw		%r21, 40(%r28) | 
					
						
							|  |  |  | 	stw		%r22, 44(%r28) | 
					
						
							|  |  |  | 	ldw		48(%r29), %r19 | 
					
						
							|  |  |  | 	ldw		52(%r29), %r20 | 
					
						
							|  |  |  | 	ldw		56(%r29), %r21 | 
					
						
							|  |  |  | 	ldw		60(%r29), %r22 | 
					
						
							|  |  |  | 	stw		%r19, 48(%r28) | 
					
						
							|  |  |  | 	stw		%r20, 52(%r28) | 
					
						
							|  |  |  | 	stw		%r21, 56(%r28) | 
					
						
							|  |  |  | 	stw		%r22, 60(%r28) | 
					
						
							|  |  |  | 	ldo		64(%r28), %r28 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r1,1b | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	ldo		64(%r29), %r29 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | #endif | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENDPROC(copy_user_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | ENTRY(clear_user_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	tophys_r1	%r26 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%(TMPALIAS_MAP_START), %r28 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #if (TMPALIAS_MAP_START >= 0x80000000) | 
					
						
							|  |  |  | 	depdi		0, 31,32, %r28		/* clear any sign extension */ | 
					
						
							|  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2013-05-02 20:41:45 +00:00
										 |  |  | 	convert_phys_for_tlb_insert20 %r26	/* convert phys addr to tlb insert format */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	depd		%r25, 63,22, %r28	/* Form aliased virtual address 'to' */ | 
					
						
							| 
									
										
										
										
											2013-05-02 20:41:45 +00:00
										 |  |  | 	depdi		0, 63,PAGE_SHIFT, %r28	/* Clear any offset bits */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #else | 
					
						
							|  |  |  | 	extrw,u		%r26, 24,25, %r26	/* convert phys addr to tlb insert format */ | 
					
						
							|  |  |  | 	depw		%r25, 31,22, %r28	/* Form aliased virtual address 'to' */ | 
					
						
							| 
									
										
										
										
											2013-05-16 20:51:41 +00:00
										 |  |  | 	depwi		0, 31,PAGE_SHIFT, %r28	/* Clear any offset bits */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Purge any old translation */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | #ifdef CONFIG_PA20 | 
					
						
							|  |  |  | 	pdtlb,l		0(%r28) | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	tlb_lock	%r20,%r21,%r22 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pdtlb		0(%r28) | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	tlb_unlock	%r20,%r21,%r22 | 
					
						
							|  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2007-10-18 00:04:50 -07:00
										 |  |  | 	ldi		(PAGE_SIZE / 128), %r1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* PREFETCH (Write) has not (yet) been proven to help here */ | 
					
						
							| 
									
										
										
										
											2006-04-20 20:40:23 +00:00
										 |  |  | 	/* #define	PREFETCHW_OP	ldd		256(%0), %r0 */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 1:	std		%r0, 0(%r28) | 
					
						
							|  |  |  | 	std		%r0, 8(%r28) | 
					
						
							|  |  |  | 	std		%r0, 16(%r28) | 
					
						
							|  |  |  | 	std		%r0, 24(%r28) | 
					
						
							|  |  |  | 	std		%r0, 32(%r28) | 
					
						
							|  |  |  | 	std		%r0, 40(%r28) | 
					
						
							|  |  |  | 	std		%r0, 48(%r28) | 
					
						
							|  |  |  | 	std		%r0, 56(%r28) | 
					
						
							|  |  |  | 	std		%r0, 64(%r28) | 
					
						
							|  |  |  | 	std		%r0, 72(%r28) | 
					
						
							|  |  |  | 	std		%r0, 80(%r28) | 
					
						
							|  |  |  | 	std		%r0, 88(%r28) | 
					
						
							|  |  |  | 	std		%r0, 96(%r28) | 
					
						
							|  |  |  | 	std		%r0, 104(%r28) | 
					
						
							|  |  |  | 	std		%r0, 112(%r28) | 
					
						
							|  |  |  | 	std		%r0, 120(%r28) | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r1, 1b | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	ldo		128(%r28), %r28 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #else	/* ! CONFIG_64BIT */ | 
					
						
							| 
									
										
										
										
											2007-10-18 00:04:50 -07:00
										 |  |  | 	ldi		(PAGE_SIZE / 64), %r1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 1:	stw		%r0, 0(%r28) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	stw		%r0, 4(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 8(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 12(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 16(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 20(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 24(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 28(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 32(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 36(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 40(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 44(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 48(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 52(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 56(%r28) | 
					
						
							|  |  |  | 	stw		%r0, 60(%r28) | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	addib,COND(>)		-1, %r1, 1b | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	ldo		64(%r28), %r28 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #endif	/* CONFIG_64BIT */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | ENDPROC(clear_user_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | ENTRY(flush_dcache_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	ldil		L%(TMPALIAS_MAP_START), %r28 | 
					
						
							|  |  |  | #ifdef CONFIG_64BIT | 
					
						
							|  |  |  | #if (TMPALIAS_MAP_START >= 0x80000000) | 
					
						
							|  |  |  | 	depdi		0, 31,32, %r28		/* clear any sign extension */ | 
					
						
							|  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2013-05-02 20:41:45 +00:00
										 |  |  | 	convert_phys_for_tlb_insert20 %r26	/* convert phys addr to tlb insert format */ | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	depd		%r25, 63,22, %r28	/* Form aliased virtual address 'to' */ | 
					
						
							| 
									
										
										
										
											2013-05-02 20:41:45 +00:00
										 |  |  | 	depdi		0, 63,PAGE_SHIFT, %r28	/* Clear any offset bits */ | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | #else | 
					
						
							|  |  |  | 	extrw,u		%r26, 24,25, %r26	/* convert phys addr to tlb insert format */ | 
					
						
							|  |  |  | 	depw		%r25, 31,22, %r28	/* Form aliased virtual address 'to' */ | 
					
						
							| 
									
										
										
										
											2013-05-16 20:51:41 +00:00
										 |  |  | 	depwi		0, 31,PAGE_SHIFT, %r28	/* Clear any offset bits */ | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Purge any old translation */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | #ifdef CONFIG_PA20 | 
					
						
							|  |  |  | 	pdtlb,l		0(%r28) | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	tlb_lock	%r20,%r21,%r22 | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	pdtlb		0(%r28) | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	tlb_unlock	%r20,%r21,%r22 | 
					
						
							|  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	ldil		L%dcache_stride, %r1 | 
					
						
							| 
									
										
										
										
											2013-06-02 12:21:48 -04:00
										 |  |  | 	ldw		R%dcache_stride(%r1), r31 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	depdi,z		1, 63-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	depwi,z		1, 31-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	add		%r28, %r25, %r25 | 
					
						
							| 
									
										
										
										
											2013-06-02 12:21:48 -04:00
										 |  |  | 	sub		%r25, r31, %r25 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1:      fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							|  |  |  | 	fdc,m		r31(%r28) | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	cmpb,COND(<<)		%r28, %r25,1b | 
					
						
							| 
									
										
										
										
											2013-06-02 12:21:48 -04:00
										 |  |  | 	fdc,m		r31(%r28) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	sync | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef CONFIG_PA20 | 
					
						
							|  |  |  | 	pdtlb,l		0(%r25) | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	tlb_lock	%r20,%r21,%r22 | 
					
						
							|  |  |  | 	pdtlb		0(%r25) | 
					
						
							|  |  |  | 	tlb_unlock	%r20,%r21,%r22 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	bv		%r0(%r2) | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	nop | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | ENDPROC(flush_dcache_page_asm) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ENTRY(flush_icache_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	ldil		L%(TMPALIAS_MAP_START), %r28 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | #if (TMPALIAS_MAP_START >= 0x80000000) | 
					
						
							|  |  |  | 	depdi		0, 31,32, %r28		/* clear any sign extension */ | 
					
						
							|  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2013-05-02 20:41:45 +00:00
										 |  |  | 	convert_phys_for_tlb_insert20 %r26	/* convert phys addr to tlb insert format */ | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	depd		%r25, 63,22, %r28	/* Form aliased virtual address 'to' */ | 
					
						
							| 
									
										
										
										
											2013-05-16 20:51:41 +00:00
										 |  |  | 	depdi		0, 63,PAGE_SHIFT, %r28	/* Clear any offset bits */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #else | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	extrw,u		%r26, 24,25, %r26	/* convert phys addr to tlb insert format */ | 
					
						
							|  |  |  | 	depw		%r25, 31,22, %r28	/* Form aliased virtual address 'to' */ | 
					
						
							| 
									
										
										
										
											2013-05-16 20:51:41 +00:00
										 |  |  | 	depwi		0, 31,PAGE_SHIFT, %r28	/* Clear any offset bits */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	/* Purge any old translation */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | #ifdef CONFIG_PA20 | 
					
						
							|  |  |  | 	pitlb,l         %r0(%sr4,%r28) | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	tlb_lock        %r20,%r21,%r22 | 
					
						
							|  |  |  | 	pitlb           (%sr4,%r28) | 
					
						
							|  |  |  | 	tlb_unlock      %r20,%r21,%r22 | 
					
						
							|  |  |  | #endif | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%icache_stride, %r1 | 
					
						
							| 
									
										
										
										
											2013-06-02 12:21:48 -04:00
										 |  |  | 	ldw		R%icache_stride(%r1), %r31 | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef CONFIG_64BIT | 
					
						
							|  |  |  | 	depdi,z		1, 63-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	depwi,z		1, 31-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 	add		%r28, %r25, %r25 | 
					
						
							| 
									
										
										
										
											2013-06-02 12:21:48 -04:00
										 |  |  | 	sub		%r25, %r31, %r25 | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-16 10:14:52 +01:00
										 |  |  | 	/* fic only has the type 26 form on PA1.1, requiring an | 
					
						
							|  |  |  | 	 * explicit space specification, so use %sr4 */ | 
					
						
							| 
									
										
										
										
											2013-06-02 12:21:48 -04:00
										 |  |  | 1:      fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							|  |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							| 
									
										
										
										
											2013-05-02 20:41:45 +00:00
										 |  |  | 	cmpb,COND(<<)	%r28, %r25,1b | 
					
						
							| 
									
										
										
										
											2013-06-02 12:21:48 -04:00
										 |  |  | 	fic,m		%r31(%sr4,%r28) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	sync | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifdef CONFIG_PA20 | 
					
						
							|  |  |  | 	pitlb,l         %r0(%sr4,%r25) | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	tlb_lock        %r20,%r21,%r22 | 
					
						
							|  |  |  | 	pitlb           (%sr4,%r25) | 
					
						
							|  |  |  | 	tlb_unlock      %r20,%r21,%r22 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	bv		%r0(%r2) | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | 	nop | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | ENDPROC(flush_icache_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | ENTRY(flush_kernel_dcache_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%dcache_stride, %r1 | 
					
						
							|  |  |  | 	ldw		R%dcache_stride(%r1), %r23 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	depdi,z		1, 63-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	depwi,z		1, 31-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 	add		%r26, %r25, %r25 | 
					
						
							|  |  |  | 	sub		%r25, %r23, %r25 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 1:      fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	fdc,m		%r23(%r26) | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	cmpb,COND(<<)		%r26, %r25,1b | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | 	fdc,m		%r23(%r26) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	sync | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2010-12-22 10:22:11 -06:00
										 |  |  | ENDPROC(flush_kernel_dcache_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | ENTRY(purge_kernel_dcache_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%dcache_stride, %r1 | 
					
						
							|  |  |  | 	ldw		R%dcache_stride(%r1), %r23 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	depdi,z		1, 63-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	depwi,z		1, 31-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 	add		%r26, %r25, %r25 | 
					
						
							|  |  |  | 	sub		%r25, %r23, %r25 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1:      pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 	pdc,m		%r23(%r26) | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	cmpb,COND(<<)		%r26, %r25, 1b | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	pdc,m		%r23(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	sync | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2013-02-03 23:00:54 +00:00
										 |  |  | ENDPROC(purge_kernel_dcache_page_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-21 22:47:15 +02:00
										 |  |  | ENTRY(flush_user_dcache_range_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%dcache_stride, %r1 | 
					
						
							|  |  |  | 	ldw		R%dcache_stride(%r1), %r23 | 
					
						
							|  |  |  | 	ldo		-1(%r23), %r21 | 
					
						
							|  |  |  | 	ANDCM		%r26, %r21, %r26 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 1:      cmpb,COND(<<),n	%r26, %r25, 1b | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	fdc,m		%r23(%sr3, %r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	sync | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2011-03-21 22:47:15 +02:00
										 |  |  | ENDPROC(flush_user_dcache_range_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENTRY(flush_kernel_dcache_range_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%dcache_stride, %r1 | 
					
						
							|  |  |  | 	ldw		R%dcache_stride(%r1), %r23 | 
					
						
							|  |  |  | 	ldo		-1(%r23), %r21 | 
					
						
							|  |  |  | 	ANDCM		%r26, %r21, %r26 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 1:      cmpb,COND(<<),n	%r26, %r25,1b | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	fdc,m		%r23(%r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	sync | 
					
						
							|  |  |  | 	syncdma | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENDPROC(flush_kernel_dcache_range_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENTRY(flush_user_icache_range_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%icache_stride, %r1 | 
					
						
							|  |  |  | 	ldw		R%icache_stride(%r1), %r23 | 
					
						
							|  |  |  | 	ldo		-1(%r23), %r21 | 
					
						
							|  |  |  | 	ANDCM		%r26, %r21, %r26 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 1:      cmpb,COND(<<),n	%r26, %r25,1b | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	fic,m		%r23(%sr3, %r26) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	sync | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENDPROC(flush_user_icache_range_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENTRY(flush_kernel_icache_page) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%icache_stride, %r1 | 
					
						
							|  |  |  | 	ldw		R%icache_stride(%r1), %r23 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:46:48 -04:00
										 |  |  | #ifdef CONFIG_64BIT | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	depdi,z		1, 63-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  | 	depwi,z		1, 31-PAGE_SHIFT,1, %r25 | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  | 	add		%r26, %r25, %r25 | 
					
						
							|  |  |  | 	sub		%r25, %r23, %r25 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:56:14 -04:00
										 |  |  | 1:      fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							|  |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 	cmpb,COND(<<)		%r26, %r25, 1b | 
					
						
							| 
									
										
										
										
											2005-10-21 22:56:14 -04:00
										 |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	sync | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENDPROC(flush_kernel_icache_page) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENTRY(flush_kernel_icache_range_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	ldil		L%icache_stride, %r1 | 
					
						
							|  |  |  | 	ldw		R%icache_stride(%r1), %r23 | 
					
						
							|  |  |  | 	ldo		-1(%r23), %r21 | 
					
						
							|  |  |  | 	ANDCM		%r26, %r21, %r26 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-05-15 10:53:57 -04:00
										 |  |  | 1:      cmpb,COND(<<),n	%r26, %r25, 1b | 
					
						
							| 
									
										
										
										
											2005-10-21 22:56:14 -04:00
										 |  |  | 	fic,m		%r23(%sr4, %r26) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	sync | 
					
						
							|  |  |  | 	bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENDPROC(flush_kernel_icache_range_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	/* align should cover use of rfi in disable_sr_hashing_asm and | 
					
						
							|  |  |  | 	 * srdis_done. | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	.align	256
 | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENTRY(disable_sr_hashing_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	.proc | 
					
						
							|  |  |  | 	.callinfo NO_CALLS
 | 
					
						
							|  |  |  | 	.entry | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	/* | 
					
						
							|  |  |  | 	 * Switch to real mode | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	/* pcxt_ssm_bug */ | 
					
						
							|  |  |  | 	rsm		PSW_SM_I, %r0 | 
					
						
							|  |  |  | 	load32		PA(1f), %r1 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	rsm		PSW_SM_Q, %r0		/* prep to load iia queue */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	mtctl		%r0, %cr17		/* Clear IIASQ tail */ | 
					
						
							|  |  |  | 	mtctl		%r0, %cr17		/* Clear IIASQ head */ | 
					
						
							|  |  |  | 	mtctl		%r1, %cr18		/* IIAOQ head */ | 
					
						
							|  |  |  | 	ldo		4(%r1), %r1 | 
					
						
							|  |  |  | 	mtctl		%r1, %cr18		/* IIAOQ tail */ | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	load32		REAL_MODE_PSW, %r1 | 
					
						
							|  |  |  | 	mtctl		%r1, %ipsw | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	rfi | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 1:      cmpib,=,n	SRHASH_PCXST, %r26,srdis_pcxs | 
					
						
							|  |  |  | 	cmpib,=,n	SRHASH_PCXL, %r26,srdis_pcxl | 
					
						
							|  |  |  | 	cmpib,=,n	SRHASH_PA20, %r26,srdis_pa20 | 
					
						
							|  |  |  | 	b,n		srdis_done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | srdis_pcxs: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Disable Space Register Hashing for PCXS,PCXT,PCXT' */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.word		0x141c1a00		/* mfdiag %dr0, %r28 */ | 
					
						
							|  |  |  | 	.word		0x141c1a00		/* must issue twice */ | 
					
						
							|  |  |  | 	depwi		0,18,1, %r28		/* Clear DHE (dcache hash enable) */ | 
					
						
							|  |  |  | 	depwi		0,20,1, %r28		/* Clear IHE (icache hash enable) */ | 
					
						
							|  |  |  | 	.word		0x141c1600		/* mtdiag %r28, %dr0 */ | 
					
						
							|  |  |  | 	.word		0x141c1600		/* must issue twice */ | 
					
						
							|  |  |  | 	b,n		srdis_done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | srdis_pcxl: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* Disable Space Register Hashing for PCXL */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.word		0x141c0600		/* mfdiag %dr0, %r28 */ | 
					
						
							|  |  |  | 	depwi           0,28,2, %r28		/* Clear DHASH_EN & IHASH_EN */ | 
					
						
							|  |  |  | 	.word		0x141c0240		/* mtdiag %r28, %dr0 */ | 
					
						
							|  |  |  | 	b,n		srdis_done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | srdis_pa20: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	/* Disable Space Register Hashing for PCXU,PCXU+,PCXW,PCXW+,PCXW2 */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	.word		0x144008bc		/* mfdiag %dr2, %r28 */ | 
					
						
							|  |  |  | 	depdi		0, 54,1, %r28		/* clear DIAG_SPHASH_ENAB (bit 54) */ | 
					
						
							|  |  |  | 	.word		0x145c1840		/* mtdiag %r28, %dr2 */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | srdis_done: | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	/* Switch back to virtual mode */ | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	rsm		PSW_SM_I, %r0		/* prep to load iia queue */ | 
					
						
							|  |  |  | 	load32 	   	2f, %r1 | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	nop | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	rsm		PSW_SM_Q, %r0		/* prep to load iia queue */ | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	mtctl		%r0, %cr17		/* Clear IIASQ tail */ | 
					
						
							|  |  |  | 	mtctl		%r0, %cr17		/* Clear IIASQ head */ | 
					
						
							|  |  |  | 	mtctl		%r1, %cr18		/* IIAOQ head */ | 
					
						
							|  |  |  | 	ldo		4(%r1), %r1 | 
					
						
							|  |  |  | 	mtctl		%r1, %cr18		/* IIAOQ tail */ | 
					
						
							| 
									
										
										
										
											2005-10-21 22:40:07 -04:00
										 |  |  | 	load32		KERNEL_PSW, %r1 | 
					
						
							|  |  |  | 	mtctl		%r1, %ipsw | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	rfi | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 2:      bv		%r0(%r2) | 
					
						
							|  |  |  | 	nop | 
					
						
							|  |  |  | 	.exit | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.procend | 
					
						
							| 
									
										
										
										
											2007-01-24 22:36:32 +01:00
										 |  |  | ENDPROC(disable_sr_hashing_asm) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	.end |