code wiki / _hdl_build / _gpu_dxg_r4_recon.nx

_gpu_dxg_r4_recon.nx

buildroot/runtime/_hdl_build/_gpu_dxg_r4_recon.nx

6124 B92 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic gpu
docsdependenciesstructsconstsfunctions

about

_gpu_dxg_r4_recon.nx -- SOVEREIGN-GPU ladder R4 RECON (create a GPU CONTEXT on the WDDM device). R3 made a real WDDM device. R4 (command-submission sub-arc) starts with a CONTEXT -- the queue GPU work is submitted on. WSL2 typically routes this through LX_DXCREATECONTEXTVIRTUAL (paravirt path). No uapi header on this kernel, so discover the ABI live: sweep BOTH nr=0x03 (CREATECONTEXT) and nr=0x04 (CREATECONTEXTVIRTUAL) across candidate sizes with device@0 + node_ordinal/engine/hint = 0 and a NULL priv_drv_data(size 0). ret==0 marks the real size; scan for a 0x4000xxxx OUT context handle. A non-ENOTTY error (e.g. -EINVAL/-22) at a given size means that nr+size IS the recognized ABI but the INPUT fields need more than zeros (then R4a needs a focused session). raw syscalls only. No log writes. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx _gpu_dxg_r4_recon.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main p sys_write sys_openat_rd sys_exit sys_mmap sys_ioctl rd32 query_type sys_mmap ↻ sys_ioctl ↻ rd32 ↻ open_from_luid sys_mmap ↻ sys_ioctl ↻ rd32 ↻ create_device sys_mmap ↻ sys_ioctl ↻ rd32 ↻ x p ↻ sys_mmap ↻ sys_write ↻ n sys_mmap ↻ sys_write ↻ sweep sys_mmap ↻ iowr sys_ioctl ↻ p ↻ x ↻ n ↻ rd32 ↻ sys_close

structs

none

consts

13const ENUM2_CODE: i64 = 0xC0104714
14const QAI_CODE: i64 = 0xC0184709
15const OAFL_CODE: i64 = 0xC00C4701
16const CDEV_CODE: i64 = 0xC0404702 // LX_DXCREATEDEVICE (R3)

functions

18func p(s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(1,s,nn); return 0 }
called by 3: xsweepmain calls 1: sys_write
19func n(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 2: sweepmain calls 2: sys_mmapsys_write
20func x(v: i64) -> i64 { p("0x" as *u8); let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;k=1}; while m>0{ let d:i64=m&15; if d<10{bb[k]=(48+d) as u8}else{bb[k]=(87+d) as u8}; m=(m>>4); k=k+1 } var i:i64=0; let o:*u8=sys_mmap(20); while i<k{o[i]=bb[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 2: sweepmain calls 3: psys_mmapsys_write
21func iowr(nr: i64, size: i64) -> i64 { return (3 << 30) | ((size & 0x3fff) << 16) | (0x47 << 8) | (nr & 0xff) }
called by 1: sweep
22func rd32(buf: *u8, off: i64) -> i64 { return (buf[off] as i64)|((buf[off+1] as i64)<<8)|((buf[off+2] as i64)<<16)|((buf[off+3] as i64)<<24) }
24func query_type(fd: i64, handle: i64, qtype: i64, psize: i64, outv: *i64) -> i64
called by 1: main calls 3: sys_mmapsys_ioctlrd32
32func open_from_luid(fd: i64, luid_lo: i64, luid_hi: i64, outh: *i64) -> i64
called by 1: main calls 3: sys_mmapsys_ioctlrd32
37func create_device(fd: i64, adapter: i64, outd: *i64) -> i64
called by 1: main calls 3: sys_mmapsys_ioctlrd32
44func sweep(fd: i64, nr: i64, device: i64) -> i64
called by 1: main calls 7: sys_mmapiowrsys_ioctlpxn+1
66func main() -> i64