Files
nvdriver/tests/dma-mock/timer_init.c
nvidia-driver-rs 4526e6a816 Baseline: validated 30/30 tree with passing Level 7 hardware regression
- 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
2026-11-23 23:48:38 +00:00

25 lines
1.2 KiB
C

#define nv_rs_pci_read32 timer_base_read32
#define nv_rs_pci_write32 timer_base_write32
#include "ffi.c"
#undef nv_rs_pci_read32
#undef nv_rs_pci_write32
static u32 control;
static unsigned reads, writes, failed_write;
static u32 offsets[2],values[2];
void fixture_timer_reset(unsigned fail,u32 ctrl)
{ reads=writes=0;failed_write=fail;control=ctrl;memset(offsets,0,sizeof(offsets));memset(values,0,sizeof(values)); }
unsigned fixture_timer_accesses(void) {return reads+writes;}
u32 fixture_timer_offset(unsigned i) {assert(i<2);return offsets[i];}
u32 fixture_timer_value(unsigned i) {assert(i<2);return values[i];}
void nv_rs_clock_system_time(u32 *seconds,u32 *microseconds) {*seconds=7;*microseconds=8;}
int nv_rs_pci_read32(struct nv_rs_pci *pci,u64 offset,u32 *value)
{ reads++;if(pci->removed)return -ENODEV;assert(offset==0x9430 || offset==0x9100 || offset==0x9140);*value=control;return 0; }
int nv_rs_pci_write32(struct nv_rs_pci *pci,u64 offset,u32 value)
{
if(pci->removed)return -ENODEV;
assert(writes<2);offsets[writes]=(u32)offset;values[writes]=value;writes++;
if(writes==failed_write)return -EIO;
if(offset==0x9140)control=value;
return 0;
}