<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Index: x86/x86/x86_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/x86_machdep.c,v
retrieving revision 1.30
diff -p -r1.30 x86_machdep.c
*** x86/x86/x86_machdep.c	13 Feb 2009 22:41:03 -0000	1.30
--- x86/x86/x86_machdep.c	20 Mar 2009 07:20:34 -0000
*************** cpu_kpreempt_enter(uintptr_t where, int 
*** 282,287 ****
--- 282,289 ----
  	return true;
  }
  
+ #include &lt;sys/ksyms.h&gt;
+ 
  /*
   * Called after returning from a kernel preemption, and called with
   * preemption disabled.
*************** cpu_kpreempt_exit(uintptr_t where)
*** 303,308 ****
--- 305,328 ----
  		pmap_load();
  	}
  
+ {
+ 	int curldt;
+ 
+ 	__asm__ __volatile__("sldt %0" : "=r" (curldt) : );
+ 	if (curldt != curlwp-&gt;l_addr-&gt;u_pcb.pcb_ldt_sel) {
+ 		const char *mod, *sym;
+ 
+ 		if (ksyms_getname(&amp;mod, &amp;sym, where, KSYMS_ANY) != 0) {
+ 			mod = "&lt;x&gt;";
+ 			sym = "&lt;x&gt;";
+ 		}
+ 
+ 		printf("oink! %x != %x! where = %p (%s:%s)\n", curldt, curlwp-&gt;l_addr-&gt;u_pcb.pcb_ldt_sel, (void *)where, mod, sym);
+ 		//Debugger();
+ 		pmap_load();
+ 	}
+ }
+ 
  	/* Restore cr2 only after the pmap, as pmap_load can block. */
  	lcr2(((struct pcb *)curlwp-&gt;l_addr)-&gt;pcb_cr2);
  }
</pre></body></html>