]> Joshua Wise's Git repositories - netwatch.git/blob - grubload/output.c
Add some headers.
[netwatch.git] / grubload / output.c
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
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
20 static void safeputs(const char *s)
21 {
22         smram_state_t old = smram_save_state();
23         smram_aseg_set_state(SMRAM_ASEG_SMMONLY);
24         puts(s);
25         smram_restore_state(old);
26 }
27 void (*output)(const char *s) = safeputs;
28
29 static 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
42 void (*outputf)(const char *s, ...) = miniprintf;
This page took 0.024985 seconds and 4 git commands to generate.