From: Andrew Cooper Subject: [PATCH 2/3] xen/x86: Use real assert frames for ASSERT_INTERRUPTS_{EN, DIS}ABLED Date: Thu, 9 Apr 2015 21:06:22 +0100 Message-ID: <1428609983-26998-3-git-send-email-andrew.cooper3@citrix.com> References: <1428609983-26998-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1428609983-26998-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Keir Fraser , Jan Beulich List-Id: xen-devel@lists.xenproject.org Signed-off-by: Andrew Cooper CC: Keir Fraser CC: Jan Beulich --- xen/include/asm-x86/asm_defns.h | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h index 1674c7c..e8a678e 100644 --- a/xen/include/asm-x86/asm_defns.h +++ b/xen/include/asm-x86/asm_defns.h @@ -6,6 +6,7 @@ /* NB. Auto-generated from arch/.../asm-offsets.c */ #include #endif +#include #include #include #include @@ -26,18 +27,24 @@ #endif #ifndef NDEBUG -#define ASSERT_INTERRUPT_STATUS(x) \ - pushf; \ - testb $X86_EFLAGS_IF>>8,1(%rsp); \ - j##x 1f; \ - ud2a; \ -1: addq $8,%rsp; +#define ASSERT_INTERRUPTS_ENABLED \ + pushf; \ + testb $X86_EFLAGS_IF>>8,1(%rsp); \ + jnz 1f; \ + ASSERT_FAILED("INTERRUPTS ENABLED"); \ +1: addq $8,%rsp; + +#define ASSERT_INTERRUPTS_DISABLED \ + pushf; \ + testb $X86_EFLAGS_IF>>8,1(%rsp); \ + jz 1f; \ + ASSERT_FAILED("INTERRUPTS DISABLED"); \ +1: addq $8,%rsp; #else -#define ASSERT_INTERRUPT_STATUS(x) +#define ASSERT_INTERRUPTS_ENABLED +#define ASSERT_INTERRUPTS_DISABLED #endif -#define ASSERT_INTERRUPTS_ENABLED ASSERT_INTERRUPT_STATUS(nz) -#define ASSERT_INTERRUPTS_DISABLED ASSERT_INTERRUPT_STATUS(z) /* * This flag is set in an exception frame when registers R12-R15 did not get -- 1.7.10.4