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

priv.h (2110B)


      1/* SPDX-License-Identifier: MIT */
      2#ifndef __NVKM_MC_PRIV_H__
      3#define __NVKM_MC_PRIV_H__
      4#define nvkm_mc(p) container_of((p), struct nvkm_mc, subdev)
      5#include <subdev/mc.h>
      6
      7void nvkm_mc_ctor(const struct nvkm_mc_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
      8		  struct nvkm_mc *);
      9int nvkm_mc_new_(const struct nvkm_mc_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
     10		 struct nvkm_mc **);
     11
     12struct nvkm_mc_map {
     13	u32 stat;
     14	enum nvkm_subdev_type type;
     15	int inst;
     16	bool noauto;
     17};
     18
     19struct nvkm_mc_func {
     20	void (*init)(struct nvkm_mc *);
     21	const struct nvkm_mc_map *intr;
     22	/* disable reporting of interrupts to host */
     23	void (*intr_unarm)(struct nvkm_mc *);
     24	/* enable reporting of interrupts to host */
     25	void (*intr_rearm)(struct nvkm_mc *);
     26	/* (un)mask delivery of specific interrupts */
     27	void (*intr_mask)(struct nvkm_mc *, u32 mask, u32 stat);
     28	/* retrieve pending interrupt mask (NV_PMC_INTR) */
     29	u32 (*intr_stat)(struct nvkm_mc *);
     30	const struct nvkm_mc_map *reset;
     31	void (*unk260)(struct nvkm_mc *, u32);
     32};
     33
     34void nv04_mc_init(struct nvkm_mc *);
     35void nv04_mc_intr_unarm(struct nvkm_mc *);
     36void nv04_mc_intr_rearm(struct nvkm_mc *);
     37u32 nv04_mc_intr_stat(struct nvkm_mc *);
     38extern const struct nvkm_mc_map nv04_mc_reset[];
     39
     40extern const struct nvkm_mc_map nv17_mc_intr[];
     41extern const struct nvkm_mc_map nv17_mc_reset[];
     42
     43void nv44_mc_init(struct nvkm_mc *);
     44
     45void nv50_mc_init(struct nvkm_mc *);
     46void gk104_mc_init(struct nvkm_mc *);
     47
     48void gf100_mc_intr_unarm(struct nvkm_mc *);
     49void gf100_mc_intr_rearm(struct nvkm_mc *);
     50void gf100_mc_intr_mask(struct nvkm_mc *, u32, u32);
     51u32 gf100_mc_intr_stat(struct nvkm_mc *);
     52void gf100_mc_unk260(struct nvkm_mc *, u32);
     53void gp100_mc_intr_unarm(struct nvkm_mc *);
     54void gp100_mc_intr_rearm(struct nvkm_mc *);
     55void gp100_mc_intr_mask(struct nvkm_mc *, u32, u32);
     56int gp100_mc_new_(const struct nvkm_mc_func *, struct nvkm_device *, enum nvkm_subdev_type, int,
     57		  struct nvkm_mc **);
     58
     59extern const struct nvkm_mc_map gk104_mc_intr[];
     60extern const struct nvkm_mc_map gk104_mc_reset[];
     61
     62extern const struct nvkm_mc_map gp100_mc_intr[];
     63#endif