]> git.ipfire.org Git - people/ms/linux.git/blame - kernel/platform-feature.c
Merge tag 'drm-misc-fixes-2022-07-29' of git://anongit.freedesktop.org/drm/drm-misc...
[people/ms/linux.git] / kernel / platform-feature.c
CommitLineData
2130a790
JG
1// SPDX-License-Identifier: GPL-2.0
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)
9static unsigned long __read_mostly platform_features[PLATFORM_FEAT_ARRAY_SZ];
10
11void platform_set(unsigned int feature)
12{
13 set_bit(feature, platform_features);
14}
15EXPORT_SYMBOL_GPL(platform_set);
16
17void platform_clear(unsigned int feature)
18{
19 clear_bit(feature, platform_features);
20}
21EXPORT_SYMBOL_GPL(platform_clear);
22
23bool platform_has(unsigned int feature)
24{
25 return test_bit(feature, platform_features);
26}
27EXPORT_SYMBOL_GPL(platform_has);