PERFORCE change 142368 for review
    John Birrell 
    jb at FreeBSD.org
       
    Tue May 27 06:26:22 UTC 2008
    
    
  
http://perforce.freebsd.org/chv.cgi?CH=142368
Change 142368 by jb at freebsd3 on 2008/05/27 06:25:53
	Add a hook for the double trap handler.
	
	Only process trap types that could be relevant to DTrace.
Affected files ...
.. //depot/projects/dtrace7/src/sys/i386/i386/trap.c#4 edit
Differences ...
==== //depot/projects/dtrace7/src/sys/i386/i386/trap.c#4 (text+ko) ====
@@ -113,6 +113,8 @@
  */
 dtrace_trap_func_t	dtrace_trap_func;
 
+dtrace_doubletrap_func_t	dtrace_doubletrap_func;
+
 /*
  * This is a hook which is initialised by the systrace module
  * when it is loaded. This keeps the DTrace syscall provider
@@ -251,7 +253,8 @@
 	 * handled the trap and modified the trap frame so that this
 	 * function can return normally.
 	 */
-	if (dtrace_trap_func != NULL)
+	if ((type == T_PROTFLT || type == T_PAGEFLT) &&
+	    dtrace_trap_func != NULL)
 		if ((*dtrace_trap_func)(frame, type))
 			goto out;
 #endif
@@ -953,6 +956,10 @@
 void
 dblfault_handler()
 {
+#ifdef KDTRACE_HOOKS
+	if (dtrace_doubletrap_func != NULL)
+		(*dtrace_doubletrap_func)();
+#endif
 	printf("\nFatal double fault:\n");
 	printf("eip = 0x%x\n", PCPU_GET(common_tss.tss_eip));
 	printf("esp = 0x%x\n", PCPU_GET(common_tss.tss_esp));
    
    
More information about the p4-projects
mailing list