]>
Commit | Line | Data |
---|---|---|
efea5b4e JW |
1 | #include <stdarg.h> |
2 | #include <minilib.h> | |
3 | #include <console.h> | |
4 | #include <output.h> | |
5 | #include <smram.h> | |
6 | ||
7 | #define OUTBLEN 160 | |
8 | ||
9 | static void safeputs(const char *s) | |
10 | { | |
f2b87dd6 | 11 | smram_state_t old = smram_save_state(); |
efea5b4e JW |
12 | smram_aseg_set_state(SMRAM_ASEG_SMMONLY); |
13 | puts(s); | |
14 | smram_restore_state(old); | |
15 | } | |
16 | void (*output)(const char *s) = safeputs; | |
17 | ||
18 | static void miniprintf(const char *fmt, ...) | |
19 | { | |
20 | va_list va; | |
21 | char b[OUTBLEN+1]; | |
22 | ||
23 | va_start(va, fmt); | |
24 | vsnprintf(b, OUTBLEN, fmt, va); | |
25 | va_end(va); | |
26 | ||
27 | output(b); | |
28 | putbyte('\n'); | |
29 | } | |
30 | ||
31 | void (*outputf)(const char *s, ...) = miniprintf; |