-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rdtsc implementation and get efiwarpper start tsc
Test Done: boot success Tracked-On: OAM-115655 Signed-off-by: Chen, Gang G <[email protected]>
- Loading branch information
1 parent
708fcec
commit 26c222a
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef RDTSC_H | ||
#define RDTSC_H | ||
|
||
#include <stdint.h> | ||
|
||
static uint64_t rdtsc(void) | ||
{ | ||
uint32_t lo, hi; | ||
|
||
asm volatile ("rdtsc" : "=a" (lo), "=d" (hi)); | ||
return (uint64_t) hi << 32 | lo; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters