diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-20 20:54:19 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-20 23:44:39 -0400 |
commit | 102a0aafc87ad894e7aba479df62ec4961bb6985 (patch) | |
tree | a6f59e352209e8de42f015733314a681a8e0d947 /kernel/lib/kspin.c | |
parent | add ata_init to main and fix some compilation problems (diff) | |
download | comus-102a0aafc87ad894e7aba479df62ec4961bb6985.tar.gz comus-102a0aafc87ad894e7aba479df62ec4961bb6985.tar.bz2 comus-102a0aafc87ad894e7aba479df62ec4961bb6985.zip |
move kspin to use ms, add ata_report
Diffstat (limited to 'kernel/lib/kspin.c')
-rw-r--r-- | kernel/lib/kspin.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/lib/kspin.c b/kernel/lib/kspin.c new file mode 100644 index 0000000..ad0b512 --- /dev/null +++ b/kernel/lib/kspin.c @@ -0,0 +1,15 @@ +#include <lib.h> +#include <comus/drivers/pit.h> +#include <comus/asm.h> + +void kspin_seconds(size_t seconds) +{ + kspin_milliseconds(seconds * 1000); +} + +void kspin_milliseconds(size_t milliseconds) +{ + uint64_t start = ticks; + while ((ticks - start) < milliseconds) + int_wait(); +} |