github.com/MerlinKodo/gvisor@v0.0.0-20231110090155-957f62ecf90e/pkg/abi/nvgpu/nvgpu_abi_autogen_unsafe.go (about) 1 // Automatically generated marshal implementation. See tools/go_marshal. 2 3 package nvgpu 4 5 import ( 6 "github.com/MerlinKodo/gvisor/pkg/gohacks" 7 "github.com/MerlinKodo/gvisor/pkg/hostarch" 8 "github.com/MerlinKodo/gvisor/pkg/marshal" 9 "io" 10 "reflect" 11 "runtime" 12 "unsafe" 13 ) 14 15 // Marshallable types used by this file. 16 var _ marshal.Marshallable = (*Handle)(nil) 17 var _ marshal.Marshallable = (*IoctlAllocOSEvent)(nil) 18 var _ marshal.Marshallable = (*IoctlFreeOSEvent)(nil) 19 var _ marshal.Marshallable = (*IoctlNVOS02ParametersWithFD)(nil) 20 var _ marshal.Marshallable = (*IoctlNVOS33ParametersWithFD)(nil) 21 var _ marshal.Marshallable = (*IoctlRegisterFD)(nil) 22 var _ marshal.Marshallable = (*IoctlSysParams)(nil) 23 var _ marshal.Marshallable = (*NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS)(nil) 24 var _ marshal.Marshallable = (*NV0005_ALLOC_PARAMETERS)(nil) 25 var _ marshal.Marshallable = (*NV0080_ALLOC_PARAMETERS)(nil) 26 var _ marshal.Marshallable = (*NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS)(nil) 27 var _ marshal.Marshallable = (*NV0080_CTRL_GR_ROUTE_INFO)(nil) 28 var _ marshal.Marshallable = (*NV00F8_ALLOCATION_PARAMETERS)(nil) 29 var _ marshal.Marshallable = (*NV2080_ALLOC_PARAMETERS)(nil) 30 var _ marshal.Marshallable = (*NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS)(nil) 31 var _ marshal.Marshallable = (*NV2080_CTRL_GR_GET_INFO_PARAMS)(nil) 32 var _ marshal.Marshallable = (*NV503C_ALLOC_PARAMETERS)(nil) 33 var _ marshal.Marshallable = (*NV83DE_ALLOC_PARAMETERS)(nil) 34 var _ marshal.Marshallable = (*NVB0B5_ALLOCATION_PARAMETERS)(nil) 35 var _ marshal.Marshallable = (*NVOS00Parameters)(nil) 36 var _ marshal.Marshallable = (*NVOS02Parameters)(nil) 37 var _ marshal.Marshallable = (*NVOS21Parameters)(nil) 38 var _ marshal.Marshallable = (*NVOS32Parameters)(nil) 39 var _ marshal.Marshallable = (*NVOS33Parameters)(nil) 40 var _ marshal.Marshallable = (*NVOS34Parameters)(nil) 41 var _ marshal.Marshallable = (*NVOS54Parameters)(nil) 42 var _ marshal.Marshallable = (*NVOS55Parameters)(nil) 43 var _ marshal.Marshallable = (*NVOS56Parameters)(nil) 44 var _ marshal.Marshallable = (*NVOS57Parameters)(nil) 45 var _ marshal.Marshallable = (*NVOS64Parameters)(nil) 46 var _ marshal.Marshallable = (*NVXXXX_CTRL_XXX_INFO)(nil) 47 var _ marshal.Marshallable = (*NV_CHANNEL_ALLOC_PARAMS)(nil) 48 var _ marshal.Marshallable = (*NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS)(nil) 49 var _ marshal.Marshallable = (*NV_CTXSHARE_ALLOCATION_PARAMETERS)(nil) 50 var _ marshal.Marshallable = (*NV_GR_ALLOCATION_PARAMETERS)(nil) 51 var _ marshal.Marshallable = (*NV_HOPPER_USERMODE_A_PARAMS)(nil) 52 var _ marshal.Marshallable = (*NV_MEMORY_DESC_PARAMS)(nil) 53 var _ marshal.Marshallable = (*NV_VASPACE_ALLOCATION_PARAMETERS)(nil) 54 var _ marshal.Marshallable = (*P64)(nil) 55 var _ marshal.Marshallable = (*RMAPIVersion)(nil) 56 var _ marshal.Marshallable = (*RS_ACCESS_MASK)(nil) 57 var _ marshal.Marshallable = (*RS_SHARE_POLICY)(nil) 58 var _ marshal.Marshallable = (*UVM_ALLOC_SEMAPHORE_POOL_PARAMS)(nil) 59 var _ marshal.Marshallable = (*UVM_CREATE_EXTERNAL_RANGE_PARAMS)(nil) 60 var _ marshal.Marshallable = (*UVM_CREATE_RANGE_GROUP_PARAMS)(nil) 61 var _ marshal.Marshallable = (*UVM_DESTROY_RANGE_GROUP_PARAMS)(nil) 62 var _ marshal.Marshallable = (*UVM_FREE_PARAMS)(nil) 63 var _ marshal.Marshallable = (*UVM_INITIALIZE_PARAMS)(nil) 64 var _ marshal.Marshallable = (*UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS)(nil) 65 var _ marshal.Marshallable = (*UVM_MAP_EXTERNAL_ALLOCATION_PARAMS)(nil) 66 var _ marshal.Marshallable = (*UVM_PAGEABLE_MEM_ACCESS_PARAMS)(nil) 67 var _ marshal.Marshallable = (*UVM_REGISTER_CHANNEL_PARAMS)(nil) 68 var _ marshal.Marshallable = (*UVM_REGISTER_GPU_PARAMS)(nil) 69 var _ marshal.Marshallable = (*UVM_REGISTER_GPU_VASPACE_PARAMS)(nil) 70 var _ marshal.Marshallable = (*UVM_UNREGISTER_CHANNEL_PARAMS)(nil) 71 var _ marshal.Marshallable = (*UVM_UNREGISTER_GPU_PARAMS)(nil) 72 var _ marshal.Marshallable = (*UVM_UNREGISTER_GPU_VASPACE_PARAMS)(nil) 73 var _ marshal.Marshallable = (*UVM_VALIDATE_VA_RANGE_PARAMS)(nil) 74 var _ marshal.Marshallable = (*UvmGpuMappingAttributes)(nil) 75 var _ marshal.Marshallable = (*nv00f8Map)(nil) 76 77 // SizeBytes implements marshal.Marshallable.SizeBytes. 78 func (n *NV0005_ALLOC_PARAMETERS) SizeBytes() int { 79 return 8 + 80 (*Handle)(nil).SizeBytes() + 81 (*Handle)(nil).SizeBytes() + 82 (*P64)(nil).SizeBytes() 83 } 84 85 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 86 func (n *NV0005_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte { 87 dst = n.HParentClient.MarshalUnsafe(dst) 88 dst = n.HSrcResource.MarshalUnsafe(dst) 89 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HClass)) 90 dst = dst[4:] 91 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NotifyIndex)) 92 dst = dst[4:] 93 dst = n.Data.MarshalUnsafe(dst) 94 return dst 95 } 96 97 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 98 func (n *NV0005_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte { 99 src = n.HParentClient.UnmarshalUnsafe(src) 100 src = n.HSrcResource.UnmarshalUnsafe(src) 101 n.HClass = uint32(hostarch.ByteOrder.Uint32(src[:4])) 102 src = src[4:] 103 n.NotifyIndex = uint32(hostarch.ByteOrder.Uint32(src[:4])) 104 src = src[4:] 105 src = n.Data.UnmarshalUnsafe(src) 106 return src 107 } 108 109 // Packed implements marshal.Marshallable.Packed. 110 //go:nosplit 111 func (n *NV0005_ALLOC_PARAMETERS) Packed() bool { 112 return n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() 113 } 114 115 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 116 func (n *NV0005_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 117 if n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() { 118 size := n.SizeBytes() 119 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 120 return dst[size:] 121 } 122 // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes. 123 return n.MarshalBytes(dst) 124 } 125 126 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 127 func (n *NV0005_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 128 if n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() { 129 size := n.SizeBytes() 130 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 131 return src[size:] 132 } 133 // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 134 return n.UnmarshalBytes(src) 135 } 136 137 // CopyOutN implements marshal.Marshallable.CopyOutN. 138 func (n *NV0005_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 139 if !n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() { 140 // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 141 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 142 n.MarshalBytes(buf) // escapes: fallback. 143 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 144 } 145 146 // Construct a slice backed by dst's underlying memory. 147 var buf []byte 148 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 149 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 150 hdr.Len = n.SizeBytes() 151 hdr.Cap = n.SizeBytes() 152 153 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 154 // Since we bypassed the compiler's escape analysis, indicate that n 155 // must live until the use above. 156 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 157 return length, err 158 } 159 160 // CopyOut implements marshal.Marshallable.CopyOut. 161 func (n *NV0005_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 162 return n.CopyOutN(cc, addr, n.SizeBytes()) 163 } 164 165 // CopyInN implements marshal.Marshallable.CopyInN. 166 func (n *NV0005_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 167 if !n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() { 168 // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 169 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 170 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 171 // Unmarshal unconditionally. If we had a short copy-in, this results in a 172 // partially unmarshalled struct. 173 n.UnmarshalBytes(buf) // escapes: fallback. 174 return length, err 175 } 176 177 // Construct a slice backed by dst's underlying memory. 178 var buf []byte 179 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 180 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 181 hdr.Len = n.SizeBytes() 182 hdr.Cap = n.SizeBytes() 183 184 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 185 // Since we bypassed the compiler's escape analysis, indicate that n 186 // must live until the use above. 187 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 188 return length, err 189 } 190 191 // CopyIn implements marshal.Marshallable.CopyIn. 192 func (n *NV0005_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 193 return n.CopyInN(cc, addr, n.SizeBytes()) 194 } 195 196 // WriteTo implements io.WriterTo.WriteTo. 197 func (n *NV0005_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 198 if !n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() { 199 // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 200 buf := make([]byte, n.SizeBytes()) 201 n.MarshalBytes(buf) 202 length, err := writer.Write(buf) 203 return int64(length), err 204 } 205 206 // Construct a slice backed by dst's underlying memory. 207 var buf []byte 208 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 209 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 210 hdr.Len = n.SizeBytes() 211 hdr.Cap = n.SizeBytes() 212 213 length, err := writer.Write(buf) 214 // Since we bypassed the compiler's escape analysis, indicate that n 215 // must live until the use above. 216 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 217 return int64(length), err 218 } 219 220 // SizeBytes implements marshal.Marshallable.SizeBytes. 221 func (n *NV0080_ALLOC_PARAMETERS) SizeBytes() int { 222 return 36 + 223 (*Handle)(nil).SizeBytes() + 224 (*Handle)(nil).SizeBytes() + 225 (*Handle)(nil).SizeBytes() + 226 1*4 + 227 1*4 228 } 229 230 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 231 func (n *NV0080_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte { 232 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.DeviceID)) 233 dst = dst[4:] 234 dst = n.HClientShare.MarshalUnsafe(dst) 235 dst = n.HTargetClient.MarshalUnsafe(dst) 236 dst = n.HTargetDevice.MarshalUnsafe(dst) 237 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 238 dst = dst[4:] 239 for idx := 0; idx < 4; idx++ { 240 dst[0] = byte(n.Pad0[idx]) 241 dst = dst[1:] 242 } 243 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VASpaceSize)) 244 dst = dst[8:] 245 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VAStartInternal)) 246 dst = dst[8:] 247 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VALimitInternal)) 248 dst = dst[8:] 249 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.VAMode)) 250 dst = dst[4:] 251 for idx := 0; idx < 4; idx++ { 252 dst[0] = byte(n.Pad1[idx]) 253 dst = dst[1:] 254 } 255 return dst 256 } 257 258 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 259 func (n *NV0080_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte { 260 n.DeviceID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 261 src = src[4:] 262 src = n.HClientShare.UnmarshalUnsafe(src) 263 src = n.HTargetClient.UnmarshalUnsafe(src) 264 src = n.HTargetDevice.UnmarshalUnsafe(src) 265 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 266 src = src[4:] 267 for idx := 0; idx < 4; idx++ { 268 n.Pad0[idx] = src[0] 269 src = src[1:] 270 } 271 n.VASpaceSize = uint64(hostarch.ByteOrder.Uint64(src[:8])) 272 src = src[8:] 273 n.VAStartInternal = uint64(hostarch.ByteOrder.Uint64(src[:8])) 274 src = src[8:] 275 n.VALimitInternal = uint64(hostarch.ByteOrder.Uint64(src[:8])) 276 src = src[8:] 277 n.VAMode = uint32(hostarch.ByteOrder.Uint32(src[:4])) 278 src = src[4:] 279 for idx := 0; idx < 4; idx++ { 280 n.Pad1[idx] = src[0] 281 src = src[1:] 282 } 283 return src 284 } 285 286 // Packed implements marshal.Marshallable.Packed. 287 //go:nosplit 288 func (n *NV0080_ALLOC_PARAMETERS) Packed() bool { 289 return n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() 290 } 291 292 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 293 func (n *NV0080_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 294 if n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() { 295 size := n.SizeBytes() 296 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 297 return dst[size:] 298 } 299 // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes. 300 return n.MarshalBytes(dst) 301 } 302 303 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 304 func (n *NV0080_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 305 if n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() { 306 size := n.SizeBytes() 307 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 308 return src[size:] 309 } 310 // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 311 return n.UnmarshalBytes(src) 312 } 313 314 // CopyOutN implements marshal.Marshallable.CopyOutN. 315 func (n *NV0080_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 316 if !n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() { 317 // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 318 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 319 n.MarshalBytes(buf) // escapes: fallback. 320 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 321 } 322 323 // Construct a slice backed by dst's underlying memory. 324 var buf []byte 325 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 326 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 327 hdr.Len = n.SizeBytes() 328 hdr.Cap = n.SizeBytes() 329 330 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 331 // Since we bypassed the compiler's escape analysis, indicate that n 332 // must live until the use above. 333 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 334 return length, err 335 } 336 337 // CopyOut implements marshal.Marshallable.CopyOut. 338 func (n *NV0080_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 339 return n.CopyOutN(cc, addr, n.SizeBytes()) 340 } 341 342 // CopyInN implements marshal.Marshallable.CopyInN. 343 func (n *NV0080_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 344 if !n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() { 345 // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 346 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 347 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 348 // Unmarshal unconditionally. If we had a short copy-in, this results in a 349 // partially unmarshalled struct. 350 n.UnmarshalBytes(buf) // escapes: fallback. 351 return length, err 352 } 353 354 // Construct a slice backed by dst's underlying memory. 355 var buf []byte 356 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 357 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 358 hdr.Len = n.SizeBytes() 359 hdr.Cap = n.SizeBytes() 360 361 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 362 // Since we bypassed the compiler's escape analysis, indicate that n 363 // must live until the use above. 364 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 365 return length, err 366 } 367 368 // CopyIn implements marshal.Marshallable.CopyIn. 369 func (n *NV0080_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 370 return n.CopyInN(cc, addr, n.SizeBytes()) 371 } 372 373 // WriteTo implements io.WriterTo.WriteTo. 374 func (n *NV0080_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 375 if !n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() { 376 // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 377 buf := make([]byte, n.SizeBytes()) 378 n.MarshalBytes(buf) 379 length, err := writer.Write(buf) 380 return int64(length), err 381 } 382 383 // Construct a slice backed by dst's underlying memory. 384 var buf []byte 385 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 386 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 387 hdr.Len = n.SizeBytes() 388 hdr.Cap = n.SizeBytes() 389 390 length, err := writer.Write(buf) 391 // Since we bypassed the compiler's escape analysis, indicate that n 392 // must live until the use above. 393 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 394 return int64(length), err 395 } 396 397 // SizeBytes implements marshal.Marshallable.SizeBytes. 398 func (n *NV00F8_ALLOCATION_PARAMETERS) SizeBytes() int { 399 return 24 + 400 (*nv00f8Map)(nil).SizeBytes() 401 } 402 403 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 404 func (n *NV00F8_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte { 405 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Alignment)) 406 dst = dst[8:] 407 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.AllocSize)) 408 dst = dst[8:] 409 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.PageSize)) 410 dst = dst[4:] 411 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.AllocFlags)) 412 dst = dst[4:] 413 dst = n.Map.MarshalUnsafe(dst) 414 return dst 415 } 416 417 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 418 func (n *NV00F8_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte { 419 n.Alignment = uint64(hostarch.ByteOrder.Uint64(src[:8])) 420 src = src[8:] 421 n.AllocSize = uint64(hostarch.ByteOrder.Uint64(src[:8])) 422 src = src[8:] 423 n.PageSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) 424 src = src[4:] 425 n.AllocFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 426 src = src[4:] 427 src = n.Map.UnmarshalUnsafe(src) 428 return src 429 } 430 431 // Packed implements marshal.Marshallable.Packed. 432 //go:nosplit 433 func (n *NV00F8_ALLOCATION_PARAMETERS) Packed() bool { 434 return n.Map.Packed() 435 } 436 437 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 438 func (n *NV00F8_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 439 if n.Map.Packed() { 440 size := n.SizeBytes() 441 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 442 return dst[size:] 443 } 444 // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes. 445 return n.MarshalBytes(dst) 446 } 447 448 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 449 func (n *NV00F8_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 450 if n.Map.Packed() { 451 size := n.SizeBytes() 452 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 453 return src[size:] 454 } 455 // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 456 return n.UnmarshalBytes(src) 457 } 458 459 // CopyOutN implements marshal.Marshallable.CopyOutN. 460 func (n *NV00F8_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 461 if !n.Map.Packed() { 462 // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 463 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 464 n.MarshalBytes(buf) // escapes: fallback. 465 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 466 } 467 468 // Construct a slice backed by dst's underlying memory. 469 var buf []byte 470 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 471 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 472 hdr.Len = n.SizeBytes() 473 hdr.Cap = n.SizeBytes() 474 475 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 476 // Since we bypassed the compiler's escape analysis, indicate that n 477 // must live until the use above. 478 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 479 return length, err 480 } 481 482 // CopyOut implements marshal.Marshallable.CopyOut. 483 func (n *NV00F8_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 484 return n.CopyOutN(cc, addr, n.SizeBytes()) 485 } 486 487 // CopyInN implements marshal.Marshallable.CopyInN. 488 func (n *NV00F8_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 489 if !n.Map.Packed() { 490 // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 491 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 492 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 493 // Unmarshal unconditionally. If we had a short copy-in, this results in a 494 // partially unmarshalled struct. 495 n.UnmarshalBytes(buf) // escapes: fallback. 496 return length, err 497 } 498 499 // Construct a slice backed by dst's underlying memory. 500 var buf []byte 501 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 502 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 503 hdr.Len = n.SizeBytes() 504 hdr.Cap = n.SizeBytes() 505 506 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 507 // Since we bypassed the compiler's escape analysis, indicate that n 508 // must live until the use above. 509 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 510 return length, err 511 } 512 513 // CopyIn implements marshal.Marshallable.CopyIn. 514 func (n *NV00F8_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 515 return n.CopyInN(cc, addr, n.SizeBytes()) 516 } 517 518 // WriteTo implements io.WriterTo.WriteTo. 519 func (n *NV00F8_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 520 if !n.Map.Packed() { 521 // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 522 buf := make([]byte, n.SizeBytes()) 523 n.MarshalBytes(buf) 524 length, err := writer.Write(buf) 525 return int64(length), err 526 } 527 528 // Construct a slice backed by dst's underlying memory. 529 var buf []byte 530 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 531 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 532 hdr.Len = n.SizeBytes() 533 hdr.Cap = n.SizeBytes() 534 535 length, err := writer.Write(buf) 536 // Since we bypassed the compiler's escape analysis, indicate that n 537 // must live until the use above. 538 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 539 return int64(length), err 540 } 541 542 // SizeBytes implements marshal.Marshallable.SizeBytes. 543 func (n *NV2080_ALLOC_PARAMETERS) SizeBytes() int { 544 return 4 545 } 546 547 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 548 func (n *NV2080_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte { 549 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDeviceID)) 550 dst = dst[4:] 551 return dst 552 } 553 554 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 555 func (n *NV2080_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte { 556 n.SubDeviceID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 557 src = src[4:] 558 return src 559 } 560 561 // Packed implements marshal.Marshallable.Packed. 562 //go:nosplit 563 func (n *NV2080_ALLOC_PARAMETERS) Packed() bool { 564 return true 565 } 566 567 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 568 func (n *NV2080_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 569 size := n.SizeBytes() 570 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 571 return dst[size:] 572 } 573 574 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 575 func (n *NV2080_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 576 size := n.SizeBytes() 577 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 578 return src[size:] 579 } 580 581 // CopyOutN implements marshal.Marshallable.CopyOutN. 582 func (n *NV2080_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 583 // Construct a slice backed by dst's underlying memory. 584 var buf []byte 585 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 586 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 587 hdr.Len = n.SizeBytes() 588 hdr.Cap = n.SizeBytes() 589 590 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 591 // Since we bypassed the compiler's escape analysis, indicate that n 592 // must live until the use above. 593 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 594 return length, err 595 } 596 597 // CopyOut implements marshal.Marshallable.CopyOut. 598 func (n *NV2080_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 599 return n.CopyOutN(cc, addr, n.SizeBytes()) 600 } 601 602 // CopyInN implements marshal.Marshallable.CopyInN. 603 func (n *NV2080_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 604 // Construct a slice backed by dst's underlying memory. 605 var buf []byte 606 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 607 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 608 hdr.Len = n.SizeBytes() 609 hdr.Cap = n.SizeBytes() 610 611 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 612 // Since we bypassed the compiler's escape analysis, indicate that n 613 // must live until the use above. 614 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 615 return length, err 616 } 617 618 // CopyIn implements marshal.Marshallable.CopyIn. 619 func (n *NV2080_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 620 return n.CopyInN(cc, addr, n.SizeBytes()) 621 } 622 623 // WriteTo implements io.WriterTo.WriteTo. 624 func (n *NV2080_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 625 // Construct a slice backed by dst's underlying memory. 626 var buf []byte 627 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 628 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 629 hdr.Len = n.SizeBytes() 630 hdr.Cap = n.SizeBytes() 631 632 length, err := writer.Write(buf) 633 // Since we bypassed the compiler's escape analysis, indicate that n 634 // must live until the use above. 635 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 636 return int64(length), err 637 } 638 639 // SizeBytes implements marshal.Marshallable.SizeBytes. 640 func (n *NV503C_ALLOC_PARAMETERS) SizeBytes() int { 641 return 4 642 } 643 644 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 645 func (n *NV503C_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte { 646 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 647 dst = dst[4:] 648 return dst 649 } 650 651 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 652 func (n *NV503C_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte { 653 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 654 src = src[4:] 655 return src 656 } 657 658 // Packed implements marshal.Marshallable.Packed. 659 //go:nosplit 660 func (n *NV503C_ALLOC_PARAMETERS) Packed() bool { 661 return true 662 } 663 664 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 665 func (n *NV503C_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 666 size := n.SizeBytes() 667 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 668 return dst[size:] 669 } 670 671 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 672 func (n *NV503C_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 673 size := n.SizeBytes() 674 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 675 return src[size:] 676 } 677 678 // CopyOutN implements marshal.Marshallable.CopyOutN. 679 func (n *NV503C_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 680 // Construct a slice backed by dst's underlying memory. 681 var buf []byte 682 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 683 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 684 hdr.Len = n.SizeBytes() 685 hdr.Cap = n.SizeBytes() 686 687 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 688 // Since we bypassed the compiler's escape analysis, indicate that n 689 // must live until the use above. 690 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 691 return length, err 692 } 693 694 // CopyOut implements marshal.Marshallable.CopyOut. 695 func (n *NV503C_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 696 return n.CopyOutN(cc, addr, n.SizeBytes()) 697 } 698 699 // CopyInN implements marshal.Marshallable.CopyInN. 700 func (n *NV503C_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 701 // Construct a slice backed by dst's underlying memory. 702 var buf []byte 703 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 704 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 705 hdr.Len = n.SizeBytes() 706 hdr.Cap = n.SizeBytes() 707 708 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 709 // Since we bypassed the compiler's escape analysis, indicate that n 710 // must live until the use above. 711 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 712 return length, err 713 } 714 715 // CopyIn implements marshal.Marshallable.CopyIn. 716 func (n *NV503C_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 717 return n.CopyInN(cc, addr, n.SizeBytes()) 718 } 719 720 // WriteTo implements io.WriterTo.WriteTo. 721 func (n *NV503C_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 722 // Construct a slice backed by dst's underlying memory. 723 var buf []byte 724 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 725 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 726 hdr.Len = n.SizeBytes() 727 hdr.Cap = n.SizeBytes() 728 729 length, err := writer.Write(buf) 730 // Since we bypassed the compiler's escape analysis, indicate that n 731 // must live until the use above. 732 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 733 return int64(length), err 734 } 735 736 // SizeBytes implements marshal.Marshallable.SizeBytes. 737 func (n *NV83DE_ALLOC_PARAMETERS) SizeBytes() int { 738 return 0 + 739 (*Handle)(nil).SizeBytes() + 740 (*Handle)(nil).SizeBytes() + 741 (*Handle)(nil).SizeBytes() 742 } 743 744 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 745 func (n *NV83DE_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte { 746 dst = n.HDebuggerClient_Obsolete.MarshalUnsafe(dst) 747 dst = n.HAppClient.MarshalUnsafe(dst) 748 dst = n.HClass3DObject.MarshalUnsafe(dst) 749 return dst 750 } 751 752 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 753 func (n *NV83DE_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte { 754 src = n.HDebuggerClient_Obsolete.UnmarshalUnsafe(src) 755 src = n.HAppClient.UnmarshalUnsafe(src) 756 src = n.HClass3DObject.UnmarshalUnsafe(src) 757 return src 758 } 759 760 // Packed implements marshal.Marshallable.Packed. 761 //go:nosplit 762 func (n *NV83DE_ALLOC_PARAMETERS) Packed() bool { 763 return n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() 764 } 765 766 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 767 func (n *NV83DE_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 768 if n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() { 769 size := n.SizeBytes() 770 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 771 return dst[size:] 772 } 773 // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes. 774 return n.MarshalBytes(dst) 775 } 776 777 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 778 func (n *NV83DE_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 779 if n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() { 780 size := n.SizeBytes() 781 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 782 return src[size:] 783 } 784 // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 785 return n.UnmarshalBytes(src) 786 } 787 788 // CopyOutN implements marshal.Marshallable.CopyOutN. 789 func (n *NV83DE_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 790 if !n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() { 791 // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 792 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 793 n.MarshalBytes(buf) // escapes: fallback. 794 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 795 } 796 797 // Construct a slice backed by dst's underlying memory. 798 var buf []byte 799 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 800 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 801 hdr.Len = n.SizeBytes() 802 hdr.Cap = n.SizeBytes() 803 804 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 805 // Since we bypassed the compiler's escape analysis, indicate that n 806 // must live until the use above. 807 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 808 return length, err 809 } 810 811 // CopyOut implements marshal.Marshallable.CopyOut. 812 func (n *NV83DE_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 813 return n.CopyOutN(cc, addr, n.SizeBytes()) 814 } 815 816 // CopyInN implements marshal.Marshallable.CopyInN. 817 func (n *NV83DE_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 818 if !n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() { 819 // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 820 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 821 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 822 // Unmarshal unconditionally. If we had a short copy-in, this results in a 823 // partially unmarshalled struct. 824 n.UnmarshalBytes(buf) // escapes: fallback. 825 return length, err 826 } 827 828 // Construct a slice backed by dst's underlying memory. 829 var buf []byte 830 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 831 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 832 hdr.Len = n.SizeBytes() 833 hdr.Cap = n.SizeBytes() 834 835 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 836 // Since we bypassed the compiler's escape analysis, indicate that n 837 // must live until the use above. 838 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 839 return length, err 840 } 841 842 // CopyIn implements marshal.Marshallable.CopyIn. 843 func (n *NV83DE_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 844 return n.CopyInN(cc, addr, n.SizeBytes()) 845 } 846 847 // WriteTo implements io.WriterTo.WriteTo. 848 func (n *NV83DE_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 849 if !n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() { 850 // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 851 buf := make([]byte, n.SizeBytes()) 852 n.MarshalBytes(buf) 853 length, err := writer.Write(buf) 854 return int64(length), err 855 } 856 857 // Construct a slice backed by dst's underlying memory. 858 var buf []byte 859 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 860 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 861 hdr.Len = n.SizeBytes() 862 hdr.Cap = n.SizeBytes() 863 864 length, err := writer.Write(buf) 865 // Since we bypassed the compiler's escape analysis, indicate that n 866 // must live until the use above. 867 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 868 return int64(length), err 869 } 870 871 // SizeBytes implements marshal.Marshallable.SizeBytes. 872 func (n *NVB0B5_ALLOCATION_PARAMETERS) SizeBytes() int { 873 return 8 874 } 875 876 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 877 func (n *NVB0B5_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte { 878 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Version)) 879 dst = dst[4:] 880 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EngineType)) 881 dst = dst[4:] 882 return dst 883 } 884 885 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 886 func (n *NVB0B5_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte { 887 n.Version = uint32(hostarch.ByteOrder.Uint32(src[:4])) 888 src = src[4:] 889 n.EngineType = uint32(hostarch.ByteOrder.Uint32(src[:4])) 890 src = src[4:] 891 return src 892 } 893 894 // Packed implements marshal.Marshallable.Packed. 895 //go:nosplit 896 func (n *NVB0B5_ALLOCATION_PARAMETERS) Packed() bool { 897 return true 898 } 899 900 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 901 func (n *NVB0B5_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 902 size := n.SizeBytes() 903 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 904 return dst[size:] 905 } 906 907 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 908 func (n *NVB0B5_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 909 size := n.SizeBytes() 910 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 911 return src[size:] 912 } 913 914 // CopyOutN implements marshal.Marshallable.CopyOutN. 915 func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 916 // Construct a slice backed by dst's underlying memory. 917 var buf []byte 918 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 919 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 920 hdr.Len = n.SizeBytes() 921 hdr.Cap = n.SizeBytes() 922 923 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 924 // Since we bypassed the compiler's escape analysis, indicate that n 925 // must live until the use above. 926 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 927 return length, err 928 } 929 930 // CopyOut implements marshal.Marshallable.CopyOut. 931 func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 932 return n.CopyOutN(cc, addr, n.SizeBytes()) 933 } 934 935 // CopyInN implements marshal.Marshallable.CopyInN. 936 func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 937 // Construct a slice backed by dst's underlying memory. 938 var buf []byte 939 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 940 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 941 hdr.Len = n.SizeBytes() 942 hdr.Cap = n.SizeBytes() 943 944 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 945 // Since we bypassed the compiler's escape analysis, indicate that n 946 // must live until the use above. 947 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 948 return length, err 949 } 950 951 // CopyIn implements marshal.Marshallable.CopyIn. 952 func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 953 return n.CopyInN(cc, addr, n.SizeBytes()) 954 } 955 956 // WriteTo implements io.WriterTo.WriteTo. 957 func (n *NVB0B5_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 958 // Construct a slice backed by dst's underlying memory. 959 var buf []byte 960 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 961 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 962 hdr.Len = n.SizeBytes() 963 hdr.Cap = n.SizeBytes() 964 965 length, err := writer.Write(buf) 966 // Since we bypassed the compiler's escape analysis, indicate that n 967 // must live until the use above. 968 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 969 return int64(length), err 970 } 971 972 // SizeBytes implements marshal.Marshallable.SizeBytes. 973 func (n *NV_CHANNEL_ALLOC_PARAMS) SizeBytes() int { 974 return 40 + 975 (*Handle)(nil).SizeBytes() + 976 (*Handle)(nil).SizeBytes() + 977 (*Handle)(nil).SizeBytes() + 978 (*Handle)(nil).SizeBytes() + 979 (*Handle)(nil).SizeBytes()*NV_MAX_SUBDEVICES + 980 8*NV_MAX_SUBDEVICES + 981 (*Handle)(nil).SizeBytes() + 982 (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() + 983 (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() + 984 (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() + 985 (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() + 986 (*Handle)(nil).SizeBytes() + 987 (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() + 988 (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() 989 } 990 991 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 992 func (n *NV_CHANNEL_ALLOC_PARAMS) MarshalBytes(dst []byte) []byte { 993 dst = n.HObjectError.MarshalUnsafe(dst) 994 dst = n.HObjectBuffer.MarshalUnsafe(dst) 995 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.GPFIFOOffset)) 996 dst = dst[8:] 997 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.GPFIFOEntries)) 998 dst = dst[4:] 999 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 1000 dst = dst[4:] 1001 dst = n.HContextShare.MarshalUnsafe(dst) 1002 dst = n.HVASpace.MarshalUnsafe(dst) 1003 for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ { 1004 dst = n.HUserdMemory[idx].MarshalUnsafe(dst) 1005 } 1006 for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ { 1007 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.UserdOffset[idx])) 1008 dst = dst[8:] 1009 } 1010 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EngineType)) 1011 dst = dst[4:] 1012 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.CID)) 1013 dst = dst[4:] 1014 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDeviceID)) 1015 dst = dst[4:] 1016 dst = n.HObjectECCError.MarshalUnsafe(dst) 1017 dst = n.InstanceMem.MarshalUnsafe(dst) 1018 dst = n.UserdMem.MarshalUnsafe(dst) 1019 dst = n.RamfcMem.MarshalUnsafe(dst) 1020 dst = n.MthdbufMem.MarshalUnsafe(dst) 1021 dst = n.HPhysChannelGroup.MarshalUnsafe(dst) 1022 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.InternalFlags)) 1023 dst = dst[4:] 1024 dst = n.ErrorNotifierMem.MarshalUnsafe(dst) 1025 dst = n.ECCErrorNotifierMem.MarshalUnsafe(dst) 1026 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ProcessID)) 1027 dst = dst[4:] 1028 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubProcessID)) 1029 dst = dst[4:] 1030 return dst 1031 } 1032 1033 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1034 func (n *NV_CHANNEL_ALLOC_PARAMS) UnmarshalBytes(src []byte) []byte { 1035 src = n.HObjectError.UnmarshalUnsafe(src) 1036 src = n.HObjectBuffer.UnmarshalUnsafe(src) 1037 n.GPFIFOOffset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1038 src = src[8:] 1039 n.GPFIFOEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1040 src = src[4:] 1041 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1042 src = src[4:] 1043 src = n.HContextShare.UnmarshalUnsafe(src) 1044 src = n.HVASpace.UnmarshalUnsafe(src) 1045 for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ { 1046 src = n.HUserdMemory[idx].UnmarshalUnsafe(src) 1047 } 1048 for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ { 1049 n.UserdOffset[idx] = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1050 src = src[8:] 1051 } 1052 n.EngineType = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1053 src = src[4:] 1054 n.CID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1055 src = src[4:] 1056 n.SubDeviceID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1057 src = src[4:] 1058 src = n.HObjectECCError.UnmarshalUnsafe(src) 1059 src = n.InstanceMem.UnmarshalUnsafe(src) 1060 src = n.UserdMem.UnmarshalUnsafe(src) 1061 src = n.RamfcMem.UnmarshalUnsafe(src) 1062 src = n.MthdbufMem.UnmarshalUnsafe(src) 1063 src = n.HPhysChannelGroup.UnmarshalUnsafe(src) 1064 n.InternalFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1065 src = src[4:] 1066 src = n.ErrorNotifierMem.UnmarshalUnsafe(src) 1067 src = n.ECCErrorNotifierMem.UnmarshalUnsafe(src) 1068 n.ProcessID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1069 src = src[4:] 1070 n.SubProcessID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1071 src = src[4:] 1072 return src 1073 } 1074 1075 // Packed implements marshal.Marshallable.Packed. 1076 //go:nosplit 1077 func (n *NV_CHANNEL_ALLOC_PARAMS) Packed() bool { 1078 return n.ECCErrorNotifierMem.Packed() && n.ErrorNotifierMem.Packed() && n.HContextShare.Packed() && n.HObjectBuffer.Packed() && n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HPhysChannelGroup.Packed() && n.HUserdMemory[0].Packed() && n.HVASpace.Packed() && n.InstanceMem.Packed() && n.MthdbufMem.Packed() && n.RamfcMem.Packed() && n.UserdMem.Packed() 1079 } 1080 1081 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1082 func (n *NV_CHANNEL_ALLOC_PARAMS) MarshalUnsafe(dst []byte) []byte { 1083 if n.ECCErrorNotifierMem.Packed() && n.ErrorNotifierMem.Packed() && n.HContextShare.Packed() && n.HObjectBuffer.Packed() && n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HPhysChannelGroup.Packed() && n.HUserdMemory[0].Packed() && n.HVASpace.Packed() && n.InstanceMem.Packed() && n.MthdbufMem.Packed() && n.RamfcMem.Packed() && n.UserdMem.Packed() { 1084 size := n.SizeBytes() 1085 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 1086 return dst[size:] 1087 } 1088 // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 1089 return n.MarshalBytes(dst) 1090 } 1091 1092 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1093 func (n *NV_CHANNEL_ALLOC_PARAMS) UnmarshalUnsafe(src []byte) []byte { 1094 if n.ECCErrorNotifierMem.Packed() && n.ErrorNotifierMem.Packed() && n.HContextShare.Packed() && n.HObjectBuffer.Packed() && n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HPhysChannelGroup.Packed() && n.HUserdMemory[0].Packed() && n.HVASpace.Packed() && n.InstanceMem.Packed() && n.MthdbufMem.Packed() && n.RamfcMem.Packed() && n.UserdMem.Packed() { 1095 size := n.SizeBytes() 1096 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 1097 return src[size:] 1098 } 1099 // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 1100 return n.UnmarshalBytes(src) 1101 } 1102 1103 // CopyOutN implements marshal.Marshallable.CopyOutN. 1104 func (n *NV_CHANNEL_ALLOC_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1105 if !n.ECCErrorNotifierMem.Packed() && n.ErrorNotifierMem.Packed() && n.HContextShare.Packed() && n.HObjectBuffer.Packed() && n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HPhysChannelGroup.Packed() && n.HUserdMemory[0].Packed() && n.HVASpace.Packed() && n.InstanceMem.Packed() && n.MthdbufMem.Packed() && n.RamfcMem.Packed() && n.UserdMem.Packed() { 1106 // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 1107 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 1108 n.MarshalBytes(buf) // escapes: fallback. 1109 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1110 } 1111 1112 // Construct a slice backed by dst's underlying memory. 1113 var buf []byte 1114 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1115 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1116 hdr.Len = n.SizeBytes() 1117 hdr.Cap = n.SizeBytes() 1118 1119 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1120 // Since we bypassed the compiler's escape analysis, indicate that n 1121 // must live until the use above. 1122 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1123 return length, err 1124 } 1125 1126 // CopyOut implements marshal.Marshallable.CopyOut. 1127 func (n *NV_CHANNEL_ALLOC_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1128 return n.CopyOutN(cc, addr, n.SizeBytes()) 1129 } 1130 1131 // CopyInN implements marshal.Marshallable.CopyInN. 1132 func (n *NV_CHANNEL_ALLOC_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1133 if !n.ECCErrorNotifierMem.Packed() && n.ErrorNotifierMem.Packed() && n.HContextShare.Packed() && n.HObjectBuffer.Packed() && n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HPhysChannelGroup.Packed() && n.HUserdMemory[0].Packed() && n.HVASpace.Packed() && n.InstanceMem.Packed() && n.MthdbufMem.Packed() && n.RamfcMem.Packed() && n.UserdMem.Packed() { 1134 // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 1135 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 1136 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1137 // Unmarshal unconditionally. If we had a short copy-in, this results in a 1138 // partially unmarshalled struct. 1139 n.UnmarshalBytes(buf) // escapes: fallback. 1140 return length, err 1141 } 1142 1143 // Construct a slice backed by dst's underlying memory. 1144 var buf []byte 1145 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1146 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1147 hdr.Len = n.SizeBytes() 1148 hdr.Cap = n.SizeBytes() 1149 1150 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1151 // Since we bypassed the compiler's escape analysis, indicate that n 1152 // must live until the use above. 1153 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1154 return length, err 1155 } 1156 1157 // CopyIn implements marshal.Marshallable.CopyIn. 1158 func (n *NV_CHANNEL_ALLOC_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1159 return n.CopyInN(cc, addr, n.SizeBytes()) 1160 } 1161 1162 // WriteTo implements io.WriterTo.WriteTo. 1163 func (n *NV_CHANNEL_ALLOC_PARAMS) WriteTo(writer io.Writer) (int64, error) { 1164 if !n.ECCErrorNotifierMem.Packed() && n.ErrorNotifierMem.Packed() && n.HContextShare.Packed() && n.HObjectBuffer.Packed() && n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HPhysChannelGroup.Packed() && n.HUserdMemory[0].Packed() && n.HVASpace.Packed() && n.InstanceMem.Packed() && n.MthdbufMem.Packed() && n.RamfcMem.Packed() && n.UserdMem.Packed() { 1165 // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 1166 buf := make([]byte, n.SizeBytes()) 1167 n.MarshalBytes(buf) 1168 length, err := writer.Write(buf) 1169 return int64(length), err 1170 } 1171 1172 // Construct a slice backed by dst's underlying memory. 1173 var buf []byte 1174 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1175 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1176 hdr.Len = n.SizeBytes() 1177 hdr.Cap = n.SizeBytes() 1178 1179 length, err := writer.Write(buf) 1180 // Since we bypassed the compiler's escape analysis, indicate that n 1181 // must live until the use above. 1182 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1183 return int64(length), err 1184 } 1185 1186 // SizeBytes implements marshal.Marshallable.SizeBytes. 1187 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) SizeBytes() int { 1188 return 5 + 1189 (*Handle)(nil).SizeBytes() + 1190 (*Handle)(nil).SizeBytes() + 1191 (*Handle)(nil).SizeBytes() + 1192 1*3 1193 } 1194 1195 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1196 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte { 1197 dst = n.HObjectError.MarshalUnsafe(dst) 1198 dst = n.HObjectECCError.MarshalUnsafe(dst) 1199 dst = n.HVASpace.MarshalUnsafe(dst) 1200 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EngineType)) 1201 dst = dst[4:] 1202 dst[0] = byte(n.BIsCallingContextVgpuPlugin) 1203 dst = dst[1:] 1204 for idx := 0; idx < 3; idx++ { 1205 dst[0] = byte(n.Pad0[idx]) 1206 dst = dst[1:] 1207 } 1208 return dst 1209 } 1210 1211 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1212 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte { 1213 src = n.HObjectError.UnmarshalUnsafe(src) 1214 src = n.HObjectECCError.UnmarshalUnsafe(src) 1215 src = n.HVASpace.UnmarshalUnsafe(src) 1216 n.EngineType = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1217 src = src[4:] 1218 n.BIsCallingContextVgpuPlugin = uint8(src[0]) 1219 src = src[1:] 1220 for idx := 0; idx < 3; idx++ { 1221 n.Pad0[idx] = src[0] 1222 src = src[1:] 1223 } 1224 return src 1225 } 1226 1227 // Packed implements marshal.Marshallable.Packed. 1228 //go:nosplit 1229 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) Packed() bool { 1230 return n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() 1231 } 1232 1233 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1234 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 1235 if n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() { 1236 size := n.SizeBytes() 1237 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 1238 return dst[size:] 1239 } 1240 // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes. 1241 return n.MarshalBytes(dst) 1242 } 1243 1244 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1245 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 1246 if n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() { 1247 size := n.SizeBytes() 1248 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 1249 return src[size:] 1250 } 1251 // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 1252 return n.UnmarshalBytes(src) 1253 } 1254 1255 // CopyOutN implements marshal.Marshallable.CopyOutN. 1256 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1257 if !n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() { 1258 // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 1259 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 1260 n.MarshalBytes(buf) // escapes: fallback. 1261 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1262 } 1263 1264 // Construct a slice backed by dst's underlying memory. 1265 var buf []byte 1266 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1267 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1268 hdr.Len = n.SizeBytes() 1269 hdr.Cap = n.SizeBytes() 1270 1271 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1272 // Since we bypassed the compiler's escape analysis, indicate that n 1273 // must live until the use above. 1274 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1275 return length, err 1276 } 1277 1278 // CopyOut implements marshal.Marshallable.CopyOut. 1279 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1280 return n.CopyOutN(cc, addr, n.SizeBytes()) 1281 } 1282 1283 // CopyInN implements marshal.Marshallable.CopyInN. 1284 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1285 if !n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() { 1286 // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 1287 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 1288 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1289 // Unmarshal unconditionally. If we had a short copy-in, this results in a 1290 // partially unmarshalled struct. 1291 n.UnmarshalBytes(buf) // escapes: fallback. 1292 return length, err 1293 } 1294 1295 // Construct a slice backed by dst's underlying memory. 1296 var buf []byte 1297 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1298 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1299 hdr.Len = n.SizeBytes() 1300 hdr.Cap = n.SizeBytes() 1301 1302 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1303 // Since we bypassed the compiler's escape analysis, indicate that n 1304 // must live until the use above. 1305 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1306 return length, err 1307 } 1308 1309 // CopyIn implements marshal.Marshallable.CopyIn. 1310 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1311 return n.CopyInN(cc, addr, n.SizeBytes()) 1312 } 1313 1314 // WriteTo implements io.WriterTo.WriteTo. 1315 func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 1316 if !n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() { 1317 // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 1318 buf := make([]byte, n.SizeBytes()) 1319 n.MarshalBytes(buf) 1320 length, err := writer.Write(buf) 1321 return int64(length), err 1322 } 1323 1324 // Construct a slice backed by dst's underlying memory. 1325 var buf []byte 1326 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1327 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1328 hdr.Len = n.SizeBytes() 1329 hdr.Cap = n.SizeBytes() 1330 1331 length, err := writer.Write(buf) 1332 // Since we bypassed the compiler's escape analysis, indicate that n 1333 // must live until the use above. 1334 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1335 return int64(length), err 1336 } 1337 1338 // SizeBytes implements marshal.Marshallable.SizeBytes. 1339 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) SizeBytes() int { 1340 return 8 + 1341 (*Handle)(nil).SizeBytes() 1342 } 1343 1344 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1345 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte { 1346 dst = n.HVASpace.MarshalUnsafe(dst) 1347 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 1348 dst = dst[4:] 1349 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubctxID)) 1350 dst = dst[4:] 1351 return dst 1352 } 1353 1354 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1355 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte { 1356 src = n.HVASpace.UnmarshalUnsafe(src) 1357 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1358 src = src[4:] 1359 n.SubctxID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1360 src = src[4:] 1361 return src 1362 } 1363 1364 // Packed implements marshal.Marshallable.Packed. 1365 //go:nosplit 1366 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) Packed() bool { 1367 return n.HVASpace.Packed() 1368 } 1369 1370 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1371 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 1372 if n.HVASpace.Packed() { 1373 size := n.SizeBytes() 1374 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 1375 return dst[size:] 1376 } 1377 // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes. 1378 return n.MarshalBytes(dst) 1379 } 1380 1381 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1382 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 1383 if n.HVASpace.Packed() { 1384 size := n.SizeBytes() 1385 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 1386 return src[size:] 1387 } 1388 // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 1389 return n.UnmarshalBytes(src) 1390 } 1391 1392 // CopyOutN implements marshal.Marshallable.CopyOutN. 1393 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1394 if !n.HVASpace.Packed() { 1395 // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 1396 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 1397 n.MarshalBytes(buf) // escapes: fallback. 1398 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1399 } 1400 1401 // Construct a slice backed by dst's underlying memory. 1402 var buf []byte 1403 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1404 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1405 hdr.Len = n.SizeBytes() 1406 hdr.Cap = n.SizeBytes() 1407 1408 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1409 // Since we bypassed the compiler's escape analysis, indicate that n 1410 // must live until the use above. 1411 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1412 return length, err 1413 } 1414 1415 // CopyOut implements marshal.Marshallable.CopyOut. 1416 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1417 return n.CopyOutN(cc, addr, n.SizeBytes()) 1418 } 1419 1420 // CopyInN implements marshal.Marshallable.CopyInN. 1421 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1422 if !n.HVASpace.Packed() { 1423 // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 1424 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 1425 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1426 // Unmarshal unconditionally. If we had a short copy-in, this results in a 1427 // partially unmarshalled struct. 1428 n.UnmarshalBytes(buf) // escapes: fallback. 1429 return length, err 1430 } 1431 1432 // Construct a slice backed by dst's underlying memory. 1433 var buf []byte 1434 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1435 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1436 hdr.Len = n.SizeBytes() 1437 hdr.Cap = n.SizeBytes() 1438 1439 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1440 // Since we bypassed the compiler's escape analysis, indicate that n 1441 // must live until the use above. 1442 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1443 return length, err 1444 } 1445 1446 // CopyIn implements marshal.Marshallable.CopyIn. 1447 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1448 return n.CopyInN(cc, addr, n.SizeBytes()) 1449 } 1450 1451 // WriteTo implements io.WriterTo.WriteTo. 1452 func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 1453 if !n.HVASpace.Packed() { 1454 // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes. 1455 buf := make([]byte, n.SizeBytes()) 1456 n.MarshalBytes(buf) 1457 length, err := writer.Write(buf) 1458 return int64(length), err 1459 } 1460 1461 // Construct a slice backed by dst's underlying memory. 1462 var buf []byte 1463 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1464 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1465 hdr.Len = n.SizeBytes() 1466 hdr.Cap = n.SizeBytes() 1467 1468 length, err := writer.Write(buf) 1469 // Since we bypassed the compiler's escape analysis, indicate that n 1470 // must live until the use above. 1471 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1472 return int64(length), err 1473 } 1474 1475 // SizeBytes implements marshal.Marshallable.SizeBytes. 1476 func (n *NV_GR_ALLOCATION_PARAMETERS) SizeBytes() int { 1477 return 16 1478 } 1479 1480 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1481 func (n *NV_GR_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte { 1482 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Version)) 1483 dst = dst[4:] 1484 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 1485 dst = dst[4:] 1486 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Size)) 1487 dst = dst[4:] 1488 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Caps)) 1489 dst = dst[4:] 1490 return dst 1491 } 1492 1493 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1494 func (n *NV_GR_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte { 1495 n.Version = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1496 src = src[4:] 1497 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1498 src = src[4:] 1499 n.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1500 src = src[4:] 1501 n.Caps = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1502 src = src[4:] 1503 return src 1504 } 1505 1506 // Packed implements marshal.Marshallable.Packed. 1507 //go:nosplit 1508 func (n *NV_GR_ALLOCATION_PARAMETERS) Packed() bool { 1509 return true 1510 } 1511 1512 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1513 func (n *NV_GR_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 1514 size := n.SizeBytes() 1515 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 1516 return dst[size:] 1517 } 1518 1519 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1520 func (n *NV_GR_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 1521 size := n.SizeBytes() 1522 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 1523 return src[size:] 1524 } 1525 1526 // CopyOutN implements marshal.Marshallable.CopyOutN. 1527 func (n *NV_GR_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1528 // Construct a slice backed by dst's underlying memory. 1529 var buf []byte 1530 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1531 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1532 hdr.Len = n.SizeBytes() 1533 hdr.Cap = n.SizeBytes() 1534 1535 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1536 // Since we bypassed the compiler's escape analysis, indicate that n 1537 // must live until the use above. 1538 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1539 return length, err 1540 } 1541 1542 // CopyOut implements marshal.Marshallable.CopyOut. 1543 func (n *NV_GR_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1544 return n.CopyOutN(cc, addr, n.SizeBytes()) 1545 } 1546 1547 // CopyInN implements marshal.Marshallable.CopyInN. 1548 func (n *NV_GR_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1549 // Construct a slice backed by dst's underlying memory. 1550 var buf []byte 1551 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1552 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1553 hdr.Len = n.SizeBytes() 1554 hdr.Cap = n.SizeBytes() 1555 1556 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1557 // Since we bypassed the compiler's escape analysis, indicate that n 1558 // must live until the use above. 1559 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1560 return length, err 1561 } 1562 1563 // CopyIn implements marshal.Marshallable.CopyIn. 1564 func (n *NV_GR_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1565 return n.CopyInN(cc, addr, n.SizeBytes()) 1566 } 1567 1568 // WriteTo implements io.WriterTo.WriteTo. 1569 func (n *NV_GR_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 1570 // Construct a slice backed by dst's underlying memory. 1571 var buf []byte 1572 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1573 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1574 hdr.Len = n.SizeBytes() 1575 hdr.Cap = n.SizeBytes() 1576 1577 length, err := writer.Write(buf) 1578 // Since we bypassed the compiler's escape analysis, indicate that n 1579 // must live until the use above. 1580 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1581 return int64(length), err 1582 } 1583 1584 // SizeBytes implements marshal.Marshallable.SizeBytes. 1585 func (n *NV_HOPPER_USERMODE_A_PARAMS) SizeBytes() int { 1586 return 2 1587 } 1588 1589 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1590 func (n *NV_HOPPER_USERMODE_A_PARAMS) MarshalBytes(dst []byte) []byte { 1591 dst[0] = byte(n.Bar1Mapping) 1592 dst = dst[1:] 1593 dst[0] = byte(n.Priv) 1594 dst = dst[1:] 1595 return dst 1596 } 1597 1598 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1599 func (n *NV_HOPPER_USERMODE_A_PARAMS) UnmarshalBytes(src []byte) []byte { 1600 n.Bar1Mapping = uint8(src[0]) 1601 src = src[1:] 1602 n.Priv = uint8(src[0]) 1603 src = src[1:] 1604 return src 1605 } 1606 1607 // Packed implements marshal.Marshallable.Packed. 1608 //go:nosplit 1609 func (n *NV_HOPPER_USERMODE_A_PARAMS) Packed() bool { 1610 return true 1611 } 1612 1613 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1614 func (n *NV_HOPPER_USERMODE_A_PARAMS) MarshalUnsafe(dst []byte) []byte { 1615 size := n.SizeBytes() 1616 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 1617 return dst[size:] 1618 } 1619 1620 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1621 func (n *NV_HOPPER_USERMODE_A_PARAMS) UnmarshalUnsafe(src []byte) []byte { 1622 size := n.SizeBytes() 1623 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 1624 return src[size:] 1625 } 1626 1627 // CopyOutN implements marshal.Marshallable.CopyOutN. 1628 func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1629 // Construct a slice backed by dst's underlying memory. 1630 var buf []byte 1631 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1632 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1633 hdr.Len = n.SizeBytes() 1634 hdr.Cap = n.SizeBytes() 1635 1636 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1637 // Since we bypassed the compiler's escape analysis, indicate that n 1638 // must live until the use above. 1639 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1640 return length, err 1641 } 1642 1643 // CopyOut implements marshal.Marshallable.CopyOut. 1644 func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1645 return n.CopyOutN(cc, addr, n.SizeBytes()) 1646 } 1647 1648 // CopyInN implements marshal.Marshallable.CopyInN. 1649 func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1650 // Construct a slice backed by dst's underlying memory. 1651 var buf []byte 1652 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1653 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1654 hdr.Len = n.SizeBytes() 1655 hdr.Cap = n.SizeBytes() 1656 1657 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1658 // Since we bypassed the compiler's escape analysis, indicate that n 1659 // must live until the use above. 1660 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1661 return length, err 1662 } 1663 1664 // CopyIn implements marshal.Marshallable.CopyIn. 1665 func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1666 return n.CopyInN(cc, addr, n.SizeBytes()) 1667 } 1668 1669 // WriteTo implements io.WriterTo.WriteTo. 1670 func (n *NV_HOPPER_USERMODE_A_PARAMS) WriteTo(writer io.Writer) (int64, error) { 1671 // Construct a slice backed by dst's underlying memory. 1672 var buf []byte 1673 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1674 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1675 hdr.Len = n.SizeBytes() 1676 hdr.Cap = n.SizeBytes() 1677 1678 length, err := writer.Write(buf) 1679 // Since we bypassed the compiler's escape analysis, indicate that n 1680 // must live until the use above. 1681 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1682 return int64(length), err 1683 } 1684 1685 // SizeBytes implements marshal.Marshallable.SizeBytes. 1686 func (n *NV_MEMORY_DESC_PARAMS) SizeBytes() int { 1687 return 24 1688 } 1689 1690 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1691 func (n *NV_MEMORY_DESC_PARAMS) MarshalBytes(dst []byte) []byte { 1692 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Base)) 1693 dst = dst[8:] 1694 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Size)) 1695 dst = dst[8:] 1696 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.AddressSpace)) 1697 dst = dst[4:] 1698 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.CacheAttrib)) 1699 dst = dst[4:] 1700 return dst 1701 } 1702 1703 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1704 func (n *NV_MEMORY_DESC_PARAMS) UnmarshalBytes(src []byte) []byte { 1705 n.Base = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1706 src = src[8:] 1707 n.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1708 src = src[8:] 1709 n.AddressSpace = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1710 src = src[4:] 1711 n.CacheAttrib = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1712 src = src[4:] 1713 return src 1714 } 1715 1716 // Packed implements marshal.Marshallable.Packed. 1717 //go:nosplit 1718 func (n *NV_MEMORY_DESC_PARAMS) Packed() bool { 1719 return true 1720 } 1721 1722 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1723 func (n *NV_MEMORY_DESC_PARAMS) MarshalUnsafe(dst []byte) []byte { 1724 size := n.SizeBytes() 1725 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 1726 return dst[size:] 1727 } 1728 1729 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1730 func (n *NV_MEMORY_DESC_PARAMS) UnmarshalUnsafe(src []byte) []byte { 1731 size := n.SizeBytes() 1732 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 1733 return src[size:] 1734 } 1735 1736 // CopyOutN implements marshal.Marshallable.CopyOutN. 1737 func (n *NV_MEMORY_DESC_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1738 // Construct a slice backed by dst's underlying memory. 1739 var buf []byte 1740 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1741 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1742 hdr.Len = n.SizeBytes() 1743 hdr.Cap = n.SizeBytes() 1744 1745 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1746 // Since we bypassed the compiler's escape analysis, indicate that n 1747 // must live until the use above. 1748 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1749 return length, err 1750 } 1751 1752 // CopyOut implements marshal.Marshallable.CopyOut. 1753 func (n *NV_MEMORY_DESC_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1754 return n.CopyOutN(cc, addr, n.SizeBytes()) 1755 } 1756 1757 // CopyInN implements marshal.Marshallable.CopyInN. 1758 func (n *NV_MEMORY_DESC_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1759 // Construct a slice backed by dst's underlying memory. 1760 var buf []byte 1761 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1762 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1763 hdr.Len = n.SizeBytes() 1764 hdr.Cap = n.SizeBytes() 1765 1766 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1767 // Since we bypassed the compiler's escape analysis, indicate that n 1768 // must live until the use above. 1769 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1770 return length, err 1771 } 1772 1773 // CopyIn implements marshal.Marshallable.CopyIn. 1774 func (n *NV_MEMORY_DESC_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1775 return n.CopyInN(cc, addr, n.SizeBytes()) 1776 } 1777 1778 // WriteTo implements io.WriterTo.WriteTo. 1779 func (n *NV_MEMORY_DESC_PARAMS) WriteTo(writer io.Writer) (int64, error) { 1780 // Construct a slice backed by dst's underlying memory. 1781 var buf []byte 1782 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1783 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1784 hdr.Len = n.SizeBytes() 1785 hdr.Cap = n.SizeBytes() 1786 1787 length, err := writer.Write(buf) 1788 // Since we bypassed the compiler's escape analysis, indicate that n 1789 // must live until the use above. 1790 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1791 return int64(length), err 1792 } 1793 1794 // SizeBytes implements marshal.Marshallable.SizeBytes. 1795 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) SizeBytes() int { 1796 return 44 + 1797 1*4 1798 } 1799 1800 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1801 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte { 1802 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Index)) 1803 dst = dst[4:] 1804 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 1805 dst = dst[4:] 1806 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VASize)) 1807 dst = dst[8:] 1808 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VAStartInternal)) 1809 dst = dst[8:] 1810 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VALimitInternal)) 1811 dst = dst[8:] 1812 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.BigPageSize)) 1813 dst = dst[4:] 1814 for idx := 0; idx < 4; idx++ { 1815 dst[0] = byte(n.Pad0[idx]) 1816 dst = dst[1:] 1817 } 1818 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VABase)) 1819 dst = dst[8:] 1820 return dst 1821 } 1822 1823 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1824 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte { 1825 n.Index = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1826 src = src[4:] 1827 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1828 src = src[4:] 1829 n.VASize = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1830 src = src[8:] 1831 n.VAStartInternal = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1832 src = src[8:] 1833 n.VALimitInternal = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1834 src = src[8:] 1835 n.BigPageSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1836 src = src[4:] 1837 for idx := 0; idx < 4; idx++ { 1838 n.Pad0[idx] = src[0] 1839 src = src[1:] 1840 } 1841 n.VABase = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1842 src = src[8:] 1843 return src 1844 } 1845 1846 // Packed implements marshal.Marshallable.Packed. 1847 //go:nosplit 1848 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) Packed() bool { 1849 return true 1850 } 1851 1852 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1853 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte { 1854 size := n.SizeBytes() 1855 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 1856 return dst[size:] 1857 } 1858 1859 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1860 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte { 1861 size := n.SizeBytes() 1862 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 1863 return src[size:] 1864 } 1865 1866 // CopyOutN implements marshal.Marshallable.CopyOutN. 1867 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1868 // Construct a slice backed by dst's underlying memory. 1869 var buf []byte 1870 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1871 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1872 hdr.Len = n.SizeBytes() 1873 hdr.Cap = n.SizeBytes() 1874 1875 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1876 // Since we bypassed the compiler's escape analysis, indicate that n 1877 // must live until the use above. 1878 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1879 return length, err 1880 } 1881 1882 // CopyOut implements marshal.Marshallable.CopyOut. 1883 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1884 return n.CopyOutN(cc, addr, n.SizeBytes()) 1885 } 1886 1887 // CopyInN implements marshal.Marshallable.CopyInN. 1888 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1889 // Construct a slice backed by dst's underlying memory. 1890 var buf []byte 1891 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1892 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1893 hdr.Len = n.SizeBytes() 1894 hdr.Cap = n.SizeBytes() 1895 1896 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1897 // Since we bypassed the compiler's escape analysis, indicate that n 1898 // must live until the use above. 1899 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1900 return length, err 1901 } 1902 1903 // CopyIn implements marshal.Marshallable.CopyIn. 1904 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1905 return n.CopyInN(cc, addr, n.SizeBytes()) 1906 } 1907 1908 // WriteTo implements io.WriterTo.WriteTo. 1909 func (n *NV_VASPACE_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) { 1910 // Construct a slice backed by dst's underlying memory. 1911 var buf []byte 1912 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1913 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1914 hdr.Len = n.SizeBytes() 1915 hdr.Cap = n.SizeBytes() 1916 1917 length, err := writer.Write(buf) 1918 // Since we bypassed the compiler's escape analysis, indicate that n 1919 // must live until the use above. 1920 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1921 return int64(length), err 1922 } 1923 1924 // SizeBytes implements marshal.Marshallable.SizeBytes. 1925 func (n *nv00f8Map) SizeBytes() int { 1926 return 12 + 1927 (*Handle)(nil).SizeBytes() 1928 } 1929 1930 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1931 func (n *nv00f8Map) MarshalBytes(dst []byte) []byte { 1932 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.offset)) 1933 dst = dst[8:] 1934 dst = n.hVidMem.MarshalUnsafe(dst) 1935 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.flags)) 1936 dst = dst[4:] 1937 return dst 1938 } 1939 1940 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1941 func (n *nv00f8Map) UnmarshalBytes(src []byte) []byte { 1942 n.offset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1943 src = src[8:] 1944 src = n.hVidMem.UnmarshalUnsafe(src) 1945 n.flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1946 src = src[4:] 1947 return src 1948 } 1949 1950 // Packed implements marshal.Marshallable.Packed. 1951 //go:nosplit 1952 func (n *nv00f8Map) Packed() bool { 1953 return n.hVidMem.Packed() 1954 } 1955 1956 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1957 func (n *nv00f8Map) MarshalUnsafe(dst []byte) []byte { 1958 if n.hVidMem.Packed() { 1959 size := n.SizeBytes() 1960 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 1961 return dst[size:] 1962 } 1963 // Type nv00f8Map doesn't have a packed layout in memory, fallback to MarshalBytes. 1964 return n.MarshalBytes(dst) 1965 } 1966 1967 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1968 func (n *nv00f8Map) UnmarshalUnsafe(src []byte) []byte { 1969 if n.hVidMem.Packed() { 1970 size := n.SizeBytes() 1971 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 1972 return src[size:] 1973 } 1974 // Type nv00f8Map doesn't have a packed layout in memory, fallback to UnmarshalBytes. 1975 return n.UnmarshalBytes(src) 1976 } 1977 1978 // CopyOutN implements marshal.Marshallable.CopyOutN. 1979 func (n *nv00f8Map) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1980 if !n.hVidMem.Packed() { 1981 // Type nv00f8Map doesn't have a packed layout in memory, fall back to MarshalBytes. 1982 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 1983 n.MarshalBytes(buf) // escapes: fallback. 1984 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1985 } 1986 1987 // Construct a slice backed by dst's underlying memory. 1988 var buf []byte 1989 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1990 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 1991 hdr.Len = n.SizeBytes() 1992 hdr.Cap = n.SizeBytes() 1993 1994 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1995 // Since we bypassed the compiler's escape analysis, indicate that n 1996 // must live until the use above. 1997 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 1998 return length, err 1999 } 2000 2001 // CopyOut implements marshal.Marshallable.CopyOut. 2002 func (n *nv00f8Map) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2003 return n.CopyOutN(cc, addr, n.SizeBytes()) 2004 } 2005 2006 // CopyInN implements marshal.Marshallable.CopyInN. 2007 func (n *nv00f8Map) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2008 if !n.hVidMem.Packed() { 2009 // Type nv00f8Map doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2010 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 2011 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2012 // Unmarshal unconditionally. If we had a short copy-in, this results in a 2013 // partially unmarshalled struct. 2014 n.UnmarshalBytes(buf) // escapes: fallback. 2015 return length, err 2016 } 2017 2018 // Construct a slice backed by dst's underlying memory. 2019 var buf []byte 2020 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2021 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2022 hdr.Len = n.SizeBytes() 2023 hdr.Cap = n.SizeBytes() 2024 2025 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2026 // Since we bypassed the compiler's escape analysis, indicate that n 2027 // must live until the use above. 2028 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2029 return length, err 2030 } 2031 2032 // CopyIn implements marshal.Marshallable.CopyIn. 2033 func (n *nv00f8Map) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2034 return n.CopyInN(cc, addr, n.SizeBytes()) 2035 } 2036 2037 // WriteTo implements io.WriterTo.WriteTo. 2038 func (n *nv00f8Map) WriteTo(writer io.Writer) (int64, error) { 2039 if !n.hVidMem.Packed() { 2040 // Type nv00f8Map doesn't have a packed layout in memory, fall back to MarshalBytes. 2041 buf := make([]byte, n.SizeBytes()) 2042 n.MarshalBytes(buf) 2043 length, err := writer.Write(buf) 2044 return int64(length), err 2045 } 2046 2047 // Construct a slice backed by dst's underlying memory. 2048 var buf []byte 2049 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2050 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2051 hdr.Len = n.SizeBytes() 2052 hdr.Cap = n.SizeBytes() 2053 2054 length, err := writer.Write(buf) 2055 // Since we bypassed the compiler's escape analysis, indicate that n 2056 // must live until the use above. 2057 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2058 return int64(length), err 2059 } 2060 2061 // SizeBytes implements marshal.Marshallable.SizeBytes. 2062 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) SizeBytes() int { 2063 return 12 + 2064 1*4 + 2065 (*P64)(nil).SizeBytes() + 2066 (*P64)(nil).SizeBytes() + 2067 (*P64)(nil).SizeBytes() 2068 } 2069 2070 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2071 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) MarshalBytes(dst []byte) []byte { 2072 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SizeOfStrings)) 2073 dst = dst[4:] 2074 for idx := 0; idx < 4; idx++ { 2075 dst[0] = byte(n.Pad[idx]) 2076 dst = dst[1:] 2077 } 2078 dst = n.PDriverVersionBuffer.MarshalUnsafe(dst) 2079 dst = n.PVersionBuffer.MarshalUnsafe(dst) 2080 dst = n.PTitleBuffer.MarshalUnsafe(dst) 2081 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ChangelistNumber)) 2082 dst = dst[4:] 2083 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.OfficialChangelistNumber)) 2084 dst = dst[4:] 2085 return dst 2086 } 2087 2088 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2089 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) UnmarshalBytes(src []byte) []byte { 2090 n.SizeOfStrings = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2091 src = src[4:] 2092 for idx := 0; idx < 4; idx++ { 2093 n.Pad[idx] = src[0] 2094 src = src[1:] 2095 } 2096 src = n.PDriverVersionBuffer.UnmarshalUnsafe(src) 2097 src = n.PVersionBuffer.UnmarshalUnsafe(src) 2098 src = n.PTitleBuffer.UnmarshalUnsafe(src) 2099 n.ChangelistNumber = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2100 src = src[4:] 2101 n.OfficialChangelistNumber = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2102 src = src[4:] 2103 return src 2104 } 2105 2106 // Packed implements marshal.Marshallable.Packed. 2107 //go:nosplit 2108 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) Packed() bool { 2109 return n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() 2110 } 2111 2112 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2113 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) MarshalUnsafe(dst []byte) []byte { 2114 if n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() { 2115 size := n.SizeBytes() 2116 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 2117 return dst[size:] 2118 } 2119 // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 2120 return n.MarshalBytes(dst) 2121 } 2122 2123 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2124 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) UnmarshalUnsafe(src []byte) []byte { 2125 if n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() { 2126 size := n.SizeBytes() 2127 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 2128 return src[size:] 2129 } 2130 // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 2131 return n.UnmarshalBytes(src) 2132 } 2133 2134 // CopyOutN implements marshal.Marshallable.CopyOutN. 2135 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2136 if !n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() { 2137 // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 2138 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 2139 n.MarshalBytes(buf) // escapes: fallback. 2140 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2141 } 2142 2143 // Construct a slice backed by dst's underlying memory. 2144 var buf []byte 2145 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2146 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2147 hdr.Len = n.SizeBytes() 2148 hdr.Cap = n.SizeBytes() 2149 2150 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2151 // Since we bypassed the compiler's escape analysis, indicate that n 2152 // must live until the use above. 2153 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2154 return length, err 2155 } 2156 2157 // CopyOut implements marshal.Marshallable.CopyOut. 2158 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2159 return n.CopyOutN(cc, addr, n.SizeBytes()) 2160 } 2161 2162 // CopyInN implements marshal.Marshallable.CopyInN. 2163 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2164 if !n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() { 2165 // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2166 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 2167 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2168 // Unmarshal unconditionally. If we had a short copy-in, this results in a 2169 // partially unmarshalled struct. 2170 n.UnmarshalBytes(buf) // escapes: fallback. 2171 return length, err 2172 } 2173 2174 // Construct a slice backed by dst's underlying memory. 2175 var buf []byte 2176 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2177 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2178 hdr.Len = n.SizeBytes() 2179 hdr.Cap = n.SizeBytes() 2180 2181 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2182 // Since we bypassed the compiler's escape analysis, indicate that n 2183 // must live until the use above. 2184 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2185 return length, err 2186 } 2187 2188 // CopyIn implements marshal.Marshallable.CopyIn. 2189 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2190 return n.CopyInN(cc, addr, n.SizeBytes()) 2191 } 2192 2193 // WriteTo implements io.WriterTo.WriteTo. 2194 func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) WriteTo(writer io.Writer) (int64, error) { 2195 if !n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() { 2196 // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 2197 buf := make([]byte, n.SizeBytes()) 2198 n.MarshalBytes(buf) 2199 length, err := writer.Write(buf) 2200 return int64(length), err 2201 } 2202 2203 // Construct a slice backed by dst's underlying memory. 2204 var buf []byte 2205 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2206 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2207 hdr.Len = n.SizeBytes() 2208 hdr.Cap = n.SizeBytes() 2209 2210 length, err := writer.Write(buf) 2211 // Since we bypassed the compiler's escape analysis, indicate that n 2212 // must live until the use above. 2213 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2214 return int64(length), err 2215 } 2216 2217 // SizeBytes implements marshal.Marshallable.SizeBytes. 2218 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) SizeBytes() int { 2219 return 4 + 2220 1*4 + 2221 (*P64)(nil).SizeBytes() + 2222 (*P64)(nil).SizeBytes() 2223 } 2224 2225 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2226 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) MarshalBytes(dst []byte) []byte { 2227 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NumChannels)) 2228 dst = dst[4:] 2229 for idx := 0; idx < 4; idx++ { 2230 dst[0] = byte(n.Pad[idx]) 2231 dst = dst[1:] 2232 } 2233 dst = n.PChannelHandleList.MarshalUnsafe(dst) 2234 dst = n.PChannelList.MarshalUnsafe(dst) 2235 return dst 2236 } 2237 2238 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2239 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) UnmarshalBytes(src []byte) []byte { 2240 n.NumChannels = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2241 src = src[4:] 2242 for idx := 0; idx < 4; idx++ { 2243 n.Pad[idx] = src[0] 2244 src = src[1:] 2245 } 2246 src = n.PChannelHandleList.UnmarshalUnsafe(src) 2247 src = n.PChannelList.UnmarshalUnsafe(src) 2248 return src 2249 } 2250 2251 // Packed implements marshal.Marshallable.Packed. 2252 //go:nosplit 2253 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) Packed() bool { 2254 return n.PChannelHandleList.Packed() && n.PChannelList.Packed() 2255 } 2256 2257 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2258 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) MarshalUnsafe(dst []byte) []byte { 2259 if n.PChannelHandleList.Packed() && n.PChannelList.Packed() { 2260 size := n.SizeBytes() 2261 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 2262 return dst[size:] 2263 } 2264 // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 2265 return n.MarshalBytes(dst) 2266 } 2267 2268 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2269 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) UnmarshalUnsafe(src []byte) []byte { 2270 if n.PChannelHandleList.Packed() && n.PChannelList.Packed() { 2271 size := n.SizeBytes() 2272 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 2273 return src[size:] 2274 } 2275 // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 2276 return n.UnmarshalBytes(src) 2277 } 2278 2279 // CopyOutN implements marshal.Marshallable.CopyOutN. 2280 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2281 if !n.PChannelHandleList.Packed() && n.PChannelList.Packed() { 2282 // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 2283 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 2284 n.MarshalBytes(buf) // escapes: fallback. 2285 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2286 } 2287 2288 // Construct a slice backed by dst's underlying memory. 2289 var buf []byte 2290 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2291 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2292 hdr.Len = n.SizeBytes() 2293 hdr.Cap = n.SizeBytes() 2294 2295 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2296 // Since we bypassed the compiler's escape analysis, indicate that n 2297 // must live until the use above. 2298 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2299 return length, err 2300 } 2301 2302 // CopyOut implements marshal.Marshallable.CopyOut. 2303 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2304 return n.CopyOutN(cc, addr, n.SizeBytes()) 2305 } 2306 2307 // CopyInN implements marshal.Marshallable.CopyInN. 2308 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2309 if !n.PChannelHandleList.Packed() && n.PChannelList.Packed() { 2310 // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2311 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 2312 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2313 // Unmarshal unconditionally. If we had a short copy-in, this results in a 2314 // partially unmarshalled struct. 2315 n.UnmarshalBytes(buf) // escapes: fallback. 2316 return length, err 2317 } 2318 2319 // Construct a slice backed by dst's underlying memory. 2320 var buf []byte 2321 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2322 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2323 hdr.Len = n.SizeBytes() 2324 hdr.Cap = n.SizeBytes() 2325 2326 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2327 // Since we bypassed the compiler's escape analysis, indicate that n 2328 // must live until the use above. 2329 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2330 return length, err 2331 } 2332 2333 // CopyIn implements marshal.Marshallable.CopyIn. 2334 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2335 return n.CopyInN(cc, addr, n.SizeBytes()) 2336 } 2337 2338 // WriteTo implements io.WriterTo.WriteTo. 2339 func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) WriteTo(writer io.Writer) (int64, error) { 2340 if !n.PChannelHandleList.Packed() && n.PChannelList.Packed() { 2341 // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 2342 buf := make([]byte, n.SizeBytes()) 2343 n.MarshalBytes(buf) 2344 length, err := writer.Write(buf) 2345 return int64(length), err 2346 } 2347 2348 // Construct a slice backed by dst's underlying memory. 2349 var buf []byte 2350 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2351 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2352 hdr.Len = n.SizeBytes() 2353 hdr.Cap = n.SizeBytes() 2354 2355 length, err := writer.Write(buf) 2356 // Since we bypassed the compiler's escape analysis, indicate that n 2357 // must live until the use above. 2358 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2359 return int64(length), err 2360 } 2361 2362 // SizeBytes implements marshal.Marshallable.SizeBytes. 2363 func (n *NV0080_CTRL_GR_ROUTE_INFO) SizeBytes() int { 2364 return 12 + 2365 1*4 2366 } 2367 2368 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2369 func (n *NV0080_CTRL_GR_ROUTE_INFO) MarshalBytes(dst []byte) []byte { 2370 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 2371 dst = dst[4:] 2372 for idx := 0; idx < 4; idx++ { 2373 dst[0] = byte(n.Pad[idx]) 2374 dst = dst[1:] 2375 } 2376 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Route)) 2377 dst = dst[8:] 2378 return dst 2379 } 2380 2381 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2382 func (n *NV0080_CTRL_GR_ROUTE_INFO) UnmarshalBytes(src []byte) []byte { 2383 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2384 src = src[4:] 2385 for idx := 0; idx < 4; idx++ { 2386 n.Pad[idx] = src[0] 2387 src = src[1:] 2388 } 2389 n.Route = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2390 src = src[8:] 2391 return src 2392 } 2393 2394 // Packed implements marshal.Marshallable.Packed. 2395 //go:nosplit 2396 func (n *NV0080_CTRL_GR_ROUTE_INFO) Packed() bool { 2397 return true 2398 } 2399 2400 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2401 func (n *NV0080_CTRL_GR_ROUTE_INFO) MarshalUnsafe(dst []byte) []byte { 2402 size := n.SizeBytes() 2403 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 2404 return dst[size:] 2405 } 2406 2407 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2408 func (n *NV0080_CTRL_GR_ROUTE_INFO) UnmarshalUnsafe(src []byte) []byte { 2409 size := n.SizeBytes() 2410 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 2411 return src[size:] 2412 } 2413 2414 // CopyOutN implements marshal.Marshallable.CopyOutN. 2415 func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2416 // Construct a slice backed by dst's underlying memory. 2417 var buf []byte 2418 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2419 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2420 hdr.Len = n.SizeBytes() 2421 hdr.Cap = n.SizeBytes() 2422 2423 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2424 // Since we bypassed the compiler's escape analysis, indicate that n 2425 // must live until the use above. 2426 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2427 return length, err 2428 } 2429 2430 // CopyOut implements marshal.Marshallable.CopyOut. 2431 func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2432 return n.CopyOutN(cc, addr, n.SizeBytes()) 2433 } 2434 2435 // CopyInN implements marshal.Marshallable.CopyInN. 2436 func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2437 // Construct a slice backed by dst's underlying memory. 2438 var buf []byte 2439 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2440 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2441 hdr.Len = n.SizeBytes() 2442 hdr.Cap = n.SizeBytes() 2443 2444 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2445 // Since we bypassed the compiler's escape analysis, indicate that n 2446 // must live until the use above. 2447 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2448 return length, err 2449 } 2450 2451 // CopyIn implements marshal.Marshallable.CopyIn. 2452 func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2453 return n.CopyInN(cc, addr, n.SizeBytes()) 2454 } 2455 2456 // WriteTo implements io.WriterTo.WriteTo. 2457 func (n *NV0080_CTRL_GR_ROUTE_INFO) WriteTo(writer io.Writer) (int64, error) { 2458 // Construct a slice backed by dst's underlying memory. 2459 var buf []byte 2460 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2461 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2462 hdr.Len = n.SizeBytes() 2463 hdr.Cap = n.SizeBytes() 2464 2465 length, err := writer.Write(buf) 2466 // Since we bypassed the compiler's escape analysis, indicate that n 2467 // must live until the use above. 2468 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2469 return int64(length), err 2470 } 2471 2472 // SizeBytes implements marshal.Marshallable.SizeBytes. 2473 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) SizeBytes() int { 2474 return 7 + 2475 1*3 + 2476 1*6 + 2477 (*P64)(nil).SizeBytes() + 2478 (*Handle)(nil).SizeBytes()*NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES + 2479 (*Handle)(nil).SizeBytes()*NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES 2480 } 2481 2482 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2483 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) MarshalBytes(dst []byte) []byte { 2484 dst[0] = byte(n.BDisable) 2485 dst = dst[1:] 2486 for idx := 0; idx < 3; idx++ { 2487 dst[0] = byte(n.Pad1[idx]) 2488 dst = dst[1:] 2489 } 2490 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NumChannels)) 2491 dst = dst[4:] 2492 dst[0] = byte(n.BOnlyDisableScheduling) 2493 dst = dst[1:] 2494 dst[0] = byte(n.BRewindGpPut) 2495 dst = dst[1:] 2496 for idx := 0; idx < 6; idx++ { 2497 dst[0] = byte(n.Pad2[idx]) 2498 dst = dst[1:] 2499 } 2500 dst = n.PRunlistPreemptEvent.MarshalUnsafe(dst) 2501 for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ { 2502 dst = n.HClientList[idx].MarshalUnsafe(dst) 2503 } 2504 for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ { 2505 dst = n.HChannelList[idx].MarshalUnsafe(dst) 2506 } 2507 return dst 2508 } 2509 2510 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2511 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) UnmarshalBytes(src []byte) []byte { 2512 n.BDisable = uint8(src[0]) 2513 src = src[1:] 2514 for idx := 0; idx < 3; idx++ { 2515 n.Pad1[idx] = src[0] 2516 src = src[1:] 2517 } 2518 n.NumChannels = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2519 src = src[4:] 2520 n.BOnlyDisableScheduling = uint8(src[0]) 2521 src = src[1:] 2522 n.BRewindGpPut = uint8(src[0]) 2523 src = src[1:] 2524 for idx := 0; idx < 6; idx++ { 2525 n.Pad2[idx] = src[0] 2526 src = src[1:] 2527 } 2528 src = n.PRunlistPreemptEvent.UnmarshalUnsafe(src) 2529 for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ { 2530 src = n.HClientList[idx].UnmarshalUnsafe(src) 2531 } 2532 for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ { 2533 src = n.HChannelList[idx].UnmarshalUnsafe(src) 2534 } 2535 return src 2536 } 2537 2538 // Packed implements marshal.Marshallable.Packed. 2539 //go:nosplit 2540 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) Packed() bool { 2541 return n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() 2542 } 2543 2544 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2545 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) MarshalUnsafe(dst []byte) []byte { 2546 if n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() { 2547 size := n.SizeBytes() 2548 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 2549 return dst[size:] 2550 } 2551 // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 2552 return n.MarshalBytes(dst) 2553 } 2554 2555 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2556 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) UnmarshalUnsafe(src []byte) []byte { 2557 if n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() { 2558 size := n.SizeBytes() 2559 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 2560 return src[size:] 2561 } 2562 // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 2563 return n.UnmarshalBytes(src) 2564 } 2565 2566 // CopyOutN implements marshal.Marshallable.CopyOutN. 2567 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2568 if !n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() { 2569 // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 2570 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 2571 n.MarshalBytes(buf) // escapes: fallback. 2572 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2573 } 2574 2575 // Construct a slice backed by dst's underlying memory. 2576 var buf []byte 2577 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2578 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2579 hdr.Len = n.SizeBytes() 2580 hdr.Cap = n.SizeBytes() 2581 2582 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2583 // Since we bypassed the compiler's escape analysis, indicate that n 2584 // must live until the use above. 2585 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2586 return length, err 2587 } 2588 2589 // CopyOut implements marshal.Marshallable.CopyOut. 2590 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2591 return n.CopyOutN(cc, addr, n.SizeBytes()) 2592 } 2593 2594 // CopyInN implements marshal.Marshallable.CopyInN. 2595 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2596 if !n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() { 2597 // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2598 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 2599 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2600 // Unmarshal unconditionally. If we had a short copy-in, this results in a 2601 // partially unmarshalled struct. 2602 n.UnmarshalBytes(buf) // escapes: fallback. 2603 return length, err 2604 } 2605 2606 // Construct a slice backed by dst's underlying memory. 2607 var buf []byte 2608 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2609 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2610 hdr.Len = n.SizeBytes() 2611 hdr.Cap = n.SizeBytes() 2612 2613 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2614 // Since we bypassed the compiler's escape analysis, indicate that n 2615 // must live until the use above. 2616 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2617 return length, err 2618 } 2619 2620 // CopyIn implements marshal.Marshallable.CopyIn. 2621 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2622 return n.CopyInN(cc, addr, n.SizeBytes()) 2623 } 2624 2625 // WriteTo implements io.WriterTo.WriteTo. 2626 func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) WriteTo(writer io.Writer) (int64, error) { 2627 if !n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() { 2628 // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 2629 buf := make([]byte, n.SizeBytes()) 2630 n.MarshalBytes(buf) 2631 length, err := writer.Write(buf) 2632 return int64(length), err 2633 } 2634 2635 // Construct a slice backed by dst's underlying memory. 2636 var buf []byte 2637 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2638 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2639 hdr.Len = n.SizeBytes() 2640 hdr.Cap = n.SizeBytes() 2641 2642 length, err := writer.Write(buf) 2643 // Since we bypassed the compiler's escape analysis, indicate that n 2644 // must live until the use above. 2645 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2646 return int64(length), err 2647 } 2648 2649 // SizeBytes implements marshal.Marshallable.SizeBytes. 2650 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) SizeBytes() int { 2651 return 4 + 2652 1*4 + 2653 (*P64)(nil).SizeBytes() + 2654 (*NV0080_CTRL_GR_ROUTE_INFO)(nil).SizeBytes() 2655 } 2656 2657 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2658 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) MarshalBytes(dst []byte) []byte { 2659 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.GRInfoListSize)) 2660 dst = dst[4:] 2661 for idx := 0; idx < 4; idx++ { 2662 dst[0] = byte(n.Pad[idx]) 2663 dst = dst[1:] 2664 } 2665 dst = n.GRInfoList.MarshalUnsafe(dst) 2666 dst = n.GRRouteInfo.MarshalUnsafe(dst) 2667 return dst 2668 } 2669 2670 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2671 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) UnmarshalBytes(src []byte) []byte { 2672 n.GRInfoListSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2673 src = src[4:] 2674 for idx := 0; idx < 4; idx++ { 2675 n.Pad[idx] = src[0] 2676 src = src[1:] 2677 } 2678 src = n.GRInfoList.UnmarshalUnsafe(src) 2679 src = n.GRRouteInfo.UnmarshalUnsafe(src) 2680 return src 2681 } 2682 2683 // Packed implements marshal.Marshallable.Packed. 2684 //go:nosplit 2685 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) Packed() bool { 2686 return n.GRInfoList.Packed() && n.GRRouteInfo.Packed() 2687 } 2688 2689 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2690 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) MarshalUnsafe(dst []byte) []byte { 2691 if n.GRInfoList.Packed() && n.GRRouteInfo.Packed() { 2692 size := n.SizeBytes() 2693 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 2694 return dst[size:] 2695 } 2696 // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 2697 return n.MarshalBytes(dst) 2698 } 2699 2700 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2701 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) UnmarshalUnsafe(src []byte) []byte { 2702 if n.GRInfoList.Packed() && n.GRRouteInfo.Packed() { 2703 size := n.SizeBytes() 2704 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 2705 return src[size:] 2706 } 2707 // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 2708 return n.UnmarshalBytes(src) 2709 } 2710 2711 // CopyOutN implements marshal.Marshallable.CopyOutN. 2712 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2713 if !n.GRInfoList.Packed() && n.GRRouteInfo.Packed() { 2714 // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 2715 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 2716 n.MarshalBytes(buf) // escapes: fallback. 2717 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2718 } 2719 2720 // Construct a slice backed by dst's underlying memory. 2721 var buf []byte 2722 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2723 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2724 hdr.Len = n.SizeBytes() 2725 hdr.Cap = n.SizeBytes() 2726 2727 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2728 // Since we bypassed the compiler's escape analysis, indicate that n 2729 // must live until the use above. 2730 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2731 return length, err 2732 } 2733 2734 // CopyOut implements marshal.Marshallable.CopyOut. 2735 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2736 return n.CopyOutN(cc, addr, n.SizeBytes()) 2737 } 2738 2739 // CopyInN implements marshal.Marshallable.CopyInN. 2740 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2741 if !n.GRInfoList.Packed() && n.GRRouteInfo.Packed() { 2742 // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2743 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 2744 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2745 // Unmarshal unconditionally. If we had a short copy-in, this results in a 2746 // partially unmarshalled struct. 2747 n.UnmarshalBytes(buf) // escapes: fallback. 2748 return length, err 2749 } 2750 2751 // Construct a slice backed by dst's underlying memory. 2752 var buf []byte 2753 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2754 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2755 hdr.Len = n.SizeBytes() 2756 hdr.Cap = n.SizeBytes() 2757 2758 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2759 // Since we bypassed the compiler's escape analysis, indicate that n 2760 // must live until the use above. 2761 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2762 return length, err 2763 } 2764 2765 // CopyIn implements marshal.Marshallable.CopyIn. 2766 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2767 return n.CopyInN(cc, addr, n.SizeBytes()) 2768 } 2769 2770 // WriteTo implements io.WriterTo.WriteTo. 2771 func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) WriteTo(writer io.Writer) (int64, error) { 2772 if !n.GRInfoList.Packed() && n.GRRouteInfo.Packed() { 2773 // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 2774 buf := make([]byte, n.SizeBytes()) 2775 n.MarshalBytes(buf) 2776 length, err := writer.Write(buf) 2777 return int64(length), err 2778 } 2779 2780 // Construct a slice backed by dst's underlying memory. 2781 var buf []byte 2782 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2783 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2784 hdr.Len = n.SizeBytes() 2785 hdr.Cap = n.SizeBytes() 2786 2787 length, err := writer.Write(buf) 2788 // Since we bypassed the compiler's escape analysis, indicate that n 2789 // must live until the use above. 2790 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2791 return int64(length), err 2792 } 2793 2794 // SizeBytes implements marshal.Marshallable.SizeBytes. 2795 func (n *NVXXXX_CTRL_XXX_INFO) SizeBytes() int { 2796 return 8 2797 } 2798 2799 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2800 func (n *NVXXXX_CTRL_XXX_INFO) MarshalBytes(dst []byte) []byte { 2801 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Index)) 2802 dst = dst[4:] 2803 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Data)) 2804 dst = dst[4:] 2805 return dst 2806 } 2807 2808 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2809 func (n *NVXXXX_CTRL_XXX_INFO) UnmarshalBytes(src []byte) []byte { 2810 n.Index = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2811 src = src[4:] 2812 n.Data = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2813 src = src[4:] 2814 return src 2815 } 2816 2817 // Packed implements marshal.Marshallable.Packed. 2818 //go:nosplit 2819 func (n *NVXXXX_CTRL_XXX_INFO) Packed() bool { 2820 return true 2821 } 2822 2823 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2824 func (n *NVXXXX_CTRL_XXX_INFO) MarshalUnsafe(dst []byte) []byte { 2825 size := n.SizeBytes() 2826 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 2827 return dst[size:] 2828 } 2829 2830 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2831 func (n *NVXXXX_CTRL_XXX_INFO) UnmarshalUnsafe(src []byte) []byte { 2832 size := n.SizeBytes() 2833 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 2834 return src[size:] 2835 } 2836 2837 // CopyOutN implements marshal.Marshallable.CopyOutN. 2838 func (n *NVXXXX_CTRL_XXX_INFO) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2839 // Construct a slice backed by dst's underlying memory. 2840 var buf []byte 2841 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2842 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2843 hdr.Len = n.SizeBytes() 2844 hdr.Cap = n.SizeBytes() 2845 2846 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2847 // Since we bypassed the compiler's escape analysis, indicate that n 2848 // must live until the use above. 2849 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2850 return length, err 2851 } 2852 2853 // CopyOut implements marshal.Marshallable.CopyOut. 2854 func (n *NVXXXX_CTRL_XXX_INFO) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2855 return n.CopyOutN(cc, addr, n.SizeBytes()) 2856 } 2857 2858 // CopyInN implements marshal.Marshallable.CopyInN. 2859 func (n *NVXXXX_CTRL_XXX_INFO) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2860 // Construct a slice backed by dst's underlying memory. 2861 var buf []byte 2862 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2863 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2864 hdr.Len = n.SizeBytes() 2865 hdr.Cap = n.SizeBytes() 2866 2867 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2868 // Since we bypassed the compiler's escape analysis, indicate that n 2869 // must live until the use above. 2870 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2871 return length, err 2872 } 2873 2874 // CopyIn implements marshal.Marshallable.CopyIn. 2875 func (n *NVXXXX_CTRL_XXX_INFO) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2876 return n.CopyInN(cc, addr, n.SizeBytes()) 2877 } 2878 2879 // WriteTo implements io.WriterTo.WriteTo. 2880 func (n *NVXXXX_CTRL_XXX_INFO) WriteTo(writer io.Writer) (int64, error) { 2881 // Construct a slice backed by dst's underlying memory. 2882 var buf []byte 2883 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2884 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 2885 hdr.Len = n.SizeBytes() 2886 hdr.Cap = n.SizeBytes() 2887 2888 length, err := writer.Write(buf) 2889 // Since we bypassed the compiler's escape analysis, indicate that n 2890 // must live until the use above. 2891 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 2892 return int64(length), err 2893 } 2894 2895 // SizeBytes implements marshal.Marshallable.SizeBytes. 2896 func (i *IoctlAllocOSEvent) SizeBytes() int { 2897 return 8 + 2898 (*Handle)(nil).SizeBytes() + 2899 (*Handle)(nil).SizeBytes() 2900 } 2901 2902 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2903 func (i *IoctlAllocOSEvent) MarshalBytes(dst []byte) []byte { 2904 dst = i.HClient.MarshalUnsafe(dst) 2905 dst = i.HDevice.MarshalUnsafe(dst) 2906 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD)) 2907 dst = dst[4:] 2908 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Status)) 2909 dst = dst[4:] 2910 return dst 2911 } 2912 2913 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2914 func (i *IoctlAllocOSEvent) UnmarshalBytes(src []byte) []byte { 2915 src = i.HClient.UnmarshalUnsafe(src) 2916 src = i.HDevice.UnmarshalUnsafe(src) 2917 i.FD = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2918 src = src[4:] 2919 i.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2920 src = src[4:] 2921 return src 2922 } 2923 2924 // Packed implements marshal.Marshallable.Packed. 2925 //go:nosplit 2926 func (i *IoctlAllocOSEvent) Packed() bool { 2927 return i.HClient.Packed() && i.HDevice.Packed() 2928 } 2929 2930 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2931 func (i *IoctlAllocOSEvent) MarshalUnsafe(dst []byte) []byte { 2932 if i.HClient.Packed() && i.HDevice.Packed() { 2933 size := i.SizeBytes() 2934 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 2935 return dst[size:] 2936 } 2937 // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fallback to MarshalBytes. 2938 return i.MarshalBytes(dst) 2939 } 2940 2941 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2942 func (i *IoctlAllocOSEvent) UnmarshalUnsafe(src []byte) []byte { 2943 if i.HClient.Packed() && i.HDevice.Packed() { 2944 size := i.SizeBytes() 2945 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 2946 return src[size:] 2947 } 2948 // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fallback to UnmarshalBytes. 2949 return i.UnmarshalBytes(src) 2950 } 2951 2952 // CopyOutN implements marshal.Marshallable.CopyOutN. 2953 func (i *IoctlAllocOSEvent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2954 if !i.HClient.Packed() && i.HDevice.Packed() { 2955 // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes. 2956 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 2957 i.MarshalBytes(buf) // escapes: fallback. 2958 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2959 } 2960 2961 // Construct a slice backed by dst's underlying memory. 2962 var buf []byte 2963 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2964 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 2965 hdr.Len = i.SizeBytes() 2966 hdr.Cap = i.SizeBytes() 2967 2968 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2969 // Since we bypassed the compiler's escape analysis, indicate that i 2970 // must live until the use above. 2971 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 2972 return length, err 2973 } 2974 2975 // CopyOut implements marshal.Marshallable.CopyOut. 2976 func (i *IoctlAllocOSEvent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2977 return i.CopyOutN(cc, addr, i.SizeBytes()) 2978 } 2979 2980 // CopyInN implements marshal.Marshallable.CopyInN. 2981 func (i *IoctlAllocOSEvent) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2982 if !i.HClient.Packed() && i.HDevice.Packed() { 2983 // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2984 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 2985 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2986 // Unmarshal unconditionally. If we had a short copy-in, this results in a 2987 // partially unmarshalled struct. 2988 i.UnmarshalBytes(buf) // escapes: fallback. 2989 return length, err 2990 } 2991 2992 // Construct a slice backed by dst's underlying memory. 2993 var buf []byte 2994 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2995 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 2996 hdr.Len = i.SizeBytes() 2997 hdr.Cap = i.SizeBytes() 2998 2999 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3000 // Since we bypassed the compiler's escape analysis, indicate that i 3001 // must live until the use above. 3002 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3003 return length, err 3004 } 3005 3006 // CopyIn implements marshal.Marshallable.CopyIn. 3007 func (i *IoctlAllocOSEvent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3008 return i.CopyInN(cc, addr, i.SizeBytes()) 3009 } 3010 3011 // WriteTo implements io.WriterTo.WriteTo. 3012 func (i *IoctlAllocOSEvent) WriteTo(writer io.Writer) (int64, error) { 3013 if !i.HClient.Packed() && i.HDevice.Packed() { 3014 // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes. 3015 buf := make([]byte, i.SizeBytes()) 3016 i.MarshalBytes(buf) 3017 length, err := writer.Write(buf) 3018 return int64(length), err 3019 } 3020 3021 // Construct a slice backed by dst's underlying memory. 3022 var buf []byte 3023 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3024 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3025 hdr.Len = i.SizeBytes() 3026 hdr.Cap = i.SizeBytes() 3027 3028 length, err := writer.Write(buf) 3029 // Since we bypassed the compiler's escape analysis, indicate that i 3030 // must live until the use above. 3031 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3032 return int64(length), err 3033 } 3034 3035 // SizeBytes implements marshal.Marshallable.SizeBytes. 3036 func (i *IoctlFreeOSEvent) SizeBytes() int { 3037 return 8 + 3038 (*Handle)(nil).SizeBytes() + 3039 (*Handle)(nil).SizeBytes() 3040 } 3041 3042 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3043 func (i *IoctlFreeOSEvent) MarshalBytes(dst []byte) []byte { 3044 dst = i.HClient.MarshalUnsafe(dst) 3045 dst = i.HDevice.MarshalUnsafe(dst) 3046 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD)) 3047 dst = dst[4:] 3048 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Status)) 3049 dst = dst[4:] 3050 return dst 3051 } 3052 3053 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3054 func (i *IoctlFreeOSEvent) UnmarshalBytes(src []byte) []byte { 3055 src = i.HClient.UnmarshalUnsafe(src) 3056 src = i.HDevice.UnmarshalUnsafe(src) 3057 i.FD = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3058 src = src[4:] 3059 i.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3060 src = src[4:] 3061 return src 3062 } 3063 3064 // Packed implements marshal.Marshallable.Packed. 3065 //go:nosplit 3066 func (i *IoctlFreeOSEvent) Packed() bool { 3067 return i.HClient.Packed() && i.HDevice.Packed() 3068 } 3069 3070 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3071 func (i *IoctlFreeOSEvent) MarshalUnsafe(dst []byte) []byte { 3072 if i.HClient.Packed() && i.HDevice.Packed() { 3073 size := i.SizeBytes() 3074 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 3075 return dst[size:] 3076 } 3077 // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fallback to MarshalBytes. 3078 return i.MarshalBytes(dst) 3079 } 3080 3081 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3082 func (i *IoctlFreeOSEvent) UnmarshalUnsafe(src []byte) []byte { 3083 if i.HClient.Packed() && i.HDevice.Packed() { 3084 size := i.SizeBytes() 3085 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 3086 return src[size:] 3087 } 3088 // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3089 return i.UnmarshalBytes(src) 3090 } 3091 3092 // CopyOutN implements marshal.Marshallable.CopyOutN. 3093 func (i *IoctlFreeOSEvent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3094 if !i.HClient.Packed() && i.HDevice.Packed() { 3095 // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes. 3096 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 3097 i.MarshalBytes(buf) // escapes: fallback. 3098 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3099 } 3100 3101 // Construct a slice backed by dst's underlying memory. 3102 var buf []byte 3103 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3104 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3105 hdr.Len = i.SizeBytes() 3106 hdr.Cap = i.SizeBytes() 3107 3108 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3109 // Since we bypassed the compiler's escape analysis, indicate that i 3110 // must live until the use above. 3111 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3112 return length, err 3113 } 3114 3115 // CopyOut implements marshal.Marshallable.CopyOut. 3116 func (i *IoctlFreeOSEvent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3117 return i.CopyOutN(cc, addr, i.SizeBytes()) 3118 } 3119 3120 // CopyInN implements marshal.Marshallable.CopyInN. 3121 func (i *IoctlFreeOSEvent) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3122 if !i.HClient.Packed() && i.HDevice.Packed() { 3123 // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3124 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 3125 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3126 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3127 // partially unmarshalled struct. 3128 i.UnmarshalBytes(buf) // escapes: fallback. 3129 return length, err 3130 } 3131 3132 // Construct a slice backed by dst's underlying memory. 3133 var buf []byte 3134 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3135 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3136 hdr.Len = i.SizeBytes() 3137 hdr.Cap = i.SizeBytes() 3138 3139 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3140 // Since we bypassed the compiler's escape analysis, indicate that i 3141 // must live until the use above. 3142 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3143 return length, err 3144 } 3145 3146 // CopyIn implements marshal.Marshallable.CopyIn. 3147 func (i *IoctlFreeOSEvent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3148 return i.CopyInN(cc, addr, i.SizeBytes()) 3149 } 3150 3151 // WriteTo implements io.WriterTo.WriteTo. 3152 func (i *IoctlFreeOSEvent) WriteTo(writer io.Writer) (int64, error) { 3153 if !i.HClient.Packed() && i.HDevice.Packed() { 3154 // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes. 3155 buf := make([]byte, i.SizeBytes()) 3156 i.MarshalBytes(buf) 3157 length, err := writer.Write(buf) 3158 return int64(length), err 3159 } 3160 3161 // Construct a slice backed by dst's underlying memory. 3162 var buf []byte 3163 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3164 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3165 hdr.Len = i.SizeBytes() 3166 hdr.Cap = i.SizeBytes() 3167 3168 length, err := writer.Write(buf) 3169 // Since we bypassed the compiler's escape analysis, indicate that i 3170 // must live until the use above. 3171 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3172 return int64(length), err 3173 } 3174 3175 // SizeBytes implements marshal.Marshallable.SizeBytes. 3176 func (i *IoctlNVOS02ParametersWithFD) SizeBytes() int { 3177 return 4 + 3178 (*NVOS02Parameters)(nil).SizeBytes() + 3179 1*4 3180 } 3181 3182 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3183 func (i *IoctlNVOS02ParametersWithFD) MarshalBytes(dst []byte) []byte { 3184 dst = i.Params.MarshalUnsafe(dst) 3185 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD)) 3186 dst = dst[4:] 3187 for idx := 0; idx < 4; idx++ { 3188 dst[0] = byte(i.Pad0[idx]) 3189 dst = dst[1:] 3190 } 3191 return dst 3192 } 3193 3194 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3195 func (i *IoctlNVOS02ParametersWithFD) UnmarshalBytes(src []byte) []byte { 3196 src = i.Params.UnmarshalUnsafe(src) 3197 i.FD = int32(hostarch.ByteOrder.Uint32(src[:4])) 3198 src = src[4:] 3199 for idx := 0; idx < 4; idx++ { 3200 i.Pad0[idx] = src[0] 3201 src = src[1:] 3202 } 3203 return src 3204 } 3205 3206 // Packed implements marshal.Marshallable.Packed. 3207 //go:nosplit 3208 func (i *IoctlNVOS02ParametersWithFD) Packed() bool { 3209 return i.Params.Packed() 3210 } 3211 3212 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3213 func (i *IoctlNVOS02ParametersWithFD) MarshalUnsafe(dst []byte) []byte { 3214 if i.Params.Packed() { 3215 size := i.SizeBytes() 3216 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 3217 return dst[size:] 3218 } 3219 // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fallback to MarshalBytes. 3220 return i.MarshalBytes(dst) 3221 } 3222 3223 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3224 func (i *IoctlNVOS02ParametersWithFD) UnmarshalUnsafe(src []byte) []byte { 3225 if i.Params.Packed() { 3226 size := i.SizeBytes() 3227 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 3228 return src[size:] 3229 } 3230 // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3231 return i.UnmarshalBytes(src) 3232 } 3233 3234 // CopyOutN implements marshal.Marshallable.CopyOutN. 3235 func (i *IoctlNVOS02ParametersWithFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3236 if !i.Params.Packed() { 3237 // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes. 3238 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 3239 i.MarshalBytes(buf) // escapes: fallback. 3240 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3241 } 3242 3243 // Construct a slice backed by dst's underlying memory. 3244 var buf []byte 3245 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3246 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3247 hdr.Len = i.SizeBytes() 3248 hdr.Cap = i.SizeBytes() 3249 3250 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3251 // Since we bypassed the compiler's escape analysis, indicate that i 3252 // must live until the use above. 3253 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3254 return length, err 3255 } 3256 3257 // CopyOut implements marshal.Marshallable.CopyOut. 3258 func (i *IoctlNVOS02ParametersWithFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3259 return i.CopyOutN(cc, addr, i.SizeBytes()) 3260 } 3261 3262 // CopyInN implements marshal.Marshallable.CopyInN. 3263 func (i *IoctlNVOS02ParametersWithFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3264 if !i.Params.Packed() { 3265 // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3266 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 3267 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3268 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3269 // partially unmarshalled struct. 3270 i.UnmarshalBytes(buf) // escapes: fallback. 3271 return length, err 3272 } 3273 3274 // Construct a slice backed by dst's underlying memory. 3275 var buf []byte 3276 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3277 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3278 hdr.Len = i.SizeBytes() 3279 hdr.Cap = i.SizeBytes() 3280 3281 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3282 // Since we bypassed the compiler's escape analysis, indicate that i 3283 // must live until the use above. 3284 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3285 return length, err 3286 } 3287 3288 // CopyIn implements marshal.Marshallable.CopyIn. 3289 func (i *IoctlNVOS02ParametersWithFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3290 return i.CopyInN(cc, addr, i.SizeBytes()) 3291 } 3292 3293 // WriteTo implements io.WriterTo.WriteTo. 3294 func (i *IoctlNVOS02ParametersWithFD) WriteTo(writer io.Writer) (int64, error) { 3295 if !i.Params.Packed() { 3296 // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes. 3297 buf := make([]byte, i.SizeBytes()) 3298 i.MarshalBytes(buf) 3299 length, err := writer.Write(buf) 3300 return int64(length), err 3301 } 3302 3303 // Construct a slice backed by dst's underlying memory. 3304 var buf []byte 3305 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3306 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3307 hdr.Len = i.SizeBytes() 3308 hdr.Cap = i.SizeBytes() 3309 3310 length, err := writer.Write(buf) 3311 // Since we bypassed the compiler's escape analysis, indicate that i 3312 // must live until the use above. 3313 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3314 return int64(length), err 3315 } 3316 3317 // SizeBytes implements marshal.Marshallable.SizeBytes. 3318 func (i *IoctlNVOS33ParametersWithFD) SizeBytes() int { 3319 return 4 + 3320 (*NVOS33Parameters)(nil).SizeBytes() + 3321 1*4 3322 } 3323 3324 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3325 func (i *IoctlNVOS33ParametersWithFD) MarshalBytes(dst []byte) []byte { 3326 dst = i.Params.MarshalUnsafe(dst) 3327 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD)) 3328 dst = dst[4:] 3329 for idx := 0; idx < 4; idx++ { 3330 dst[0] = byte(i.Pad0[idx]) 3331 dst = dst[1:] 3332 } 3333 return dst 3334 } 3335 3336 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3337 func (i *IoctlNVOS33ParametersWithFD) UnmarshalBytes(src []byte) []byte { 3338 src = i.Params.UnmarshalUnsafe(src) 3339 i.FD = int32(hostarch.ByteOrder.Uint32(src[:4])) 3340 src = src[4:] 3341 for idx := 0; idx < 4; idx++ { 3342 i.Pad0[idx] = src[0] 3343 src = src[1:] 3344 } 3345 return src 3346 } 3347 3348 // Packed implements marshal.Marshallable.Packed. 3349 //go:nosplit 3350 func (i *IoctlNVOS33ParametersWithFD) Packed() bool { 3351 return i.Params.Packed() 3352 } 3353 3354 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3355 func (i *IoctlNVOS33ParametersWithFD) MarshalUnsafe(dst []byte) []byte { 3356 if i.Params.Packed() { 3357 size := i.SizeBytes() 3358 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 3359 return dst[size:] 3360 } 3361 // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fallback to MarshalBytes. 3362 return i.MarshalBytes(dst) 3363 } 3364 3365 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3366 func (i *IoctlNVOS33ParametersWithFD) UnmarshalUnsafe(src []byte) []byte { 3367 if i.Params.Packed() { 3368 size := i.SizeBytes() 3369 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 3370 return src[size:] 3371 } 3372 // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3373 return i.UnmarshalBytes(src) 3374 } 3375 3376 // CopyOutN implements marshal.Marshallable.CopyOutN. 3377 func (i *IoctlNVOS33ParametersWithFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3378 if !i.Params.Packed() { 3379 // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes. 3380 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 3381 i.MarshalBytes(buf) // escapes: fallback. 3382 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3383 } 3384 3385 // Construct a slice backed by dst's underlying memory. 3386 var buf []byte 3387 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3388 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3389 hdr.Len = i.SizeBytes() 3390 hdr.Cap = i.SizeBytes() 3391 3392 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3393 // Since we bypassed the compiler's escape analysis, indicate that i 3394 // must live until the use above. 3395 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3396 return length, err 3397 } 3398 3399 // CopyOut implements marshal.Marshallable.CopyOut. 3400 func (i *IoctlNVOS33ParametersWithFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3401 return i.CopyOutN(cc, addr, i.SizeBytes()) 3402 } 3403 3404 // CopyInN implements marshal.Marshallable.CopyInN. 3405 func (i *IoctlNVOS33ParametersWithFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3406 if !i.Params.Packed() { 3407 // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3408 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 3409 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3410 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3411 // partially unmarshalled struct. 3412 i.UnmarshalBytes(buf) // escapes: fallback. 3413 return length, err 3414 } 3415 3416 // Construct a slice backed by dst's underlying memory. 3417 var buf []byte 3418 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3419 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3420 hdr.Len = i.SizeBytes() 3421 hdr.Cap = i.SizeBytes() 3422 3423 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3424 // Since we bypassed the compiler's escape analysis, indicate that i 3425 // must live until the use above. 3426 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3427 return length, err 3428 } 3429 3430 // CopyIn implements marshal.Marshallable.CopyIn. 3431 func (i *IoctlNVOS33ParametersWithFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3432 return i.CopyInN(cc, addr, i.SizeBytes()) 3433 } 3434 3435 // WriteTo implements io.WriterTo.WriteTo. 3436 func (i *IoctlNVOS33ParametersWithFD) WriteTo(writer io.Writer) (int64, error) { 3437 if !i.Params.Packed() { 3438 // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes. 3439 buf := make([]byte, i.SizeBytes()) 3440 i.MarshalBytes(buf) 3441 length, err := writer.Write(buf) 3442 return int64(length), err 3443 } 3444 3445 // Construct a slice backed by dst's underlying memory. 3446 var buf []byte 3447 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3448 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3449 hdr.Len = i.SizeBytes() 3450 hdr.Cap = i.SizeBytes() 3451 3452 length, err := writer.Write(buf) 3453 // Since we bypassed the compiler's escape analysis, indicate that i 3454 // must live until the use above. 3455 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3456 return int64(length), err 3457 } 3458 3459 // SizeBytes implements marshal.Marshallable.SizeBytes. 3460 func (i *IoctlRegisterFD) SizeBytes() int { 3461 return 4 3462 } 3463 3464 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3465 func (i *IoctlRegisterFD) MarshalBytes(dst []byte) []byte { 3466 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CtlFD)) 3467 dst = dst[4:] 3468 return dst 3469 } 3470 3471 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3472 func (i *IoctlRegisterFD) UnmarshalBytes(src []byte) []byte { 3473 i.CtlFD = int32(hostarch.ByteOrder.Uint32(src[:4])) 3474 src = src[4:] 3475 return src 3476 } 3477 3478 // Packed implements marshal.Marshallable.Packed. 3479 //go:nosplit 3480 func (i *IoctlRegisterFD) Packed() bool { 3481 return true 3482 } 3483 3484 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3485 func (i *IoctlRegisterFD) MarshalUnsafe(dst []byte) []byte { 3486 size := i.SizeBytes() 3487 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 3488 return dst[size:] 3489 } 3490 3491 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3492 func (i *IoctlRegisterFD) UnmarshalUnsafe(src []byte) []byte { 3493 size := i.SizeBytes() 3494 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 3495 return src[size:] 3496 } 3497 3498 // CopyOutN implements marshal.Marshallable.CopyOutN. 3499 func (i *IoctlRegisterFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3500 // Construct a slice backed by dst's underlying memory. 3501 var buf []byte 3502 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3503 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3504 hdr.Len = i.SizeBytes() 3505 hdr.Cap = i.SizeBytes() 3506 3507 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3508 // Since we bypassed the compiler's escape analysis, indicate that i 3509 // must live until the use above. 3510 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3511 return length, err 3512 } 3513 3514 // CopyOut implements marshal.Marshallable.CopyOut. 3515 func (i *IoctlRegisterFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3516 return i.CopyOutN(cc, addr, i.SizeBytes()) 3517 } 3518 3519 // CopyInN implements marshal.Marshallable.CopyInN. 3520 func (i *IoctlRegisterFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3521 // Construct a slice backed by dst's underlying memory. 3522 var buf []byte 3523 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3524 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3525 hdr.Len = i.SizeBytes() 3526 hdr.Cap = i.SizeBytes() 3527 3528 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3529 // Since we bypassed the compiler's escape analysis, indicate that i 3530 // must live until the use above. 3531 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3532 return length, err 3533 } 3534 3535 // CopyIn implements marshal.Marshallable.CopyIn. 3536 func (i *IoctlRegisterFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3537 return i.CopyInN(cc, addr, i.SizeBytes()) 3538 } 3539 3540 // WriteTo implements io.WriterTo.WriteTo. 3541 func (i *IoctlRegisterFD) WriteTo(writer io.Writer) (int64, error) { 3542 // Construct a slice backed by dst's underlying memory. 3543 var buf []byte 3544 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3545 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3546 hdr.Len = i.SizeBytes() 3547 hdr.Cap = i.SizeBytes() 3548 3549 length, err := writer.Write(buf) 3550 // Since we bypassed the compiler's escape analysis, indicate that i 3551 // must live until the use above. 3552 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3553 return int64(length), err 3554 } 3555 3556 // SizeBytes implements marshal.Marshallable.SizeBytes. 3557 func (i *IoctlSysParams) SizeBytes() int { 3558 return 8 3559 } 3560 3561 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3562 func (i *IoctlSysParams) MarshalBytes(dst []byte) []byte { 3563 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.MemblockSize)) 3564 dst = dst[8:] 3565 return dst 3566 } 3567 3568 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3569 func (i *IoctlSysParams) UnmarshalBytes(src []byte) []byte { 3570 i.MemblockSize = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3571 src = src[8:] 3572 return src 3573 } 3574 3575 // Packed implements marshal.Marshallable.Packed. 3576 //go:nosplit 3577 func (i *IoctlSysParams) Packed() bool { 3578 return true 3579 } 3580 3581 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3582 func (i *IoctlSysParams) MarshalUnsafe(dst []byte) []byte { 3583 size := i.SizeBytes() 3584 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 3585 return dst[size:] 3586 } 3587 3588 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3589 func (i *IoctlSysParams) UnmarshalUnsafe(src []byte) []byte { 3590 size := i.SizeBytes() 3591 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 3592 return src[size:] 3593 } 3594 3595 // CopyOutN implements marshal.Marshallable.CopyOutN. 3596 func (i *IoctlSysParams) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3597 // Construct a slice backed by dst's underlying memory. 3598 var buf []byte 3599 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3600 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3601 hdr.Len = i.SizeBytes() 3602 hdr.Cap = i.SizeBytes() 3603 3604 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3605 // Since we bypassed the compiler's escape analysis, indicate that i 3606 // must live until the use above. 3607 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3608 return length, err 3609 } 3610 3611 // CopyOut implements marshal.Marshallable.CopyOut. 3612 func (i *IoctlSysParams) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3613 return i.CopyOutN(cc, addr, i.SizeBytes()) 3614 } 3615 3616 // CopyInN implements marshal.Marshallable.CopyInN. 3617 func (i *IoctlSysParams) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3618 // Construct a slice backed by dst's underlying memory. 3619 var buf []byte 3620 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3621 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3622 hdr.Len = i.SizeBytes() 3623 hdr.Cap = i.SizeBytes() 3624 3625 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3626 // Since we bypassed the compiler's escape analysis, indicate that i 3627 // must live until the use above. 3628 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3629 return length, err 3630 } 3631 3632 // CopyIn implements marshal.Marshallable.CopyIn. 3633 func (i *IoctlSysParams) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3634 return i.CopyInN(cc, addr, i.SizeBytes()) 3635 } 3636 3637 // WriteTo implements io.WriterTo.WriteTo. 3638 func (i *IoctlSysParams) WriteTo(writer io.Writer) (int64, error) { 3639 // Construct a slice backed by dst's underlying memory. 3640 var buf []byte 3641 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3642 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 3643 hdr.Len = i.SizeBytes() 3644 hdr.Cap = i.SizeBytes() 3645 3646 length, err := writer.Write(buf) 3647 // Since we bypassed the compiler's escape analysis, indicate that i 3648 // must live until the use above. 3649 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 3650 return int64(length), err 3651 } 3652 3653 // SizeBytes implements marshal.Marshallable.SizeBytes. 3654 func (n *NVOS00Parameters) SizeBytes() int { 3655 return 4 + 3656 (*Handle)(nil).SizeBytes() + 3657 (*Handle)(nil).SizeBytes() + 3658 (*Handle)(nil).SizeBytes() 3659 } 3660 3661 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3662 func (n *NVOS00Parameters) MarshalBytes(dst []byte) []byte { 3663 dst = n.HRoot.MarshalUnsafe(dst) 3664 dst = n.HObjectParent.MarshalUnsafe(dst) 3665 dst = n.HObjectOld.MarshalUnsafe(dst) 3666 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 3667 dst = dst[4:] 3668 return dst 3669 } 3670 3671 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3672 func (n *NVOS00Parameters) UnmarshalBytes(src []byte) []byte { 3673 src = n.HRoot.UnmarshalUnsafe(src) 3674 src = n.HObjectParent.UnmarshalUnsafe(src) 3675 src = n.HObjectOld.UnmarshalUnsafe(src) 3676 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3677 src = src[4:] 3678 return src 3679 } 3680 3681 // Packed implements marshal.Marshallable.Packed. 3682 //go:nosplit 3683 func (n *NVOS00Parameters) Packed() bool { 3684 return n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() 3685 } 3686 3687 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3688 func (n *NVOS00Parameters) MarshalUnsafe(dst []byte) []byte { 3689 if n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() { 3690 size := n.SizeBytes() 3691 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 3692 return dst[size:] 3693 } 3694 // Type NVOS00Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 3695 return n.MarshalBytes(dst) 3696 } 3697 3698 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3699 func (n *NVOS00Parameters) UnmarshalUnsafe(src []byte) []byte { 3700 if n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() { 3701 size := n.SizeBytes() 3702 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 3703 return src[size:] 3704 } 3705 // Type NVOS00Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3706 return n.UnmarshalBytes(src) 3707 } 3708 3709 // CopyOutN implements marshal.Marshallable.CopyOutN. 3710 func (n *NVOS00Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3711 if !n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() { 3712 // Type NVOS00Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 3713 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 3714 n.MarshalBytes(buf) // escapes: fallback. 3715 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3716 } 3717 3718 // Construct a slice backed by dst's underlying memory. 3719 var buf []byte 3720 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3721 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 3722 hdr.Len = n.SizeBytes() 3723 hdr.Cap = n.SizeBytes() 3724 3725 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3726 // Since we bypassed the compiler's escape analysis, indicate that n 3727 // must live until the use above. 3728 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 3729 return length, err 3730 } 3731 3732 // CopyOut implements marshal.Marshallable.CopyOut. 3733 func (n *NVOS00Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3734 return n.CopyOutN(cc, addr, n.SizeBytes()) 3735 } 3736 3737 // CopyInN implements marshal.Marshallable.CopyInN. 3738 func (n *NVOS00Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3739 if !n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() { 3740 // Type NVOS00Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3741 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 3742 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3743 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3744 // partially unmarshalled struct. 3745 n.UnmarshalBytes(buf) // escapes: fallback. 3746 return length, err 3747 } 3748 3749 // Construct a slice backed by dst's underlying memory. 3750 var buf []byte 3751 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3752 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 3753 hdr.Len = n.SizeBytes() 3754 hdr.Cap = n.SizeBytes() 3755 3756 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3757 // Since we bypassed the compiler's escape analysis, indicate that n 3758 // must live until the use above. 3759 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 3760 return length, err 3761 } 3762 3763 // CopyIn implements marshal.Marshallable.CopyIn. 3764 func (n *NVOS00Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3765 return n.CopyInN(cc, addr, n.SizeBytes()) 3766 } 3767 3768 // WriteTo implements io.WriterTo.WriteTo. 3769 func (n *NVOS00Parameters) WriteTo(writer io.Writer) (int64, error) { 3770 if !n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() { 3771 // Type NVOS00Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 3772 buf := make([]byte, n.SizeBytes()) 3773 n.MarshalBytes(buf) 3774 length, err := writer.Write(buf) 3775 return int64(length), err 3776 } 3777 3778 // Construct a slice backed by dst's underlying memory. 3779 var buf []byte 3780 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3781 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 3782 hdr.Len = n.SizeBytes() 3783 hdr.Cap = n.SizeBytes() 3784 3785 length, err := writer.Write(buf) 3786 // Since we bypassed the compiler's escape analysis, indicate that n 3787 // must live until the use above. 3788 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 3789 return int64(length), err 3790 } 3791 3792 // SizeBytes implements marshal.Marshallable.SizeBytes. 3793 func (n *NVOS02Parameters) SizeBytes() int { 3794 return 20 + 3795 (*Handle)(nil).SizeBytes() + 3796 (*Handle)(nil).SizeBytes() + 3797 (*Handle)(nil).SizeBytes() + 3798 1*4 + 3799 (*P64)(nil).SizeBytes() + 3800 1*4 3801 } 3802 3803 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3804 func (n *NVOS02Parameters) MarshalBytes(dst []byte) []byte { 3805 dst = n.HRoot.MarshalUnsafe(dst) 3806 dst = n.HObjectParent.MarshalUnsafe(dst) 3807 dst = n.HObjectNew.MarshalUnsafe(dst) 3808 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HClass)) 3809 dst = dst[4:] 3810 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 3811 dst = dst[4:] 3812 for idx := 0; idx < 4; idx++ { 3813 dst[0] = byte(n.Pad0[idx]) 3814 dst = dst[1:] 3815 } 3816 dst = n.PMemory.MarshalUnsafe(dst) 3817 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Limit)) 3818 dst = dst[8:] 3819 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 3820 dst = dst[4:] 3821 for idx := 0; idx < 4; idx++ { 3822 dst[0] = byte(n.Pad1[idx]) 3823 dst = dst[1:] 3824 } 3825 return dst 3826 } 3827 3828 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3829 func (n *NVOS02Parameters) UnmarshalBytes(src []byte) []byte { 3830 src = n.HRoot.UnmarshalUnsafe(src) 3831 src = n.HObjectParent.UnmarshalUnsafe(src) 3832 src = n.HObjectNew.UnmarshalUnsafe(src) 3833 n.HClass = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3834 src = src[4:] 3835 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3836 src = src[4:] 3837 for idx := 0; idx < 4; idx++ { 3838 n.Pad0[idx] = src[0] 3839 src = src[1:] 3840 } 3841 src = n.PMemory.UnmarshalUnsafe(src) 3842 n.Limit = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3843 src = src[8:] 3844 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3845 src = src[4:] 3846 for idx := 0; idx < 4; idx++ { 3847 n.Pad1[idx] = src[0] 3848 src = src[1:] 3849 } 3850 return src 3851 } 3852 3853 // Packed implements marshal.Marshallable.Packed. 3854 //go:nosplit 3855 func (n *NVOS02Parameters) Packed() bool { 3856 return n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() 3857 } 3858 3859 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3860 func (n *NVOS02Parameters) MarshalUnsafe(dst []byte) []byte { 3861 if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() { 3862 size := n.SizeBytes() 3863 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 3864 return dst[size:] 3865 } 3866 // Type NVOS02Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 3867 return n.MarshalBytes(dst) 3868 } 3869 3870 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3871 func (n *NVOS02Parameters) UnmarshalUnsafe(src []byte) []byte { 3872 if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() { 3873 size := n.SizeBytes() 3874 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 3875 return src[size:] 3876 } 3877 // Type NVOS02Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3878 return n.UnmarshalBytes(src) 3879 } 3880 3881 // CopyOutN implements marshal.Marshallable.CopyOutN. 3882 func (n *NVOS02Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3883 if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() { 3884 // Type NVOS02Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 3885 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 3886 n.MarshalBytes(buf) // escapes: fallback. 3887 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3888 } 3889 3890 // Construct a slice backed by dst's underlying memory. 3891 var buf []byte 3892 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3893 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 3894 hdr.Len = n.SizeBytes() 3895 hdr.Cap = n.SizeBytes() 3896 3897 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3898 // Since we bypassed the compiler's escape analysis, indicate that n 3899 // must live until the use above. 3900 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 3901 return length, err 3902 } 3903 3904 // CopyOut implements marshal.Marshallable.CopyOut. 3905 func (n *NVOS02Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3906 return n.CopyOutN(cc, addr, n.SizeBytes()) 3907 } 3908 3909 // CopyInN implements marshal.Marshallable.CopyInN. 3910 func (n *NVOS02Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3911 if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() { 3912 // Type NVOS02Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3913 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 3914 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3915 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3916 // partially unmarshalled struct. 3917 n.UnmarshalBytes(buf) // escapes: fallback. 3918 return length, err 3919 } 3920 3921 // Construct a slice backed by dst's underlying memory. 3922 var buf []byte 3923 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3924 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 3925 hdr.Len = n.SizeBytes() 3926 hdr.Cap = n.SizeBytes() 3927 3928 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3929 // Since we bypassed the compiler's escape analysis, indicate that n 3930 // must live until the use above. 3931 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 3932 return length, err 3933 } 3934 3935 // CopyIn implements marshal.Marshallable.CopyIn. 3936 func (n *NVOS02Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3937 return n.CopyInN(cc, addr, n.SizeBytes()) 3938 } 3939 3940 // WriteTo implements io.WriterTo.WriteTo. 3941 func (n *NVOS02Parameters) WriteTo(writer io.Writer) (int64, error) { 3942 if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() { 3943 // Type NVOS02Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 3944 buf := make([]byte, n.SizeBytes()) 3945 n.MarshalBytes(buf) 3946 length, err := writer.Write(buf) 3947 return int64(length), err 3948 } 3949 3950 // Construct a slice backed by dst's underlying memory. 3951 var buf []byte 3952 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3953 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 3954 hdr.Len = n.SizeBytes() 3955 hdr.Cap = n.SizeBytes() 3956 3957 length, err := writer.Write(buf) 3958 // Since we bypassed the compiler's escape analysis, indicate that n 3959 // must live until the use above. 3960 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 3961 return int64(length), err 3962 } 3963 3964 // SizeBytes implements marshal.Marshallable.SizeBytes. 3965 func (n *NVOS21Parameters) SizeBytes() int { 3966 return 8 + 3967 (*Handle)(nil).SizeBytes() + 3968 (*Handle)(nil).SizeBytes() + 3969 (*Handle)(nil).SizeBytes() + 3970 (*P64)(nil).SizeBytes() + 3971 1*4 3972 } 3973 3974 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3975 func (n *NVOS21Parameters) MarshalBytes(dst []byte) []byte { 3976 dst = n.HRoot.MarshalUnsafe(dst) 3977 dst = n.HObjectParent.MarshalUnsafe(dst) 3978 dst = n.HObjectNew.MarshalUnsafe(dst) 3979 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HClass)) 3980 dst = dst[4:] 3981 dst = n.PAllocParms.MarshalUnsafe(dst) 3982 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 3983 dst = dst[4:] 3984 for idx := 0; idx < 4; idx++ { 3985 dst[0] = byte(n.Pad0[idx]) 3986 dst = dst[1:] 3987 } 3988 return dst 3989 } 3990 3991 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3992 func (n *NVOS21Parameters) UnmarshalBytes(src []byte) []byte { 3993 src = n.HRoot.UnmarshalUnsafe(src) 3994 src = n.HObjectParent.UnmarshalUnsafe(src) 3995 src = n.HObjectNew.UnmarshalUnsafe(src) 3996 n.HClass = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3997 src = src[4:] 3998 src = n.PAllocParms.UnmarshalUnsafe(src) 3999 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4000 src = src[4:] 4001 for idx := 0; idx < 4; idx++ { 4002 n.Pad0[idx] = src[0] 4003 src = src[1:] 4004 } 4005 return src 4006 } 4007 4008 // Packed implements marshal.Marshallable.Packed. 4009 //go:nosplit 4010 func (n *NVOS21Parameters) Packed() bool { 4011 return n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() 4012 } 4013 4014 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4015 func (n *NVOS21Parameters) MarshalUnsafe(dst []byte) []byte { 4016 if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() { 4017 size := n.SizeBytes() 4018 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 4019 return dst[size:] 4020 } 4021 // Type NVOS21Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 4022 return n.MarshalBytes(dst) 4023 } 4024 4025 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4026 func (n *NVOS21Parameters) UnmarshalUnsafe(src []byte) []byte { 4027 if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() { 4028 size := n.SizeBytes() 4029 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 4030 return src[size:] 4031 } 4032 // Type NVOS21Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4033 return n.UnmarshalBytes(src) 4034 } 4035 4036 // CopyOutN implements marshal.Marshallable.CopyOutN. 4037 func (n *NVOS21Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4038 if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() { 4039 // Type NVOS21Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4040 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4041 n.MarshalBytes(buf) // escapes: fallback. 4042 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4043 } 4044 4045 // Construct a slice backed by dst's underlying memory. 4046 var buf []byte 4047 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4048 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4049 hdr.Len = n.SizeBytes() 4050 hdr.Cap = n.SizeBytes() 4051 4052 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4053 // Since we bypassed the compiler's escape analysis, indicate that n 4054 // must live until the use above. 4055 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4056 return length, err 4057 } 4058 4059 // CopyOut implements marshal.Marshallable.CopyOut. 4060 func (n *NVOS21Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4061 return n.CopyOutN(cc, addr, n.SizeBytes()) 4062 } 4063 4064 // CopyInN implements marshal.Marshallable.CopyInN. 4065 func (n *NVOS21Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4066 if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() { 4067 // Type NVOS21Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4068 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4069 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4070 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4071 // partially unmarshalled struct. 4072 n.UnmarshalBytes(buf) // escapes: fallback. 4073 return length, err 4074 } 4075 4076 // Construct a slice backed by dst's underlying memory. 4077 var buf []byte 4078 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4079 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4080 hdr.Len = n.SizeBytes() 4081 hdr.Cap = n.SizeBytes() 4082 4083 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4084 // Since we bypassed the compiler's escape analysis, indicate that n 4085 // must live until the use above. 4086 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4087 return length, err 4088 } 4089 4090 // CopyIn implements marshal.Marshallable.CopyIn. 4091 func (n *NVOS21Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4092 return n.CopyInN(cc, addr, n.SizeBytes()) 4093 } 4094 4095 // WriteTo implements io.WriterTo.WriteTo. 4096 func (n *NVOS21Parameters) WriteTo(writer io.Writer) (int64, error) { 4097 if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() { 4098 // Type NVOS21Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4099 buf := make([]byte, n.SizeBytes()) 4100 n.MarshalBytes(buf) 4101 length, err := writer.Write(buf) 4102 return int64(length), err 4103 } 4104 4105 // Construct a slice backed by dst's underlying memory. 4106 var buf []byte 4107 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4108 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4109 hdr.Len = n.SizeBytes() 4110 hdr.Cap = n.SizeBytes() 4111 4112 length, err := writer.Write(buf) 4113 // Since we bypassed the compiler's escape analysis, indicate that n 4114 // must live until the use above. 4115 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4116 return int64(length), err 4117 } 4118 4119 // SizeBytes implements marshal.Marshallable.SizeBytes. 4120 func (n *NVOS32Parameters) SizeBytes() int { 4121 return 26 + 4122 (*Handle)(nil).SizeBytes() + 4123 (*Handle)(nil).SizeBytes() + 4124 (*Handle)(nil).SizeBytes() + 4125 1*2 + 4126 1*144 4127 } 4128 4129 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4130 func (n *NVOS32Parameters) MarshalBytes(dst []byte) []byte { 4131 dst = n.HRoot.MarshalUnsafe(dst) 4132 dst = n.HObjectParent.MarshalUnsafe(dst) 4133 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Function)) 4134 dst = dst[4:] 4135 dst = n.HVASpace.MarshalUnsafe(dst) 4136 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.IVCHeapNumber)) 4137 dst = dst[2:] 4138 for idx := 0; idx < 2; idx++ { 4139 dst[0] = byte(n.Pad[idx]) 4140 dst = dst[1:] 4141 } 4142 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 4143 dst = dst[4:] 4144 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Total)) 4145 dst = dst[8:] 4146 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Free)) 4147 dst = dst[8:] 4148 for idx := 0; idx < 144; idx++ { 4149 dst[0] = byte(n.Data[idx]) 4150 dst = dst[1:] 4151 } 4152 return dst 4153 } 4154 4155 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4156 func (n *NVOS32Parameters) UnmarshalBytes(src []byte) []byte { 4157 src = n.HRoot.UnmarshalUnsafe(src) 4158 src = n.HObjectParent.UnmarshalUnsafe(src) 4159 n.Function = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4160 src = src[4:] 4161 src = n.HVASpace.UnmarshalUnsafe(src) 4162 n.IVCHeapNumber = int16(hostarch.ByteOrder.Uint16(src[:2])) 4163 src = src[2:] 4164 for idx := 0; idx < 2; idx++ { 4165 n.Pad[idx] = src[0] 4166 src = src[1:] 4167 } 4168 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4169 src = src[4:] 4170 n.Total = uint64(hostarch.ByteOrder.Uint64(src[:8])) 4171 src = src[8:] 4172 n.Free = uint64(hostarch.ByteOrder.Uint64(src[:8])) 4173 src = src[8:] 4174 for idx := 0; idx < 144; idx++ { 4175 n.Data[idx] = src[0] 4176 src = src[1:] 4177 } 4178 return src 4179 } 4180 4181 // Packed implements marshal.Marshallable.Packed. 4182 //go:nosplit 4183 func (n *NVOS32Parameters) Packed() bool { 4184 return n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() 4185 } 4186 4187 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4188 func (n *NVOS32Parameters) MarshalUnsafe(dst []byte) []byte { 4189 if n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() { 4190 size := n.SizeBytes() 4191 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 4192 return dst[size:] 4193 } 4194 // Type NVOS32Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 4195 return n.MarshalBytes(dst) 4196 } 4197 4198 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4199 func (n *NVOS32Parameters) UnmarshalUnsafe(src []byte) []byte { 4200 if n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() { 4201 size := n.SizeBytes() 4202 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 4203 return src[size:] 4204 } 4205 // Type NVOS32Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4206 return n.UnmarshalBytes(src) 4207 } 4208 4209 // CopyOutN implements marshal.Marshallable.CopyOutN. 4210 func (n *NVOS32Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4211 if !n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() { 4212 // Type NVOS32Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4213 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4214 n.MarshalBytes(buf) // escapes: fallback. 4215 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4216 } 4217 4218 // Construct a slice backed by dst's underlying memory. 4219 var buf []byte 4220 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4221 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4222 hdr.Len = n.SizeBytes() 4223 hdr.Cap = n.SizeBytes() 4224 4225 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4226 // Since we bypassed the compiler's escape analysis, indicate that n 4227 // must live until the use above. 4228 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4229 return length, err 4230 } 4231 4232 // CopyOut implements marshal.Marshallable.CopyOut. 4233 func (n *NVOS32Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4234 return n.CopyOutN(cc, addr, n.SizeBytes()) 4235 } 4236 4237 // CopyInN implements marshal.Marshallable.CopyInN. 4238 func (n *NVOS32Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4239 if !n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() { 4240 // Type NVOS32Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4241 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4242 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4243 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4244 // partially unmarshalled struct. 4245 n.UnmarshalBytes(buf) // escapes: fallback. 4246 return length, err 4247 } 4248 4249 // Construct a slice backed by dst's underlying memory. 4250 var buf []byte 4251 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4252 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4253 hdr.Len = n.SizeBytes() 4254 hdr.Cap = n.SizeBytes() 4255 4256 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4257 // Since we bypassed the compiler's escape analysis, indicate that n 4258 // must live until the use above. 4259 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4260 return length, err 4261 } 4262 4263 // CopyIn implements marshal.Marshallable.CopyIn. 4264 func (n *NVOS32Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4265 return n.CopyInN(cc, addr, n.SizeBytes()) 4266 } 4267 4268 // WriteTo implements io.WriterTo.WriteTo. 4269 func (n *NVOS32Parameters) WriteTo(writer io.Writer) (int64, error) { 4270 if !n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() { 4271 // Type NVOS32Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4272 buf := make([]byte, n.SizeBytes()) 4273 n.MarshalBytes(buf) 4274 length, err := writer.Write(buf) 4275 return int64(length), err 4276 } 4277 4278 // Construct a slice backed by dst's underlying memory. 4279 var buf []byte 4280 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4281 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4282 hdr.Len = n.SizeBytes() 4283 hdr.Cap = n.SizeBytes() 4284 4285 length, err := writer.Write(buf) 4286 // Since we bypassed the compiler's escape analysis, indicate that n 4287 // must live until the use above. 4288 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4289 return int64(length), err 4290 } 4291 4292 // SizeBytes implements marshal.Marshallable.SizeBytes. 4293 func (n *NVOS33Parameters) SizeBytes() int { 4294 return 24 + 4295 (*Handle)(nil).SizeBytes() + 4296 (*Handle)(nil).SizeBytes() + 4297 (*Handle)(nil).SizeBytes() + 4298 1*4 + 4299 (*P64)(nil).SizeBytes() 4300 } 4301 4302 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4303 func (n *NVOS33Parameters) MarshalBytes(dst []byte) []byte { 4304 dst = n.HClient.MarshalUnsafe(dst) 4305 dst = n.HDevice.MarshalUnsafe(dst) 4306 dst = n.HMemory.MarshalUnsafe(dst) 4307 for idx := 0; idx < 4; idx++ { 4308 dst[0] = byte(n.Pad0[idx]) 4309 dst = dst[1:] 4310 } 4311 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Offset)) 4312 dst = dst[8:] 4313 hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Length)) 4314 dst = dst[8:] 4315 dst = n.PLinearAddress.MarshalUnsafe(dst) 4316 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 4317 dst = dst[4:] 4318 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 4319 dst = dst[4:] 4320 return dst 4321 } 4322 4323 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4324 func (n *NVOS33Parameters) UnmarshalBytes(src []byte) []byte { 4325 src = n.HClient.UnmarshalUnsafe(src) 4326 src = n.HDevice.UnmarshalUnsafe(src) 4327 src = n.HMemory.UnmarshalUnsafe(src) 4328 for idx := 0; idx < 4; idx++ { 4329 n.Pad0[idx] = src[0] 4330 src = src[1:] 4331 } 4332 n.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 4333 src = src[8:] 4334 n.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 4335 src = src[8:] 4336 src = n.PLinearAddress.UnmarshalUnsafe(src) 4337 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4338 src = src[4:] 4339 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4340 src = src[4:] 4341 return src 4342 } 4343 4344 // Packed implements marshal.Marshallable.Packed. 4345 //go:nosplit 4346 func (n *NVOS33Parameters) Packed() bool { 4347 return n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() 4348 } 4349 4350 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4351 func (n *NVOS33Parameters) MarshalUnsafe(dst []byte) []byte { 4352 if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4353 size := n.SizeBytes() 4354 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 4355 return dst[size:] 4356 } 4357 // Type NVOS33Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 4358 return n.MarshalBytes(dst) 4359 } 4360 4361 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4362 func (n *NVOS33Parameters) UnmarshalUnsafe(src []byte) []byte { 4363 if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4364 size := n.SizeBytes() 4365 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 4366 return src[size:] 4367 } 4368 // Type NVOS33Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4369 return n.UnmarshalBytes(src) 4370 } 4371 4372 // CopyOutN implements marshal.Marshallable.CopyOutN. 4373 func (n *NVOS33Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4374 if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4375 // Type NVOS33Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4376 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4377 n.MarshalBytes(buf) // escapes: fallback. 4378 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4379 } 4380 4381 // Construct a slice backed by dst's underlying memory. 4382 var buf []byte 4383 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4384 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4385 hdr.Len = n.SizeBytes() 4386 hdr.Cap = n.SizeBytes() 4387 4388 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4389 // Since we bypassed the compiler's escape analysis, indicate that n 4390 // must live until the use above. 4391 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4392 return length, err 4393 } 4394 4395 // CopyOut implements marshal.Marshallable.CopyOut. 4396 func (n *NVOS33Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4397 return n.CopyOutN(cc, addr, n.SizeBytes()) 4398 } 4399 4400 // CopyInN implements marshal.Marshallable.CopyInN. 4401 func (n *NVOS33Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4402 if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4403 // Type NVOS33Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4404 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4405 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4406 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4407 // partially unmarshalled struct. 4408 n.UnmarshalBytes(buf) // escapes: fallback. 4409 return length, err 4410 } 4411 4412 // Construct a slice backed by dst's underlying memory. 4413 var buf []byte 4414 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4415 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4416 hdr.Len = n.SizeBytes() 4417 hdr.Cap = n.SizeBytes() 4418 4419 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4420 // Since we bypassed the compiler's escape analysis, indicate that n 4421 // must live until the use above. 4422 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4423 return length, err 4424 } 4425 4426 // CopyIn implements marshal.Marshallable.CopyIn. 4427 func (n *NVOS33Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4428 return n.CopyInN(cc, addr, n.SizeBytes()) 4429 } 4430 4431 // WriteTo implements io.WriterTo.WriteTo. 4432 func (n *NVOS33Parameters) WriteTo(writer io.Writer) (int64, error) { 4433 if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4434 // Type NVOS33Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4435 buf := make([]byte, n.SizeBytes()) 4436 n.MarshalBytes(buf) 4437 length, err := writer.Write(buf) 4438 return int64(length), err 4439 } 4440 4441 // Construct a slice backed by dst's underlying memory. 4442 var buf []byte 4443 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4444 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4445 hdr.Len = n.SizeBytes() 4446 hdr.Cap = n.SizeBytes() 4447 4448 length, err := writer.Write(buf) 4449 // Since we bypassed the compiler's escape analysis, indicate that n 4450 // must live until the use above. 4451 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4452 return int64(length), err 4453 } 4454 4455 // SizeBytes implements marshal.Marshallable.SizeBytes. 4456 func (n *NVOS34Parameters) SizeBytes() int { 4457 return 8 + 4458 (*Handle)(nil).SizeBytes() + 4459 (*Handle)(nil).SizeBytes() + 4460 (*Handle)(nil).SizeBytes() + 4461 1*4 + 4462 (*P64)(nil).SizeBytes() 4463 } 4464 4465 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4466 func (n *NVOS34Parameters) MarshalBytes(dst []byte) []byte { 4467 dst = n.HClient.MarshalUnsafe(dst) 4468 dst = n.HDevice.MarshalUnsafe(dst) 4469 dst = n.HMemory.MarshalUnsafe(dst) 4470 for idx := 0; idx < 4; idx++ { 4471 dst[0] = byte(n.Pad0[idx]) 4472 dst = dst[1:] 4473 } 4474 dst = n.PLinearAddress.MarshalUnsafe(dst) 4475 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 4476 dst = dst[4:] 4477 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 4478 dst = dst[4:] 4479 return dst 4480 } 4481 4482 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4483 func (n *NVOS34Parameters) UnmarshalBytes(src []byte) []byte { 4484 src = n.HClient.UnmarshalUnsafe(src) 4485 src = n.HDevice.UnmarshalUnsafe(src) 4486 src = n.HMemory.UnmarshalUnsafe(src) 4487 for idx := 0; idx < 4; idx++ { 4488 n.Pad0[idx] = src[0] 4489 src = src[1:] 4490 } 4491 src = n.PLinearAddress.UnmarshalUnsafe(src) 4492 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4493 src = src[4:] 4494 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4495 src = src[4:] 4496 return src 4497 } 4498 4499 // Packed implements marshal.Marshallable.Packed. 4500 //go:nosplit 4501 func (n *NVOS34Parameters) Packed() bool { 4502 return n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() 4503 } 4504 4505 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4506 func (n *NVOS34Parameters) MarshalUnsafe(dst []byte) []byte { 4507 if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4508 size := n.SizeBytes() 4509 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 4510 return dst[size:] 4511 } 4512 // Type NVOS34Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 4513 return n.MarshalBytes(dst) 4514 } 4515 4516 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4517 func (n *NVOS34Parameters) UnmarshalUnsafe(src []byte) []byte { 4518 if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4519 size := n.SizeBytes() 4520 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 4521 return src[size:] 4522 } 4523 // Type NVOS34Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4524 return n.UnmarshalBytes(src) 4525 } 4526 4527 // CopyOutN implements marshal.Marshallable.CopyOutN. 4528 func (n *NVOS34Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4529 if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4530 // Type NVOS34Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4531 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4532 n.MarshalBytes(buf) // escapes: fallback. 4533 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4534 } 4535 4536 // Construct a slice backed by dst's underlying memory. 4537 var buf []byte 4538 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4539 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4540 hdr.Len = n.SizeBytes() 4541 hdr.Cap = n.SizeBytes() 4542 4543 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4544 // Since we bypassed the compiler's escape analysis, indicate that n 4545 // must live until the use above. 4546 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4547 return length, err 4548 } 4549 4550 // CopyOut implements marshal.Marshallable.CopyOut. 4551 func (n *NVOS34Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4552 return n.CopyOutN(cc, addr, n.SizeBytes()) 4553 } 4554 4555 // CopyInN implements marshal.Marshallable.CopyInN. 4556 func (n *NVOS34Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4557 if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4558 // Type NVOS34Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4559 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4560 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4561 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4562 // partially unmarshalled struct. 4563 n.UnmarshalBytes(buf) // escapes: fallback. 4564 return length, err 4565 } 4566 4567 // Construct a slice backed by dst's underlying memory. 4568 var buf []byte 4569 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4570 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4571 hdr.Len = n.SizeBytes() 4572 hdr.Cap = n.SizeBytes() 4573 4574 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4575 // Since we bypassed the compiler's escape analysis, indicate that n 4576 // must live until the use above. 4577 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4578 return length, err 4579 } 4580 4581 // CopyIn implements marshal.Marshallable.CopyIn. 4582 func (n *NVOS34Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4583 return n.CopyInN(cc, addr, n.SizeBytes()) 4584 } 4585 4586 // WriteTo implements io.WriterTo.WriteTo. 4587 func (n *NVOS34Parameters) WriteTo(writer io.Writer) (int64, error) { 4588 if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() { 4589 // Type NVOS34Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4590 buf := make([]byte, n.SizeBytes()) 4591 n.MarshalBytes(buf) 4592 length, err := writer.Write(buf) 4593 return int64(length), err 4594 } 4595 4596 // Construct a slice backed by dst's underlying memory. 4597 var buf []byte 4598 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4599 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4600 hdr.Len = n.SizeBytes() 4601 hdr.Cap = n.SizeBytes() 4602 4603 length, err := writer.Write(buf) 4604 // Since we bypassed the compiler's escape analysis, indicate that n 4605 // must live until the use above. 4606 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4607 return int64(length), err 4608 } 4609 4610 // SizeBytes implements marshal.Marshallable.SizeBytes. 4611 func (n *NVOS54Parameters) SizeBytes() int { 4612 return 16 + 4613 (*Handle)(nil).SizeBytes() + 4614 (*Handle)(nil).SizeBytes() + 4615 (*P64)(nil).SizeBytes() 4616 } 4617 4618 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4619 func (n *NVOS54Parameters) MarshalBytes(dst []byte) []byte { 4620 dst = n.HClient.MarshalUnsafe(dst) 4621 dst = n.HObject.MarshalUnsafe(dst) 4622 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Cmd)) 4623 dst = dst[4:] 4624 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 4625 dst = dst[4:] 4626 dst = n.Params.MarshalUnsafe(dst) 4627 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ParamsSize)) 4628 dst = dst[4:] 4629 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 4630 dst = dst[4:] 4631 return dst 4632 } 4633 4634 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4635 func (n *NVOS54Parameters) UnmarshalBytes(src []byte) []byte { 4636 src = n.HClient.UnmarshalUnsafe(src) 4637 src = n.HObject.UnmarshalUnsafe(src) 4638 n.Cmd = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4639 src = src[4:] 4640 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4641 src = src[4:] 4642 src = n.Params.UnmarshalUnsafe(src) 4643 n.ParamsSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4644 src = src[4:] 4645 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4646 src = src[4:] 4647 return src 4648 } 4649 4650 // Packed implements marshal.Marshallable.Packed. 4651 //go:nosplit 4652 func (n *NVOS54Parameters) Packed() bool { 4653 return n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() 4654 } 4655 4656 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4657 func (n *NVOS54Parameters) MarshalUnsafe(dst []byte) []byte { 4658 if n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() { 4659 size := n.SizeBytes() 4660 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 4661 return dst[size:] 4662 } 4663 // Type NVOS54Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 4664 return n.MarshalBytes(dst) 4665 } 4666 4667 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4668 func (n *NVOS54Parameters) UnmarshalUnsafe(src []byte) []byte { 4669 if n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() { 4670 size := n.SizeBytes() 4671 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 4672 return src[size:] 4673 } 4674 // Type NVOS54Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4675 return n.UnmarshalBytes(src) 4676 } 4677 4678 // CopyOutN implements marshal.Marshallable.CopyOutN. 4679 func (n *NVOS54Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4680 if !n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() { 4681 // Type NVOS54Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4682 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4683 n.MarshalBytes(buf) // escapes: fallback. 4684 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4685 } 4686 4687 // Construct a slice backed by dst's underlying memory. 4688 var buf []byte 4689 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4690 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4691 hdr.Len = n.SizeBytes() 4692 hdr.Cap = n.SizeBytes() 4693 4694 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4695 // Since we bypassed the compiler's escape analysis, indicate that n 4696 // must live until the use above. 4697 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4698 return length, err 4699 } 4700 4701 // CopyOut implements marshal.Marshallable.CopyOut. 4702 func (n *NVOS54Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4703 return n.CopyOutN(cc, addr, n.SizeBytes()) 4704 } 4705 4706 // CopyInN implements marshal.Marshallable.CopyInN. 4707 func (n *NVOS54Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4708 if !n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() { 4709 // Type NVOS54Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4710 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4711 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4712 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4713 // partially unmarshalled struct. 4714 n.UnmarshalBytes(buf) // escapes: fallback. 4715 return length, err 4716 } 4717 4718 // Construct a slice backed by dst's underlying memory. 4719 var buf []byte 4720 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4721 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4722 hdr.Len = n.SizeBytes() 4723 hdr.Cap = n.SizeBytes() 4724 4725 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4726 // Since we bypassed the compiler's escape analysis, indicate that n 4727 // must live until the use above. 4728 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4729 return length, err 4730 } 4731 4732 // CopyIn implements marshal.Marshallable.CopyIn. 4733 func (n *NVOS54Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4734 return n.CopyInN(cc, addr, n.SizeBytes()) 4735 } 4736 4737 // WriteTo implements io.WriterTo.WriteTo. 4738 func (n *NVOS54Parameters) WriteTo(writer io.Writer) (int64, error) { 4739 if !n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() { 4740 // Type NVOS54Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4741 buf := make([]byte, n.SizeBytes()) 4742 n.MarshalBytes(buf) 4743 length, err := writer.Write(buf) 4744 return int64(length), err 4745 } 4746 4747 // Construct a slice backed by dst's underlying memory. 4748 var buf []byte 4749 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4750 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4751 hdr.Len = n.SizeBytes() 4752 hdr.Cap = n.SizeBytes() 4753 4754 length, err := writer.Write(buf) 4755 // Since we bypassed the compiler's escape analysis, indicate that n 4756 // must live until the use above. 4757 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4758 return int64(length), err 4759 } 4760 4761 // SizeBytes implements marshal.Marshallable.SizeBytes. 4762 func (n *NVOS55Parameters) SizeBytes() int { 4763 return 8 + 4764 (*Handle)(nil).SizeBytes() + 4765 (*Handle)(nil).SizeBytes() + 4766 (*Handle)(nil).SizeBytes() + 4767 (*Handle)(nil).SizeBytes() + 4768 (*Handle)(nil).SizeBytes() 4769 } 4770 4771 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4772 func (n *NVOS55Parameters) MarshalBytes(dst []byte) []byte { 4773 dst = n.HClient.MarshalUnsafe(dst) 4774 dst = n.HParent.MarshalUnsafe(dst) 4775 dst = n.HObject.MarshalUnsafe(dst) 4776 dst = n.HClientSrc.MarshalUnsafe(dst) 4777 dst = n.HObjectSrc.MarshalUnsafe(dst) 4778 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 4779 dst = dst[4:] 4780 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 4781 dst = dst[4:] 4782 return dst 4783 } 4784 4785 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4786 func (n *NVOS55Parameters) UnmarshalBytes(src []byte) []byte { 4787 src = n.HClient.UnmarshalUnsafe(src) 4788 src = n.HParent.UnmarshalUnsafe(src) 4789 src = n.HObject.UnmarshalUnsafe(src) 4790 src = n.HClientSrc.UnmarshalUnsafe(src) 4791 src = n.HObjectSrc.UnmarshalUnsafe(src) 4792 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4793 src = src[4:] 4794 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4795 src = src[4:] 4796 return src 4797 } 4798 4799 // Packed implements marshal.Marshallable.Packed. 4800 //go:nosplit 4801 func (n *NVOS55Parameters) Packed() bool { 4802 return n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() 4803 } 4804 4805 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4806 func (n *NVOS55Parameters) MarshalUnsafe(dst []byte) []byte { 4807 if n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() { 4808 size := n.SizeBytes() 4809 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 4810 return dst[size:] 4811 } 4812 // Type NVOS55Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 4813 return n.MarshalBytes(dst) 4814 } 4815 4816 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4817 func (n *NVOS55Parameters) UnmarshalUnsafe(src []byte) []byte { 4818 if n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() { 4819 size := n.SizeBytes() 4820 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 4821 return src[size:] 4822 } 4823 // Type NVOS55Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4824 return n.UnmarshalBytes(src) 4825 } 4826 4827 // CopyOutN implements marshal.Marshallable.CopyOutN. 4828 func (n *NVOS55Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4829 if !n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() { 4830 // Type NVOS55Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4831 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4832 n.MarshalBytes(buf) // escapes: fallback. 4833 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4834 } 4835 4836 // Construct a slice backed by dst's underlying memory. 4837 var buf []byte 4838 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4839 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4840 hdr.Len = n.SizeBytes() 4841 hdr.Cap = n.SizeBytes() 4842 4843 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4844 // Since we bypassed the compiler's escape analysis, indicate that n 4845 // must live until the use above. 4846 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4847 return length, err 4848 } 4849 4850 // CopyOut implements marshal.Marshallable.CopyOut. 4851 func (n *NVOS55Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4852 return n.CopyOutN(cc, addr, n.SizeBytes()) 4853 } 4854 4855 // CopyInN implements marshal.Marshallable.CopyInN. 4856 func (n *NVOS55Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4857 if !n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() { 4858 // Type NVOS55Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4859 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4860 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4861 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4862 // partially unmarshalled struct. 4863 n.UnmarshalBytes(buf) // escapes: fallback. 4864 return length, err 4865 } 4866 4867 // Construct a slice backed by dst's underlying memory. 4868 var buf []byte 4869 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4870 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4871 hdr.Len = n.SizeBytes() 4872 hdr.Cap = n.SizeBytes() 4873 4874 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4875 // Since we bypassed the compiler's escape analysis, indicate that n 4876 // must live until the use above. 4877 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4878 return length, err 4879 } 4880 4881 // CopyIn implements marshal.Marshallable.CopyIn. 4882 func (n *NVOS55Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4883 return n.CopyInN(cc, addr, n.SizeBytes()) 4884 } 4885 4886 // WriteTo implements io.WriterTo.WriteTo. 4887 func (n *NVOS55Parameters) WriteTo(writer io.Writer) (int64, error) { 4888 if !n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() { 4889 // Type NVOS55Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4890 buf := make([]byte, n.SizeBytes()) 4891 n.MarshalBytes(buf) 4892 length, err := writer.Write(buf) 4893 return int64(length), err 4894 } 4895 4896 // Construct a slice backed by dst's underlying memory. 4897 var buf []byte 4898 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4899 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 4900 hdr.Len = n.SizeBytes() 4901 hdr.Cap = n.SizeBytes() 4902 4903 length, err := writer.Write(buf) 4904 // Since we bypassed the compiler's escape analysis, indicate that n 4905 // must live until the use above. 4906 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 4907 return int64(length), err 4908 } 4909 4910 // SizeBytes implements marshal.Marshallable.SizeBytes. 4911 func (n *NVOS56Parameters) SizeBytes() int { 4912 return 4 + 4913 (*Handle)(nil).SizeBytes() + 4914 (*Handle)(nil).SizeBytes() + 4915 (*Handle)(nil).SizeBytes() + 4916 1*4 + 4917 (*P64)(nil).SizeBytes() + 4918 (*P64)(nil).SizeBytes() + 4919 1*4 4920 } 4921 4922 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4923 func (n *NVOS56Parameters) MarshalBytes(dst []byte) []byte { 4924 dst = n.HClient.MarshalUnsafe(dst) 4925 dst = n.HDevice.MarshalUnsafe(dst) 4926 dst = n.HMemory.MarshalUnsafe(dst) 4927 for idx := 0; idx < 4; idx++ { 4928 dst[0] = byte(n.Pad0[idx]) 4929 dst = dst[1:] 4930 } 4931 dst = n.POldCPUAddress.MarshalUnsafe(dst) 4932 dst = n.PNewCPUAddress.MarshalUnsafe(dst) 4933 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 4934 dst = dst[4:] 4935 for idx := 0; idx < 4; idx++ { 4936 dst[0] = byte(n.Pad1[idx]) 4937 dst = dst[1:] 4938 } 4939 return dst 4940 } 4941 4942 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4943 func (n *NVOS56Parameters) UnmarshalBytes(src []byte) []byte { 4944 src = n.HClient.UnmarshalUnsafe(src) 4945 src = n.HDevice.UnmarshalUnsafe(src) 4946 src = n.HMemory.UnmarshalUnsafe(src) 4947 for idx := 0; idx < 4; idx++ { 4948 n.Pad0[idx] = src[0] 4949 src = src[1:] 4950 } 4951 src = n.POldCPUAddress.UnmarshalUnsafe(src) 4952 src = n.PNewCPUAddress.UnmarshalUnsafe(src) 4953 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4954 src = src[4:] 4955 for idx := 0; idx < 4; idx++ { 4956 n.Pad1[idx] = src[0] 4957 src = src[1:] 4958 } 4959 return src 4960 } 4961 4962 // Packed implements marshal.Marshallable.Packed. 4963 //go:nosplit 4964 func (n *NVOS56Parameters) Packed() bool { 4965 return n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() 4966 } 4967 4968 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4969 func (n *NVOS56Parameters) MarshalUnsafe(dst []byte) []byte { 4970 if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() { 4971 size := n.SizeBytes() 4972 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 4973 return dst[size:] 4974 } 4975 // Type NVOS56Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 4976 return n.MarshalBytes(dst) 4977 } 4978 4979 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4980 func (n *NVOS56Parameters) UnmarshalUnsafe(src []byte) []byte { 4981 if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() { 4982 size := n.SizeBytes() 4983 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 4984 return src[size:] 4985 } 4986 // Type NVOS56Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4987 return n.UnmarshalBytes(src) 4988 } 4989 4990 // CopyOutN implements marshal.Marshallable.CopyOutN. 4991 func (n *NVOS56Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4992 if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() { 4993 // Type NVOS56Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 4994 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 4995 n.MarshalBytes(buf) // escapes: fallback. 4996 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4997 } 4998 4999 // Construct a slice backed by dst's underlying memory. 5000 var buf []byte 5001 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5002 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 5003 hdr.Len = n.SizeBytes() 5004 hdr.Cap = n.SizeBytes() 5005 5006 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5007 // Since we bypassed the compiler's escape analysis, indicate that n 5008 // must live until the use above. 5009 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 5010 return length, err 5011 } 5012 5013 // CopyOut implements marshal.Marshallable.CopyOut. 5014 func (n *NVOS56Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5015 return n.CopyOutN(cc, addr, n.SizeBytes()) 5016 } 5017 5018 // CopyInN implements marshal.Marshallable.CopyInN. 5019 func (n *NVOS56Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5020 if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() { 5021 // Type NVOS56Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 5022 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 5023 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5024 // Unmarshal unconditionally. If we had a short copy-in, this results in a 5025 // partially unmarshalled struct. 5026 n.UnmarshalBytes(buf) // escapes: fallback. 5027 return length, err 5028 } 5029 5030 // Construct a slice backed by dst's underlying memory. 5031 var buf []byte 5032 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5033 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 5034 hdr.Len = n.SizeBytes() 5035 hdr.Cap = n.SizeBytes() 5036 5037 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5038 // Since we bypassed the compiler's escape analysis, indicate that n 5039 // must live until the use above. 5040 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 5041 return length, err 5042 } 5043 5044 // CopyIn implements marshal.Marshallable.CopyIn. 5045 func (n *NVOS56Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5046 return n.CopyInN(cc, addr, n.SizeBytes()) 5047 } 5048 5049 // WriteTo implements io.WriterTo.WriteTo. 5050 func (n *NVOS56Parameters) WriteTo(writer io.Writer) (int64, error) { 5051 if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() { 5052 // Type NVOS56Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 5053 buf := make([]byte, n.SizeBytes()) 5054 n.MarshalBytes(buf) 5055 length, err := writer.Write(buf) 5056 return int64(length), err 5057 } 5058 5059 // Construct a slice backed by dst's underlying memory. 5060 var buf []byte 5061 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5062 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 5063 hdr.Len = n.SizeBytes() 5064 hdr.Cap = n.SizeBytes() 5065 5066 length, err := writer.Write(buf) 5067 // Since we bypassed the compiler's escape analysis, indicate that n 5068 // must live until the use above. 5069 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 5070 return int64(length), err 5071 } 5072 5073 // SizeBytes implements marshal.Marshallable.SizeBytes. 5074 func (n *NVOS57Parameters) SizeBytes() int { 5075 return 4 + 5076 (*Handle)(nil).SizeBytes() + 5077 (*Handle)(nil).SizeBytes() + 5078 (*RS_SHARE_POLICY)(nil).SizeBytes() 5079 } 5080 5081 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5082 func (n *NVOS57Parameters) MarshalBytes(dst []byte) []byte { 5083 dst = n.HClient.MarshalUnsafe(dst) 5084 dst = n.HObject.MarshalUnsafe(dst) 5085 dst = n.SharePolicy.MarshalUnsafe(dst) 5086 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 5087 dst = dst[4:] 5088 return dst 5089 } 5090 5091 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5092 func (n *NVOS57Parameters) UnmarshalBytes(src []byte) []byte { 5093 src = n.HClient.UnmarshalUnsafe(src) 5094 src = n.HObject.UnmarshalUnsafe(src) 5095 src = n.SharePolicy.UnmarshalUnsafe(src) 5096 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5097 src = src[4:] 5098 return src 5099 } 5100 5101 // Packed implements marshal.Marshallable.Packed. 5102 //go:nosplit 5103 func (n *NVOS57Parameters) Packed() bool { 5104 return n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() 5105 } 5106 5107 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5108 func (n *NVOS57Parameters) MarshalUnsafe(dst []byte) []byte { 5109 if n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() { 5110 size := n.SizeBytes() 5111 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 5112 return dst[size:] 5113 } 5114 // Type NVOS57Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 5115 return n.MarshalBytes(dst) 5116 } 5117 5118 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5119 func (n *NVOS57Parameters) UnmarshalUnsafe(src []byte) []byte { 5120 if n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() { 5121 size := n.SizeBytes() 5122 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 5123 return src[size:] 5124 } 5125 // Type NVOS57Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 5126 return n.UnmarshalBytes(src) 5127 } 5128 5129 // CopyOutN implements marshal.Marshallable.CopyOutN. 5130 func (n *NVOS57Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5131 if !n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() { 5132 // Type NVOS57Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 5133 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 5134 n.MarshalBytes(buf) // escapes: fallback. 5135 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5136 } 5137 5138 // Construct a slice backed by dst's underlying memory. 5139 var buf []byte 5140 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5141 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 5142 hdr.Len = n.SizeBytes() 5143 hdr.Cap = n.SizeBytes() 5144 5145 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5146 // Since we bypassed the compiler's escape analysis, indicate that n 5147 // must live until the use above. 5148 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 5149 return length, err 5150 } 5151 5152 // CopyOut implements marshal.Marshallable.CopyOut. 5153 func (n *NVOS57Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5154 return n.CopyOutN(cc, addr, n.SizeBytes()) 5155 } 5156 5157 // CopyInN implements marshal.Marshallable.CopyInN. 5158 func (n *NVOS57Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5159 if !n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() { 5160 // Type NVOS57Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 5161 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 5162 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5163 // Unmarshal unconditionally. If we had a short copy-in, this results in a 5164 // partially unmarshalled struct. 5165 n.UnmarshalBytes(buf) // escapes: fallback. 5166 return length, err 5167 } 5168 5169 // Construct a slice backed by dst's underlying memory. 5170 var buf []byte 5171 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5172 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 5173 hdr.Len = n.SizeBytes() 5174 hdr.Cap = n.SizeBytes() 5175 5176 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5177 // Since we bypassed the compiler's escape analysis, indicate that n 5178 // must live until the use above. 5179 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 5180 return length, err 5181 } 5182 5183 // CopyIn implements marshal.Marshallable.CopyIn. 5184 func (n *NVOS57Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5185 return n.CopyInN(cc, addr, n.SizeBytes()) 5186 } 5187 5188 // WriteTo implements io.WriterTo.WriteTo. 5189 func (n *NVOS57Parameters) WriteTo(writer io.Writer) (int64, error) { 5190 if !n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() { 5191 // Type NVOS57Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 5192 buf := make([]byte, n.SizeBytes()) 5193 n.MarshalBytes(buf) 5194 length, err := writer.Write(buf) 5195 return int64(length), err 5196 } 5197 5198 // Construct a slice backed by dst's underlying memory. 5199 var buf []byte 5200 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5201 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 5202 hdr.Len = n.SizeBytes() 5203 hdr.Cap = n.SizeBytes() 5204 5205 length, err := writer.Write(buf) 5206 // Since we bypassed the compiler's escape analysis, indicate that n 5207 // must live until the use above. 5208 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 5209 return int64(length), err 5210 } 5211 5212 // SizeBytes implements marshal.Marshallable.SizeBytes. 5213 func (n *NVOS64Parameters) SizeBytes() int { 5214 return 12 + 5215 (*Handle)(nil).SizeBytes() + 5216 (*Handle)(nil).SizeBytes() + 5217 (*Handle)(nil).SizeBytes() + 5218 (*P64)(nil).SizeBytes() + 5219 (*P64)(nil).SizeBytes() 5220 } 5221 5222 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5223 func (n *NVOS64Parameters) MarshalBytes(dst []byte) []byte { 5224 dst = n.HRoot.MarshalUnsafe(dst) 5225 dst = n.HObjectParent.MarshalUnsafe(dst) 5226 dst = n.HObjectNew.MarshalUnsafe(dst) 5227 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HClass)) 5228 dst = dst[4:] 5229 dst = n.PAllocParms.MarshalUnsafe(dst) 5230 dst = n.PRightsRequested.MarshalUnsafe(dst) 5231 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 5232 dst = dst[4:] 5233 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status)) 5234 dst = dst[4:] 5235 return dst 5236 } 5237 5238 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5239 func (n *NVOS64Parameters) UnmarshalBytes(src []byte) []byte { 5240 src = n.HRoot.UnmarshalUnsafe(src) 5241 src = n.HObjectParent.UnmarshalUnsafe(src) 5242 src = n.HObjectNew.UnmarshalUnsafe(src) 5243 n.HClass = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5244 src = src[4:] 5245 src = n.PAllocParms.UnmarshalUnsafe(src) 5246 src = n.PRightsRequested.UnmarshalUnsafe(src) 5247 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5248 src = src[4:] 5249 n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5250 src = src[4:] 5251 return src 5252 } 5253 5254 // Packed implements marshal.Marshallable.Packed. 5255 //go:nosplit 5256 func (n *NVOS64Parameters) Packed() bool { 5257 return n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() 5258 } 5259 5260 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5261 func (n *NVOS64Parameters) MarshalUnsafe(dst []byte) []byte { 5262 if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() { 5263 size := n.SizeBytes() 5264 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 5265 return dst[size:] 5266 } 5267 // Type NVOS64Parameters doesn't have a packed layout in memory, fallback to MarshalBytes. 5268 return n.MarshalBytes(dst) 5269 } 5270 5271 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5272 func (n *NVOS64Parameters) UnmarshalUnsafe(src []byte) []byte { 5273 if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() { 5274 size := n.SizeBytes() 5275 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 5276 return src[size:] 5277 } 5278 // Type NVOS64Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes. 5279 return n.UnmarshalBytes(src) 5280 } 5281 5282 // CopyOutN implements marshal.Marshallable.CopyOutN. 5283 func (n *NVOS64Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5284 if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() { 5285 // Type NVOS64Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 5286 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 5287 n.MarshalBytes(buf) // escapes: fallback. 5288 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5289 } 5290 5291 // Construct a slice backed by dst's underlying memory. 5292 var buf []byte 5293 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5294 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 5295 hdr.Len = n.SizeBytes() 5296 hdr.Cap = n.SizeBytes() 5297 5298 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5299 // Since we bypassed the compiler's escape analysis, indicate that n 5300 // must live until the use above. 5301 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 5302 return length, err 5303 } 5304 5305 // CopyOut implements marshal.Marshallable.CopyOut. 5306 func (n *NVOS64Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5307 return n.CopyOutN(cc, addr, n.SizeBytes()) 5308 } 5309 5310 // CopyInN implements marshal.Marshallable.CopyInN. 5311 func (n *NVOS64Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5312 if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() { 5313 // Type NVOS64Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes. 5314 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 5315 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5316 // Unmarshal unconditionally. If we had a short copy-in, this results in a 5317 // partially unmarshalled struct. 5318 n.UnmarshalBytes(buf) // escapes: fallback. 5319 return length, err 5320 } 5321 5322 // Construct a slice backed by dst's underlying memory. 5323 var buf []byte 5324 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5325 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 5326 hdr.Len = n.SizeBytes() 5327 hdr.Cap = n.SizeBytes() 5328 5329 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5330 // Since we bypassed the compiler's escape analysis, indicate that n 5331 // must live until the use above. 5332 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 5333 return length, err 5334 } 5335 5336 // CopyIn implements marshal.Marshallable.CopyIn. 5337 func (n *NVOS64Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5338 return n.CopyInN(cc, addr, n.SizeBytes()) 5339 } 5340 5341 // WriteTo implements io.WriterTo.WriteTo. 5342 func (n *NVOS64Parameters) WriteTo(writer io.Writer) (int64, error) { 5343 if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() { 5344 // Type NVOS64Parameters doesn't have a packed layout in memory, fall back to MarshalBytes. 5345 buf := make([]byte, n.SizeBytes()) 5346 n.MarshalBytes(buf) 5347 length, err := writer.Write(buf) 5348 return int64(length), err 5349 } 5350 5351 // Construct a slice backed by dst's underlying memory. 5352 var buf []byte 5353 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5354 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 5355 hdr.Len = n.SizeBytes() 5356 hdr.Cap = n.SizeBytes() 5357 5358 length, err := writer.Write(buf) 5359 // Since we bypassed the compiler's escape analysis, indicate that n 5360 // must live until the use above. 5361 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 5362 return int64(length), err 5363 } 5364 5365 // SizeBytes implements marshal.Marshallable.SizeBytes. 5366 func (r *RMAPIVersion) SizeBytes() int { 5367 return 8 + 5368 1*64 5369 } 5370 5371 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5372 func (r *RMAPIVersion) MarshalBytes(dst []byte) []byte { 5373 hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Cmd)) 5374 dst = dst[4:] 5375 hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Reply)) 5376 dst = dst[4:] 5377 for idx := 0; idx < 64; idx++ { 5378 dst[0] = byte(r.VersionString[idx]) 5379 dst = dst[1:] 5380 } 5381 return dst 5382 } 5383 5384 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5385 func (r *RMAPIVersion) UnmarshalBytes(src []byte) []byte { 5386 r.Cmd = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5387 src = src[4:] 5388 r.Reply = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5389 src = src[4:] 5390 for idx := 0; idx < 64; idx++ { 5391 r.VersionString[idx] = src[0] 5392 src = src[1:] 5393 } 5394 return src 5395 } 5396 5397 // Packed implements marshal.Marshallable.Packed. 5398 //go:nosplit 5399 func (r *RMAPIVersion) Packed() bool { 5400 return true 5401 } 5402 5403 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5404 func (r *RMAPIVersion) MarshalUnsafe(dst []byte) []byte { 5405 size := r.SizeBytes() 5406 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) 5407 return dst[size:] 5408 } 5409 5410 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5411 func (r *RMAPIVersion) UnmarshalUnsafe(src []byte) []byte { 5412 size := r.SizeBytes() 5413 gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) 5414 return src[size:] 5415 } 5416 5417 // CopyOutN implements marshal.Marshallable.CopyOutN. 5418 func (r *RMAPIVersion) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5419 // Construct a slice backed by dst's underlying memory. 5420 var buf []byte 5421 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5422 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 5423 hdr.Len = r.SizeBytes() 5424 hdr.Cap = r.SizeBytes() 5425 5426 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5427 // Since we bypassed the compiler's escape analysis, indicate that r 5428 // must live until the use above. 5429 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 5430 return length, err 5431 } 5432 5433 // CopyOut implements marshal.Marshallable.CopyOut. 5434 func (r *RMAPIVersion) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5435 return r.CopyOutN(cc, addr, r.SizeBytes()) 5436 } 5437 5438 // CopyInN implements marshal.Marshallable.CopyInN. 5439 func (r *RMAPIVersion) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5440 // Construct a slice backed by dst's underlying memory. 5441 var buf []byte 5442 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5443 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 5444 hdr.Len = r.SizeBytes() 5445 hdr.Cap = r.SizeBytes() 5446 5447 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5448 // Since we bypassed the compiler's escape analysis, indicate that r 5449 // must live until the use above. 5450 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 5451 return length, err 5452 } 5453 5454 // CopyIn implements marshal.Marshallable.CopyIn. 5455 func (r *RMAPIVersion) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5456 return r.CopyInN(cc, addr, r.SizeBytes()) 5457 } 5458 5459 // WriteTo implements io.WriterTo.WriteTo. 5460 func (r *RMAPIVersion) WriteTo(writer io.Writer) (int64, error) { 5461 // Construct a slice backed by dst's underlying memory. 5462 var buf []byte 5463 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5464 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 5465 hdr.Len = r.SizeBytes() 5466 hdr.Cap = r.SizeBytes() 5467 5468 length, err := writer.Write(buf) 5469 // Since we bypassed the compiler's escape analysis, indicate that r 5470 // must live until the use above. 5471 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 5472 return int64(length), err 5473 } 5474 5475 // SizeBytes implements marshal.Marshallable.SizeBytes. 5476 func (h *Handle) SizeBytes() int { 5477 return 4 5478 } 5479 5480 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5481 func (h *Handle) MarshalBytes(dst []byte) []byte { 5482 hostarch.ByteOrder.PutUint32(dst[:4], uint32(h.Val)) 5483 dst = dst[4:] 5484 return dst 5485 } 5486 5487 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5488 func (h *Handle) UnmarshalBytes(src []byte) []byte { 5489 h.Val = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5490 src = src[4:] 5491 return src 5492 } 5493 5494 // Packed implements marshal.Marshallable.Packed. 5495 //go:nosplit 5496 func (h *Handle) Packed() bool { 5497 return true 5498 } 5499 5500 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5501 func (h *Handle) MarshalUnsafe(dst []byte) []byte { 5502 size := h.SizeBytes() 5503 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(h), uintptr(size)) 5504 return dst[size:] 5505 } 5506 5507 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5508 func (h *Handle) UnmarshalUnsafe(src []byte) []byte { 5509 size := h.SizeBytes() 5510 gohacks.Memmove(unsafe.Pointer(h), unsafe.Pointer(&src[0]), uintptr(size)) 5511 return src[size:] 5512 } 5513 5514 // CopyOutN implements marshal.Marshallable.CopyOutN. 5515 func (h *Handle) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5516 // Construct a slice backed by dst's underlying memory. 5517 var buf []byte 5518 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5519 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(h))) 5520 hdr.Len = h.SizeBytes() 5521 hdr.Cap = h.SizeBytes() 5522 5523 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5524 // Since we bypassed the compiler's escape analysis, indicate that h 5525 // must live until the use above. 5526 runtime.KeepAlive(h) // escapes: replaced by intrinsic. 5527 return length, err 5528 } 5529 5530 // CopyOut implements marshal.Marshallable.CopyOut. 5531 func (h *Handle) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5532 return h.CopyOutN(cc, addr, h.SizeBytes()) 5533 } 5534 5535 // CopyInN implements marshal.Marshallable.CopyInN. 5536 func (h *Handle) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5537 // Construct a slice backed by dst's underlying memory. 5538 var buf []byte 5539 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5540 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(h))) 5541 hdr.Len = h.SizeBytes() 5542 hdr.Cap = h.SizeBytes() 5543 5544 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5545 // Since we bypassed the compiler's escape analysis, indicate that h 5546 // must live until the use above. 5547 runtime.KeepAlive(h) // escapes: replaced by intrinsic. 5548 return length, err 5549 } 5550 5551 // CopyIn implements marshal.Marshallable.CopyIn. 5552 func (h *Handle) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5553 return h.CopyInN(cc, addr, h.SizeBytes()) 5554 } 5555 5556 // WriteTo implements io.WriterTo.WriteTo. 5557 func (h *Handle) WriteTo(writer io.Writer) (int64, error) { 5558 // Construct a slice backed by dst's underlying memory. 5559 var buf []byte 5560 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5561 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(h))) 5562 hdr.Len = h.SizeBytes() 5563 hdr.Cap = h.SizeBytes() 5564 5565 length, err := writer.Write(buf) 5566 // Since we bypassed the compiler's escape analysis, indicate that h 5567 // must live until the use above. 5568 runtime.KeepAlive(h) // escapes: replaced by intrinsic. 5569 return int64(length), err 5570 } 5571 5572 // SizeBytes implements marshal.Marshallable.SizeBytes. 5573 //go:nosplit 5574 func (p *P64) SizeBytes() int { 5575 return 8 5576 } 5577 5578 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5579 func (p *P64) MarshalBytes(dst []byte) []byte { 5580 hostarch.ByteOrder.PutUint64(dst[:8], uint64(*p)) 5581 return dst[8:] 5582 } 5583 5584 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5585 func (p *P64) UnmarshalBytes(src []byte) []byte { 5586 *p = P64(uint64(hostarch.ByteOrder.Uint64(src[:8]))) 5587 return src[8:] 5588 } 5589 5590 // Packed implements marshal.Marshallable.Packed. 5591 //go:nosplit 5592 func (p *P64) Packed() bool { 5593 // Scalar newtypes are always packed. 5594 return true 5595 } 5596 5597 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5598 func (p *P64) MarshalUnsafe(dst []byte) []byte { 5599 size := p.SizeBytes() 5600 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size)) 5601 return dst[size:] 5602 } 5603 5604 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5605 func (p *P64) UnmarshalUnsafe(src []byte) []byte { 5606 size := p.SizeBytes() 5607 gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size)) 5608 return src[size:] 5609 } 5610 5611 // CopyOutN implements marshal.Marshallable.CopyOutN. 5612 func (p *P64) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5613 // Construct a slice backed by dst's underlying memory. 5614 var buf []byte 5615 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5616 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 5617 hdr.Len = p.SizeBytes() 5618 hdr.Cap = p.SizeBytes() 5619 5620 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5621 // Since we bypassed the compiler's escape analysis, indicate that p 5622 // must live until the use above. 5623 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 5624 return length, err 5625 } 5626 5627 // CopyOut implements marshal.Marshallable.CopyOut. 5628 func (p *P64) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5629 return p.CopyOutN(cc, addr, p.SizeBytes()) 5630 } 5631 5632 // CopyInN implements marshal.Marshallable.CopyInN. 5633 func (p *P64) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5634 // Construct a slice backed by dst's underlying memory. 5635 var buf []byte 5636 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5637 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 5638 hdr.Len = p.SizeBytes() 5639 hdr.Cap = p.SizeBytes() 5640 5641 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5642 // Since we bypassed the compiler's escape analysis, indicate that p 5643 // must live until the use above. 5644 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 5645 return length, err 5646 } 5647 5648 // CopyIn implements marshal.Marshallable.CopyIn. 5649 func (p *P64) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5650 return p.CopyInN(cc, addr, p.SizeBytes()) 5651 } 5652 5653 // WriteTo implements io.WriterTo.WriteTo. 5654 func (p *P64) WriteTo(writer io.Writer) (int64, error) { 5655 // Construct a slice backed by dst's underlying memory. 5656 var buf []byte 5657 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5658 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 5659 hdr.Len = p.SizeBytes() 5660 hdr.Cap = p.SizeBytes() 5661 5662 length, err := writer.Write(buf) 5663 // Since we bypassed the compiler's escape analysis, indicate that p 5664 // must live until the use above. 5665 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 5666 return int64(length), err 5667 } 5668 5669 // SizeBytes implements marshal.Marshallable.SizeBytes. 5670 func (r *RS_ACCESS_MASK) SizeBytes() int { 5671 return 0 + 5672 4*SDK_RS_ACCESS_MAX_LIMBS 5673 } 5674 5675 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5676 func (r *RS_ACCESS_MASK) MarshalBytes(dst []byte) []byte { 5677 for idx := 0; idx < SDK_RS_ACCESS_MAX_LIMBS; idx++ { 5678 hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Limbs[idx])) 5679 dst = dst[4:] 5680 } 5681 return dst 5682 } 5683 5684 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5685 func (r *RS_ACCESS_MASK) UnmarshalBytes(src []byte) []byte { 5686 for idx := 0; idx < SDK_RS_ACCESS_MAX_LIMBS; idx++ { 5687 r.Limbs[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5688 src = src[4:] 5689 } 5690 return src 5691 } 5692 5693 // Packed implements marshal.Marshallable.Packed. 5694 //go:nosplit 5695 func (r *RS_ACCESS_MASK) Packed() bool { 5696 return true 5697 } 5698 5699 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5700 func (r *RS_ACCESS_MASK) MarshalUnsafe(dst []byte) []byte { 5701 size := r.SizeBytes() 5702 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) 5703 return dst[size:] 5704 } 5705 5706 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5707 func (r *RS_ACCESS_MASK) UnmarshalUnsafe(src []byte) []byte { 5708 size := r.SizeBytes() 5709 gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) 5710 return src[size:] 5711 } 5712 5713 // CopyOutN implements marshal.Marshallable.CopyOutN. 5714 func (r *RS_ACCESS_MASK) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5715 // Construct a slice backed by dst's underlying memory. 5716 var buf []byte 5717 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5718 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 5719 hdr.Len = r.SizeBytes() 5720 hdr.Cap = r.SizeBytes() 5721 5722 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5723 // Since we bypassed the compiler's escape analysis, indicate that r 5724 // must live until the use above. 5725 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 5726 return length, err 5727 } 5728 5729 // CopyOut implements marshal.Marshallable.CopyOut. 5730 func (r *RS_ACCESS_MASK) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5731 return r.CopyOutN(cc, addr, r.SizeBytes()) 5732 } 5733 5734 // CopyInN implements marshal.Marshallable.CopyInN. 5735 func (r *RS_ACCESS_MASK) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5736 // Construct a slice backed by dst's underlying memory. 5737 var buf []byte 5738 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5739 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 5740 hdr.Len = r.SizeBytes() 5741 hdr.Cap = r.SizeBytes() 5742 5743 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5744 // Since we bypassed the compiler's escape analysis, indicate that r 5745 // must live until the use above. 5746 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 5747 return length, err 5748 } 5749 5750 // CopyIn implements marshal.Marshallable.CopyIn. 5751 func (r *RS_ACCESS_MASK) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5752 return r.CopyInN(cc, addr, r.SizeBytes()) 5753 } 5754 5755 // WriteTo implements io.WriterTo.WriteTo. 5756 func (r *RS_ACCESS_MASK) WriteTo(writer io.Writer) (int64, error) { 5757 // Construct a slice backed by dst's underlying memory. 5758 var buf []byte 5759 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5760 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 5761 hdr.Len = r.SizeBytes() 5762 hdr.Cap = r.SizeBytes() 5763 5764 length, err := writer.Write(buf) 5765 // Since we bypassed the compiler's escape analysis, indicate that r 5766 // must live until the use above. 5767 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 5768 return int64(length), err 5769 } 5770 5771 // SizeBytes implements marshal.Marshallable.SizeBytes. 5772 func (r *RS_SHARE_POLICY) SizeBytes() int { 5773 return 7 + 5774 (*RS_ACCESS_MASK)(nil).SizeBytes() + 5775 1*1 5776 } 5777 5778 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5779 func (r *RS_SHARE_POLICY) MarshalBytes(dst []byte) []byte { 5780 hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Target)) 5781 dst = dst[4:] 5782 dst = r.AccessMask.MarshalUnsafe(dst) 5783 hostarch.ByteOrder.PutUint16(dst[:2], uint16(r.Type)) 5784 dst = dst[2:] 5785 dst[0] = byte(r.Action) 5786 dst = dst[1:] 5787 for idx := 0; idx < 1; idx++ { 5788 dst[0] = byte(r.Pad[idx]) 5789 dst = dst[1:] 5790 } 5791 return dst 5792 } 5793 5794 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5795 func (r *RS_SHARE_POLICY) UnmarshalBytes(src []byte) []byte { 5796 r.Target = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5797 src = src[4:] 5798 src = r.AccessMask.UnmarshalUnsafe(src) 5799 r.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) 5800 src = src[2:] 5801 r.Action = uint8(src[0]) 5802 src = src[1:] 5803 for idx := 0; idx < 1; idx++ { 5804 r.Pad[idx] = src[0] 5805 src = src[1:] 5806 } 5807 return src 5808 } 5809 5810 // Packed implements marshal.Marshallable.Packed. 5811 //go:nosplit 5812 func (r *RS_SHARE_POLICY) Packed() bool { 5813 return r.AccessMask.Packed() 5814 } 5815 5816 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5817 func (r *RS_SHARE_POLICY) MarshalUnsafe(dst []byte) []byte { 5818 if r.AccessMask.Packed() { 5819 size := r.SizeBytes() 5820 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) 5821 return dst[size:] 5822 } 5823 // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fallback to MarshalBytes. 5824 return r.MarshalBytes(dst) 5825 } 5826 5827 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5828 func (r *RS_SHARE_POLICY) UnmarshalUnsafe(src []byte) []byte { 5829 if r.AccessMask.Packed() { 5830 size := r.SizeBytes() 5831 gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) 5832 return src[size:] 5833 } 5834 // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fallback to UnmarshalBytes. 5835 return r.UnmarshalBytes(src) 5836 } 5837 5838 // CopyOutN implements marshal.Marshallable.CopyOutN. 5839 func (r *RS_SHARE_POLICY) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5840 if !r.AccessMask.Packed() { 5841 // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fall back to MarshalBytes. 5842 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 5843 r.MarshalBytes(buf) // escapes: fallback. 5844 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5845 } 5846 5847 // Construct a slice backed by dst's underlying memory. 5848 var buf []byte 5849 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5850 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 5851 hdr.Len = r.SizeBytes() 5852 hdr.Cap = r.SizeBytes() 5853 5854 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5855 // Since we bypassed the compiler's escape analysis, indicate that r 5856 // must live until the use above. 5857 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 5858 return length, err 5859 } 5860 5861 // CopyOut implements marshal.Marshallable.CopyOut. 5862 func (r *RS_SHARE_POLICY) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5863 return r.CopyOutN(cc, addr, r.SizeBytes()) 5864 } 5865 5866 // CopyInN implements marshal.Marshallable.CopyInN. 5867 func (r *RS_SHARE_POLICY) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5868 if !r.AccessMask.Packed() { 5869 // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fall back to UnmarshalBytes. 5870 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 5871 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5872 // Unmarshal unconditionally. If we had a short copy-in, this results in a 5873 // partially unmarshalled struct. 5874 r.UnmarshalBytes(buf) // escapes: fallback. 5875 return length, err 5876 } 5877 5878 // Construct a slice backed by dst's underlying memory. 5879 var buf []byte 5880 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5881 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 5882 hdr.Len = r.SizeBytes() 5883 hdr.Cap = r.SizeBytes() 5884 5885 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5886 // Since we bypassed the compiler's escape analysis, indicate that r 5887 // must live until the use above. 5888 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 5889 return length, err 5890 } 5891 5892 // CopyIn implements marshal.Marshallable.CopyIn. 5893 func (r *RS_SHARE_POLICY) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5894 return r.CopyInN(cc, addr, r.SizeBytes()) 5895 } 5896 5897 // WriteTo implements io.WriterTo.WriteTo. 5898 func (r *RS_SHARE_POLICY) WriteTo(writer io.Writer) (int64, error) { 5899 if !r.AccessMask.Packed() { 5900 // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fall back to MarshalBytes. 5901 buf := make([]byte, r.SizeBytes()) 5902 r.MarshalBytes(buf) 5903 length, err := writer.Write(buf) 5904 return int64(length), err 5905 } 5906 5907 // Construct a slice backed by dst's underlying memory. 5908 var buf []byte 5909 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5910 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 5911 hdr.Len = r.SizeBytes() 5912 hdr.Cap = r.SizeBytes() 5913 5914 length, err := writer.Write(buf) 5915 // Since we bypassed the compiler's escape analysis, indicate that r 5916 // must live until the use above. 5917 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 5918 return int64(length), err 5919 } 5920 5921 // SizeBytes implements marshal.Marshallable.SizeBytes. 5922 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) SizeBytes() int { 5923 return 28 + 5924 (*UvmGpuMappingAttributes)(nil).SizeBytes()*UVM_MAX_GPUS + 5925 1*4 5926 } 5927 5928 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5929 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) MarshalBytes(dst []byte) []byte { 5930 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base)) 5931 dst = dst[8:] 5932 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length)) 5933 dst = dst[8:] 5934 for idx := 0; idx < UVM_MAX_GPUS; idx++ { 5935 dst = u.PerGPUAttributes[idx].MarshalUnsafe(dst) 5936 } 5937 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.GPUAttributesCount)) 5938 dst = dst[8:] 5939 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 5940 dst = dst[4:] 5941 for idx := 0; idx < 4; idx++ { 5942 dst[0] = byte(u.Pad0[idx]) 5943 dst = dst[1:] 5944 } 5945 return dst 5946 } 5947 5948 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5949 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) UnmarshalBytes(src []byte) []byte { 5950 u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8])) 5951 src = src[8:] 5952 u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 5953 src = src[8:] 5954 for idx := 0; idx < UVM_MAX_GPUS; idx++ { 5955 src = u.PerGPUAttributes[idx].UnmarshalUnsafe(src) 5956 } 5957 u.GPUAttributesCount = uint64(hostarch.ByteOrder.Uint64(src[:8])) 5958 src = src[8:] 5959 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5960 src = src[4:] 5961 for idx := 0; idx < 4; idx++ { 5962 u.Pad0[idx] = src[0] 5963 src = src[1:] 5964 } 5965 return src 5966 } 5967 5968 // Packed implements marshal.Marshallable.Packed. 5969 //go:nosplit 5970 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) Packed() bool { 5971 return u.PerGPUAttributes[0].Packed() 5972 } 5973 5974 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5975 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) MarshalUnsafe(dst []byte) []byte { 5976 if u.PerGPUAttributes[0].Packed() { 5977 size := u.SizeBytes() 5978 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 5979 return dst[size:] 5980 } 5981 // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 5982 return u.MarshalBytes(dst) 5983 } 5984 5985 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5986 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) UnmarshalUnsafe(src []byte) []byte { 5987 if u.PerGPUAttributes[0].Packed() { 5988 size := u.SizeBytes() 5989 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 5990 return src[size:] 5991 } 5992 // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 5993 return u.UnmarshalBytes(src) 5994 } 5995 5996 // CopyOutN implements marshal.Marshallable.CopyOutN. 5997 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5998 if !u.PerGPUAttributes[0].Packed() { 5999 // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 6000 buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay. 6001 u.MarshalBytes(buf) // escapes: fallback. 6002 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6003 } 6004 6005 // Construct a slice backed by dst's underlying memory. 6006 var buf []byte 6007 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6008 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6009 hdr.Len = u.SizeBytes() 6010 hdr.Cap = u.SizeBytes() 6011 6012 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6013 // Since we bypassed the compiler's escape analysis, indicate that u 6014 // must live until the use above. 6015 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6016 return length, err 6017 } 6018 6019 // CopyOut implements marshal.Marshallable.CopyOut. 6020 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6021 return u.CopyOutN(cc, addr, u.SizeBytes()) 6022 } 6023 6024 // CopyInN implements marshal.Marshallable.CopyInN. 6025 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6026 if !u.PerGPUAttributes[0].Packed() { 6027 // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 6028 buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay. 6029 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6030 // Unmarshal unconditionally. If we had a short copy-in, this results in a 6031 // partially unmarshalled struct. 6032 u.UnmarshalBytes(buf) // escapes: fallback. 6033 return length, err 6034 } 6035 6036 // Construct a slice backed by dst's underlying memory. 6037 var buf []byte 6038 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6039 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6040 hdr.Len = u.SizeBytes() 6041 hdr.Cap = u.SizeBytes() 6042 6043 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6044 // Since we bypassed the compiler's escape analysis, indicate that u 6045 // must live until the use above. 6046 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6047 return length, err 6048 } 6049 6050 // CopyIn implements marshal.Marshallable.CopyIn. 6051 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6052 return u.CopyInN(cc, addr, u.SizeBytes()) 6053 } 6054 6055 // WriteTo implements io.WriterTo.WriteTo. 6056 func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) WriteTo(writer io.Writer) (int64, error) { 6057 if !u.PerGPUAttributes[0].Packed() { 6058 // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 6059 buf := make([]byte, u.SizeBytes()) 6060 u.MarshalBytes(buf) 6061 length, err := writer.Write(buf) 6062 return int64(length), err 6063 } 6064 6065 // Construct a slice backed by dst's underlying memory. 6066 var buf []byte 6067 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6068 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6069 hdr.Len = u.SizeBytes() 6070 hdr.Cap = u.SizeBytes() 6071 6072 length, err := writer.Write(buf) 6073 // Since we bypassed the compiler's escape analysis, indicate that u 6074 // must live until the use above. 6075 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6076 return int64(length), err 6077 } 6078 6079 // SizeBytes implements marshal.Marshallable.SizeBytes. 6080 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) SizeBytes() int { 6081 return 20 + 6082 1*4 6083 } 6084 6085 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6086 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) MarshalBytes(dst []byte) []byte { 6087 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base)) 6088 dst = dst[8:] 6089 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length)) 6090 dst = dst[8:] 6091 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 6092 dst = dst[4:] 6093 for idx := 0; idx < 4; idx++ { 6094 dst[0] = byte(u.Pad0[idx]) 6095 dst = dst[1:] 6096 } 6097 return dst 6098 } 6099 6100 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6101 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) UnmarshalBytes(src []byte) []byte { 6102 u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6103 src = src[8:] 6104 u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6105 src = src[8:] 6106 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6107 src = src[4:] 6108 for idx := 0; idx < 4; idx++ { 6109 u.Pad0[idx] = src[0] 6110 src = src[1:] 6111 } 6112 return src 6113 } 6114 6115 // Packed implements marshal.Marshallable.Packed. 6116 //go:nosplit 6117 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) Packed() bool { 6118 return true 6119 } 6120 6121 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6122 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) MarshalUnsafe(dst []byte) []byte { 6123 size := u.SizeBytes() 6124 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 6125 return dst[size:] 6126 } 6127 6128 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6129 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) UnmarshalUnsafe(src []byte) []byte { 6130 size := u.SizeBytes() 6131 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 6132 return src[size:] 6133 } 6134 6135 // CopyOutN implements marshal.Marshallable.CopyOutN. 6136 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6137 // Construct a slice backed by dst's underlying memory. 6138 var buf []byte 6139 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6140 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6141 hdr.Len = u.SizeBytes() 6142 hdr.Cap = u.SizeBytes() 6143 6144 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6145 // Since we bypassed the compiler's escape analysis, indicate that u 6146 // must live until the use above. 6147 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6148 return length, err 6149 } 6150 6151 // CopyOut implements marshal.Marshallable.CopyOut. 6152 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6153 return u.CopyOutN(cc, addr, u.SizeBytes()) 6154 } 6155 6156 // CopyInN implements marshal.Marshallable.CopyInN. 6157 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6158 // Construct a slice backed by dst's underlying memory. 6159 var buf []byte 6160 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6161 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6162 hdr.Len = u.SizeBytes() 6163 hdr.Cap = u.SizeBytes() 6164 6165 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6166 // Since we bypassed the compiler's escape analysis, indicate that u 6167 // must live until the use above. 6168 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6169 return length, err 6170 } 6171 6172 // CopyIn implements marshal.Marshallable.CopyIn. 6173 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6174 return u.CopyInN(cc, addr, u.SizeBytes()) 6175 } 6176 6177 // WriteTo implements io.WriterTo.WriteTo. 6178 func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) WriteTo(writer io.Writer) (int64, error) { 6179 // Construct a slice backed by dst's underlying memory. 6180 var buf []byte 6181 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6182 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6183 hdr.Len = u.SizeBytes() 6184 hdr.Cap = u.SizeBytes() 6185 6186 length, err := writer.Write(buf) 6187 // Since we bypassed the compiler's escape analysis, indicate that u 6188 // must live until the use above. 6189 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6190 return int64(length), err 6191 } 6192 6193 // SizeBytes implements marshal.Marshallable.SizeBytes. 6194 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) SizeBytes() int { 6195 return 12 + 6196 1*4 6197 } 6198 6199 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6200 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) MarshalBytes(dst []byte) []byte { 6201 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RangeGroupID)) 6202 dst = dst[8:] 6203 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 6204 dst = dst[4:] 6205 for idx := 0; idx < 4; idx++ { 6206 dst[0] = byte(u.Pad0[idx]) 6207 dst = dst[1:] 6208 } 6209 return dst 6210 } 6211 6212 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6213 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) UnmarshalBytes(src []byte) []byte { 6214 u.RangeGroupID = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6215 src = src[8:] 6216 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6217 src = src[4:] 6218 for idx := 0; idx < 4; idx++ { 6219 u.Pad0[idx] = src[0] 6220 src = src[1:] 6221 } 6222 return src 6223 } 6224 6225 // Packed implements marshal.Marshallable.Packed. 6226 //go:nosplit 6227 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) Packed() bool { 6228 return true 6229 } 6230 6231 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6232 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) MarshalUnsafe(dst []byte) []byte { 6233 size := u.SizeBytes() 6234 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 6235 return dst[size:] 6236 } 6237 6238 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6239 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) UnmarshalUnsafe(src []byte) []byte { 6240 size := u.SizeBytes() 6241 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 6242 return src[size:] 6243 } 6244 6245 // CopyOutN implements marshal.Marshallable.CopyOutN. 6246 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6247 // Construct a slice backed by dst's underlying memory. 6248 var buf []byte 6249 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6250 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6251 hdr.Len = u.SizeBytes() 6252 hdr.Cap = u.SizeBytes() 6253 6254 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6255 // Since we bypassed the compiler's escape analysis, indicate that u 6256 // must live until the use above. 6257 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6258 return length, err 6259 } 6260 6261 // CopyOut implements marshal.Marshallable.CopyOut. 6262 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6263 return u.CopyOutN(cc, addr, u.SizeBytes()) 6264 } 6265 6266 // CopyInN implements marshal.Marshallable.CopyInN. 6267 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6268 // Construct a slice backed by dst's underlying memory. 6269 var buf []byte 6270 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6271 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6272 hdr.Len = u.SizeBytes() 6273 hdr.Cap = u.SizeBytes() 6274 6275 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6276 // Since we bypassed the compiler's escape analysis, indicate that u 6277 // must live until the use above. 6278 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6279 return length, err 6280 } 6281 6282 // CopyIn implements marshal.Marshallable.CopyIn. 6283 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6284 return u.CopyInN(cc, addr, u.SizeBytes()) 6285 } 6286 6287 // WriteTo implements io.WriterTo.WriteTo. 6288 func (u *UVM_CREATE_RANGE_GROUP_PARAMS) WriteTo(writer io.Writer) (int64, error) { 6289 // Construct a slice backed by dst's underlying memory. 6290 var buf []byte 6291 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6292 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6293 hdr.Len = u.SizeBytes() 6294 hdr.Cap = u.SizeBytes() 6295 6296 length, err := writer.Write(buf) 6297 // Since we bypassed the compiler's escape analysis, indicate that u 6298 // must live until the use above. 6299 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6300 return int64(length), err 6301 } 6302 6303 // SizeBytes implements marshal.Marshallable.SizeBytes. 6304 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) SizeBytes() int { 6305 return 12 + 6306 1*4 6307 } 6308 6309 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6310 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) MarshalBytes(dst []byte) []byte { 6311 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RangeGroupID)) 6312 dst = dst[8:] 6313 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 6314 dst = dst[4:] 6315 for idx := 0; idx < 4; idx++ { 6316 dst[0] = byte(u.Pad0[idx]) 6317 dst = dst[1:] 6318 } 6319 return dst 6320 } 6321 6322 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6323 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) UnmarshalBytes(src []byte) []byte { 6324 u.RangeGroupID = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6325 src = src[8:] 6326 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6327 src = src[4:] 6328 for idx := 0; idx < 4; idx++ { 6329 u.Pad0[idx] = src[0] 6330 src = src[1:] 6331 } 6332 return src 6333 } 6334 6335 // Packed implements marshal.Marshallable.Packed. 6336 //go:nosplit 6337 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) Packed() bool { 6338 return true 6339 } 6340 6341 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6342 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) MarshalUnsafe(dst []byte) []byte { 6343 size := u.SizeBytes() 6344 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 6345 return dst[size:] 6346 } 6347 6348 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6349 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) UnmarshalUnsafe(src []byte) []byte { 6350 size := u.SizeBytes() 6351 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 6352 return src[size:] 6353 } 6354 6355 // CopyOutN implements marshal.Marshallable.CopyOutN. 6356 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6357 // Construct a slice backed by dst's underlying memory. 6358 var buf []byte 6359 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6360 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6361 hdr.Len = u.SizeBytes() 6362 hdr.Cap = u.SizeBytes() 6363 6364 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6365 // Since we bypassed the compiler's escape analysis, indicate that u 6366 // must live until the use above. 6367 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6368 return length, err 6369 } 6370 6371 // CopyOut implements marshal.Marshallable.CopyOut. 6372 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6373 return u.CopyOutN(cc, addr, u.SizeBytes()) 6374 } 6375 6376 // CopyInN implements marshal.Marshallable.CopyInN. 6377 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6378 // Construct a slice backed by dst's underlying memory. 6379 var buf []byte 6380 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6381 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6382 hdr.Len = u.SizeBytes() 6383 hdr.Cap = u.SizeBytes() 6384 6385 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6386 // Since we bypassed the compiler's escape analysis, indicate that u 6387 // must live until the use above. 6388 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6389 return length, err 6390 } 6391 6392 // CopyIn implements marshal.Marshallable.CopyIn. 6393 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6394 return u.CopyInN(cc, addr, u.SizeBytes()) 6395 } 6396 6397 // WriteTo implements io.WriterTo.WriteTo. 6398 func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) WriteTo(writer io.Writer) (int64, error) { 6399 // Construct a slice backed by dst's underlying memory. 6400 var buf []byte 6401 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6402 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6403 hdr.Len = u.SizeBytes() 6404 hdr.Cap = u.SizeBytes() 6405 6406 length, err := writer.Write(buf) 6407 // Since we bypassed the compiler's escape analysis, indicate that u 6408 // must live until the use above. 6409 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6410 return int64(length), err 6411 } 6412 6413 // SizeBytes implements marshal.Marshallable.SizeBytes. 6414 func (u *UVM_FREE_PARAMS) SizeBytes() int { 6415 return 20 + 6416 1*4 6417 } 6418 6419 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6420 func (u *UVM_FREE_PARAMS) MarshalBytes(dst []byte) []byte { 6421 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base)) 6422 dst = dst[8:] 6423 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length)) 6424 dst = dst[8:] 6425 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 6426 dst = dst[4:] 6427 for idx := 0; idx < 4; idx++ { 6428 dst[0] = byte(u.Pad0[idx]) 6429 dst = dst[1:] 6430 } 6431 return dst 6432 } 6433 6434 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6435 func (u *UVM_FREE_PARAMS) UnmarshalBytes(src []byte) []byte { 6436 u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6437 src = src[8:] 6438 u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6439 src = src[8:] 6440 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6441 src = src[4:] 6442 for idx := 0; idx < 4; idx++ { 6443 u.Pad0[idx] = src[0] 6444 src = src[1:] 6445 } 6446 return src 6447 } 6448 6449 // Packed implements marshal.Marshallable.Packed. 6450 //go:nosplit 6451 func (u *UVM_FREE_PARAMS) Packed() bool { 6452 return true 6453 } 6454 6455 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6456 func (u *UVM_FREE_PARAMS) MarshalUnsafe(dst []byte) []byte { 6457 size := u.SizeBytes() 6458 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 6459 return dst[size:] 6460 } 6461 6462 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6463 func (u *UVM_FREE_PARAMS) UnmarshalUnsafe(src []byte) []byte { 6464 size := u.SizeBytes() 6465 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 6466 return src[size:] 6467 } 6468 6469 // CopyOutN implements marshal.Marshallable.CopyOutN. 6470 func (u *UVM_FREE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6471 // Construct a slice backed by dst's underlying memory. 6472 var buf []byte 6473 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6474 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6475 hdr.Len = u.SizeBytes() 6476 hdr.Cap = u.SizeBytes() 6477 6478 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6479 // Since we bypassed the compiler's escape analysis, indicate that u 6480 // must live until the use above. 6481 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6482 return length, err 6483 } 6484 6485 // CopyOut implements marshal.Marshallable.CopyOut. 6486 func (u *UVM_FREE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6487 return u.CopyOutN(cc, addr, u.SizeBytes()) 6488 } 6489 6490 // CopyInN implements marshal.Marshallable.CopyInN. 6491 func (u *UVM_FREE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6492 // Construct a slice backed by dst's underlying memory. 6493 var buf []byte 6494 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6495 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6496 hdr.Len = u.SizeBytes() 6497 hdr.Cap = u.SizeBytes() 6498 6499 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6500 // Since we bypassed the compiler's escape analysis, indicate that u 6501 // must live until the use above. 6502 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6503 return length, err 6504 } 6505 6506 // CopyIn implements marshal.Marshallable.CopyIn. 6507 func (u *UVM_FREE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6508 return u.CopyInN(cc, addr, u.SizeBytes()) 6509 } 6510 6511 // WriteTo implements io.WriterTo.WriteTo. 6512 func (u *UVM_FREE_PARAMS) WriteTo(writer io.Writer) (int64, error) { 6513 // Construct a slice backed by dst's underlying memory. 6514 var buf []byte 6515 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6516 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6517 hdr.Len = u.SizeBytes() 6518 hdr.Cap = u.SizeBytes() 6519 6520 length, err := writer.Write(buf) 6521 // Since we bypassed the compiler's escape analysis, indicate that u 6522 // must live until the use above. 6523 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6524 return int64(length), err 6525 } 6526 6527 // SizeBytes implements marshal.Marshallable.SizeBytes. 6528 func (u *UVM_INITIALIZE_PARAMS) SizeBytes() int { 6529 return 12 + 6530 1*4 6531 } 6532 6533 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6534 func (u *UVM_INITIALIZE_PARAMS) MarshalBytes(dst []byte) []byte { 6535 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Flags)) 6536 dst = dst[8:] 6537 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 6538 dst = dst[4:] 6539 for idx := 0; idx < 4; idx++ { 6540 dst[0] = byte(u.Pad0[idx]) 6541 dst = dst[1:] 6542 } 6543 return dst 6544 } 6545 6546 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6547 func (u *UVM_INITIALIZE_PARAMS) UnmarshalBytes(src []byte) []byte { 6548 u.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6549 src = src[8:] 6550 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6551 src = src[4:] 6552 for idx := 0; idx < 4; idx++ { 6553 u.Pad0[idx] = src[0] 6554 src = src[1:] 6555 } 6556 return src 6557 } 6558 6559 // Packed implements marshal.Marshallable.Packed. 6560 //go:nosplit 6561 func (u *UVM_INITIALIZE_PARAMS) Packed() bool { 6562 return true 6563 } 6564 6565 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6566 func (u *UVM_INITIALIZE_PARAMS) MarshalUnsafe(dst []byte) []byte { 6567 size := u.SizeBytes() 6568 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 6569 return dst[size:] 6570 } 6571 6572 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6573 func (u *UVM_INITIALIZE_PARAMS) UnmarshalUnsafe(src []byte) []byte { 6574 size := u.SizeBytes() 6575 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 6576 return src[size:] 6577 } 6578 6579 // CopyOutN implements marshal.Marshallable.CopyOutN. 6580 func (u *UVM_INITIALIZE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6581 // Construct a slice backed by dst's underlying memory. 6582 var buf []byte 6583 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6584 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6585 hdr.Len = u.SizeBytes() 6586 hdr.Cap = u.SizeBytes() 6587 6588 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6589 // Since we bypassed the compiler's escape analysis, indicate that u 6590 // must live until the use above. 6591 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6592 return length, err 6593 } 6594 6595 // CopyOut implements marshal.Marshallable.CopyOut. 6596 func (u *UVM_INITIALIZE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6597 return u.CopyOutN(cc, addr, u.SizeBytes()) 6598 } 6599 6600 // CopyInN implements marshal.Marshallable.CopyInN. 6601 func (u *UVM_INITIALIZE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6602 // Construct a slice backed by dst's underlying memory. 6603 var buf []byte 6604 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6605 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6606 hdr.Len = u.SizeBytes() 6607 hdr.Cap = u.SizeBytes() 6608 6609 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6610 // Since we bypassed the compiler's escape analysis, indicate that u 6611 // must live until the use above. 6612 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6613 return length, err 6614 } 6615 6616 // CopyIn implements marshal.Marshallable.CopyIn. 6617 func (u *UVM_INITIALIZE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6618 return u.CopyInN(cc, addr, u.SizeBytes()) 6619 } 6620 6621 // WriteTo implements io.WriterTo.WriteTo. 6622 func (u *UVM_INITIALIZE_PARAMS) WriteTo(writer io.Writer) (int64, error) { 6623 // Construct a slice backed by dst's underlying memory. 6624 var buf []byte 6625 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6626 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6627 hdr.Len = u.SizeBytes() 6628 hdr.Cap = u.SizeBytes() 6629 6630 length, err := writer.Write(buf) 6631 // Since we bypassed the compiler's escape analysis, indicate that u 6632 // must live until the use above. 6633 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6634 return int64(length), err 6635 } 6636 6637 // SizeBytes implements marshal.Marshallable.SizeBytes. 6638 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) SizeBytes() int { 6639 return 20 + 6640 1*16 + 6641 1*4 6642 } 6643 6644 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6645 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) MarshalBytes(dst []byte) []byte { 6646 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base)) 6647 dst = dst[8:] 6648 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length)) 6649 dst = dst[8:] 6650 for idx := 0; idx < 16; idx++ { 6651 dst[0] = byte(u.GPUUUID[idx]) 6652 dst = dst[1:] 6653 } 6654 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 6655 dst = dst[4:] 6656 for idx := 0; idx < 4; idx++ { 6657 dst[0] = byte(u.Pad0[idx]) 6658 dst = dst[1:] 6659 } 6660 return dst 6661 } 6662 6663 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6664 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) UnmarshalBytes(src []byte) []byte { 6665 u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6666 src = src[8:] 6667 u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6668 src = src[8:] 6669 for idx := 0; idx < 16; idx++ { 6670 u.GPUUUID[idx] = uint8(src[0]) 6671 src = src[1:] 6672 } 6673 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6674 src = src[4:] 6675 for idx := 0; idx < 4; idx++ { 6676 u.Pad0[idx] = src[0] 6677 src = src[1:] 6678 } 6679 return src 6680 } 6681 6682 // Packed implements marshal.Marshallable.Packed. 6683 //go:nosplit 6684 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) Packed() bool { 6685 return true 6686 } 6687 6688 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6689 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) MarshalUnsafe(dst []byte) []byte { 6690 size := u.SizeBytes() 6691 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 6692 return dst[size:] 6693 } 6694 6695 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6696 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) UnmarshalUnsafe(src []byte) []byte { 6697 size := u.SizeBytes() 6698 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 6699 return src[size:] 6700 } 6701 6702 // CopyOutN implements marshal.Marshallable.CopyOutN. 6703 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6704 // Construct a slice backed by dst's underlying memory. 6705 var buf []byte 6706 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6707 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6708 hdr.Len = u.SizeBytes() 6709 hdr.Cap = u.SizeBytes() 6710 6711 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6712 // Since we bypassed the compiler's escape analysis, indicate that u 6713 // must live until the use above. 6714 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6715 return length, err 6716 } 6717 6718 // CopyOut implements marshal.Marshallable.CopyOut. 6719 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6720 return u.CopyOutN(cc, addr, u.SizeBytes()) 6721 } 6722 6723 // CopyInN implements marshal.Marshallable.CopyInN. 6724 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6725 // Construct a slice backed by dst's underlying memory. 6726 var buf []byte 6727 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6728 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6729 hdr.Len = u.SizeBytes() 6730 hdr.Cap = u.SizeBytes() 6731 6732 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6733 // Since we bypassed the compiler's escape analysis, indicate that u 6734 // must live until the use above. 6735 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6736 return length, err 6737 } 6738 6739 // CopyIn implements marshal.Marshallable.CopyIn. 6740 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6741 return u.CopyInN(cc, addr, u.SizeBytes()) 6742 } 6743 6744 // WriteTo implements io.WriterTo.WriteTo. 6745 func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) WriteTo(writer io.Writer) (int64, error) { 6746 // Construct a slice backed by dst's underlying memory. 6747 var buf []byte 6748 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6749 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6750 hdr.Len = u.SizeBytes() 6751 hdr.Cap = u.SizeBytes() 6752 6753 length, err := writer.Write(buf) 6754 // Since we bypassed the compiler's escape analysis, indicate that u 6755 // must live until the use above. 6756 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6757 return int64(length), err 6758 } 6759 6760 // SizeBytes implements marshal.Marshallable.SizeBytes. 6761 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) SizeBytes() int { 6762 return 40 + 6763 (*UvmGpuMappingAttributes)(nil).SizeBytes()*UVM_MAX_GPUS + 6764 (*Handle)(nil).SizeBytes() + 6765 (*Handle)(nil).SizeBytes() 6766 } 6767 6768 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6769 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) MarshalBytes(dst []byte) []byte { 6770 hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Base)) 6771 dst = dst[8:] 6772 hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Length)) 6773 dst = dst[8:] 6774 hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Offset)) 6775 dst = dst[8:] 6776 for idx := 0; idx < UVM_MAX_GPUS; idx++ { 6777 dst = p.PerGPUAttributes[idx].MarshalUnsafe(dst) 6778 } 6779 hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.GPUAttributesCount)) 6780 dst = dst[8:] 6781 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD)) 6782 dst = dst[4:] 6783 dst = p.HClient.MarshalUnsafe(dst) 6784 dst = p.HMemory.MarshalUnsafe(dst) 6785 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus)) 6786 dst = dst[4:] 6787 return dst 6788 } 6789 6790 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6791 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) UnmarshalBytes(src []byte) []byte { 6792 p.Base = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6793 src = src[8:] 6794 p.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6795 src = src[8:] 6796 p.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6797 src = src[8:] 6798 for idx := 0; idx < UVM_MAX_GPUS; idx++ { 6799 src = p.PerGPUAttributes[idx].UnmarshalUnsafe(src) 6800 } 6801 p.GPUAttributesCount = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6802 src = src[8:] 6803 p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4])) 6804 src = src[4:] 6805 src = p.HClient.UnmarshalUnsafe(src) 6806 src = p.HMemory.UnmarshalUnsafe(src) 6807 p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6808 src = src[4:] 6809 return src 6810 } 6811 6812 // Packed implements marshal.Marshallable.Packed. 6813 //go:nosplit 6814 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) Packed() bool { 6815 return p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() 6816 } 6817 6818 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6819 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) MarshalUnsafe(dst []byte) []byte { 6820 if p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() { 6821 size := p.SizeBytes() 6822 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size)) 6823 return dst[size:] 6824 } 6825 // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 6826 return p.MarshalBytes(dst) 6827 } 6828 6829 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6830 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) UnmarshalUnsafe(src []byte) []byte { 6831 if p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() { 6832 size := p.SizeBytes() 6833 gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size)) 6834 return src[size:] 6835 } 6836 // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 6837 return p.UnmarshalBytes(src) 6838 } 6839 6840 // CopyOutN implements marshal.Marshallable.CopyOutN. 6841 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6842 if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() { 6843 // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 6844 buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay. 6845 p.MarshalBytes(buf) // escapes: fallback. 6846 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6847 } 6848 6849 // Construct a slice backed by dst's underlying memory. 6850 var buf []byte 6851 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6852 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 6853 hdr.Len = p.SizeBytes() 6854 hdr.Cap = p.SizeBytes() 6855 6856 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6857 // Since we bypassed the compiler's escape analysis, indicate that p 6858 // must live until the use above. 6859 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 6860 return length, err 6861 } 6862 6863 // CopyOut implements marshal.Marshallable.CopyOut. 6864 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6865 return p.CopyOutN(cc, addr, p.SizeBytes()) 6866 } 6867 6868 // CopyInN implements marshal.Marshallable.CopyInN. 6869 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6870 if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() { 6871 // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 6872 buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay. 6873 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6874 // Unmarshal unconditionally. If we had a short copy-in, this results in a 6875 // partially unmarshalled struct. 6876 p.UnmarshalBytes(buf) // escapes: fallback. 6877 return length, err 6878 } 6879 6880 // Construct a slice backed by dst's underlying memory. 6881 var buf []byte 6882 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6883 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 6884 hdr.Len = p.SizeBytes() 6885 hdr.Cap = p.SizeBytes() 6886 6887 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6888 // Since we bypassed the compiler's escape analysis, indicate that p 6889 // must live until the use above. 6890 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 6891 return length, err 6892 } 6893 6894 // CopyIn implements marshal.Marshallable.CopyIn. 6895 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6896 return p.CopyInN(cc, addr, p.SizeBytes()) 6897 } 6898 6899 // WriteTo implements io.WriterTo.WriteTo. 6900 func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) WriteTo(writer io.Writer) (int64, error) { 6901 if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() { 6902 // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 6903 buf := make([]byte, p.SizeBytes()) 6904 p.MarshalBytes(buf) 6905 length, err := writer.Write(buf) 6906 return int64(length), err 6907 } 6908 6909 // Construct a slice backed by dst's underlying memory. 6910 var buf []byte 6911 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6912 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 6913 hdr.Len = p.SizeBytes() 6914 hdr.Cap = p.SizeBytes() 6915 6916 length, err := writer.Write(buf) 6917 // Since we bypassed the compiler's escape analysis, indicate that p 6918 // must live until the use above. 6919 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 6920 return int64(length), err 6921 } 6922 6923 // SizeBytes implements marshal.Marshallable.SizeBytes. 6924 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) SizeBytes() int { 6925 return 5 + 6926 1*3 6927 } 6928 6929 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6930 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) MarshalBytes(dst []byte) []byte { 6931 dst[0] = byte(u.PageableMemAccess) 6932 dst = dst[1:] 6933 for idx := 0; idx < 3; idx++ { 6934 dst[0] = byte(u.Pad[idx]) 6935 dst = dst[1:] 6936 } 6937 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 6938 dst = dst[4:] 6939 return dst 6940 } 6941 6942 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6943 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) UnmarshalBytes(src []byte) []byte { 6944 u.PageableMemAccess = uint8(src[0]) 6945 src = src[1:] 6946 for idx := 0; idx < 3; idx++ { 6947 u.Pad[idx] = src[0] 6948 src = src[1:] 6949 } 6950 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6951 src = src[4:] 6952 return src 6953 } 6954 6955 // Packed implements marshal.Marshallable.Packed. 6956 //go:nosplit 6957 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) Packed() bool { 6958 return true 6959 } 6960 6961 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6962 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) MarshalUnsafe(dst []byte) []byte { 6963 size := u.SizeBytes() 6964 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 6965 return dst[size:] 6966 } 6967 6968 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6969 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) UnmarshalUnsafe(src []byte) []byte { 6970 size := u.SizeBytes() 6971 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 6972 return src[size:] 6973 } 6974 6975 // CopyOutN implements marshal.Marshallable.CopyOutN. 6976 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6977 // Construct a slice backed by dst's underlying memory. 6978 var buf []byte 6979 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6980 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 6981 hdr.Len = u.SizeBytes() 6982 hdr.Cap = u.SizeBytes() 6983 6984 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6985 // Since we bypassed the compiler's escape analysis, indicate that u 6986 // must live until the use above. 6987 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 6988 return length, err 6989 } 6990 6991 // CopyOut implements marshal.Marshallable.CopyOut. 6992 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6993 return u.CopyOutN(cc, addr, u.SizeBytes()) 6994 } 6995 6996 // CopyInN implements marshal.Marshallable.CopyInN. 6997 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6998 // Construct a slice backed by dst's underlying memory. 6999 var buf []byte 7000 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7001 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7002 hdr.Len = u.SizeBytes() 7003 hdr.Cap = u.SizeBytes() 7004 7005 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7006 // Since we bypassed the compiler's escape analysis, indicate that u 7007 // must live until the use above. 7008 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7009 return length, err 7010 } 7011 7012 // CopyIn implements marshal.Marshallable.CopyIn. 7013 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7014 return u.CopyInN(cc, addr, u.SizeBytes()) 7015 } 7016 7017 // WriteTo implements io.WriterTo.WriteTo. 7018 func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) WriteTo(writer io.Writer) (int64, error) { 7019 // Construct a slice backed by dst's underlying memory. 7020 var buf []byte 7021 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7022 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7023 hdr.Len = u.SizeBytes() 7024 hdr.Cap = u.SizeBytes() 7025 7026 length, err := writer.Write(buf) 7027 // Since we bypassed the compiler's escape analysis, indicate that u 7028 // must live until the use above. 7029 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7030 return int64(length), err 7031 } 7032 7033 // SizeBytes implements marshal.Marshallable.SizeBytes. 7034 func (p *UVM_REGISTER_CHANNEL_PARAMS) SizeBytes() int { 7035 return 24 + 7036 1*16 + 7037 (*Handle)(nil).SizeBytes() + 7038 (*Handle)(nil).SizeBytes() + 7039 1*4 + 7040 1*4 7041 } 7042 7043 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7044 func (p *UVM_REGISTER_CHANNEL_PARAMS) MarshalBytes(dst []byte) []byte { 7045 for idx := 0; idx < 16; idx++ { 7046 dst[0] = byte(p.GPUUUID[idx]) 7047 dst = dst[1:] 7048 } 7049 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD)) 7050 dst = dst[4:] 7051 dst = p.HClient.MarshalUnsafe(dst) 7052 dst = p.HChannel.MarshalUnsafe(dst) 7053 for idx := 0; idx < 4; idx++ { 7054 dst[0] = byte(p.Pad[idx]) 7055 dst = dst[1:] 7056 } 7057 hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Base)) 7058 dst = dst[8:] 7059 hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Length)) 7060 dst = dst[8:] 7061 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus)) 7062 dst = dst[4:] 7063 for idx := 0; idx < 4; idx++ { 7064 dst[0] = byte(p.Pad0[idx]) 7065 dst = dst[1:] 7066 } 7067 return dst 7068 } 7069 7070 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7071 func (p *UVM_REGISTER_CHANNEL_PARAMS) UnmarshalBytes(src []byte) []byte { 7072 for idx := 0; idx < 16; idx++ { 7073 p.GPUUUID[idx] = uint8(src[0]) 7074 src = src[1:] 7075 } 7076 p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4])) 7077 src = src[4:] 7078 src = p.HClient.UnmarshalUnsafe(src) 7079 src = p.HChannel.UnmarshalUnsafe(src) 7080 for idx := 0; idx < 4; idx++ { 7081 p.Pad[idx] = src[0] 7082 src = src[1:] 7083 } 7084 p.Base = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7085 src = src[8:] 7086 p.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7087 src = src[8:] 7088 p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7089 src = src[4:] 7090 for idx := 0; idx < 4; idx++ { 7091 p.Pad0[idx] = src[0] 7092 src = src[1:] 7093 } 7094 return src 7095 } 7096 7097 // Packed implements marshal.Marshallable.Packed. 7098 //go:nosplit 7099 func (p *UVM_REGISTER_CHANNEL_PARAMS) Packed() bool { 7100 return p.HChannel.Packed() && p.HClient.Packed() 7101 } 7102 7103 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7104 func (p *UVM_REGISTER_CHANNEL_PARAMS) MarshalUnsafe(dst []byte) []byte { 7105 if p.HChannel.Packed() && p.HClient.Packed() { 7106 size := p.SizeBytes() 7107 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size)) 7108 return dst[size:] 7109 } 7110 // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 7111 return p.MarshalBytes(dst) 7112 } 7113 7114 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7115 func (p *UVM_REGISTER_CHANNEL_PARAMS) UnmarshalUnsafe(src []byte) []byte { 7116 if p.HChannel.Packed() && p.HClient.Packed() { 7117 size := p.SizeBytes() 7118 gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size)) 7119 return src[size:] 7120 } 7121 // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 7122 return p.UnmarshalBytes(src) 7123 } 7124 7125 // CopyOutN implements marshal.Marshallable.CopyOutN. 7126 func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7127 if !p.HChannel.Packed() && p.HClient.Packed() { 7128 // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 7129 buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay. 7130 p.MarshalBytes(buf) // escapes: fallback. 7131 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7132 } 7133 7134 // Construct a slice backed by dst's underlying memory. 7135 var buf []byte 7136 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7137 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 7138 hdr.Len = p.SizeBytes() 7139 hdr.Cap = p.SizeBytes() 7140 7141 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7142 // Since we bypassed the compiler's escape analysis, indicate that p 7143 // must live until the use above. 7144 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 7145 return length, err 7146 } 7147 7148 // CopyOut implements marshal.Marshallable.CopyOut. 7149 func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7150 return p.CopyOutN(cc, addr, p.SizeBytes()) 7151 } 7152 7153 // CopyInN implements marshal.Marshallable.CopyInN. 7154 func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7155 if !p.HChannel.Packed() && p.HClient.Packed() { 7156 // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 7157 buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay. 7158 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7159 // Unmarshal unconditionally. If we had a short copy-in, this results in a 7160 // partially unmarshalled struct. 7161 p.UnmarshalBytes(buf) // escapes: fallback. 7162 return length, err 7163 } 7164 7165 // Construct a slice backed by dst's underlying memory. 7166 var buf []byte 7167 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7168 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 7169 hdr.Len = p.SizeBytes() 7170 hdr.Cap = p.SizeBytes() 7171 7172 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7173 // Since we bypassed the compiler's escape analysis, indicate that p 7174 // must live until the use above. 7175 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 7176 return length, err 7177 } 7178 7179 // CopyIn implements marshal.Marshallable.CopyIn. 7180 func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7181 return p.CopyInN(cc, addr, p.SizeBytes()) 7182 } 7183 7184 // WriteTo implements io.WriterTo.WriteTo. 7185 func (p *UVM_REGISTER_CHANNEL_PARAMS) WriteTo(writer io.Writer) (int64, error) { 7186 if !p.HChannel.Packed() && p.HClient.Packed() { 7187 // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 7188 buf := make([]byte, p.SizeBytes()) 7189 p.MarshalBytes(buf) 7190 length, err := writer.Write(buf) 7191 return int64(length), err 7192 } 7193 7194 // Construct a slice backed by dst's underlying memory. 7195 var buf []byte 7196 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7197 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 7198 hdr.Len = p.SizeBytes() 7199 hdr.Cap = p.SizeBytes() 7200 7201 length, err := writer.Write(buf) 7202 // Since we bypassed the compiler's escape analysis, indicate that p 7203 // must live until the use above. 7204 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 7205 return int64(length), err 7206 } 7207 7208 // SizeBytes implements marshal.Marshallable.SizeBytes. 7209 func (p *UVM_REGISTER_GPU_PARAMS) SizeBytes() int { 7210 return 13 + 7211 1*16 + 7212 1*3 + 7213 (*Handle)(nil).SizeBytes() + 7214 (*Handle)(nil).SizeBytes() 7215 } 7216 7217 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7218 func (p *UVM_REGISTER_GPU_PARAMS) MarshalBytes(dst []byte) []byte { 7219 for idx := 0; idx < 16; idx++ { 7220 dst[0] = byte(p.GPUUUID[idx]) 7221 dst = dst[1:] 7222 } 7223 dst[0] = byte(p.NumaEnabled) 7224 dst = dst[1:] 7225 for idx := 0; idx < 3; idx++ { 7226 dst[0] = byte(p.Pad[idx]) 7227 dst = dst[1:] 7228 } 7229 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.NumaNodeID)) 7230 dst = dst[4:] 7231 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD)) 7232 dst = dst[4:] 7233 dst = p.HClient.MarshalUnsafe(dst) 7234 dst = p.HSMCPartRef.MarshalUnsafe(dst) 7235 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus)) 7236 dst = dst[4:] 7237 return dst 7238 } 7239 7240 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7241 func (p *UVM_REGISTER_GPU_PARAMS) UnmarshalBytes(src []byte) []byte { 7242 for idx := 0; idx < 16; idx++ { 7243 p.GPUUUID[idx] = uint8(src[0]) 7244 src = src[1:] 7245 } 7246 p.NumaEnabled = uint8(src[0]) 7247 src = src[1:] 7248 for idx := 0; idx < 3; idx++ { 7249 p.Pad[idx] = src[0] 7250 src = src[1:] 7251 } 7252 p.NumaNodeID = int32(hostarch.ByteOrder.Uint32(src[:4])) 7253 src = src[4:] 7254 p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4])) 7255 src = src[4:] 7256 src = p.HClient.UnmarshalUnsafe(src) 7257 src = p.HSMCPartRef.UnmarshalUnsafe(src) 7258 p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7259 src = src[4:] 7260 return src 7261 } 7262 7263 // Packed implements marshal.Marshallable.Packed. 7264 //go:nosplit 7265 func (p *UVM_REGISTER_GPU_PARAMS) Packed() bool { 7266 return p.HClient.Packed() && p.HSMCPartRef.Packed() 7267 } 7268 7269 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7270 func (p *UVM_REGISTER_GPU_PARAMS) MarshalUnsafe(dst []byte) []byte { 7271 if p.HClient.Packed() && p.HSMCPartRef.Packed() { 7272 size := p.SizeBytes() 7273 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size)) 7274 return dst[size:] 7275 } 7276 // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 7277 return p.MarshalBytes(dst) 7278 } 7279 7280 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7281 func (p *UVM_REGISTER_GPU_PARAMS) UnmarshalUnsafe(src []byte) []byte { 7282 if p.HClient.Packed() && p.HSMCPartRef.Packed() { 7283 size := p.SizeBytes() 7284 gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size)) 7285 return src[size:] 7286 } 7287 // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 7288 return p.UnmarshalBytes(src) 7289 } 7290 7291 // CopyOutN implements marshal.Marshallable.CopyOutN. 7292 func (p *UVM_REGISTER_GPU_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7293 if !p.HClient.Packed() && p.HSMCPartRef.Packed() { 7294 // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 7295 buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay. 7296 p.MarshalBytes(buf) // escapes: fallback. 7297 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7298 } 7299 7300 // Construct a slice backed by dst's underlying memory. 7301 var buf []byte 7302 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7303 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 7304 hdr.Len = p.SizeBytes() 7305 hdr.Cap = p.SizeBytes() 7306 7307 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7308 // Since we bypassed the compiler's escape analysis, indicate that p 7309 // must live until the use above. 7310 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 7311 return length, err 7312 } 7313 7314 // CopyOut implements marshal.Marshallable.CopyOut. 7315 func (p *UVM_REGISTER_GPU_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7316 return p.CopyOutN(cc, addr, p.SizeBytes()) 7317 } 7318 7319 // CopyInN implements marshal.Marshallable.CopyInN. 7320 func (p *UVM_REGISTER_GPU_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7321 if !p.HClient.Packed() && p.HSMCPartRef.Packed() { 7322 // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 7323 buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay. 7324 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7325 // Unmarshal unconditionally. If we had a short copy-in, this results in a 7326 // partially unmarshalled struct. 7327 p.UnmarshalBytes(buf) // escapes: fallback. 7328 return length, err 7329 } 7330 7331 // Construct a slice backed by dst's underlying memory. 7332 var buf []byte 7333 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7334 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 7335 hdr.Len = p.SizeBytes() 7336 hdr.Cap = p.SizeBytes() 7337 7338 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7339 // Since we bypassed the compiler's escape analysis, indicate that p 7340 // must live until the use above. 7341 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 7342 return length, err 7343 } 7344 7345 // CopyIn implements marshal.Marshallable.CopyIn. 7346 func (p *UVM_REGISTER_GPU_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7347 return p.CopyInN(cc, addr, p.SizeBytes()) 7348 } 7349 7350 // WriteTo implements io.WriterTo.WriteTo. 7351 func (p *UVM_REGISTER_GPU_PARAMS) WriteTo(writer io.Writer) (int64, error) { 7352 if !p.HClient.Packed() && p.HSMCPartRef.Packed() { 7353 // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 7354 buf := make([]byte, p.SizeBytes()) 7355 p.MarshalBytes(buf) 7356 length, err := writer.Write(buf) 7357 return int64(length), err 7358 } 7359 7360 // Construct a slice backed by dst's underlying memory. 7361 var buf []byte 7362 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7363 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 7364 hdr.Len = p.SizeBytes() 7365 hdr.Cap = p.SizeBytes() 7366 7367 length, err := writer.Write(buf) 7368 // Since we bypassed the compiler's escape analysis, indicate that p 7369 // must live until the use above. 7370 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 7371 return int64(length), err 7372 } 7373 7374 // SizeBytes implements marshal.Marshallable.SizeBytes. 7375 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) SizeBytes() int { 7376 return 8 + 7377 1*16 + 7378 (*Handle)(nil).SizeBytes() + 7379 (*Handle)(nil).SizeBytes() 7380 } 7381 7382 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7383 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) MarshalBytes(dst []byte) []byte { 7384 for idx := 0; idx < 16; idx++ { 7385 dst[0] = byte(p.GPUUUID[idx]) 7386 dst = dst[1:] 7387 } 7388 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD)) 7389 dst = dst[4:] 7390 dst = p.HClient.MarshalUnsafe(dst) 7391 dst = p.HVASpace.MarshalUnsafe(dst) 7392 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus)) 7393 dst = dst[4:] 7394 return dst 7395 } 7396 7397 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7398 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) UnmarshalBytes(src []byte) []byte { 7399 for idx := 0; idx < 16; idx++ { 7400 p.GPUUUID[idx] = uint8(src[0]) 7401 src = src[1:] 7402 } 7403 p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4])) 7404 src = src[4:] 7405 src = p.HClient.UnmarshalUnsafe(src) 7406 src = p.HVASpace.UnmarshalUnsafe(src) 7407 p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7408 src = src[4:] 7409 return src 7410 } 7411 7412 // Packed implements marshal.Marshallable.Packed. 7413 //go:nosplit 7414 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) Packed() bool { 7415 return p.HClient.Packed() && p.HVASpace.Packed() 7416 } 7417 7418 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7419 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) MarshalUnsafe(dst []byte) []byte { 7420 if p.HClient.Packed() && p.HVASpace.Packed() { 7421 size := p.SizeBytes() 7422 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size)) 7423 return dst[size:] 7424 } 7425 // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 7426 return p.MarshalBytes(dst) 7427 } 7428 7429 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7430 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) UnmarshalUnsafe(src []byte) []byte { 7431 if p.HClient.Packed() && p.HVASpace.Packed() { 7432 size := p.SizeBytes() 7433 gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size)) 7434 return src[size:] 7435 } 7436 // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 7437 return p.UnmarshalBytes(src) 7438 } 7439 7440 // CopyOutN implements marshal.Marshallable.CopyOutN. 7441 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7442 if !p.HClient.Packed() && p.HVASpace.Packed() { 7443 // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 7444 buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay. 7445 p.MarshalBytes(buf) // escapes: fallback. 7446 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7447 } 7448 7449 // Construct a slice backed by dst's underlying memory. 7450 var buf []byte 7451 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7452 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 7453 hdr.Len = p.SizeBytes() 7454 hdr.Cap = p.SizeBytes() 7455 7456 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7457 // Since we bypassed the compiler's escape analysis, indicate that p 7458 // must live until the use above. 7459 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 7460 return length, err 7461 } 7462 7463 // CopyOut implements marshal.Marshallable.CopyOut. 7464 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7465 return p.CopyOutN(cc, addr, p.SizeBytes()) 7466 } 7467 7468 // CopyInN implements marshal.Marshallable.CopyInN. 7469 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7470 if !p.HClient.Packed() && p.HVASpace.Packed() { 7471 // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 7472 buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay. 7473 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7474 // Unmarshal unconditionally. If we had a short copy-in, this results in a 7475 // partially unmarshalled struct. 7476 p.UnmarshalBytes(buf) // escapes: fallback. 7477 return length, err 7478 } 7479 7480 // Construct a slice backed by dst's underlying memory. 7481 var buf []byte 7482 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7483 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 7484 hdr.Len = p.SizeBytes() 7485 hdr.Cap = p.SizeBytes() 7486 7487 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7488 // Since we bypassed the compiler's escape analysis, indicate that p 7489 // must live until the use above. 7490 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 7491 return length, err 7492 } 7493 7494 // CopyIn implements marshal.Marshallable.CopyIn. 7495 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7496 return p.CopyInN(cc, addr, p.SizeBytes()) 7497 } 7498 7499 // WriteTo implements io.WriterTo.WriteTo. 7500 func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) WriteTo(writer io.Writer) (int64, error) { 7501 if !p.HClient.Packed() && p.HVASpace.Packed() { 7502 // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 7503 buf := make([]byte, p.SizeBytes()) 7504 p.MarshalBytes(buf) 7505 length, err := writer.Write(buf) 7506 return int64(length), err 7507 } 7508 7509 // Construct a slice backed by dst's underlying memory. 7510 var buf []byte 7511 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7512 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 7513 hdr.Len = p.SizeBytes() 7514 hdr.Cap = p.SizeBytes() 7515 7516 length, err := writer.Write(buf) 7517 // Since we bypassed the compiler's escape analysis, indicate that p 7518 // must live until the use above. 7519 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 7520 return int64(length), err 7521 } 7522 7523 // SizeBytes implements marshal.Marshallable.SizeBytes. 7524 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) SizeBytes() int { 7525 return 4 + 7526 1*16 + 7527 (*Handle)(nil).SizeBytes() + 7528 (*Handle)(nil).SizeBytes() 7529 } 7530 7531 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7532 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) MarshalBytes(dst []byte) []byte { 7533 for idx := 0; idx < 16; idx++ { 7534 dst[0] = byte(u.GPUUUID[idx]) 7535 dst = dst[1:] 7536 } 7537 dst = u.HClient.MarshalUnsafe(dst) 7538 dst = u.HChannel.MarshalUnsafe(dst) 7539 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 7540 dst = dst[4:] 7541 return dst 7542 } 7543 7544 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7545 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) UnmarshalBytes(src []byte) []byte { 7546 for idx := 0; idx < 16; idx++ { 7547 u.GPUUUID[idx] = uint8(src[0]) 7548 src = src[1:] 7549 } 7550 src = u.HClient.UnmarshalUnsafe(src) 7551 src = u.HChannel.UnmarshalUnsafe(src) 7552 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7553 src = src[4:] 7554 return src 7555 } 7556 7557 // Packed implements marshal.Marshallable.Packed. 7558 //go:nosplit 7559 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) Packed() bool { 7560 return u.HChannel.Packed() && u.HClient.Packed() 7561 } 7562 7563 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7564 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) MarshalUnsafe(dst []byte) []byte { 7565 if u.HChannel.Packed() && u.HClient.Packed() { 7566 size := u.SizeBytes() 7567 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 7568 return dst[size:] 7569 } 7570 // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes. 7571 return u.MarshalBytes(dst) 7572 } 7573 7574 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7575 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) UnmarshalUnsafe(src []byte) []byte { 7576 if u.HChannel.Packed() && u.HClient.Packed() { 7577 size := u.SizeBytes() 7578 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 7579 return src[size:] 7580 } 7581 // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 7582 return u.UnmarshalBytes(src) 7583 } 7584 7585 // CopyOutN implements marshal.Marshallable.CopyOutN. 7586 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7587 if !u.HChannel.Packed() && u.HClient.Packed() { 7588 // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 7589 buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay. 7590 u.MarshalBytes(buf) // escapes: fallback. 7591 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7592 } 7593 7594 // Construct a slice backed by dst's underlying memory. 7595 var buf []byte 7596 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7597 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7598 hdr.Len = u.SizeBytes() 7599 hdr.Cap = u.SizeBytes() 7600 7601 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7602 // Since we bypassed the compiler's escape analysis, indicate that u 7603 // must live until the use above. 7604 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7605 return length, err 7606 } 7607 7608 // CopyOut implements marshal.Marshallable.CopyOut. 7609 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7610 return u.CopyOutN(cc, addr, u.SizeBytes()) 7611 } 7612 7613 // CopyInN implements marshal.Marshallable.CopyInN. 7614 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7615 if !u.HChannel.Packed() && u.HClient.Packed() { 7616 // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 7617 buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay. 7618 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7619 // Unmarshal unconditionally. If we had a short copy-in, this results in a 7620 // partially unmarshalled struct. 7621 u.UnmarshalBytes(buf) // escapes: fallback. 7622 return length, err 7623 } 7624 7625 // Construct a slice backed by dst's underlying memory. 7626 var buf []byte 7627 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7628 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7629 hdr.Len = u.SizeBytes() 7630 hdr.Cap = u.SizeBytes() 7631 7632 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7633 // Since we bypassed the compiler's escape analysis, indicate that u 7634 // must live until the use above. 7635 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7636 return length, err 7637 } 7638 7639 // CopyIn implements marshal.Marshallable.CopyIn. 7640 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7641 return u.CopyInN(cc, addr, u.SizeBytes()) 7642 } 7643 7644 // WriteTo implements io.WriterTo.WriteTo. 7645 func (u *UVM_UNREGISTER_CHANNEL_PARAMS) WriteTo(writer io.Writer) (int64, error) { 7646 if !u.HChannel.Packed() && u.HClient.Packed() { 7647 // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes. 7648 buf := make([]byte, u.SizeBytes()) 7649 u.MarshalBytes(buf) 7650 length, err := writer.Write(buf) 7651 return int64(length), err 7652 } 7653 7654 // Construct a slice backed by dst's underlying memory. 7655 var buf []byte 7656 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7657 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7658 hdr.Len = u.SizeBytes() 7659 hdr.Cap = u.SizeBytes() 7660 7661 length, err := writer.Write(buf) 7662 // Since we bypassed the compiler's escape analysis, indicate that u 7663 // must live until the use above. 7664 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7665 return int64(length), err 7666 } 7667 7668 // SizeBytes implements marshal.Marshallable.SizeBytes. 7669 func (u *UVM_UNREGISTER_GPU_PARAMS) SizeBytes() int { 7670 return 4 + 7671 1*16 7672 } 7673 7674 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7675 func (u *UVM_UNREGISTER_GPU_PARAMS) MarshalBytes(dst []byte) []byte { 7676 for idx := 0; idx < 16; idx++ { 7677 dst[0] = byte(u.GPUUUID[idx]) 7678 dst = dst[1:] 7679 } 7680 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 7681 dst = dst[4:] 7682 return dst 7683 } 7684 7685 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7686 func (u *UVM_UNREGISTER_GPU_PARAMS) UnmarshalBytes(src []byte) []byte { 7687 for idx := 0; idx < 16; idx++ { 7688 u.GPUUUID[idx] = uint8(src[0]) 7689 src = src[1:] 7690 } 7691 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7692 src = src[4:] 7693 return src 7694 } 7695 7696 // Packed implements marshal.Marshallable.Packed. 7697 //go:nosplit 7698 func (u *UVM_UNREGISTER_GPU_PARAMS) Packed() bool { 7699 return true 7700 } 7701 7702 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7703 func (u *UVM_UNREGISTER_GPU_PARAMS) MarshalUnsafe(dst []byte) []byte { 7704 size := u.SizeBytes() 7705 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 7706 return dst[size:] 7707 } 7708 7709 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7710 func (u *UVM_UNREGISTER_GPU_PARAMS) UnmarshalUnsafe(src []byte) []byte { 7711 size := u.SizeBytes() 7712 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 7713 return src[size:] 7714 } 7715 7716 // CopyOutN implements marshal.Marshallable.CopyOutN. 7717 func (u *UVM_UNREGISTER_GPU_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7718 // Construct a slice backed by dst's underlying memory. 7719 var buf []byte 7720 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7721 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7722 hdr.Len = u.SizeBytes() 7723 hdr.Cap = u.SizeBytes() 7724 7725 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7726 // Since we bypassed the compiler's escape analysis, indicate that u 7727 // must live until the use above. 7728 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7729 return length, err 7730 } 7731 7732 // CopyOut implements marshal.Marshallable.CopyOut. 7733 func (u *UVM_UNREGISTER_GPU_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7734 return u.CopyOutN(cc, addr, u.SizeBytes()) 7735 } 7736 7737 // CopyInN implements marshal.Marshallable.CopyInN. 7738 func (u *UVM_UNREGISTER_GPU_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7739 // Construct a slice backed by dst's underlying memory. 7740 var buf []byte 7741 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7742 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7743 hdr.Len = u.SizeBytes() 7744 hdr.Cap = u.SizeBytes() 7745 7746 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7747 // Since we bypassed the compiler's escape analysis, indicate that u 7748 // must live until the use above. 7749 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7750 return length, err 7751 } 7752 7753 // CopyIn implements marshal.Marshallable.CopyIn. 7754 func (u *UVM_UNREGISTER_GPU_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7755 return u.CopyInN(cc, addr, u.SizeBytes()) 7756 } 7757 7758 // WriteTo implements io.WriterTo.WriteTo. 7759 func (u *UVM_UNREGISTER_GPU_PARAMS) WriteTo(writer io.Writer) (int64, error) { 7760 // Construct a slice backed by dst's underlying memory. 7761 var buf []byte 7762 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7763 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7764 hdr.Len = u.SizeBytes() 7765 hdr.Cap = u.SizeBytes() 7766 7767 length, err := writer.Write(buf) 7768 // Since we bypassed the compiler's escape analysis, indicate that u 7769 // must live until the use above. 7770 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7771 return int64(length), err 7772 } 7773 7774 // SizeBytes implements marshal.Marshallable.SizeBytes. 7775 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) SizeBytes() int { 7776 return 4 + 7777 1*16 7778 } 7779 7780 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7781 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) MarshalBytes(dst []byte) []byte { 7782 for idx := 0; idx < 16; idx++ { 7783 dst[0] = byte(u.GPUUUID[idx]) 7784 dst = dst[1:] 7785 } 7786 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 7787 dst = dst[4:] 7788 return dst 7789 } 7790 7791 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7792 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) UnmarshalBytes(src []byte) []byte { 7793 for idx := 0; idx < 16; idx++ { 7794 u.GPUUUID[idx] = uint8(src[0]) 7795 src = src[1:] 7796 } 7797 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7798 src = src[4:] 7799 return src 7800 } 7801 7802 // Packed implements marshal.Marshallable.Packed. 7803 //go:nosplit 7804 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) Packed() bool { 7805 return true 7806 } 7807 7808 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7809 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) MarshalUnsafe(dst []byte) []byte { 7810 size := u.SizeBytes() 7811 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 7812 return dst[size:] 7813 } 7814 7815 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7816 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) UnmarshalUnsafe(src []byte) []byte { 7817 size := u.SizeBytes() 7818 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 7819 return src[size:] 7820 } 7821 7822 // CopyOutN implements marshal.Marshallable.CopyOutN. 7823 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7824 // Construct a slice backed by dst's underlying memory. 7825 var buf []byte 7826 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7827 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7828 hdr.Len = u.SizeBytes() 7829 hdr.Cap = u.SizeBytes() 7830 7831 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7832 // Since we bypassed the compiler's escape analysis, indicate that u 7833 // must live until the use above. 7834 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7835 return length, err 7836 } 7837 7838 // CopyOut implements marshal.Marshallable.CopyOut. 7839 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7840 return u.CopyOutN(cc, addr, u.SizeBytes()) 7841 } 7842 7843 // CopyInN implements marshal.Marshallable.CopyInN. 7844 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7845 // Construct a slice backed by dst's underlying memory. 7846 var buf []byte 7847 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7848 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7849 hdr.Len = u.SizeBytes() 7850 hdr.Cap = u.SizeBytes() 7851 7852 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7853 // Since we bypassed the compiler's escape analysis, indicate that u 7854 // must live until the use above. 7855 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7856 return length, err 7857 } 7858 7859 // CopyIn implements marshal.Marshallable.CopyIn. 7860 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7861 return u.CopyInN(cc, addr, u.SizeBytes()) 7862 } 7863 7864 // WriteTo implements io.WriterTo.WriteTo. 7865 func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) WriteTo(writer io.Writer) (int64, error) { 7866 // Construct a slice backed by dst's underlying memory. 7867 var buf []byte 7868 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7869 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7870 hdr.Len = u.SizeBytes() 7871 hdr.Cap = u.SizeBytes() 7872 7873 length, err := writer.Write(buf) 7874 // Since we bypassed the compiler's escape analysis, indicate that u 7875 // must live until the use above. 7876 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7877 return int64(length), err 7878 } 7879 7880 // SizeBytes implements marshal.Marshallable.SizeBytes. 7881 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) SizeBytes() int { 7882 return 20 + 7883 1*4 7884 } 7885 7886 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7887 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) MarshalBytes(dst []byte) []byte { 7888 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base)) 7889 dst = dst[8:] 7890 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length)) 7891 dst = dst[8:] 7892 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus)) 7893 dst = dst[4:] 7894 for idx := 0; idx < 4; idx++ { 7895 dst[0] = byte(u.Pad0[idx]) 7896 dst = dst[1:] 7897 } 7898 return dst 7899 } 7900 7901 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7902 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) UnmarshalBytes(src []byte) []byte { 7903 u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7904 src = src[8:] 7905 u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7906 src = src[8:] 7907 u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7908 src = src[4:] 7909 for idx := 0; idx < 4; idx++ { 7910 u.Pad0[idx] = src[0] 7911 src = src[1:] 7912 } 7913 return src 7914 } 7915 7916 // Packed implements marshal.Marshallable.Packed. 7917 //go:nosplit 7918 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) Packed() bool { 7919 return true 7920 } 7921 7922 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7923 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) MarshalUnsafe(dst []byte) []byte { 7924 size := u.SizeBytes() 7925 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 7926 return dst[size:] 7927 } 7928 7929 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7930 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) UnmarshalUnsafe(src []byte) []byte { 7931 size := u.SizeBytes() 7932 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 7933 return src[size:] 7934 } 7935 7936 // CopyOutN implements marshal.Marshallable.CopyOutN. 7937 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7938 // Construct a slice backed by dst's underlying memory. 7939 var buf []byte 7940 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7941 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7942 hdr.Len = u.SizeBytes() 7943 hdr.Cap = u.SizeBytes() 7944 7945 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7946 // Since we bypassed the compiler's escape analysis, indicate that u 7947 // must live until the use above. 7948 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7949 return length, err 7950 } 7951 7952 // CopyOut implements marshal.Marshallable.CopyOut. 7953 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7954 return u.CopyOutN(cc, addr, u.SizeBytes()) 7955 } 7956 7957 // CopyInN implements marshal.Marshallable.CopyInN. 7958 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7959 // Construct a slice backed by dst's underlying memory. 7960 var buf []byte 7961 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7962 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7963 hdr.Len = u.SizeBytes() 7964 hdr.Cap = u.SizeBytes() 7965 7966 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7967 // Since we bypassed the compiler's escape analysis, indicate that u 7968 // must live until the use above. 7969 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7970 return length, err 7971 } 7972 7973 // CopyIn implements marshal.Marshallable.CopyIn. 7974 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7975 return u.CopyInN(cc, addr, u.SizeBytes()) 7976 } 7977 7978 // WriteTo implements io.WriterTo.WriteTo. 7979 func (u *UVM_VALIDATE_VA_RANGE_PARAMS) WriteTo(writer io.Writer) (int64, error) { 7980 // Construct a slice backed by dst's underlying memory. 7981 var buf []byte 7982 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7983 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 7984 hdr.Len = u.SizeBytes() 7985 hdr.Cap = u.SizeBytes() 7986 7987 length, err := writer.Write(buf) 7988 // Since we bypassed the compiler's escape analysis, indicate that u 7989 // must live until the use above. 7990 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 7991 return int64(length), err 7992 } 7993 7994 // SizeBytes implements marshal.Marshallable.SizeBytes. 7995 func (u *UvmGpuMappingAttributes) SizeBytes() int { 7996 return 20 + 7997 1*16 7998 } 7999 8000 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8001 func (u *UvmGpuMappingAttributes) MarshalBytes(dst []byte) []byte { 8002 for idx := 0; idx < 16; idx++ { 8003 dst[0] = byte(u.GPUUUID[idx]) 8004 dst = dst[1:] 8005 } 8006 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUMappingType)) 8007 dst = dst[4:] 8008 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUCachingType)) 8009 dst = dst[4:] 8010 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUFormatType)) 8011 dst = dst[4:] 8012 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUElementBits)) 8013 dst = dst[4:] 8014 hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUCompressionType)) 8015 dst = dst[4:] 8016 return dst 8017 } 8018 8019 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 8020 func (u *UvmGpuMappingAttributes) UnmarshalBytes(src []byte) []byte { 8021 for idx := 0; idx < 16; idx++ { 8022 u.GPUUUID[idx] = src[0] 8023 src = src[1:] 8024 } 8025 u.GPUMappingType = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8026 src = src[4:] 8027 u.GPUCachingType = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8028 src = src[4:] 8029 u.GPUFormatType = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8030 src = src[4:] 8031 u.GPUElementBits = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8032 src = src[4:] 8033 u.GPUCompressionType = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8034 src = src[4:] 8035 return src 8036 } 8037 8038 // Packed implements marshal.Marshallable.Packed. 8039 //go:nosplit 8040 func (u *UvmGpuMappingAttributes) Packed() bool { 8041 return true 8042 } 8043 8044 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8045 func (u *UvmGpuMappingAttributes) MarshalUnsafe(dst []byte) []byte { 8046 size := u.SizeBytes() 8047 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 8048 return dst[size:] 8049 } 8050 8051 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8052 func (u *UvmGpuMappingAttributes) UnmarshalUnsafe(src []byte) []byte { 8053 size := u.SizeBytes() 8054 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 8055 return src[size:] 8056 } 8057 8058 // CopyOutN implements marshal.Marshallable.CopyOutN. 8059 func (u *UvmGpuMappingAttributes) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8060 // Construct a slice backed by dst's underlying memory. 8061 var buf []byte 8062 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8063 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 8064 hdr.Len = u.SizeBytes() 8065 hdr.Cap = u.SizeBytes() 8066 8067 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8068 // Since we bypassed the compiler's escape analysis, indicate that u 8069 // must live until the use above. 8070 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 8071 return length, err 8072 } 8073 8074 // CopyOut implements marshal.Marshallable.CopyOut. 8075 func (u *UvmGpuMappingAttributes) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8076 return u.CopyOutN(cc, addr, u.SizeBytes()) 8077 } 8078 8079 // CopyInN implements marshal.Marshallable.CopyInN. 8080 func (u *UvmGpuMappingAttributes) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8081 // Construct a slice backed by dst's underlying memory. 8082 var buf []byte 8083 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8084 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 8085 hdr.Len = u.SizeBytes() 8086 hdr.Cap = u.SizeBytes() 8087 8088 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8089 // Since we bypassed the compiler's escape analysis, indicate that u 8090 // must live until the use above. 8091 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 8092 return length, err 8093 } 8094 8095 // CopyIn implements marshal.Marshallable.CopyIn. 8096 func (u *UvmGpuMappingAttributes) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8097 return u.CopyInN(cc, addr, u.SizeBytes()) 8098 } 8099 8100 // WriteTo implements io.WriterTo.WriteTo. 8101 func (u *UvmGpuMappingAttributes) WriteTo(writer io.Writer) (int64, error) { 8102 // Construct a slice backed by dst's underlying memory. 8103 var buf []byte 8104 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8105 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 8106 hdr.Len = u.SizeBytes() 8107 hdr.Cap = u.SizeBytes() 8108 8109 length, err := writer.Write(buf) 8110 // Since we bypassed the compiler's escape analysis, indicate that u 8111 // must live until the use above. 8112 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 8113 return int64(length), err 8114 } 8115