Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/cdefs.h
Show First 20 Lines • Show All 441 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* * These are meant to be used in places that are run `a lot'. | * * These are meant to be used in places that are run `a lot'. | ||||
* It is wasteful to make predictions in code that is run | * It is wasteful to make predictions in code that is run | ||||
* seldomly (e.g. at subsystem initialization time) as the | * seldomly (e.g. at subsystem initialization time) as the | ||||
* basic block reordering that this affects can often generate | * basic block reordering that this affects can often generate | ||||
* larger code. | * larger code. | ||||
*/ | */ | ||||
#if __GNUC_PREREQ__(2, 96) | #if __GNUC_PREREQ__(2, 96) | ||||
#define __predict_true(exp) __builtin_expect((exp), 1) | #define __predict_true_noprobe(exp) __builtin_expect((exp), 1) | ||||
#define __predict_false(exp) __builtin_expect((exp), 0) | #define __predict_false_noprobe(exp) __builtin_expect((exp), 0) | ||||
#else | #else | ||||
#define __predict_true(exp) (exp) | #define __predict_true_noprobe(exp) (exp) | ||||
#define __predict_false(exp) (exp) | #define __predict_false_noprobe(exp) (exp) | ||||
#endif | |||||
#ifdef PREDICT_PROFILING | |||||
kib: Use of such define conflicts with user namespace. cdefs.h must not interfere with user… | |||||
mjgAuthorUnsubmitted Done Inline Actionswould it be sufficient to hide it under KERNEL and PREDICT_PROFILING? that should sort out any userspace which does not define KERNEL. mjg: would it be sufficient to hide it under __KERNEL and PREDICT_PROFILING? that should sort out… | |||||
#define __predict_true(exp) sdt_predict_profile(exp, true, __FILE__, __LINE__) | |||||
#define __predict_false(exp) sdt_predict_profile(exp, false, __FILE__, __LINE__) | |||||
#else | |||||
#define __predict_true(exp) __predict_true_noprobe(exp) | |||||
#define __predict_false(exp) __predict_false_noprobe(exp) | |||||
#endif | #endif | ||||
#if __GNUC_PREREQ__(4, 0) | #if __GNUC_PREREQ__(4, 0) | ||||
#define __null_sentinel __attribute__((__sentinel__)) | #define __null_sentinel __attribute__((__sentinel__)) | ||||
#define __exported __attribute__((__visibility__("default"))) | #define __exported __attribute__((__visibility__("default"))) | ||||
#define __hidden __attribute__((__visibility__("hidden"))) | #define __hidden __attribute__((__visibility__("hidden"))) | ||||
#else | #else | ||||
#define __null_sentinel | #define __null_sentinel | ||||
▲ Show 20 Lines • Show All 425 Lines • Show Last 20 Lines |
Use of such define conflicts with user namespace. cdefs.h must not interfere with user namespace in any way.