Skip to content

Commit

Permalink
[core] Add volatile keyword to asm block in rdtsc (Haivision#2759).
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-jencks authored Jul 13, 2023
1 parent 61c7bed commit 1737e96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion srtcore/sync_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void rdtsc(uint64_t& x)
asm("mov %0=ar.itc" : "=r"(x)::"memory");
#elif SRT_SYNC_CLOCK == SRT_SYNC_CLOCK_AMD64_RDTSC
uint32_t lval, hval;
asm("rdtsc" : "=a"(lval), "=d"(hval));
asm volatile("rdtsc" : "=a"(lval), "=d"(hval));
x = hval;
x = (x << 32) | lval;
#elif SRT_SYNC_CLOCK == SRT_SYNC_CLOCK_WINQPC
Expand Down

0 comments on commit 1737e96

Please sign in to comment.