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

孙世龙 sunshilong sunshilong369 at gmail.com
Thu Jul 16 08:20:36 EDT 2020


Hi, list

Here is the code snippet:
#define ipipe_read_tsc(t)              \
__asm__ __volatile__("rdtsc" : "=A"(t))

I found that the rdtsc (Read Time-Stamp Counter) instruction is used
to determine how many CPU ticks took place since the processor was
reset.

But what does
"=A"(t)
mean?

Thank you for your attention to this matter.



More information about the Kernelnewbies mailing list