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

push006c.h (2104B)


      1#ifndef __NVIF_PUSH006C_H__
      2#define __NVIF_PUSH006C_H__
      3#include <nvif/push.h>
      4
      5#include <nvhw/class/cl006c.h>
      6
      7#ifndef PUSH006C_SUBC
      8// Host methods
      9#define PUSH006C_SUBC_NV06E	0
     10#define PUSH006C_SUBC_NV176E	0
     11#define PUSH006C_SUBC_NV826F	0
     12
     13// ContextSurfaces2d
     14#define PUSH006C_SUBC_NV042	0
     15#define PUSH006C_SUBC_NV062	0
     16
     17// ContextClipRectangle
     18#define PUSH006C_SUBC_NV019	0
     19
     20// ContextRop
     21#define PUSH006C_SUBC_NV043	0
     22
     23// ContextPattern
     24#define PUSH006C_SUBC_NV044	0
     25
     26// Misc dodginess...
     27#define PUSH006C_SUBC_NV_SW	1
     28
     29// ImageBlit
     30#define PUSH006C_SUBC_NV05F	2
     31#define PUSH006C_SUBC_NV09F	2
     32
     33// GdiRectangleText
     34#define PUSH006C_SUBC_NV04A	3
     35
     36// Twod
     37#define PUSH006C_SUBC_NV502D	3
     38
     39// MemoryToMemoryFormat
     40#define PUSH006C_SUBC_NV039	4
     41#define PUSH006C_SUBC_NV5039	4
     42
     43// DmaCopy
     44#define PUSH006C_SUBC_NV85B5	4
     45
     46// Cipher
     47#define PUSH006C_SUBC_NV74C1	4
     48#endif
     49
     50#define PUSH_HDR(p,o,n,s,m,c) do {                                        \
     51        PUSH_ASSERT(!((s) & ~DRF_MASK(NV06C_METHOD_SUBCHANNEL)), "subc"); \
     52        PUSH_ASSERT(!((m) & ~DRF_SMASK(NV06C_METHOD_ADDRESS)), "mthd");   \
     53        PUSH_ASSERT(!((c) & ~DRF_MASK(NV06C_METHOD_COUNT)), "count");     \
     54        PUSH_DATA__((p), NVVAL_X(NV06C_METHOD_ADDRESS, (m) >> 2) |        \
     55			 NVVAL_X(NV06C_METHOD_SUBCHANNEL, (s)) |          \
     56			 NVVAL_X(NV06C_METHOD_COUNT, (c)) |               \
     57			 NVVAL_X(NV06C_OPCODE, NV06C_OPCODE_##o),         \
     58		    " "n" subc %d mthd 0x%04x size %d - %s",              \
     59		    (u32)(s), (u32)(m), (u32)(c), __func__);              \
     60} while(0)
     61
     62#define PUSH_MTHD_HDR(p,c,m,n) PUSH_HDR(p, METHOD, "incr", PUSH006C_SUBC_##c, m, n)
     63#define PUSH_MTHD_INC 4:4
     64#define PUSH_NINC_HDR(p,c,m,n) PUSH_HDR(p, NONINC_METHOD, "ninc", PUSH006C_SUBC_##c, m, n)
     65#define PUSH_NINC_INC 0:0
     66
     67#define PUSH_JUMP(p,o) do {                                         \
     68        PUSH_ASSERT(!((o) & ~0x1fffffffcULL), "offset");            \
     69	PUSH_DATA__((p), NVVAL_X(NV06C_OPCODE, NV06C_OPCODE_JUMP) | \
     70			 NVVAL_X(NV06C_JUMP_OFFSET, (o) >> 2),      \
     71		    " jump 0x%08x - %s", (u32)(o), __func__);       \
     72} while(0)
     73#endif