123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef _READ_XCR0_H_
- #define _READ_XCR0_H_
- static inline uint64_t xgetbv(uint32_t index)
- {
- uint32_t eax, edx;
- asm volatile(".byte 0x0f,0x01,0xd0"
- : "=a" (eax), "=d" (edx)
- : "c" (index));
- return eax + ((uint64_t)edx << 32);
- }
- static inline uint64_t read_xcr0()
- {
- return xgetbv(0);
- }
- #endif
|