PERFORCE change 92585 for review

Kip Macy kmacy at FreeBSD.org
Wed Mar 1 00:02:58 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=92585

Change 92585 by kmacy at kmacy_storage:sun4v_work on 2006/03/01 08:02:53

	fix spill / fill handlers
	fix trap table so that handlers are all at the right offsets
	add magic trap on to all unimplement trap handlers
	add magic trap on at beginning of spill /fill - off at the end 

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#11 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#11 (text+ko) ====

@@ -69,7 +69,15 @@
 
 #include "assym.s"
 
-
+#if 1
+#define MAGIC_TRAP_ON	ta	0x77
+#define MAGIC_TRAP_OFF	ta	0x78 
+/*#define MAGIC_TRAP_OFF	nop */ 
+#else
+#define MAGIC_TRAP_ON	nop
+#define MAGIC_TRAP_OFF	nop
+#endif
+	
 #define	TSB_KERNEL_MASK	0x0
 #define	TSB_KERNEL	0x0
 
@@ -112,6 +120,7 @@
  */
 
 #define	SPILL(storer, bias, size, asi) \
+	MAGIC_TRAP_ON		                ;\
 	mov	0 + bias, %g1	                ;\
 	storer	%l0, [%sp + %g1]asi             ;\
 	mov	size + bias, %g2	        ;\
@@ -125,18 +134,19 @@
 	storer	%l5, [%g5 + %g2]asi             ;\
 	storer	%l6, [%g5 + %g3]asi             ;\
 	storer	%l7, [%g5 + %g4]asi             ;\
-	add	%sp,  (4 * size), %g5           ;\
+	add	%g5,  (4 * size), %g5           ;\
 	storer	%i0, [%g5 + %g1]asi             ;\
 	storer	%i1, [%g5 + %g2]asi             ;\
 	storer	%i2, [%g5 + %g3]asi             ;\
 	storer	%i3, [%g5 + %g4]asi             ;\
-	add	%sp,  (4 * size), %g5           ;\
+	add	%g5,  (4 * size), %g5           ;\
 	storer	%i4, [%g5 + %g1]asi             ;\
 	storer	%i5, [%g5 + %g2]asi             ;\
 	storer	%i6, [%g5 + %g3]asi             ;\
 	storer	%i7, [%g5 + %g4]asi  
 
 #define	FILL(loader, bias, size, asi) \
+	MAGIC_TRAP_ON		                ;\
 	mov	0 + bias, %g1			;\
 	loader	[%sp + %g1]asi, %l0		;\
 	mov	size + bias, %g2		;\
@@ -150,12 +160,12 @@
 	loader	[%g5 + %g2]asi, %l5		;\
 	loader	[%g5 + %g3]asi, %l6		;\
 	loader	[%g5 + %g4]asi, %l7		;\
-	add	%sp, (4 * size), %g5		;\
+	add	%g5, (4 * size), %g5		;\
 	loader	[%g5 + %g1]asi, %i0		;\
 	loader	[%g5 + %g2]asi, %i1		;\
 	loader	[%g5 + %g3]asi, %i2		;\
 	loader	[%g5 + %g4]asi, %i3		;\
-	add	%sp, (4 * size), %g5		;\
+	add	%g5, (4 * size), %g5		;\
 	loader	[%g5 + %g1]asi, %i4		;\
 	loader	[%g5 + %g2]asi, %i5		;\
 	loader	[%g5 + %g3]asi, %i6		;\
@@ -169,10 +179,10 @@
 	add	%sp, 32, %g3			;\
 	ldda	[%g3 + %g1]asi, %l4		;\
 	ldda	[%g3 + %g2]asi, %l6		;\
-	add	%sp, 32, %g3			;\
+	add	%g3, 32, %g3			;\
 	ldda	[%g3 + %g1]asi, %i0		;\
 	ldda	[%g3 + %g2]asi, %i2		;\
-	add	%sp, 32, %g3			;\
+	add	%g3, 32, %g3			;\
 	ldda	[%g3 + %g1]asi, %i4		;\
 	ldda	[%g3 + %g2]asi, %i6		
 
@@ -446,6 +456,7 @@
 	 * Generic trap type.  Call trap() with the specified type.
 	 */
 	.macro	tl0_gen		type
