diff options
author | Ian McFarlane <i.mcfarlane2002@gmail.com> | 2025-04-20 14:19:33 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-20 23:44:38 -0400 |
commit | 74e6646b5c4d4363ec0f339d33e3adb6659737e8 (patch) | |
tree | ec92bbe1689334379e7c90470ee6bf9c8dc69f39 /kernel/include | |
parent | adding code from osdev and reading (diff) | |
download | comus-74e6646b5c4d4363ec0f339d33e3adb6659737e8.tar.gz comus-74e6646b5c4d4363ec0f339d33e3adb6659737e8.tar.bz2 comus-74e6646b5c4d4363ec0f339d33e3adb6659737e8.zip |
added initialization but it is untested
Diffstat (limited to 'kernel/include')
-rw-r--r-- | kernel/include/comus/asm.h | 7 | ||||
-rw-r--r-- | kernel/include/comus/drivers/ata.h | 14 |
2 files changed, 20 insertions, 1 deletions
diff --git a/kernel/include/comus/asm.h b/kernel/include/comus/asm.h index 5e1dce7..87393eb 100644 --- a/kernel/include/comus/asm.h +++ b/kernel/include/comus/asm.h @@ -26,10 +26,15 @@ static inline void outw(uint16_t port, uint16_t val) __asm__ volatile("outw %0, %1" : : "a"(val), "Nd"(port)); } +#define __inl_nocall(port, out_uint32) \ + do { \ + __asm__ volatile("inl %1, %0" : "=a"(out_uint32) : "Nd"(port)); \ + } while (0); + static inline uint32_t inl(uint16_t port) { uint32_t ret; - __asm__ volatile("inl %1, %0" : "=a"(ret) : "Nd"(port)); + __inl_nocall(port, ret); return ret; } diff --git a/kernel/include/comus/drivers/ata.h b/kernel/include/comus/drivers/ata.h index e69de29..a9770c8 100644 --- a/kernel/include/comus/drivers/ata.h +++ b/kernel/include/comus/drivers/ata.h @@ -0,0 +1,14 @@ +#ifndef ATA_H_ +#define ATA_H_ + +/* + * @file ata.h + * + * @author Ian McFarlane <i.mcfarlane2002@gmail.com> + * + * ATA driver + */ + +void ata_init(void); + +#endif |