diff options
author | Dominik Sliwa <dominik.sliwa@toradex.com> | 2019-03-04 12:01:54 +0100 |
---|---|---|
committer | Dominik Sliwa <dominik.sliwa@toradex.com> | 2019-03-04 12:01:54 +0100 |
commit | 348fa3f6871f56a37dcd16c99ca98118c6d79a38 (patch) | |
tree | 6fcae7785bae4ffb838fd6549f7d01ba6abf0763 /backport-include/linux/static_key.h |
Backports v4.19.24
Backports generated by toradex backports 515a1fa55cda2b1d952872e1786857481bd54fcc
against mainline kernel tag v4.19.24
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'backport-include/linux/static_key.h')
-rw-r--r-- | backport-include/linux/static_key.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/backport-include/linux/static_key.h b/backport-include/linux/static_key.h new file mode 100644 index 0000000..4b82eec --- /dev/null +++ b/backport-include/linux/static_key.h @@ -0,0 +1,49 @@ +#ifndef _BACKPORTS_LINUX_STATIC_KEY_H +#define _BACKPORTS_LINUX_STATIC_KEY_H 1 + +#include <linux/version.h> + +#if LINUX_VERSION_IS_GEQ(3,3,0) /* kernels >= 3.3 */ +/* + * XXX: NOTE! + * + * Some 3.3 kernels carry <linux/static.h> but some don't even though its + * its including <linux/jump_label.h>. What makes it more confusing is that + * later all this got shuffled. The safe thing to do then is to just assume + * kernels 3.3..3.4 don't have it and include <linux/jump_label.h> instead, + * and for newer kernels include <linux/static_key.h>. + */ +#if LINUX_VERSION_IS_GEQ(3,5,0) +#include_next <linux/static_key.h> +#else +#include <linux/jump_label.h> +#endif + +#else /* kernels < 3.3 */ +/* + * in between 2.6.37 - 3.5 there's a slew of changes that make + * it hard to backport this properly. If you are interested in + * trying you can use this as reference: + * + * http://drvbp1.linux-foundation.org/~mcgrof/examples/2014/04/01/backport-static-keys.patch + * + * And these notes: + * + * < v2.6.37 - No tracing support + * bf5438fc - v2.6.37 - Jump label support added primarily for tracing but + * tracing was broken, later kernels started sporting + * functional tracing. + * d430d3d7e - v3.0 - Static branch optimizations for jump labels + * c5905afb - v3.3 - Static keys split out, note on the below issue + * c5905afb - v3.5 - git describe --contains c5905afb claims but not true! + * c4b2c0c5f - v3.13 - Adds static_key_initialized(), STATIC_KEY_CHECK_USE() + * + * Because all of this we skip 2.6.37 - 3.3 but and adding support for older + * can be done by of carrying over the non-architecture optimized code. + * Carrying new changes into this file is a burden though so if we really + * find use for this we could just split the non optimized versions upstream + * and copy that through an automatic process. + */ +#endif /* kernels < 3.3 */ + +#endif /* _BACKPORTS_LINUX_STATIC_KEY_H */ |