debuggers.hg

view xen/include/asm-x86/io.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 cab326925ea6
children
line source
1 #ifndef _ASM_IO_H
2 #define _ASM_IO_H
4 #include <xen/config.h>
5 #include <xen/types.h>
6 #include <asm/page.h>
8 /* We don't need real ioremap() on Xen/x86. */
9 #define ioremap(x,l) (__va(x))
10 #define iounmap(p) ((void)0)
12 #define readb(x) (*(volatile char *)(x))
13 #define readw(x) (*(volatile short *)(x))
14 #define readl(x) (*(volatile int *)(x))
15 #define writeb(d,x) (*(volatile char *)(x) = (d))
16 #define writew(d,x) (*(volatile short *)(x) = (d))
17 #define writel(d,x) (*(volatile int *)(x) = (d))
19 #define __OUT1(s,x) \
20 static inline void out##s(unsigned x value, unsigned short port) {
22 #define __OUT2(s,s1,s2) \
23 __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
25 #define __OUT(s,s1,x) \
26 __OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port)); } \
27 __OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a" (value), "Nd" (port));}
29 #define __IN1(s) \
30 static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v;
32 #define __IN2(s,s1,s2) \
33 __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
35 #define __IN(s,s1,i...) \
36 __IN1(s) __IN2(s,s1,"w") : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \
37 __IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v) : "Nd" (port) ,##i ); return _v; }
39 #define RETURN_TYPE unsigned char
40 __IN(b,"")
41 #undef RETURN_TYPE
42 #define RETURN_TYPE unsigned short
43 __IN(w,"")
44 #undef RETURN_TYPE
45 #define RETURN_TYPE unsigned int
46 __IN(l,"")
47 #undef RETURN_TYPE
49 __OUT(b,"b",char)
50 __OUT(w,"w",short)
51 __OUT(l,,int)
53 extern void (*pv_post_outb_hook)(unsigned int port, u8 value);
55 #endif