On 23 November 2011 23:31, Alexander Graf <ag...@suse.de> wrote: > If it was the same value before, it will still be the same value in guest > memory. > > get_guest_s32(status, status_ptr); > old_status = status; > wait(...) > if (old_status != status) { > status = convert_status(status); > put_guest_s32(status, status_ptr); > }
Picking some concrete numbers as an illustration; obviously they're not really sensible status values: Suppose guest memory contains the value 1, and that convert_status(1) == 2. Now if you come out of wait() and status == 1 (ie old_status == status), then either: (a) wait() didn't write to status => do nothing (b) wait() did write to status => since convert_status(1) == 2 we need to write 2 to guest memory For this approach to work you have to have a conversion function from guest to host status, I think. -- PMM