File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,27 @@ arch___test_and_change_bit(unsigned long nr, volatile unsigned long *addr)
286
286
#define arch_test_bit generic_test_bit
287
287
#define arch_test_bit_acquire generic_test_bit_acquire
288
288
289
+ static inline bool xor_unlock_is_negative_byte (unsigned long mask ,
290
+ volatile unsigned long * p )
291
+ {
292
+ unsigned long temp , old ;
293
+
294
+ __asm__ __volatile__(
295
+ "1: ldl_l %0,%4\n"
296
+ " mov %0,%2\n"
297
+ " xor %0,%3,%0\n"
298
+ " stl_c %0,%1\n"
299
+ " beq %0,2f\n"
300
+ ".subsection 2\n"
301
+ "2: br 1b\n"
302
+ ".previous"
303
+ :"=&r" (temp ), "=m" (* p ), "=&r" (old )
304
+ :"Ir" (mask ), "m" (* p ));
305
+
306
+ return (old & BIT (7 )) != 0 ;
307
+ }
308
+ #define xor_unlock_is_negative_byte xor_unlock_is_negative_byte
309
+
289
310
/*
290
311
* ffz = Find First Zero in word. Undefined if no zero exists,
291
312
* so code should check against ~0UL first..
You can’t perform that action at this time.
0 commit comments