* Something went wrong, print an error and abort. */
| 111 | * Something went wrong, print an error and abort. |
| 112 | */ |
| 113 | static NO_INLINE NO_RETURN void e9panic(const char *msg, ...) |
| 114 | { |
| 115 | char buf[BUFSIZ], *str = buf; |
| 116 | str = e9write_str(str, "e9patch loader error: "); |
| 117 | va_list ap; |
| 118 | va_start(ap, msg); |
| 119 | str = e9write_format(str, msg, ap); |
| 120 | va_end(ap); |
| 121 | str = e9write_char(str, '\n'); |
| 122 | |
| 123 | size_t len = str - buf; |
| 124 | e9syscall(SYS_write, STDERR_FILENO, buf, len); |
| 125 | e9syscall(SYS_kill, /*pid=*/0, SIGABRT); |
| 126 | while (true) |
| 127 | asm volatile ("ud2"); |
| 128 | } |
| 129 | |
| 130 | /* |
| 131 | * Write a debug message. |
no test coverage detected