mirror of
https://github.com/drasko/codezero.git
synced 2026-04-06 12:09:05 +02:00
Few fixes in libposix error checking.
size_t is a non-negative type and negative error checking didn't work. Now fixed. Fixed various issues with reading file pages in the sys_read() path.
This commit is contained in:
@@ -55,13 +55,13 @@ static inline void write_mr(unsigned int offset, unsigned int val)
|
||||
|
||||
static inline void copy_to_utcb(void *arg, int offset, int size)
|
||||
{
|
||||
BUG_ON(size > PAGE_SIZE);
|
||||
memcpy(utcb_page, arg, size);
|
||||
BUG_ON(offset + size > PAGE_SIZE);
|
||||
memcpy(utcb_page + offset, arg, size);
|
||||
}
|
||||
|
||||
static inline void copy_from_utcb(void *buf, int offset, int size)
|
||||
{
|
||||
BUG_ON(size > PAGE_SIZE);
|
||||
BUG_ON(offset + size > PAGE_SIZE);
|
||||
memcpy(buf, utcb_page + offset, size);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user