From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 2/3] xen/x86: Use real assert frames for ASSERT_INTERRUPTS_{EN, DIS}ABLED Date: Tue, 14 Apr 2015 09:38:27 +0100 Message-ID: <552CEE230200007800071BF3@mail.emea.novell.com> References: <1428609983-26998-1-git-send-email-andrew.cooper3@citrix.com> <1428609983-26998-3-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-3-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 09.04.15 at 22:06, wrote: > @@ -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) So what's the point of deleting these and duplicating most of the macro definition text above? Jan