nv: return real struct in _alloc_boot_struct (#11130)

This commit is contained in:
nimlgen 2025-07-08 20:04:43 +03:00 committed by GitHub
commit b516fe71b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -127,7 +127,7 @@ class NVDev(PCIDevImplBase):
def _alloc_boot_struct(self, struct):
va, paddrs = System.alloc_sysmem(sz:=ctypes.sizeof(type(struct)), contiguous=True)
to_mv(va, sz)[:] = bytes(struct)
return struct, paddrs[0]
return type(struct).from_address(va), paddrs[0]
def _download(self, file) -> str:
url = f"https://raw.githubusercontent.com/NVIDIA/open-gpu-kernel-modules/e8113f665d936d9f30a6d508f3bacd1e148539be/{file}"