Date: Thu, 29 Dec 2011 16:40:55 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r228962 - in head/sys: i386/i386 mips/mips Message-ID: <201112291640.pBTGetCb063943@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112291640.pBTGetCb063943>