diff options
-rw-r--r-- | src/console/post.c | 15 | ||||
-rw-r--r-- | src/include/console/console.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/console/post.c b/src/console/post.c index 08336a28e9..be2d0e9307 100644 --- a/src/console/post.c +++ b/src/console/post.c @@ -24,6 +24,20 @@ /* Write POST information */ +/* someday romcc will be gone. */ +#ifndef __ROMCC__ +/* Some mainboards have very nice features beyond just a simple display. + * They can override this function. + */ +void __attribute__((weak)) mainboard_post(uint8_t value) +{ +} + +#else +/* This just keeps the number of #ifs to a minimum */ +#define mainboard_post(x) +#endif + void post_code(uint8_t value) { #if !CONFIG_NO_POST @@ -34,4 +48,5 @@ void post_code(uint8_t value) #endif outb(value, CONFIG_POST_PORT); #endif + mainboard_post(value); } diff --git a/src/include/console/console.h b/src/include/console/console.h index 56e202d99b..00be96f80f 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -69,6 +69,8 @@ extern int console_loglevel; #ifndef __ROMCC__ void console_init(void); void post_code(u8 value); +/* this function is weak and can be overridden by a mainboard function. */ +void mainboard_post(u8 value); void __attribute__ ((noreturn)) die(const char *msg); int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); |