1 // SPDX-License-Identifier: GPL-2.0 2 3 #include <asm/barrier.h> 4 #include <asm/rwonce.h> 5 6 __rust_helper s8 rust_helper_atomic_i8_read(s8 *ptr) 7 { 8 return READ_ONCE(*ptr); 9 } 10 11 __rust_helper s8 rust_helper_atomic_i8_read_acquire(s8 *ptr) 12 { 13 return smp_load_acquire(ptr); 14 } 15 16 __rust_helper s16 rust_helper_atomic_i16_read(s16 *ptr) 17 { 18 return READ_ONCE(*ptr); 19 } 20 21 __rust_helper s16 rust_helper_atomic_i16_read_acquire(s16 *ptr) 22 { 23 return smp_load_acquire(ptr); 24 } 25 26 __rust_helper void rust_helper_atomic_i8_set(s8 *ptr, s8 val) 27 { 28 WRITE_ONCE(*ptr, val); 29 } 30 31 __rust_helper void rust_helper_atomic_i8_set_release(s8 *ptr, s8 val) 32 { 33 smp_store_release(ptr, val); 34 } 35 36 __rust_helper void rust_helper_atomic_i16_set(s16 *ptr, s16 val) 37 { 38 WRITE_ONCE(*ptr, val); 39 } 40 41 __rust_helper void rust_helper_atomic_i16_set_release(s16 *ptr, s16 val) 42 { 43 smp_store_release(ptr, val); 44 } 45