debuggers.hg

view xen/include/asm-x86/byteorder.h @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents 5ccf8bbf8628
children
line source
1 #ifndef __ASM_X86_BYTEORDER_H__
2 #define __ASM_X86_BYTEORDER_H__
4 #include <asm/types.h>
5 #include <xen/compiler.h>
7 static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
8 {
9 asm("bswap %0" : "=r" (x) : "0" (x));
10 return x;
11 }
13 static inline __attribute_const__ __u64 ___arch__swab64(__u64 val)
14 {
15 union {
16 struct { __u32 a,b; } s;
17 __u64 u;
18 } v;
19 v.u = val;
20 asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
21 : "=r" (v.s.a), "=r" (v.s.b)
22 : "0" (v.s.a), "1" (v.s.b));
23 return v.u;
24 }
26 /* Do not define swab16. Gcc is smart enough to recognize "C" version and
27 convert it into rotation or exhange. */
29 #define __arch__swab64(x) ___arch__swab64(x)
30 #define __arch__swab32(x) ___arch__swab32(x)
32 #define __BYTEORDER_HAS_U64__
34 #include <xen/byteorder/little_endian.h>
36 #endif /* __ASM_X86_BYTEORDER_H__ */