diff -r e66f047bc97e xen/include/asm-x86/guest_access.h --- a/xen/include/asm-x86/guest_access.h Tue Jan 09 18:56:44 2007 -0800 +++ b/xen/include/asm-x86/guest_access.h Thu Jan 11 15:40:25 2007 +0100 @@ -32,8 +32,8 @@ * specifying an offset into the guest array. */ #define copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(ptr) _x = (hnd).p; \ - const typeof(ptr) _y = (ptr); \ + __typeof__(ptr) _x = (__typeof__(ptr))((hnd).p); \ + const __typeof__(ptr) _y = (__typeof__(ptr))(ptr); \ is_hvm_vcpu(current) ? \ copy_to_user_hvm(_x+(off), _y, sizeof(*_x)*(nr)) : \ copy_to_user(_x+(off), _y, sizeof(*_x)*(nr)); \ @@ -44,8 +44,8 @@ * specifying an offset into the guest array. */ #define copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(ptr) _x = (hnd).p; \ - const typeof(ptr) _y = (ptr); \ + const __typeof__(ptr) _x = (__typeof__(ptr))((hnd).p);\ + __typeof__(ptr) _y = (__typeof__(ptr))(ptr); \ is_hvm_vcpu(current) ? \ copy_from_user_hvm(_y, _x+(off), sizeof(*_x)*(nr)) :\ copy_from_user(_y, _x+(off), sizeof(*_x)*(nr)); \ @@ -53,8 +53,8 @@ /* Copy sub-field of a structure to guest context via a guest handle. */ #define copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _x = &(hnd).p->field; \ - const typeof(&(ptr)->field) _y = &(ptr)->field; \ + __typeof__(&(ptr)->field) _x = &(hnd).p->field; \ + const __typeof__(&(ptr)->field) _y = &(ptr)->field; \ is_hvm_vcpu(current) ? \ copy_to_user_hvm(_x, _y, sizeof(*_x)) : \ copy_to_user(_x, _y, sizeof(*_x)); \ @@ -62,8 +62,8 @@ /* Copy sub-field of a structure from guest context via a guest handle. */ #define copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _x = &(hnd).p->field; \ - const typeof(&(ptr)->field) _y = &(ptr)->field; \ + const __typeof__(&(ptr)->field) _x = &(hnd).p->field;\ + __typeof__(&(ptr)->field) _y = &(ptr)->field; \ is_hvm_vcpu(current) ? \ copy_from_user_hvm(_y, _x, sizeof(*_x)) : \ copy_from_user(_y, _x, sizeof(*_x)); \ @@ -78,34 +78,34 @@ array_access_ok((hnd).p, (nr), sizeof(*(hnd).p))) #define __copy_to_guest_offset(hnd, off, ptr, nr) ({ \ - const typeof(ptr) _x = (hnd).p; \ - const typeof(ptr) _y = (ptr); \ + __typeof__(ptr) _x = (__typeof__(ptr))((hnd).p); \ + const __typeof__(ptr) _y = (__typeof__(ptr))(ptr); \ is_hvm_vcpu(current) ? \ copy_to_user_hvm(_x+(off), _y, sizeof(*_x)*(nr)) : \ __copy_to_user(_x+(off), _y, sizeof(*_x)*(nr)); \ }) #define __copy_from_guest_offset(ptr, hnd, off, nr) ({ \ - const typeof(ptr) _x = (hnd).p; \ - const typeof(ptr) _y = (ptr); \ + const __typeof__(ptr) _x = (__typeof__(ptr))((hnd).p);\ + __typeof__(ptr) _y = (__typeof__(ptr))(ptr); \ is_hvm_vcpu(current) ? \ copy_from_user_hvm(_y, _x+(off),sizeof(*_x)*(nr)) : \ __copy_from_user(_y, _x+(off), sizeof(*_x)*(nr)); \ }) #define __copy_field_to_guest(hnd, ptr, field) ({ \ - const typeof(&(ptr)->field) _x = &(hnd).p->field; \ - const typeof(&(ptr)->field) _y = &(ptr)->field; \ + __typeof__(&(ptr)->field) _x = &(hnd).p->field; \ + const __typeof__(&(ptr)->field) _y = &(ptr)->field; \ is_hvm_vcpu(current) ? \ copy_to_user_hvm(_x, _y, sizeof(*_x)) : \ __copy_to_user(_x, _y, sizeof(*_x)); \ }) #define __copy_field_from_guest(ptr, hnd, field) ({ \ - const typeof(&(ptr)->field) _x = &(hnd).p->field; \ - const typeof(&(ptr)->field) _y = &(ptr)->field; \ + const __typeof__(&(ptr)->field) _x = &(hnd).p->field;\ + __typeof__(&(ptr)->field) _y = &(ptr)->field; \ is_hvm_vcpu(current) ? \ - copy_from_user_hvm(_x, _y, sizeof(*_x)) : \ + copy_from_user_hvm(_y, _x, sizeof(*_x)) : \ __copy_from_user(_y, _x, sizeof(*_x)); \ })