diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/libc/inc/sys.h | 8 | ||||
-rw-r--r-- | libs/libc/print.c | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/libs/libc/inc/sys.h b/libs/libc/inc/sys.h index ee82946..749888a 100644 --- a/libs/libc/inc/sys.h +++ b/libs/libc/inc/sys.h @@ -81,10 +81,12 @@ res read(const char *path, void *buf, u32 offset, u32 count) NONNULL; res write(const char *path, const void *buf, u32 offset, u32 count) NONNULL; res stat(const char *path, struct stat *buf) NONNULL; res exec(const char *path, ...) ATTR((nonnull(1))) SENTINEL; -res io_poll(u32 *devs); -res io_read(enum io_type io, void *buf, u32 offset, u32 count); -res io_write(enum io_type io, void *buf, u32 offset, u32 count); + +res io_poll(u32 *devs) NONNULL; +res io_read(enum io_type io, void *buf, u32 offset, u32 count) NONNULL; +res io_write(enum io_type io, void *buf, u32 offset, u32 count) NONNULL; res io_control(enum io_type io, ...); + res yield(void); res boot(u32 cmd); diff --git a/libs/libc/print.c b/libs/libc/print.c index 425eb01..27048bd 100644 --- a/libs/libc/print.c +++ b/libs/libc/print.c @@ -233,7 +233,7 @@ void print_trace(u32 count) } * stk; __asm__ volatile("movl %%ebp, %0;" : "=r"(stk)); print("EBP\tEIP\n"); - for (u32 i = 0; stk && i < count; i++) { + for (u32 i = 0; stk && memory_readable(stk) && i < count; i++) { printf("0x%x\t0x%x\n", stk->ebp, stk->eip); stk = stk->ebp; } |