Merge branch 'master' into iso-9660
[lunaix-os.git] / lunaix-os / includes / hal / io.h
index c57de5984a060979e87689d95e77efa375288737..dd445098bf7240b7c64e623457005e3aa898f6ce 100644 (file)
@@ -110,5 +110,15 @@ io_outl(int port, uint32_t data)
 {
     asm volatile("outl %0,%w1" : : "a"(data), "d"(port));
 }
 {
     asm volatile("outl %0,%w1" : : "a"(data), "d"(port));
 }
+static inline void
+io_delay(int counter)
+{
+    asm volatile (
+        "   test %0, %0\n"
+        "   jz 1f\n"
+        "2: dec %0\n"
+        "   jnz 2b\n"
+        "1: dec %0"::"a"(counter));
+}
 
 #endif /* __LUNAIX_IO_H */
 
 #endif /* __LUNAIX_IO_H */