summaryrefslogtreecommitdiff
path: root/src/kernel/util.h
diff options
context:
space:
mode:
authorBenji Dial <Benji3.141@gmail.com>2020-08-13 17:58:50 -0400
committerBenji Dial <Benji3.141@gmail.com>2020-08-13 17:58:50 -0400
commit2ddbeb9f7214f6d3feef651eba83e6a9d120a743 (patch)
tree10a2aef195e0f40b0e44ffac82dcf60e426c4385 /src/kernel/util.h
parent63167f223e1f54910f6b80e698390ee60aec79ee (diff)
downloadportland-os-2ddbeb9f7214f6d3feef651eba83e6a9d120a743.tar.gz
lots of progress, including readonly PATA driver and part of FAT16 driver
Diffstat (limited to 'src/kernel/util.h')
-rw-r--r--src/kernel/util.h16
1 files changed, 8 insertions, 8 deletions
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);