]> Joshua Wise's Git repositories - netwatch.git/blame - grubload/output.c
Wait for completion before we pull the trigger on the pbuf
[netwatch.git] / grubload / output.c
CommitLineData
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
9static 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}
16void (*output)(const char *s) = safeputs;
17
18static 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
31void (*outputf)(const char *s, ...) = miniprintf;
This page took 0.029519 seconds and 4 git commands to generate.