diff options
author | Benji Dial <Benji3.141@gmail.com> | 2020-08-13 17:58:50 -0400 |
---|---|---|
committer | Benji Dial <Benji3.141@gmail.com> | 2020-08-13 17:58:50 -0400 |
commit | 2ddbeb9f7214f6d3feef651eba83e6a9d120a743 (patch) | |
tree | 10a2aef195e0f40b0e44ffac82dcf60e426c4385 /src/kernel/util.c | |
parent | 63167f223e1f54910f6b80e698390ee60aec79ee (diff) | |
download | portland-os-2ddbeb9f7214f6d3feef651eba83e6a9d120a743.tar.gz |
lots of progress, including readonly PATA driver and part of FAT16 driver
Diffstat (limited to 'src/kernel/util.c')
-rw-r--r-- | src/kernel/util.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/kernel/util.c b/src/kernel/util.c index 1531f83..29d7e3f 100644 --- a/src/kernel/util.c +++ b/src/kernel/util.c @@ -1,10 +1,10 @@ -#include <stdint.h> -#include "panic.h" #include <stdbool.h> +#include <stdint.h> #include "drive.h" -void memcpy(void *to, void *from, uint32_t n) { - uint32_t *tp = to, *fp = from; +void memcpy(void *to, const void *from, uint32_t n) { + uint32_t *tp = to; + const uint32_t *fp = from; while (n >= 4) { *(tp++) = *(fp++); n -= 4; @@ -14,7 +14,7 @@ void memcpy(void *to, void *from, uint32_t n) { *(tpp++) = *(fpp++); } -void fmcpy(void *to, struct drive *d, drive_file_id_t f, uint32_t from, uint32_t n) { +void fmcpy(void *to, const struct drive *d, drive_file_id_t f, uint32_t from, uint32_t n) { uint8_t buf[512]; d->load_sector(d, f, from >> 9, buf); uint16_t from_low = from & 511; |