WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] RFC: vaddr_t and vsize_t

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] RFC: vaddr_t and vsize_t
From: "Christoph Egger" <Christoph.Egger@xxxxxxx>
Date: Wed, 17 Jan 2007 17:21:26 +0100
Cc: Keir Fraser <keir@xxxxxxxxxxxxx>
Delivery-date: Wed, 17 Jan 2007 08:24:25 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C1D3F60F.7C1A%keir@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: AMD / OSRC
References: <C1D3F60F.7C1A%keir@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.4
On Wednesday 17 January 2007 16:49, Keir Fraser wrote:
> On 17/1/07 15:17, "Christoph Egger" <Christoph.Egger@xxxxxxx> wrote:
> > vaddr_t is used when a virtual address is meant. It is an unsigned
> > integer and its size always matches sizeof(void *).
> > vsize_t is used when the virtual address space is meant. It is an
> > unsigned integer and its size always matches the whole size of the
> > virtual address space.
>
> Is this distinction ever useful?

As long as no architecture is added to Xen which uses ILP rather LP64,
vsize_t is not really needed. For vaddr_t see below.

> The assumption that a pointer fits in a long is rather ingrained into Xen's
> code base. Any attempt to remove that assumption is going to need some big
> patches, and it's really not clear that we ought to care as I'm sure it's
> true for any architecture we can conceive of caring one jot about.

Once an ILP arch comes up, the assumption is no longer true. Until this 
happens, noone need to care.

This stuff is about removing a place where programmers can make mistakes.
vaddr_t also avoids void * arithmetics. It should be possible then to use 
-Wpointer-arith.

I don't mind if you dislike vsize_t for the above reason. What do you think
about vaddr_t?

Christoph





_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>