1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/bitops.h>
4 #include <linux/cache.h>
5 #include <linux/export.h>
6 #include <linux/platform-feature.h>
8 #define PLATFORM_FEAT_ARRAY_SZ BITS_TO_LONGS(PLATFORM_FEAT_N)
9 static unsigned long __read_mostly platform_features[PLATFORM_FEAT_ARRAY_SZ];
11 void platform_set(unsigned int feature)
13 set_bit(feature, platform_features);
15 EXPORT_SYMBOL_GPL(platform_set);
17 void platform_clear(unsigned int feature)
19 clear_bit(feature, platform_features);
21 EXPORT_SYMBOL_GPL(platform_clear);
23 bool platform_has(unsigned int feature)
25 return test_bit(feature, platform_features);
27 EXPORT_SYMBOL_GPL(platform_has);