| 1 | |
| 2 |
|
| 3 | #include <linux/bitops.h>
|
| 4 | #include <linux/cache.h>
|
| 5 | #include <linux/export.h>
|
| 6 | #include <linux/platform-feature.h>
|
| 7 |
|
| 8 | #define PLATFORM_FEAT_ARRAY_SZ BITS_TO_LONGS(PLATFORM_FEAT_N)
|
| 9 | static unsigned long __read_mostly platform_features[PLATFORM_FEAT_ARRAY_SZ];
|
| 10 |
|
| 11 | void platform_set(unsigned int feature)
|
| 12 | {
|
| 13 | set_bit(feature, platform_features);
|
| 14 | }
|
| 15 | EXPORT_SYMBOL_GPL(platform_set);
|
| 16 |
|
| 17 | void platform_clear(unsigned int feature)
|
| 18 | {
|
| 19 | clear_bit(feature, platform_features);
|
| 20 | }
|
| 21 | EXPORT_SYMBOL_GPL(platform_clear);
|
| 22 |
|
| 23 | bool platform_has(unsigned int feature)
|
| 24 | {
|
| 25 | return test_bit(feature, platform_features);
|
| 26 | }
|
| 27 | EXPORT_SYMBOL_GPL(platform_has);
|