More x86 asm cleanup

Colin Plumb (colin@nyx.net)
Sun, 19 Apr 1998 04:57:13 -0600 (MDT)


I as looking at some other code, and I do confess that it's
spectacularly irrelelvant, but arch/i386/kernel/smp contains:
__initfunc(void initialize_secondary(void))
{
struct thread_struct * p = &current->tss;

/*
* We don't actually need to load the full TSS,
* basically just the stack pointer and the eip.
*/
asm volatile("lldt %%ax": :"a" (p->ldt));
asm volatile("ltr %%ax": :"a" (p->tr));
asm volatile(
"movl %0,%%esp\n\t"
"jmp *%1"
:
:"r" (p->esp),"r" (p->eip));
}

And I was wondering why p->ldt is forced into register a before
loading. Isn't

asm volatile("lldt %w0": :"g" (p->ldt));
asm volatile("ltr %w0": :"g" (p->tr));

good enough? Is there something wrong with doing the
memory acess in one instruction?

-- 
	-Colin

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu