How to comprehend this code snippet: __asm__ __volatile__("rdtsc" : "=A"(t))?

Jeffrey Walton noloader at gmail.com
Thu Jul 16 09:42:18 EDT 2020


On Thu, Jul 16, 2020 at 9:25 AM 孙世龙 sunshilong <sunshilong369 at gmail.com> wrote:
>
> >The 'A' is the constraint EAX:RDX register pair.
> >Also see https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html
> >and https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html.
> Thanks to your attached document, I find a lot of useful information.
> BTW,  What does "The A register", "The B register" and etc mean?
> I googled but didn't get any useful information.
> Could you please give me a few brief explanations or suggest some
> documents for me to go through?

See the docs for the various constraints. Also see
https://gcc.gnu.org/onlinedocs/gcc/Constraints.html#Constraints.

Jeff



More information about the Kernelnewbies mailing list