+	MAGIC_TRAP_ON
 	tl0_setup \type
 	.align	32
 	.endm
@@ -454,12 +465,14 @@
 	 * This is used to suck up the massive swaths of reserved trap types.
 	 * Generates count "reserved" trap vectors.
 	 */
+
 	.macro	tl0_reserved	count
 	.rept	\count
 	tl0_gen	T_RESERVED
 	.endr
 	.endm
 
+
 	.macro	tl1_split
 #if 0
 	rdpr	%wstate, %g1
@@ -489,62 +502,56 @@
 	.endm
 
 	.macro	insn_excptn
-	nop
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 
 	.macro	insn_miss
-	nop
-	mov %o0, %g6
-	mov 0x23, %o0
-	call hv_cnputchar
-	mov 0x24, %o0
-	call hv_cnputchar
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 	
 	.macro	data_excptn
-	nop
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 
 	.macro	data_miss
-	nop
-	mov %o0, %g6
-	mov 0x23, %o0
-	call hv_cnputchar
-	mov 0x24, %o0
-	call hv_cnputchar
+	MAGIC_TRAP_ON
+	MAGIC_TRAP_ON
+	MAGIC_TRAP_ON
+	MAGIC_TRAP_ON
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 
 	.macro	data_prot
-	nop
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 
 	.macro	tl0_align
-	nop
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 	
 	.macro	cpu_mondo
-	nop
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 
 	.macro	dev_mondo
-	nop
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 
 	.macro	resumable_error
-	nop
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 
 	.macro	nonresumable_error
-	nop
+	MAGIC_TRAP_ON
 	.align	32
 	.endm
 
@@ -555,16 +562,18 @@
 	srl	%sp, 0, %sp	;		\
 	SPILL(sta, 0, 4, asi)	; 		\
 	saved			; 		\
+	MAGIC_TRAP_OFF		;		\
 	retry			; 		\
-	.skip (31-26)*4		; 		\
+	.skip (31-28)*4		; 		\
 	ba,a,pt %xcc, fault_32bit_##target ; \
 	ALIGN_128
 
 #define spill_64bit_asi(asi, target)		\
 	SPILL(stxa, SPOFF, 8, asi) ; 		\
 	saved			   ;		\
+	MAGIC_TRAP_OFF		;		\
 	retry			   ;		\
-	.skip (31-25)*4		   ;		\
+	.skip (31-27)*4		   ;		\
 	ba,a,pt %xcc, fault_64bit_##target ; \
 	ALIGN_128	
 
@@ -573,7 +582,7 @@
 	SPILL(sta, 0, 4, asi)	; 		\
 	b	spill_clean	; 		\
 	  mov	WSTATE_USER32, %g7 ; 		\
-	.skip (31-26)*4		; 		\
+	.skip (31-27)*4		; 		\
 	ba,a,pt    %xcc, fault_32bit_##target ; \
 	ALIGN_128	
 	
@@ -581,24 +590,25 @@
 	SPILL(stxa, SPOFF, 8, asi) ; 		\
 	b	spill_clean	   ;		\
 	  mov	WSTATE_USER64, %g7 ; 		\
-	.skip (31-25)*4		   ;		\
+	.skip (31-26)*4		   ;		\
 	ba,a,pt %xcc, fault_64bit_##target ; 	\
 	ALIGN_128	
 
 #define fill_32bit_asi(asi, target)		\
 	srl	%sp, 0, %sp	;		\
 	FILL(lda, 0, 4, asi)	; 		\
-	saved			; 		\
+	restored		; 		\
 	retry			; 		\
-	.skip (31-26)*4		; 		\
+	.skip (31-27)*4		; 		\
 	ba,a,pt %xcc, fault_32bit_##target ; \
 	ALIGN_128	
 
 #define fill_64bit_asi(asi, target)		\
-	FILL(ldxa, SPOFF, 8, asi) ; 		\
-	saved			   ;		\
+	FILL(ldxa, SPOFF, 8, asi)  ; 		\
+	restored		   ;		\
+	MAGIC_TRAP_OFF		;		\
 	retry			   ;		\
