mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 14:38:47 +00:00
- Updated tools/post_reboot.sh to check kernel oops taint bit and stuck driver tasks instead of <86400s uptime - Level 7 hardware regression passed on 0000:b3:00.0 (module 37e6fa430835eee2b426019db3ad70eeb7a9e9070c09c84bd9b973cf56cbe529, 107 inventory words, 0 static mismatches, CUDA baseline verified before and after) - Updated .gitignore to exclude build archives (*.a, *.rlib), __pycache__, and raw trace dumps
52 lines
2.2 KiB
C
52 lines
2.2 KiB
C
/* Test-only dependencies for unchanged 580 timeoutSet/_checkTimeout/timeoutCheck. */
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <stdio.h>
|
|
#define NVBIT(n) (1u << (n))
|
|
typedef uint64_t NvU64;
|
|
typedef uint32_t NvU32;
|
|
typedef bool NvBool;
|
|
typedef uint32_t NV_STATUS;
|
|
#define NV_OK 0
|
|
#define NV_ERR_TIMEOUT 0x65
|
|
#define NV_ERR_INVALID_STATE 0x40
|
|
#define NV_FALSE false
|
|
#define NV_MIN(a,b) ((a)<(b)?(a):(b))
|
|
#define NV_PRINTF(...) ((void)0)
|
|
#define NV_ASSERT(x) ((void)0)
|
|
#define NV_ASSERT_OR_RETURN(x,r) do {if(!(x))return (r);}while(0)
|
|
#define NV_ASSERT_OR_RETURN_VOID(x) do {if(!(x))return;}while(0)
|
|
#define DBG_BREAKPOINT() ((void)0)
|
|
#define NV_RETURN_ADDRESS() 0
|
|
#define PDB_PROP_GPU_IN_PM_RESUME_CODEPATH 1
|
|
#define PDB_PROP_GPU_IN_FULLCHIP_RESET 2
|
|
#define API_GPU_IN_RESET_SANITY_CHECK(g) ((g)->reset)
|
|
#define API_GPU_ATTACHED_SANITY_CHECK(g) ((g)->attached && !(g)->reset)
|
|
#define IS_EMULATION(g) ((g)->emulation)
|
|
#define GPU_GET_TIMER(g) (&(g)->timer)
|
|
typedef struct {NvU64 now;} OBJTMR;
|
|
typedef struct OBJGPU OBJGPU;
|
|
struct OBJGPU {
|
|
OBJGPU *parent;
|
|
NvU32 gpuInstance;
|
|
bool attached,reset,emulation,full_power,resuming;
|
|
OBJTMR timer;
|
|
bool (*getProperty)(OBJGPU *, int);
|
|
};
|
|
static bool property(OBJGPU *g,int p){return p==1?g->resuming:g->reset;}
|
|
static OBJGPU *gpumgrGetParentGPU(OBJGPU *g){return g->parent;}
|
|
static bool gpumgrIsParentGPU(OBJGPU *g){return g==g->parent;}
|
|
static bool gpuIsGpuFullPower(OBJGPU *g){return g->full_power;}
|
|
static NvU64 cpu_now,tick_resolution;
|
|
static NV_STATUS thread_status;
|
|
static void portMemSet(void *p,int c,unsigned long n){__builtin_memset(p,c,n);}
|
|
static NvU64 osGetMonotonicTimeNs(void){return cpu_now;}
|
|
static NvU64 osGetMonotonicTickResolutionNs(void){return tick_resolution;}
|
|
static void osDelayUs(NvU32 us){(void)us;}
|
|
static void tmrDelay(OBJTMR *t,NvU64 ns){(void)t;(void)ns;}
|
|
static void tmrGetCurrentTime(OBJTMR *t,NvU64 *now){*now=t->now;}
|
|
static void threadStateYieldCpuIfNecessary(OBJGPU *g,bool b){(void)g;(void)b;}
|
|
static NV_STATUS threadStateCheckTimeout(OBJGPU *g,void *p){(void)g;(void)p;return thread_status;}
|
|
static void threadPriorityThrottle(void){}
|
|
static void threadStateLogTimeout(OBJGPU *g,NvU64 a,NvU32 line){(void)g;(void)a;(void)line;}
|