cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

platform-feature.c (654B)


      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);