MOS Source Code
Toggle main menu visibility
Main Page
Topics
Classes
Class List
Class Index
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
~
Functions
_
b
d
e
f
g
h
i
l
m
n
o
p
r
s
v
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
a
b
c
d
f
g
h
i
k
l
m
o
p
r
s
t
u
v
x
Enumerations
c
e
f
g
h
i
l
m
o
p
r
s
t
v
x
Enumerator
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
v
w
x
y
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Examples
▼
MOS Source Code
►
Topics
►
Classes
▼
Files
▼
File List
►
build
▼
kernel
▼
arch
►
generic
►
riscv64
▼
x86_64
►
acpi
►
cpu
►
descriptors
►
devices
▼
include
▼
private
▼
mos
►
platform
▼
x86
►
acpi
►
cpu
►
descriptors
►
devices
►
interrupt
►
mm
►
tasks
►
delays.h
►
x86_interrupt.h
►
x86_platform.h
►
public
►
interrupt
►
mm
►
tasks
►
x86_platform.c
►
x86_platform_api.c
►
device
►
filesystem
►
include
►
interrupt
►
io
►
ipc
►
lib
►
misc
►
mm
►
syslog
►
tasks
►
tests
►
kmain.c
►
ksyscall.c
►
ksyscall_entry.c
►
libs
►
File Members
►
Examples
•
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Loading...
Searching...
No Matches
delays.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-3.0-or-later
2
3
#pragma once
4
5
#include <
mos/mos_global.h
>
6
#include <
mos/types.h
>
7
8
should_inline
u64
rdtsc
(
void
)
9
{
10
u64
a, d;
11
__asm__
volatile
(
"rdtsc"
:
"=a"
(a),
"=d"
(d) : :
"memory"
);
12
return
(d << 32) | a;
13
}
8
should_inline
u64
rdtsc
(
void
) {
…
}
14
15
should_inline
void
mdelay
(
u64
ms)
16
{
17
u64
end =
rdtsc
() + ms * 2000 * 1000;
18
while
(
rdtsc
() < end)
19
;
20
}
15
should_inline
void
mdelay
(
u64
ms) {
…
}
21
22
should_inline
void
udelay
(
u64
us)
23
{
24
u64
end =
rdtsc
() + us * 2000;
25
while
(
rdtsc
() < end)
26
;
27
}
22
should_inline
void
udelay
(
u64
us) {
…
}
udelay
should_inline void udelay(u64 us)
Definition
delays.h:22
mdelay
should_inline void mdelay(u64 ms)
Definition
delays.h:15
rdtsc
should_inline u64 rdtsc(void)
Definition
delays.h:8
mos_global.h
should_inline
#define should_inline
Definition
mos_global.h:37
types.h
u64
unsigned long long u64
Definition
types.h:23
kernel
arch
x86_64
include
private
mos
x86
delays.h
Generated on Sun Sep 1 2024 18:22:52 for MOS Source Code by
1.12.0