diff options
| author | Tianhao Wang <shrik3@riseup.net> | 2023-03-14 10:47:25 +0100 |
|---|---|---|
| committer | Tianhao Wang <shrik3@riseup.net> | 2023-03-14 10:47:25 +0100 |
| commit | 383c203d77404b4f74723d7a89be691744f41c25 (patch) | |
| tree | 1061f01ed975a2c6b37015567b27cccac9f9f87b /src/arch/x86_64/misc.rs | |
| parent | 4eae38a6ce9110a155715575adcf12bdf45703cb (diff) | |
add delay between IOs
Diffstat (limited to 'src/arch/x86_64/misc.rs')
| -rw-r--r-- | src/arch/x86_64/misc.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/arch/x86_64/misc.rs b/src/arch/x86_64/misc.rs new file mode 100644 index 0000000..c007d99 --- /dev/null +++ b/src/arch/x86_64/misc.rs @@ -0,0 +1,17 @@ +// wrappers for misc. architectural code +// before they find better place to go. +// asm code goes to asm/misc.s + +extern "C" { + fn _delay(); +} + +#[inline(always)] + +// delays for several cycles. Used to fill sequantial IO commands +// (for devices to react) +pub fn delay() { + unsafe { + _delay(); + } +} |
