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