Commit d54f0b47 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] v850: use volatile qualifier on v850 test-n-bitop asm statements

From: <miles@mcspd15.ucom.lsi.nec.co.jp> (Miles Bader)

Otherwise the compiler can delete them (this is one of those "how on earth
did it ever work before" moments).
parent 0e568881
/* /*
* include/asm-v850/bitops.h -- Bit operations * include/asm-v850/bitops.h -- Bit operations
* *
* Copyright (C) 2001,02,03 NEC Electronics Corporation * Copyright (C) 2001,02,03,04 NEC Electronics Corporation
* Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org>
* Copyright (C) 1992 Linus Torvalds. * Copyright (C) 1992 Linus Torvalds.
* *
* This file is subject to the terms and conditions of the GNU General * This file is subject to the terms and conditions of the GNU General
...@@ -86,7 +86,8 @@ extern __inline__ unsigned long ffz (unsigned long word) ...@@ -86,7 +86,8 @@ extern __inline__ unsigned long ffz (unsigned long word)
#define __const_tns_bit_op(op, nr, addr) \ #define __const_tns_bit_op(op, nr, addr) \
({ int __tns_res; \ ({ int __tns_res; \
__asm__ ("tst1 (%1 - 0x123), %2; setf nz, %0; " op " (%1 - 0x123), %2" \ __asm__ __volatile__ ( \
"tst1 (%1 - 0x123), %2; setf nz, %0; " op " (%1 - 0x123), %2" \
: "=&r" (__tns_res) \ : "=&r" (__tns_res) \
: "g" (((nr) & 0x7) + 0x123), \ : "g" (((nr) & 0x7) + 0x123), \
"m" (*((char *)(addr) + ((nr) >> 3))) \ "m" (*((char *)(addr) + ((nr) >> 3))) \
...@@ -96,7 +97,8 @@ extern __inline__ unsigned long ffz (unsigned long word) ...@@ -96,7 +97,8 @@ extern __inline__ unsigned long ffz (unsigned long word)
#define __var_tns_bit_op(op, nr, addr) \ #define __var_tns_bit_op(op, nr, addr) \
({ int __nr = (nr); \ ({ int __nr = (nr); \
int __tns_res; \ int __tns_res; \
__asm__ ("tst1 %1, [%2]; setf nz, %0; " op " %1, [%2]" \ __asm__ __volatile__ ( \
"tst1 %1, [%2]; setf nz, %0; " op " %1, [%2]" \
: "=&r" (__tns_res) \ : "=&r" (__tns_res) \
: "r" (__nr & 0x7), \ : "r" (__nr & 0x7), \
"r" ((char *)(addr) + (__nr >> 3)) \ "r" ((char *)(addr) + (__nr >> 3)) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment