X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fvm.c;h=1005507db4a00bb2e90e8b5ca40f68bd68f12381;hb=ace8f0532fa5650c6642a3a7174f3aa19b09095a;hp=b0e2b3fbe8b28c26fd4b1cb959d4fbe92a68f4d5;hpb=df58bd3c484a52b1e166dc28e7b9b6fd94e5a023;p=palacios.releases.git diff --git a/palacios/src/geekos/vm.c b/palacios/src/geekos/vm.c index b0e2b3f..1005507 100644 --- a/palacios/src/geekos/vm.c +++ b/palacios/src/geekos/vm.c @@ -41,30 +41,26 @@ inline uchar_t VM_In_Byte(ushort_t port) int IO_Read(ushort_t port, void * dst, uint_t length, void * priv_data) { - uchar_t * iter = dst; - uint_t i; - for (i = 0; i < length; i++) { - *iter = VM_In_Byte(port); - iter++; + if (length != 1) { + return 0; } - - return 0; + + *(uchar_t*)dst = VM_In_Byte(port); + return 1; } int IO_Write(ushort_t port, void * src, uint_t length, void * priv_data) { - uchar_t * iter = src; - uint_t i; - - for (i = 0; i < length; i++) { - VM_Out_Byte(port, *iter); - iter++; + if (length != 1) { + return 0; } - return 0; + VM_Out_Byte(port, *(uchar_t *)src); + + return 1; } @@ -291,7 +287,7 @@ int RunVMM(struct Boot_Info * bootInfo) { { struct vm_device * nvram = create_nvram(); - struct vm_device * timer = create_timer(); + //struct vm_device * timer = create_timer(); attach_device(&(vm_info), nvram); //attach_device(&(vm_info), timer); @@ -301,7 +297,6 @@ int RunVMM(struct Boot_Info * bootInfo) { } - PrintDebug("foo\n"); vm_info.rip = 0xfff0;