]> Joshua Wise's Git repositories - netwatch.git/blame_incremental - grubload/output.c
Merge nyus.joshuawise.com:/storage/git/netwatch
[netwatch.git] / grubload / output.c
... / ...
CommitLineData
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{
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}
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.02471 seconds and 4 git commands to generate.