riscv/
.clang-format
570 B
.gitignore
5 B
.gitsigners
112 B
LICENSE
1.1 KiB
Makefile
1.1 KiB
README
3.3 KiB
color.h
567 B
emulator.c
79.7 KiB
io.c
1.1 KiB
io.h
444 B
jit.c
32.6 KiB
jit.h
5.0 KiB
riscv.c
12.0 KiB
riscv.h
12.0 KiB
types.h
1.0 KiB
io.h
raw
| 1 | #ifndef IO_H |
| 2 | #define IO_H |
| 3 | |
| 4 | #include "types.h" |
| 5 | |
| 6 | /* Abort execution and exit with an error code. */ |
| 7 | #define bail(...) _bail(__FILE__, __LINE__, __VA_ARGS__) |
| 8 | |
| 9 | /* Debug output - disabled for bootstrap compiler. */ |
| 10 | #define debug(...) ((void)0) |
| 11 | |
| 12 | __attribute__((noreturn)) void _bail( |
| 13 | const char *file, int line, const char *restrict fmt, ... |
| 14 | ); |
| 15 | |
| 16 | /* Read a file in its entirety into `data`. */ |
| 17 | i32 readfile(const char *path, char **data); |
| 18 | |
| 19 | #endif |