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

dcc.h (623B)


      1/* SPDX-License-Identifier: GPL-2.0-only */
      2/* Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
      3 */
      4
      5#include <asm/barrier.h>
      6
      7static inline u32 __dcc_getstatus(void)
      8{
      9	u32 __ret;
     10	asm volatile("mrc p14, 0, %0, c0, c1, 0	@ read comms ctrl reg"
     11		: "=r" (__ret) : : "cc");
     12
     13	return __ret;
     14}
     15
     16static inline char __dcc_getchar(void)
     17{
     18	char __c;
     19
     20	asm volatile("mrc p14, 0, %0, c0, c5, 0	@ read comms data reg"
     21		: "=r" (__c));
     22	isb();
     23
     24	return __c;
     25}
     26
     27static inline void __dcc_putchar(char c)
     28{
     29	asm volatile("mcr p14, 0, %0, c0, c5, 0	@ write a char"
     30		: /* no output register */
     31		: "r" (c));
     32	isb();
     33}