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

schid.h (525B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2#ifndef ASM_SCHID_H
      3#define ASM_SCHID_H
      4
      5#include <linux/string.h>
      6#include <uapi/asm/schid.h>
      7
      8/* Helper function for sane state of pre-allocated subchannel_id. */
      9static inline void
     10init_subchannel_id(struct subchannel_id *schid)
     11{
     12	memset(schid, 0, sizeof(struct subchannel_id));
     13	schid->one = 1;
     14}
     15
     16static inline int
     17schid_equal(struct subchannel_id *schid1, struct subchannel_id *schid2)
     18{
     19	return !memcmp(schid1, schid2, sizeof(struct subchannel_id));
     20}
     21
     22#endif /* ASM_SCHID_H */