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

[Xen-devel] RFC: vaddr_t and vsize_t

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] RFC: vaddr_t and vsize_t
From: "Christoph Egger" <Christoph.Egger@xxxxxxx>
Date: Wed, 17 Jan 2007 16:17:33 +0100
Cc: Keir Fraser <keir@xxxxxxxxxxxxx>
Delivery-date: Wed, 17 Jan 2007 07:17:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.4
Hi!

*BSD uses two types for virtual addresses and the virtual address space:
vaddr_t and vsize_t.

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.

The difference to the pointer is that the pointer is only used to point to
something specific, e.g. a structure in the kernel.

That way mixing up virtual addresses, virtual address spaces and pointers
is hardly possible. What do you think about adding those types to Xen?


The type definition for x86_32 and x86_64 would be this:

diff -r fd2667419c53 xen/include/asm-x86/types.h
--- a/xen/include/asm-x86/types.h       Tue Jan 16 14:04:12 2007 -0500
+++ b/xen/include/asm-x86/types.h       Thu Nov 09 10:23:14 2006 +0100
@@ -36,6 +36,9 @@ typedef unsigned int u32;
 #if defined(__i386__)
 typedef signed long long s64;
 typedef unsigned long long u64;
+/* datatype to store virtual addresses. */
+typedef unsigned long vaddr_t;
+typedef unsigned long vsize_t;
 #if defined(CONFIG_X86_PAE)
 typedef u64 paddr_t;
 #define PRIpaddr "016llx"
@@ -47,6 +50,8 @@ typedef signed long s64;
 typedef signed long s64;
 typedef unsigned long u64;
 typedef unsigned long paddr_t;
+typedef unsigned long vaddr_t;
+typedef unsigned long vsize_t;
 #define PRIpaddr "016lx"
 #endif
 




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

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