X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=misc%2Ftest_vm%2Fsrc%2Fgeekos%2Fvm_cons.c;fp=misc%2Ftest_vm%2Fsrc%2Fgeekos%2Fvm_cons.c;h=0000000000000000000000000000000000000000;hp=9c2e5a460ddb1c17f76e3c1e07cbeb04e838d83b;hb=a70930549d1b741704dd7af4e6bb0e89f6f8a519;hpb=afb634a80f946634454a5d067a92aa600227bd93 diff --git a/misc/test_vm/src/geekos/vm_cons.c b/misc/test_vm/src/geekos/vm_cons.c deleted file mode 100644 index 9c2e5a4..0000000 --- a/misc/test_vm/src/geekos/vm_cons.c +++ /dev/null @@ -1,116 +0,0 @@ -#include -#include -#include -#include - -#define CONS_PORT 0xc0c0 - -void VMConsPutChar(unsigned char c) { - /* send char */ - Out_Byte(CONS_PORT, c); -} - - - - -void VMConsPutLineN(char * line, int len) { - int i; - for (i = 0; i < len && line[i] != 0; i++) { - VMConsPutChar(line[i]); - } -} - - -void VMConsPutLine(char * line) { - int i; - for (i = 0; line[i]!= 0; i++) { - VMConsPutChar(line[i]); - } -} - - -void VMConsPrintHex(unsigned char x) -{ - unsigned char z; - - z = (x >> 4) & 0xf ; - VMConsPrint("%x", z); - z = x & 0xf; - VMConsPrint("%x", z); -} - -void VMConsMemDump(unsigned char *start, int n) -{ - int i, j; - - for (i=0;i=32) && (start[j]<=126)) ? start[j] : '.'); - } - VMConsPrint("\n"); - } -} - - -static struct Output_Sink vm_cons_output_sink; -static void VMCons_Emit(struct Output_Sink * o, int ch) { - VMConsPutChar((unsigned char)ch); -} -static void VMCons_Finish(struct Output_Sink * o) { return; } - - -static void __inline__ VMConsPrintInternal(const char * format, va_list ap) { - Format_Output(&vm_cons_output_sink, format, ap); -} - - -void VMConsPrint(const char * format, ...) { - va_list args; - bool iflag = Begin_Int_Atomic(); - - va_start(args, format); - VMConsPrintInternal(format, args); - va_end(args); - - End_Int_Atomic(iflag); -} - -void VMConsPrintList(const char * format, va_list ap) { - bool iflag = Begin_Int_Atomic(); - VMConsPrintInternal(format, ap); - End_Int_Atomic(iflag); - -} - - - - -void VMConsPrintLevel(int level, const char * format, ...) { - va_list args; - bool iflag = Begin_Int_Atomic(); - - va_start(args, format); - VMConsPrintInternal(format, args); - va_end(args); - - End_Int_Atomic(iflag); -} - -void Init_VMCons() { - - vm_cons_output_sink.Emit = &VMCons_Emit; - vm_cons_output_sink.Finish = &VMCons_Finish; - - VMConsPrint("Initializing VM Console\n"); - - return; -}