]> Joshua Wise's Git repositories - netwatch.git/blob - grubload/output.c
Make the log longer, and make it faster to write to.
[netwatch.git] / grubload / output.c
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 {
11         smram_state_t old = smram_save_state();
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;
This page took 0.026419 seconds and 4 git commands to generate.