From 3bf9fdbe040136753e6a2c809bd18a44ac5fac03 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 13 Jun 2016 09:46:17 +0200 Subject: i386: Fix _CPU_Bitfield_Find_first_bit() Bug introduced by b04b76c6a0c87ffc9670d356e793108411ce355a. --- cpukit/score/cpu/i386/rtems/score/cpu.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h index 3f0e3369f9..6cfeee6b9b 100644 --- a/cpukit/score/cpu/i386/rtems/score/cpu.h +++ b/cpukit/score/cpu/i386/rtems/score/cpu.h @@ -552,14 +552,13 @@ extern void _CPU_Fatal_halt(uint32_t source, uint32_t error) #define _CPU_Bitfield_Find_first_bit( _value, _output ) \ { \ - register uint16_t __value_in_register = (_value); \ - \ - _output = 0; \ - \ + register uint16_t __value_in_register = ( _value ); \ + uint16_t __output = 0; \ __asm__ volatile ( "bsfw %0,%1 " \ - : "=r" (__value_in_register), "=r" (_output) \ - : "0" (__value_in_register), "1" (_output) \ + : "=r" ( __value_in_register ), "=r" ( __output ) \ + : "0" ( __value_in_register ), "1" ( __output ) \ ); \ + ( _output ) = __output; \ } /* end of Bitfield handler macros */ -- cgit v1.2.3