diff options
author | Tim Deegan <tim@xen.org> | 2013-08-29 16:47:12 +0100 |
---|---|---|
committer | Tim Deegan <tim@xen.org> | 2013-08-30 11:23:38 +0100 |
commit | ec3f60c9d609703cce2fca30edbc6e72cd18e492 (patch) | |
tree | a405e4ecc1bf9134c6f562a0fc3653450cc23120 /xen/include/asm-x86/bug.h | |
parent | 6e287713c94b40bbf21a378eab622108b1186233 (diff) | |
download | xen-ec3f60c9d609703cce2fca30edbc6e72cd18e492.tar.gz xen-ec3f60c9d609703cce2fca30edbc6e72cd18e492.tar.bz2 xen-ec3f60c9d609703cce2fca30edbc6e72cd18e492.zip |
xen/x86: don't use '.ifnes' in bug frame construction.
Spotted because it breaks the clang build for LLVM <3.2. .ifnes is
not right here as it will choke on a string with embedded quotes.
.ifnb would be better except that LLVM <3.2 doesn't support that either
(and nor does binutils 2.16).
It should be possible to use something like !!msg or !!msg[0] instead
of a separate flag, but I gave up trying to find something that would
make it through CPP, asm() and gas as a usable constant. :|
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/include/asm-x86/bug.h')
-rw-r--r-- | xen/include/asm-x86/bug.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/xen/include/asm-x86/bug.h b/xen/include/asm-x86/bug.h index 148975fde2..e5dd559407 100644 --- a/xen/include/asm-x86/bug.h +++ b/xen/include/asm-x86/bug.h @@ -25,7 +25,7 @@ struct bug_frame { #define BUGFRAME_bug 2 #define BUGFRAME_assert 3 -#define BUG_FRAME(type, line, ptr, msg) do { \ +#define BUG_FRAME(type, line, ptr, second_frame, msg) do { \ BUILD_BUG_ON((line) >> (BUG_LINE_LO_WIDTH + BUG_LINE_HI_WIDTH)); \ asm volatile ( ".Lbug%=: ud2\n" \ ".pushsection .bug_frames.%c0, \"a\", @progbits\n" \ @@ -33,7 +33,7 @@ struct bug_frame { ".Lfrm%=:\n" \ ".long (.Lbug%= - .Lfrm%=) + %c4\n" \ ".long (%c1 - .Lfrm%=) + %c3\n" \ - ".ifnes \"" msg "\", \"\"\n" \ + ".if " #second_frame "\n" \ ".long 0, %c2 - .Lfrm%=\n" \ ".endif\n" \ ".popsection" \ @@ -44,12 +44,14 @@ struct bug_frame { "i" (((line) >> BUG_LINE_LO_WIDTH) << BUG_DISP_WIDTH)); \ } while (0) -#define WARN() BUG_FRAME(BUGFRAME_warn, __LINE__, __FILE__, "") -#define BUG() BUG_FRAME(BUGFRAME_bug, __LINE__, __FILE__, "") -#define run_in_exception_handler(fn) BUG_FRAME(BUGFRAME_run_fn, 0, fn, "") +#define WARN() BUG_FRAME(BUGFRAME_warn, __LINE__, __FILE__, 0, NULL) +#define BUG() BUG_FRAME(BUGFRAME_bug, __LINE__, __FILE__, 0, NULL) -#define assert_failed(msg) BUG_FRAME(BUGFRAME_assert, __LINE__, __FILE__, msg) +#define run_in_exception_handler(fn) BUG_FRAME(BUGFRAME_run_fn, 0, fn, 0, NULL) + +#define assert_failed(msg) \ + BUG_FRAME(BUGFRAME_assert, __LINE__, __FILE__, 1, msg) extern const struct bug_frame __start_bug_frames[], __stop_bug_frames_0[], |