CS350 COS
COS
Loading...
Searching...
No Matches
time.c
Go to the documentation of this file.
1
2
#include <
stdbool.h
>
3
#include <
stdint.h
>
4
5
#include <sys/kassert.h>
6
#include <sys/kdebug.h>
7
#include <sys/ktime.h>
8
9
#include <machine/amd64.h>
10
#include <machine/amd64op.h>
11
12
uint64_t
13
Time_GetTSC
()
14
{
15
return
rdtsc
();
16
}
17
18
static
void
19
Debug_ReadTSC
(
int
argc,
const
char
*argv[])
20
{
21
kprintf
(
"RDTSC: %lld\n"
,
Time_GetTSC
());
22
}
23
24
REGISTER_DBGCMD
(readtsc,
"Print current timestamp"
,
Debug_ReadTSC
);
25
rdtsc
static INLINE uint64_t rdtsc()
Definition:
amd64op.h:39
kprintf
int kprintf(const char *fmt,...)
Definition:
printf.c:210
REGISTER_DBGCMD
#define REGISTER_DBGCMD(_NAME, _DESC, _FUNC)
Definition:
kdebug.h:11
stdbool.h
stdint.h
Time_GetTSC
uint64_t Time_GetTSC()
Definition:
time.c:13
Debug_ReadTSC
static void Debug_ReadTSC(int argc, const char *argv[])
Definition:
time.c:19
uint64_t
unsigned long uint64_t
Definition:
types.h:13
sys
amd64
time.c
Generated by
1.9.6