Theo Buehler:

> ++#ifdef __OpenBSD__
> ++    asm volatile( "rd %%tick, %0;" : "=r" (tick) );
> ++#else
> +     asm volatile( "rdpr %%tick, %0;" : "=&r" (tick) );
> ++#endif /* __OpenBSD__ */

I'd just change the "rd" to "rdpr" without any ifdef.

The "read privileged register" instruction is only available in
privileged mode, so seems wrong for userland.

"rd %tick" is assembled into a "read state register" instruction.

I don't know what the earlyclobber constraint ('&') is supposed to
do here; it doesn't hurt, I guess.

-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to