>>> On 07.02.19 at 10:04, <julien.gr...@arm.com> wrote:
> On 2/7/19 6:32 AM, Christopher Clark wrote:
>> It uses that null test because both are XEN_GUEST_HANDLE_PARAM type in
>> the function signature:
>> 
>> long do_argo_op(
>>      unsigned int cmd,
>>      XEN_GUEST_HANDLE_PARAM(void) arg1,
>>      XEN_GUEST_HANDLE_PARAM(void) arg2,
>>      unsigned long arg3,
>>      unsigned long arg4);
>> 
>> and since it does that, the comment states NULL rather than zero.
>> 
>> It is Xen's definition for NULL that is used, so the expected value in
>> the register when the hypercall is invoked is: zero.
> 
> As above, I don't think it is clearly define in the headers that NULL 
> means 0. This is rather an implicit written rules in the hope that every 
> OS are going to follow that.
> 
> I know, I am pedantic here (hence the NIT) :). And I realize this is not 
> related to this series and a few places in the code assumes the same.

Exactly - just grep the public headers. The assumption is that a null
handle is a type-wrapped representation of a NULL pointer. All
platforms Xen runs on or has run on have NULL have a binary
representation of zero afaik.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to