X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=test%2Fgeekos_test_vm%2Fsrc%2Fgeekos%2Fscreen.c;h=5323e3c17822a4517169f2a0e0891db7cc3d1a01;hb=cbbdb1c69dae70c0d8b836a3d9ff92e2aa67f1f9;hp=077112fe40432b0a3af7758a917f3b2e3bb9a54f;hpb=a70930549d1b741704dd7af4e6bb0e89f6f8a519;p=palacios.git diff --git a/test/geekos_test_vm/src/geekos/screen.c b/test/geekos_test_vm/src/geekos/screen.c index 077112f..5323e3c 100644 --- a/test/geekos_test_vm/src/geekos/screen.c +++ b/test/geekos_test_vm/src/geekos/screen.c @@ -14,6 +14,7 @@ #include #include #include +#include /* * Information sources for VT100 and ANSI escape sequences: @@ -387,20 +388,6 @@ static void Update_Cursor(void) * Public functions * ---------------------------------------------------------------------- */ -/* - * Initialize the screen module. - */ -void Init_Screen(void) -{ - bool iflag = Begin_Int_Atomic(); - - s_cons.row = s_cons.col = 0; - s_cons.currentAttr = DEFAULT_ATTRIBUTE; - Clear_Screen(); - - End_Int_Atomic(iflag); - Print("Screen Inited\n"); -} /* * Clear the screen using the current attribute. @@ -512,7 +499,7 @@ void Put_Buf(const char* buf, ulong_t length) /* Support for Print(). */ static void Print_Emit(struct Output_Sink *o, int ch) { Put_Char_Imp(ch); } static void Print_Finish(struct Output_Sink *o) { Update_Cursor(); } -static struct Output_Sink s_outputSink = { &Print_Emit, &Print_Finish }; +static struct Output_Sink s_outputSink; /* * Print to console using printf()-style formatting. @@ -542,3 +529,22 @@ void PrintList(const char * fmt, va_list ap) { PrintInternal(fmt, ap); End_Int_Atomic(iflag); } + + +/* + * Initialize the screen module. + */ +void Init_Screen(void) +{ + bool iflag = Begin_Int_Atomic(); + + s_outputSink.Emit = &Print_Emit; + s_outputSink.Finish = &Print_Finish; + + s_cons.row = s_cons.col = 0; + s_cons.currentAttr = DEFAULT_ATTRIBUTE; + Clear_Screen(); + + End_Int_Atomic(iflag); + Print("Screen Inited\n"); +}