-	.skip (31-25)*4		   ;		\
+	.skip (31-27)*4		   ;		\
 	ba,a,pt %xcc, fault_64bit_##target ; \
 	.align 128
 		
@@ -623,11 +633,6 @@
 	.endm
 
 	.macro spill_64bit_nucleus_not
-	mov %o0, %g6
-	mov 0x23, %o0
-	call hv_cnputchar
-	mov 0x24, %o0
-	call hv_cnputchar
 	spill_64bit_asi(ASI_N,not)
 	.endm
 
@@ -652,11 +657,6 @@
 	.endm
 
 	.macro fill_64bit_nucleus_not
-	mov %o0, %g6
-	mov 0x23, %o0
-	call hv_cnputchar
-	mov 0x24, %o0
-	call hv_cnputchar
 	fill_64bit_asi(ASI_N, not)
 	.endm
 
@@ -694,6 +694,7 @@
 	.endm
 
 	.macro	spill_64bit_tt1_secondary_so1
+	MAGIC_TRAP_ON
 	ba,a,pt %xcc, fault_64bit_so1
 	  nop
 	.align 128
@@ -701,16 +702,17 @@
 	.endm
 
 	.macro	spill_mixed
-	nop
+	MAGIC_TRAP_ON
 	.align	128
 	.endm
 
 	.macro	fill_mixed
-	nop
+	MAGIC_TRAP_ON
 	.align	128
 	.endm
 
 	.macro	tl1_align
+	MAGIC_TRAP_ON
 	.align	32
 	.endm		
 		
@@ -1701,7 +1703,7 @@
 
 	.sect	.trap
 	.align	0x8000
-	.globl	tl0_base,tl0_insn_miss, tl0_insn_excptn, tl0_spill_n_normal
+	.globl	tl0_base
 tl0_base:
  	tl0_reserved	8				! 0x0-0x7
 tl0_insn_excptn:
@@ -1741,44 +1743,52 @@
 tl0_priv_action:
 	tl0_gen		T_PRIVILEGED_ACTION		! 0x37
 	tl0_reserved	9				! 0x38-0x40
-tl0_intr_level:
+tl0_intr_level_41:
 	tl0_intr_level					! 0x41-0x4f
 	tl0_reserved	18				! 0x50-0x61
-tl0_watch_virt:
+tl0_watch_virt_62:
 	tl0_gen		T_VA_WATCHPOINT			! 0x62
 	tl0_reserved	10				! 0x63-0x6c
-tl0_data_prot:	
+tl0_data_prot_6c:	
 	data_prot					! 0x6c
 	tl0_reserved	8				! 0x6d-0x75
-tl0_breakpoint:
+tl0_breakpoint_76:
 	tl0_gen		T_BREAKPOINT			! 0x76
 	tl0_reserved	5				! 0x77-0x7b
-tl0_cpu_mondo:
+tl0_cpu_mondo_7c:
 	cpu_mondo					! 0x7c
-tl0_dev_mondo:	
+tl0_dev_mondo_7d:	
 	dev_mondo					! 0x7d	
-tl0_resumable_error:	
+tl0_resumable_error_7e:
 	resumable_error					! 0x7e
-tl0_nonresumable_error:	
+tl0_nonresumable_error_7f:	
 	nonresumable_error				! 0x7f	
-tl0_spill_n_normal:
+tl0_spill_n_normal_80:
+tl0_spill_0_normal:	
 	tl0_reserved		4			! 0x80
+tl0_spill_1_normal:	
 	spill_32bit_primary_sn0				! 0x84
+tl0_spill_2_normal:	
 	spill_64bit_primary_sn0				! 0x88
+tl0_spill_3_normal:	
 	spill_32clean_primary_sn0			! 0x8c
+tl0_spill_4_normal:	
 	spill_64clean_primary_sn0			! 0x90
+tl0_spill_5_normal:	
 	spill_32bit_nucleus_not				! 0x94
+tl0_spill_6_normal:	
 	spill_64bit_nucleus_not				! 0x98
+tl0_spill_7_normal:	
 	spill_mixed					! 0x9c
