Date: Sat, 4 Jul 2020 06:22:05 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362921 - in head/sys: kern sys Message-ID: <202007040622.0646M5OD025751@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sat Jul 4 06:22:05 2020 New Revision: 362921 URL: https://svnweb.freebsd.org/changeset/base/362921 Log: Add char and short types to kcsan Modified: head/sys/kern/subr_csan.c head/sys/sys/_cscan_atomic.h Modified: head/sys/kern/subr_csan.c ============================================================================== --- head/sys/kern/subr_csan.c Sat Jul 4 06:21:20 2020 (r362920) +++ head/sys/kern/subr_csan.c Sat Jul 4 06:22:05 2020 (r362921) @@ -590,6 +590,38 @@ CSAN_ATOMIC_FUNC_TESTANDCLEAR(64, uint64_t) CSAN_ATOMIC_FUNC_TESTANDSET(64, uint64_t) #endif +CSAN_ATOMIC_FUNC_ADD(char, uint8_t) +CSAN_ATOMIC_FUNC_CLEAR(char, uint8_t) +CSAN_ATOMIC_FUNC_CMPSET(char, uint8_t) +CSAN_ATOMIC_FUNC_FCMPSET(char, uint8_t) +CSAN_ATOMIC_FUNC_LOAD(char, uint8_t) +CSAN_ATOMIC_FUNC_SET(char, uint8_t) +CSAN_ATOMIC_FUNC_SUBTRACT(char, uint8_t) +_CSAN_ATOMIC_FUNC_STORE(char, uint8_t) +#if 0 +CSAN_ATOMIC_FUNC_FETCHADD(char, uint8_t) +CSAN_ATOMIC_FUNC_READANDCLEAR(char, uint8_t) +CSAN_ATOMIC_FUNC_SWAP(char, uint8_t) +CSAN_ATOMIC_FUNC_TESTANDCLEAR(char, uint8_t) +CSAN_ATOMIC_FUNC_TESTANDSET(char, uint8_t) +#endif + +CSAN_ATOMIC_FUNC_ADD(short, uint16_t) +CSAN_ATOMIC_FUNC_CLEAR(short, uint16_t) +CSAN_ATOMIC_FUNC_CMPSET(short, uint16_t) +CSAN_ATOMIC_FUNC_FCMPSET(short, uint16_t) +CSAN_ATOMIC_FUNC_LOAD(short, uint16_t) +CSAN_ATOMIC_FUNC_SET(short, uint16_t) +CSAN_ATOMIC_FUNC_SUBTRACT(short, uint16_t) +_CSAN_ATOMIC_FUNC_STORE(short, uint16_t) +#if 0 +CSAN_ATOMIC_FUNC_FETCHADD(short, uint16_t) +CSAN_ATOMIC_FUNC_READANDCLEAR(short, uint16_t) +CSAN_ATOMIC_FUNC_SWAP(short, uint16_t) +CSAN_ATOMIC_FUNC_TESTANDCLEAR(short, uint16_t) +CSAN_ATOMIC_FUNC_TESTANDSET(short, uint16_t) +#endif + CSAN_ATOMIC_FUNC_ADD(int, u_int) CSAN_ATOMIC_FUNC_CLEAR(int, u_int) CSAN_ATOMIC_FUNC_CMPSET(int, u_int) Modified: head/sys/sys/_cscan_atomic.h ============================================================================== --- head/sys/sys/_cscan_atomic.h Sat Jul 4 06:21:20 2020 (r362920) +++ head/sys/sys/_cscan_atomic.h Sat Jul 4 06:22:05 2020 (r362921) @@ -87,6 +87,8 @@ KCSAN_ATOMIC_TEST(testandclear, name, type); \ KCSAN_ATOMIC_TEST(testandset, name, type) +KCSAN_ATOMIC_FUNCS(char, uint8_t); +KCSAN_ATOMIC_FUNCS(short, uint16_t); KCSAN_ATOMIC_FUNCS(int, u_int); KCSAN_ATOMIC_FUNCS(long, u_long); KCSAN_ATOMIC_FUNCS(ptr, uintptr_t); @@ -101,6 +103,62 @@ void kcsan_atomic_thread_fence_rel(void); void kcsan_atomic_thread_fence_seq_cst(void); #ifndef KCSAN_RUNTIME + +#define atomic_add_char kcsan_atomic_add_char +#define atomic_add_acq_char kcsan_atomic_add_acq_char +#define atomic_add_rel_char kcsan_atomic_add_rel_char +#define atomic_clear_char kcsan_atomic_clear_char +#define atomic_clear_acq_char kcsan_atomic_clear_acq_char +#define atomic_clear_rel_char kcsan_atomic_clear_rel_char +#define atomic_cmpset_char kcsan_atomic_cmpset_char +#define atomic_cmpset_acq_char kcsan_atomic_cmpset_acq_char +#define atomic_cmpset_rel_char kcsan_atomic_cmpset_rel_char +#define atomic_fcmpset_char kcsan_atomic_fcmpset_char +#define atomic_fcmpset_acq_char kcsan_atomic_fcmpset_acq_char +#define atomic_fcmpset_rel_char kcsan_atomic_fcmpset_rel_char +#define atomic_fetchadd_char kcsan_atomic_fetchadd_char +#define atomic_load_char kcsan_atomic_load_char +#define atomic_load_acq_char kcsan_atomic_load_acq_char +#define atomic_readandclear_char kcsan_atomic_readandclear_char +#define atomic_set_char kcsan_atomic_set_char +#define atomic_set_acq_char kcsan_atomic_set_acq_char +#define atomic_set_rel_char kcsan_atomic_set_rel_char +#define atomic_subtract_char kcsan_atomic_subtract_char +#define atomic_subtract_acq_char kcsan_atomic_subtract_acq_char +#define atomic_subtract_rel_char kcsan_atomic_subtract_rel_char +#define atomic_store_char kcsan_atomic_store_char +#define atomic_store_rel_char kcsan_atomic_store_rel_char +#define atomic_swap_char kcsan_atomic_swap_char +#define atomic_testandclear_char kcsan_atomic_testandclear_char +#define atomic_testandset_char kcsan_atomic_testandset_char + +#define atomic_add_short kcsan_atomic_add_short +#define atomic_add_acq_short kcsan_atomic_add_acq_short +#define atomic_add_rel_short kcsan_atomic_add_rel_short +#define atomic_clear_short kcsan_atomic_clear_short +#define atomic_clear_acq_short kcsan_atomic_clear_acq_short +#define atomic_clear_rel_short kcsan_atomic_clear_rel_short +#define atomic_cmpset_short kcsan_atomic_cmpset_short +#define atomic_cmpset_acq_short kcsan_atomic_cmpset_acq_short +#define atomic_cmpset_rel_short kcsan_atomic_cmpset_rel_short +#define atomic_fcmpset_short kcsan_atomic_fcmpset_short +#define atomic_fcmpset_acq_short kcsan_atomic_fcmpset_acq_short +#define atomic_fcmpset_rel_short kcsan_atomic_fcmpset_rel_short +#define atomic_fetchadd_short kcsan_atomic_fetchadd_short +#define atomic_load_short kcsan_atomic_load_short +#define atomic_load_acq_short kcsan_atomic_load_acq_short +#define atomic_readandclear_short kcsan_atomic_readandclear_short +#define atomic_set_short kcsan_atomic_set_short +#define atomic_set_acq_short kcsan_atomic_set_acq_short +#define atomic_set_rel_short kcsan_atomic_set_rel_short +#define atomic_subtract_short kcsan_atomic_subtract_short +#define atomic_subtract_acq_short kcsan_atomic_subtract_acq_short +#define atomic_subtract_rel_short kcsan_atomic_subtract_rel_short +#define atomic_store_short kcsan_atomic_store_short +#define atomic_store_rel_short kcsan_atomic_store_rel_short +#define atomic_swap_short kcsan_atomic_swap_short +#define atomic_testandclear_short kcsan_atomic_testandclear_short +#define atomic_testandset_short kcsan_atomic_testandset_short #define atomic_add_int kcsan_atomic_add_int #define atomic_add_acq_int kcsan_atomic_add_acq_int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007040622.0646M5OD025751>