]> Joshua Wise's Git repositories - netwatch.git/blame - grubload/output.c
Add some headers.
[netwatch.git] / grubload / output.c
CommitLineData
f1584bb0
JW
1/* output.c
2 * Console output routines
3 * NetWatch multiboot loader
4 *
5 * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved.
6 * This program is free software; you can redistribute and/or modify it under
7 * the terms found in the file LICENSE in the root of this source tree.
8 *
9 */
10
11
efea5b4e
JW
12#include <stdarg.h>
13#include <minilib.h>
14#include <console.h>
15#include <output.h>
16#include <smram.h>
17
18#define OUTBLEN 160
19
20static void safeputs(const char *s)
21{
f2b87dd6 22 smram_state_t old = smram_save_state();
efea5b4e
JW
23 smram_aseg_set_state(SMRAM_ASEG_SMMONLY);
24 puts(s);
25 smram_restore_state(old);
26}
27void (*output)(const char *s) = safeputs;
28
29static void miniprintf(const char *fmt, ...)
30{
31 va_list va;
32 char b[OUTBLEN+1];
33
34 va_start(va, fmt);
35 vsnprintf(b, OUTBLEN, fmt, va);
36 va_end(va);
37
38 output(b);
39 putbyte('\n');
40}
41
42void (*outputf)(const char *s, ...) = miniprintf;
This page took 0.025992 seconds and 4 git commands to generate.