Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/cdefs.h
Show First 20 Lines • Show All 857 Lines • ▼ Show 20 Lines | #define __requires_shared(...) \ | ||||
__lock_annotate(shared_locks_required(__VA_ARGS__)) | __lock_annotate(shared_locks_required(__VA_ARGS__)) | ||||
#define __requires_unlocked(...) \ | #define __requires_unlocked(...) \ | ||||
__lock_annotate(locks_excluded(__VA_ARGS__)) | __lock_annotate(locks_excluded(__VA_ARGS__)) | ||||
/* Function should not be analyzed. */ | /* Function should not be analyzed. */ | ||||
#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) | #define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) | ||||
/* | /* | ||||
* Function or variable should not be sanitized, i.e. by AddressSanitizer. | * Function or variable should not be sanitized, e.g., by AddressSanitizer. | ||||
* GCC has the nosanitize attribute, but as a function attribute only, and | * GCC has the nosanitize attribute, but as a function attribute only, and | ||||
* warns on use as a variable attribute. | * warns on use as a variable attribute. | ||||
*/ | */ | ||||
#if __has_attribute(no_sanitize) && defined(__clang__) | #if __has_attribute(no_sanitize) && defined(__clang__) | ||||
#ifdef _KERNEL | |||||
#define __nosanitizeaddress __attribute__((no_sanitize("kernel-address"))) | |||||
#define __nosanitizememory __attribute__((no_sanitize("kernel-memory"))) | |||||
#else | |||||
#define __nosanitizeaddress __attribute__((no_sanitize("address"))) | #define __nosanitizeaddress __attribute__((no_sanitize("address"))) | ||||
#define __nosanitizememory __attribute__((no_sanitize("memory"))) | |||||
#endif | |||||
#define __nosanitizethread __attribute__((no_sanitize("thread"))) | #define __nosanitizethread __attribute__((no_sanitize("thread"))) | ||||
#else | #else | ||||
#define __nosanitizeaddress | #define __nosanitizeaddress | ||||
#define __nosanitizethread | #define __nosanitizethread | ||||
#endif | #endif | ||||
/* Guard variables and structure members by lock. */ | /* Guard variables and structure members by lock. */ | ||||
#define __guarded_by(x) __lock_annotate(guarded_by(x)) | #define __guarded_by(x) __lock_annotate(guarded_by(x)) | ||||
Show All 22 Lines |