debuggers.hg

view xen/include/asm-x86/bug.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 96441daf4a5b
children
line source
1 #ifndef __X86_BUG_H__
2 #define __X86_BUG_H__
4 #ifdef __x86_64__
5 #include <asm/x86_64/bug.h>
6 #else
7 #include <asm/x86_32/bug.h>
8 #endif
10 struct bug_frame {
11 unsigned char ud2[2];
12 unsigned char ret;
13 unsigned short id; /* BUGFRAME_??? */
14 } __attribute__((packed));
16 #define BUGFRAME_run_fn 0
17 #define BUGFRAME_warn 1
18 #define BUGFRAME_bug 2
19 #define BUGFRAME_assert 3
21 #define run_in_exception_handler(fn) \
22 asm volatile ( \
23 "ud2 ; ret %0" BUG_STR(1) \
24 : : "i" (BUGFRAME_run_fn), \
25 "i" (fn) )
27 #define WARN() \
28 asm volatile ( \
29 "ud2 ; ret %0" BUG_STR(1) \
30 : : "i" (BUGFRAME_warn | (__LINE__<<2)), \
31 "i" (__FILE__) )
33 #define BUG() \
34 asm volatile ( \
35 "ud2 ; ret %0" BUG_STR(1) \
36 : : "i" (BUGFRAME_bug | (__LINE__<<2)), \
37 "i" (__FILE__) )
39 #define assert_failed(p) \
40 asm volatile ( \
41 "ud2 ; ret %0" BUG_STR(1) BUG_STR(2) \
42 : : "i" (BUGFRAME_assert | (__LINE__<<2)), \
43 "i" (__FILE__), "i" (p) )
46 #endif /* __X86_BUG_H__ */