From: Jack Lange Date: Wed, 9 Sep 2009 19:37:29 +0000 (-0500) Subject: changed v3_yield to be usable by non guest threads X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=e8c6db81c1ad76fab0f6a783c03654145e41599d changed v3_yield to be usable by non guest threads --- diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index fcc6ea5..27edd92 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -174,9 +174,17 @@ void v3_yield_cond(struct guest_info * info) { } } +/* + * unconditional cpu yield + * if the yielding thread is a guest context, the guest quantum is reset on resumption + * Non guest context threads should call this function with a NULL argument + */ void v3_yield(struct guest_info * info) { V3_Yield(); - rdtscll(info->yield_start_cycle); + + if (info) { + rdtscll(info->yield_start_cycle); + } }