-tl0_spill_n_other:
+tl0_spill_n_other_a0:
 	tl0_reserved		4			! 0xa0
 	spill_32bit_secondary_so0			! 0xa4
 	spill_64bit_secondary_so0			! 0xa8
 	spill_32bit_secondary_so0			! 0xac
 	spill_64bit_secondary_so0			! 0xb0
 	tl0_reserved		12			! 0xb4-0xbf
-tl0_fill_n_normal:
-	tl0_reserved		4			! 0xa0
+tl0_fill_n_normal_c0:
+	tl0_reserved		4			! 0xc0
 	fill_32bit_primary_fn0				! 0xc4 
 	fill_64bit_primary_fn0				! 0xc8
 	fill_32bit_primary_fn0				! 0xcc
@@ -1786,9 +1796,9 @@
 	fill_32bit_nucleus_not				! 0xd4
 	fill_64bit_nucleus_not				! 0xd8
 	fill_mixed					! 0xdc
-tl0_fill_n_other:
+tl0_fill_n_other_e0:
 	tl0_reserved		32			! 0xe0-0xff
-tl0_soft:
+tl0_soft_100:
 	tl0_gen		T_SYSCALL			! 0x100
 	tl0_gen		T_BREAKPOINT			! 0x101
 	tl0_gen		T_DIVISION_BY_ZERO		! 0x102
@@ -1823,16 +1833,16 @@
 	tl0_gen		T_SYSCALL			! 0x142
 	tl0_gen		T_SYSCALL			! 0x143
 	tl0_reserved	188				! 0x144-0x1ff
-tll_base:
+tl1_base:
  	tl1_reserved	9				! 0x200-0x208
-tll_insn_miss:
+tl1_insn_miss_209:
 	insn_miss					! 0x209
 	tl1_reserved	27				! 0x20a-0x224
-tl1_clean_window:
+tl1_clean_window_224:
  	clean_window					! 0x224
-tl1_divide:
+tl1_divide_228:
  	tl1_reserved	8				! 0x228-0x22f
-tl1_data_excptn:
+tl1_data_excptn_230:
  	data_excptn					! 0x230
 	data_miss					! 0x231
  	tl1_reserved	2				! 0x232-0x233
@@ -1845,25 +1855,45 @@
 tl1_nonresumable_error:	
 	nonresumable_error				! 0x27f	
 tl1_spill_n_normal:
+tl1_spill_0_normal:	
 	tl1_reserved		4			! 0x280
+tl1_spill_1_normal:
 	spill_32bit_tt1_primary_sn1			! 0x284
+tl1_spill_2_normal:
 	spill_64bit_tt1_primary_sn1			! 0x288
+tl1_spill_3_normal:
 	spill_32bit_tt1_primary_sn1			! 0x28c
+tl1_spill_4_normal:
 	spill_64bit_tt1_primary_sn1			! 0x290
-	tl1_reserved					! 0x294
+tl1_spill_5_normal:
+	tl1_reserved		4			! 0x294
+tl1_spill_6_normal:
 	spill_64bit_ktt1_sk				! 0x298
+tl1_spill_7_normal:
 	spill_mixed_ktt1_sk				! 0x29c
 tl1_spill_n_other:
+tl1_spill_0_other:	
 	tl1_reserved		4			! 0x2a0
+tl1_spill_1_other:	
 	spill_32bit_tt1_secondary_so1			! 0x2a4
+tl1_spill_2_other:	
 	spill_64bit_tt1_secondary_so1			! 0x2a8
+tl1_spill_3_other:	
 	spill_32bit_tt1_secondary_so1			! 0x2ac
+tl1_spill_4_other:	
 	spill_64bit_tt1_secondary_so1			! 0x2b0
-	tl1_reserved		12			! 0x2b4-0x2bf
+tl1_spill_5_other:	
+	tl1_reserved		4			! 0x2b4
+tl1_spill_6_other:	
+	tl1_reserved		4			! 0x2b8
+tl1_spill_7_other:	
+	tl1_reserved		4			! 0x2bc
 tl1_fill_n_normal:
 	tl1_reserved		32			! 0x2c0-0x2df
 tl1_fill_n_other:
 	tl1_reserved		32			! 0x2e0-0x2ff
+tl1_soft_traps:
+	tl1_reserved		256
 .globl tl0_end
 tl0_end:					
 /* 


More information about the p4-projects mailing list