#include "stdlib.h" static Console *global_console = nullptr; void console_set(Console *ptr) { if (ptr != nullptr) { global_console = ptr; } } void printk(const String &msg) { if (global_console == nullptr) return; global_console->write(msg); } void abort() { /* * On gcc, a 'while(true) {}' will infinitely loop * but clang will optimize it away on -O2 if it's empty * therefore, add no-op */ while (true) { asm volatile("nop"); } __builtin_unreachable(); }