Interesting code in exec_setregs

David Xu davidxu at freebsd.org
Sat Sep 25 22:40:28 PDT 2004


I found following code in  sys/i386/i386/machdep.c:
function exec_setregs:

 bzero((char *)regs, sizeof(struct trapframe));
 regs->tf_eip = entry;
 regs->tf_esp = stack;
 regs->tf_eflags = PSL_USER | (regs->tf_eflags & PSL_T);

the regs is cleared to zero, why do we bother to test it
again ? regs->tf_eflags & PSL_T  is useless code.

AMD64 also has this, I also found it in releng_4, why ?

David Xu



More information about the freebsd-current mailing list