Author: jhb
Date: Thu Dec 29 16:40:54 2011
New Revision: 228962
URL: http://svn.freebsd.org/changeset/base/228962

Log:
  Use curthread rather than PCPU_GET(curthread).  'curthread' uses
  special-case optimizations on several platforms and is preferred.
  
  Reported by:  dim (indirectly)
  MFC after:    2 weeks

Modified:
  head/sys/i386/i386/sys_machdep.c
  head/sys/mips/mips/gdb_machdep.c

Modified: head/sys/i386/i386/sys_machdep.c
==============================================================================
--- head/sys/i386/i386/sys_machdep.c    Thu Dec 29 16:23:14 2011        
(r228961)
+++ head/sys/i386/i386/sys_machdep.c    Thu Dec 29 16:40:54 2011        
(r228962)
@@ -553,7 +553,7 @@ user_ldt_free(struct thread *td)
                return;
        }
 
-       if (td == PCPU_GET(curthread)) {
+       if (td == curthread) {
 #ifdef XEN
                i386_reset_ldt(&default_proc_ldt);
                PCPU_SET(currentldt, (int)&default_proc_ldt);

Modified: head/sys/mips/mips/gdb_machdep.c
==============================================================================
--- head/sys/mips/mips/gdb_machdep.c    Thu Dec 29 16:23:14 2011        
(r228961)
+++ head/sys/mips/mips/gdb_machdep.c    Thu Dec 29 16:40:54 2011        
(r228962)
@@ -116,7 +116,7 @@ gdb_cpu_getreg(int regnum, size_t *regsz
 {
 
        *regsz = gdb_cpu_regsz(regnum);
-       if (kdb_thread  == PCPU_GET(curthread)) {
+       if (kdb_thread == curthread) {
                register_t *zero_ptr = &kdb_frame->zero;
                return zero_ptr + regnum;
        }
@@ -154,7 +154,7 @@ gdb_cpu_setreg(int regnum, void *val)
        switch (regnum) {
        case GDB_REG_PC:
                kdb_thrctx->pcb_context[10] = *(register_t *)val;
-               if (kdb_thread  == PCPU_GET(curthread))
+               if (kdb_thread == curthread)
                        kdb_frame->pc = *(register_t *)val;
        }
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to