From 2ddbeb9f7214f6d3feef651eba83e6a9d120a743 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Thu, 13 Aug 2020 17:58:50 -0400 Subject: lots of progress, including readonly PATA driver and part of FAT16 driver --- src/kernel/util.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/kernel/util.h') diff --git a/src/kernel/util.h b/src/kernel/util.h index 243541c..324f379 100644 --- a/src/kernel/util.h +++ b/src/kernel/util.h @@ -10,8 +10,8 @@ static inline void outb(uint16_t port, uint8_t value) { : : "a"(value), "Nd"(port)); } static inline uint8_t inb(uint16_t port) { - uint8_t value; - asm volatile ( + volatile uint8_t value; + asm ( "inb %1, %0" : "=a"(value) : "Nd"(port)); return value; @@ -22,8 +22,8 @@ static inline void outw(uint16_t port, uint16_t value) { : : "a"(value), "Nd"(port)); } static inline uint16_t inw(uint16_t port) { - uint16_t value; - asm volatile ( + volatile uint16_t value; + asm ( "inw %1, %0" : "=a"(value) : "Nd"(port)); return value; @@ -34,15 +34,15 @@ static inline void outd(uint16_t port, uint32_t value) { : : "a"(value), "Nd"(port)); } static inline uint32_t ind(uint16_t port) { - uint32_t value; - asm volatile ( + volatile uint32_t value; + asm ( "inl %1, %0" : "=a"(value) : "Nd"(port)); return value; } -void memcpy(void *to, void *from, uint32_t n); -void fmcpy(void *to, struct drive *d, drive_file_id_t f, uint32_t from, uint32_t n); +void memcpy(void *to, const void *from, uint32_t n); +void fmcpy(void *to, const struct drive *d, drive_file_id_t f, uint32_t from, uint32_t n); void u32_dec(uint32_t n, char *b); void u16_dec(uint16_t n, char *b); -- cgit v1.2.3