kernel: restructure readi/writei to save memory
authorAlan Cox <alan@linux.intel.com>
Fri, 9 Feb 2018 23:49:50 +0000 (23:49 +0000)
committerAlan Cox <alan@linux.intel.com>
Fri, 9 Feb 2018 23:49:50 +0000 (23:49 +0000)
commitdbb192b76544dfc00d38c047033b668eb43a65cd
tree12df712da1b5092e79bcff2dfd13fa49e4e6c502
parentf6488daf7ad7864ca42cda3255f5fba0b8a69ea9
kernel: restructure readi/writei to save memory

This saves us 256 bytes on Z80 mostly by removing the amount of 32bit maths
SDCC has the opportunity to **** up.

We introduce a helper (umove) which adjusts all the pointers and offsets
for a given file and use that where we can. We also restructure a bit so we
can use the udata.u_done value in readi/writei

This has some minor consequences:
Callers need to check u_done for completion not u_count
Char and Socket handlers don't affect the offset unless they choose to (which
is saner). Devsys has been modified accordingly.

Handle with care.
Kernel/devsys.c
Kernel/filesys.c
Kernel/include/kernel.h
Kernel/inode.c
Kernel/syscall_exec16.c
Kernel/syscall_exec32.c
Kernel/syscall_fs.c