From: Alan Cox Date: Sun, 9 Sep 2018 23:18:33 +0000 (+0100) Subject: syscall_fs: stop sdcc making such a hash of this X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=315aa39cfadb4863bb9f2533e823925bd746edc2;p=FUZIX.git syscall_fs: stop sdcc making such a hash of this --- diff --git a/Kernel/syscall_fs.c b/Kernel/syscall_fs.c index 767c159d..60ea8c97 100644 --- a/Kernel/syscall_fs.c +++ b/Kernel/syscall_fs.c @@ -140,6 +140,7 @@ arg_t _fstat(void) /* Utility for stat and fstat */ int stcpy(inoptr ino, char *buf) { + static uint8_t zero[4]; /* Copying the structure a member at a time is too expensive. Instead we * copy sequential runs of identical types (the only members which the * compiler guarantees are next to each other). */ @@ -147,13 +148,12 @@ int stcpy(inoptr ino, char *buf) /* VIRTUAL: If we ever do true virtual memory we'll need to copy the structure first or we may sleep and copy bits from different inode states */ - uint32_t zero = 0; struct _uzistat* st = (struct _uzistat*) buf; int err = uput(&ino->c_dev, &st->st_dev, 2 * sizeof(uint16_t)); err |= uput(&ino->c_node.i_mode, &st->st_mode, 4 * sizeof(uint16_t)); err |= uput(&ino->c_node.i_addr[0], &st->st_rdev, 1 * sizeof(uint16_t)); err |= uput(&ino->c_node.i_size, &st->st_size, 4 * sizeof(uint32_t)); - err |= uput(&zero, &st->st_timeh, 1 * sizeof(uint32_t)); + err |= uput(zero, &st->st_timeh, 4); return err; }