From 383c203d77404b4f74723d7a89be691744f41c25 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Tue, 14 Mar 2023 10:47:25 +0100 Subject: add delay between IOs --- src/arch/x86_64/misc.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/arch/x86_64/misc.rs (limited to 'src/arch/x86_64/misc.rs') 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(); + } +} -- cgit v1.2.3-70-g09d2