#define __SBI_CONSOLE_H__
#include <sbi/sbi_types.h>
+#include <sbi/sbi_hart.h>
struct sbi_console_device {
/** Name of the console device */
int sbi_console_init(struct sbi_scratch *scratch);
+#define BUG() do { \
+ sbi_printf("BUG: failure at %s:%d/%s()!\n", \
+ __FILE__, __LINE__, __func__); \
+ sbi_hart_hang(); \
+} while (0)
+
+#define BUG_ON(cond) do { \
+ if (cond) \
+ BUG(); \
+} while (0)
+
+#define SBI_ASSERT(cond) do { \
+ if (!(cond)) { \
+ sbi_printf("ASSERT: %s:%d/%s(): Assertion `%s` failed.\n", \
+ __FILE__,__LINE__,__func__, #cond);\
+ sbi_hart_hang(); \
+ } \
+} while (0)
+
#endif