PERFORCE change 97917 for review

Kip Macy kmacy at FreeBSD.org
Fri May 26 21:03:03 PDT 2006


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

Change 97917 by kmacy at kmacy_storage:sun4v_work on 2006/05/27 04:01:30

	add dtrace traps and stubs for default case of dtrace not being enabled

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/conf/files.sun4v#17 edit
.. //depot/projects/kmacy_sun4v/src/sys/sparc64/dtrace/dtrace_stub.c#1 add
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/exception.S#59 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/conf/files.sun4v#17 (text+ko) ====

@@ -62,6 +62,7 @@
 sparc64/dtrace/fasttrap_isa.c	optional	dtrace
 sparc64/dtrace/fbt.c		optional	dtrace
 sparc64/dtrace/sdt.c		optional	dtrace
+sparc64/dtrace/dtrace_stub.c	standard
 
 # XXX hvcons should be optional
 sun4v/sun4v/hvcons.c	standard	

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

@@ -587,6 +587,29 @@
 	.align	32
 	.endm
 
+	.macro	dtrace_fasttrap
+	sethi	%hi(dtrace_fasttrap_probe_ptr), %g4
+	ldx	[%g4 + %lo(dtrace_fasttrap_probe_ptr)], %g4
+	set	dtrace_fasttrap_probe, %g1
+	brnz,pn	%g4, tl0_utrap
+	  sub	%g0, 1, %g4
+	.align	32
+	.endm
+
+	.macro	dtrace_pid
+	set	dtrace_pid_probe, %g1
+	ba,pt	%xcc, tl0_utrap
+	  sub	%g0, 1, %g4
+	.align	32
+	.endm
+
+	.macro	dtrace_return
+	set	dtrace_return_probe, %g1
+	ba,pt	%xcc, tl0_utrap
+	  sub	%g0, 1, %g4
+	.align 32
+	.endm
+	
 	.macro	tl0_fp_restore
 	GET_PCB(PCB_REG)			! 3 instructions
 	ldx	[%g6 + PCB_FLAGS], %g1
@@ -763,7 +786,14 @@
 	tl0_gen		T_TRAP_INSTRUCTION_29		! 0x11d
 	tl0_gen		T_TRAP_INSTRUCTION_30		! 0x11e
 	tl0_gen		T_TRAP_INSTRUCTION_31		! 0x11f
-	tl0_reserved	32				! 0x120-0x13f
+	tl0_reserved	24				! 0x120-0x137
+tl0_dtrace_pid:						
+	dtrace_pid					! 0x138
+tl0_dtrace_fasttrap:					
+	dtrace_fasttrap					! 0x139
+tl0_dtrace_return:					
+	dtrace_return					! 0x13a
+	tl0_reserved	5				! 0x13b - 0x13f
 	tl0_gen		T_SYSCALL			! 0x140       LP64 system call
 	tl0_syscall					! 0x141
 	tl0_gen		T_SYSCALL			! 0x142
@@ -928,12 +958,12 @@
 
 	brnz	%o1, common_utrap
 	  nop		
-	call	critical_enter
+	call	spinlock_enter
 	  nop
 common_uintr:	
 	jmpl	%l3, %o7			! call interrupt handler
 	  mov	%l7, %o0
-	call	critical_exit
+	call	spinlock_exit
 	  nop
 	b	user_rtt
 	  nop
@@ -1069,23 +1099,22 @@
 	rd	%asi, %g1
 	SAVE_OUTS(%l7)
 	stx	%g1, [%l7 + TF_ASI]
-	GET_PCPU_SCRATCH_SLOW(%g6)		! we really shouldn't need this ...				
-	wrpr	%g0, PSTATE_KERNEL, %pstate	! enable ints
+	GET_PCPU_SCRATCH_SLOW(%g6)		! we really shouldn't need this ...	
+	wrpr	%g0, PSTATE_KERNEL, %pstate	! enable interrupts
 
 	brnz	%o1, common_ktrap
 	  nop	
-	call	critical_enter
+	call	spinlock_enter
 	  nop
 common_kintr:	
 	jmpl	%l3, %o7			! call trap handler
 	  mov	%l7, %o0
-	call	critical_exit
+	call	spinlock_exit
 	  nop
 	b	common_rtt
 	  nop
 common_ktrap:
-!	jmpl	%l3, %o7			! call trap handler
-	call	trap
+	jmpl	%l3, %o7			! call trap handler
 	  mov	%l7, %o0
 	
 ENTRY(krtt)
@@ -1191,7 +1220,6 @@
 	sllx	%g4, IH_SHIFT, %g7
 	ldx	[%g6 + %g7], %g1	! pointer to interrupt handler
 	rdpr	%pil, %g5
-!	wrpr	%g4, 0, %pil
 	mov	%g5, %g4
 				
 	! %g1		pc of trap handler


More information about the p4-projects mailing list