From 315aa39cfadb4863bb9f2533e823925bd746edc2 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 10 Sep 2018 00:18:33 +0100 Subject: [PATCH] syscall_fs: stop sdcc making such a hash of this --- Kernel/syscall_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.34.1