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
This commit is contained in:
John Baldwin 2011-12-29 16:40:54 +00:00
parent a74d695299
commit b494482f39
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}
}