summaryrefslogtreecommitdiffstats
path: root/flash.h
diff options
context:
space:
mode:
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/flash.h b/flash.h
index 0dac13d..0c14ce1 100644
--- a/flash.h
+++ b/flash.h
@@ -268,13 +268,15 @@ int write_buf_to_file(unsigned char *buf, unsigned long size, const char *filena
#define ERROR_FLASHROM_LIMIT -201
/* cli_output.c */
+enum msglevel {
+ MSG_ERROR = 0,
+ MSG_INFO = 1,
+ MSG_DEBUG = 2,
+ MSG_DEBUG2 = 3,
+ MSG_SPEW = 4,
+};
/* Let gcc and clang check for correct printf-style format strings. */
-int print(int type, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
-#define MSG_ERROR 0
-#define MSG_INFO 1
-#define MSG_DEBUG 2
-#define MSG_DEBUG2 3
-#define MSG_BARF 4
+int print(enum msglevel level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
#define msg_gerr(...) print(MSG_ERROR, __VA_ARGS__) /* general errors */
#define msg_perr(...) print(MSG_ERROR, __VA_ARGS__) /* programmer errors */
#define msg_cerr(...) print(MSG_ERROR, __VA_ARGS__) /* chip errors */
@@ -287,9 +289,9 @@ int print(int type, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
#define msg_gdbg2(...) print(MSG_DEBUG2, __VA_ARGS__) /* general debug2 */
#define msg_pdbg2(...) print(MSG_DEBUG2, __VA_ARGS__) /* programmer debug2 */
#define msg_cdbg2(...) print(MSG_DEBUG2, __VA_ARGS__) /* chip debug2 */
-#define msg_gspew(...) print(MSG_BARF, __VA_ARGS__) /* general debug barf */
-#define msg_pspew(...) print(MSG_BARF, __VA_ARGS__) /* programmer debug barf */
-#define msg_cspew(...) print(MSG_BARF, __VA_ARGS__) /* chip debug barf */
+#define msg_gspew(...) print(MSG_SPEW, __VA_ARGS__) /* general debug spew */
+#define msg_pspew(...) print(MSG_SPEW, __VA_ARGS__) /* programmer debug spew */
+#define msg_cspew(...) print(MSG_SPEW, __VA_ARGS__) /* chip debug spew */
/* layout.c */
int register_include_arg(char *name);
OpenPOWER on IntegriCloud