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

reg_ops.h (489B)


      1/* SPDX-License-Identifier: GPL-2.0 */
      2
      3#ifndef __ABI_REG_OPS_H
      4#define __ABI_REG_OPS_H
      5#include <asm/reg_ops.h>
      6
      7#define cprcr(reg)					\
      8({							\
      9	unsigned int tmp;				\
     10	asm volatile("cprcr %0, "reg"\n":"=b"(tmp));	\
     11	tmp;						\
     12})
     13
     14#define cpwcr(reg, val)					\
     15({							\
     16	asm volatile("cpwcr %0, "reg"\n"::"b"(val));	\
     17})
     18
     19static inline unsigned int mfcr_hint(void)
     20{
     21	return mfcr("cr30");
     22}
     23
     24static inline unsigned int mfcr_ccr2(void) { return 0; }
     25
     26#endif /* __ABI_REG_OPS_H */