Nucleus
Barry Kernel printf routines 120a213 (3 years, 2 months ago)
diff --git a/include/nucleus/kernel.h b/include/nucleus/kernel.h
new file mode 100644
index 0000000..50bba3d
--- /dev/null
+++ b/include/nucleus/kernel.h
@@ -0,0 +1,19 @@
+#ifndef _NUCLEUS_KERNEL_H
+#define _NUCLEUS_KERNEL_H
+
+#include <stdarg.h>
+
+int vsprintf(char *buf, const char *fmt, va_list args);
+int sprintf(char *buf, const char *fmt, ...);
+void dbgprintf(char *str);
+void kprintf(char *fmt, ...);
+_Noreturn void panic(char *fmt, ...);
+
+#define ASSERT(c) ({ \
+ if (__builtin_expect(!(c),0)) \
+ panic("Assertion failed (%s:%d): %s", \
+ __FILE__, __LINE__, #c); \
+ c; \
+})
+
+#endif