github.com/sagernet/gvisor@v0.0.0-20240428053021-e691de28565f/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/sagernet/gvisor/pkg/gohacks"
     7      "github.com/sagernet/gvisor/pkg/hostarch"
     8      "github.com/sagernet/gvisor/pkg/marshal"
     9      "io"
    10      "reflect"
    11      "runtime"
    12      "unsafe"
    13  )
    14  
    15  // Marshallable types used by this file.
    16  var _ marshal.Marshallable = (*ClassID)(nil)
    17  var _ marshal.Marshallable = (*Handle)(nil)
    18  var _ marshal.Marshallable = (*IoctlAllocOSEvent)(nil)
    19  var _ marshal.Marshallable = (*IoctlFreeOSEvent)(nil)
    20  var _ marshal.Marshallable = (*IoctlNVOS02ParametersWithFD)(nil)
    21  var _ marshal.Marshallable = (*IoctlNVOS33ParametersWithFD)(nil)
    22  var _ marshal.Marshallable = (*IoctlRegisterFD)(nil)
    23  var _ marshal.Marshallable = (*IoctlSysParams)(nil)
    24  var _ marshal.Marshallable = (*IoctlWaitOpenComplete)(nil)
    25  var _ marshal.Marshallable = (*NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS)(nil)
    26  var _ marshal.Marshallable = (*NV0005_ALLOC_PARAMETERS)(nil)
    27  var _ marshal.Marshallable = (*NV0080_ALLOC_PARAMETERS)(nil)
    28  var _ marshal.Marshallable = (*NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS)(nil)
    29  var _ marshal.Marshallable = (*NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS)(nil)
    30  var _ marshal.Marshallable = (*NV0080_CTRL_GR_ROUTE_INFO)(nil)
    31  var _ marshal.Marshallable = (*NV00F8_ALLOCATION_PARAMETERS)(nil)
    32  var _ marshal.Marshallable = (*NV2080_ALLOC_PARAMETERS)(nil)
    33  var _ marshal.Marshallable = (*NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS)(nil)
    34  var _ marshal.Marshallable = (*NV2080_CTRL_GR_GET_INFO_PARAMS)(nil)
    35  var _ marshal.Marshallable = (*NV2081_ALLOC_PARAMETERS)(nil)
    36  var _ marshal.Marshallable = (*NV503B_ALLOC_PARAMETERS)(nil)
    37  var _ marshal.Marshallable = (*NV503B_BAR1_P2P_DMA_INFO)(nil)
    38  var _ marshal.Marshallable = (*NV503C_ALLOC_PARAMETERS)(nil)
    39  var _ marshal.Marshallable = (*NV83DE_ALLOC_PARAMETERS)(nil)
    40  var _ marshal.Marshallable = (*NVB0B5_ALLOCATION_PARAMETERS)(nil)
    41  var _ marshal.Marshallable = (*NVOS00Parameters)(nil)
    42  var _ marshal.Marshallable = (*NVOS02Parameters)(nil)
    43  var _ marshal.Marshallable = (*NVOS21Parameters)(nil)
    44  var _ marshal.Marshallable = (*NVOS32Parameters)(nil)
    45  var _ marshal.Marshallable = (*NVOS33Parameters)(nil)
    46  var _ marshal.Marshallable = (*NVOS34Parameters)(nil)
    47  var _ marshal.Marshallable = (*NVOS54Parameters)(nil)
    48  var _ marshal.Marshallable = (*NVOS55Parameters)(nil)
    49  var _ marshal.Marshallable = (*NVOS56Parameters)(nil)
    50  var _ marshal.Marshallable = (*NVOS57Parameters)(nil)
    51  var _ marshal.Marshallable = (*NVOS64Parameters)(nil)
    52  var _ marshal.Marshallable = (*NVXXXX_CTRL_XXX_INFO)(nil)
    53  var _ marshal.Marshallable = (*NV_CHANNEL_ALLOC_PARAMS)(nil)
    54  var _ marshal.Marshallable = (*NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS)(nil)
    55  var _ marshal.Marshallable = (*NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS)(nil)
    56  var _ marshal.Marshallable = (*NV_CTXSHARE_ALLOCATION_PARAMETERS)(nil)
    57  var _ marshal.Marshallable = (*NV_GR_ALLOCATION_PARAMETERS)(nil)
    58  var _ marshal.Marshallable = (*NV_HOPPER_USERMODE_A_PARAMS)(nil)
    59  var _ marshal.Marshallable = (*NV_MEMORY_ALLOCATION_PARAMS)(nil)
    60  var _ marshal.Marshallable = (*NV_MEMORY_ALLOCATION_PARAMS_V545)(nil)
    61  var _ marshal.Marshallable = (*NV_MEMORY_DESC_PARAMS)(nil)
    62  var _ marshal.Marshallable = (*NV_VASPACE_ALLOCATION_PARAMETERS)(nil)
    63  var _ marshal.Marshallable = (*NvUUID)(nil)
    64  var _ marshal.Marshallable = (*P64)(nil)
    65  var _ marshal.Marshallable = (*RMAPIVersion)(nil)
    66  var _ marshal.Marshallable = (*RS_ACCESS_MASK)(nil)
    67  var _ marshal.Marshallable = (*RS_SHARE_POLICY)(nil)
    68  var _ marshal.Marshallable = (*UVM_ALLOC_SEMAPHORE_POOL_PARAMS)(nil)
    69  var _ marshal.Marshallable = (*UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550)(nil)
    70  var _ marshal.Marshallable = (*UVM_CREATE_EXTERNAL_RANGE_PARAMS)(nil)
    71  var _ marshal.Marshallable = (*UVM_CREATE_RANGE_GROUP_PARAMS)(nil)
    72  var _ marshal.Marshallable = (*UVM_DESTROY_RANGE_GROUP_PARAMS)(nil)
    73  var _ marshal.Marshallable = (*UVM_DISABLE_READ_DUPLICATION_PARAMS)(nil)
    74  var _ marshal.Marshallable = (*UVM_FREE_PARAMS)(nil)
    75  var _ marshal.Marshallable = (*UVM_INITIALIZE_PARAMS)(nil)
    76  var _ marshal.Marshallable = (*UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS)(nil)
    77  var _ marshal.Marshallable = (*UVM_MAP_EXTERNAL_ALLOCATION_PARAMS)(nil)
    78  var _ marshal.Marshallable = (*UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550)(nil)
    79  var _ marshal.Marshallable = (*UVM_MM_INITIALIZE_PARAMS)(nil)
    80  var _ marshal.Marshallable = (*UVM_PAGEABLE_MEM_ACCESS_PARAMS)(nil)
    81  var _ marshal.Marshallable = (*UVM_REGISTER_CHANNEL_PARAMS)(nil)
    82  var _ marshal.Marshallable = (*UVM_REGISTER_GPU_PARAMS)(nil)
    83  var _ marshal.Marshallable = (*UVM_REGISTER_GPU_VASPACE_PARAMS)(nil)
    84  var _ marshal.Marshallable = (*UVM_SET_PREFERRED_LOCATION_PARAMS)(nil)
    85  var _ marshal.Marshallable = (*UVM_SET_PREFERRED_LOCATION_PARAMS_V550)(nil)
    86  var _ marshal.Marshallable = (*UVM_UNREGISTER_CHANNEL_PARAMS)(nil)
    87  var _ marshal.Marshallable = (*UVM_UNREGISTER_GPU_PARAMS)(nil)
    88  var _ marshal.Marshallable = (*UVM_UNREGISTER_GPU_VASPACE_PARAMS)(nil)
    89  var _ marshal.Marshallable = (*UVM_VALIDATE_VA_RANGE_PARAMS)(nil)
    90  var _ marshal.Marshallable = (*UvmGpuMappingAttributes)(nil)
    91  var _ marshal.Marshallable = (*nv00f8Map)(nil)
    92  
    93  // SizeBytes implements marshal.Marshallable.SizeBytes.
    94  //go:nosplit
    95  func (id *ClassID) SizeBytes() int {
    96      return 4
    97  }
    98  
    99  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   100  func (id *ClassID) MarshalBytes(dst []byte) []byte {
   101      hostarch.ByteOrder.PutUint32(dst[:4], uint32(*id))
   102      return dst[4:]
   103  }
   104  
   105  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   106  func (id *ClassID) UnmarshalBytes(src []byte) []byte {
   107      *id = ClassID(uint32(hostarch.ByteOrder.Uint32(src[:4])))
   108      return src[4:]
   109  }
   110  
   111  // Packed implements marshal.Marshallable.Packed.
   112  //go:nosplit
   113  func (id *ClassID) Packed() bool {
   114      // Scalar newtypes are always packed.
   115      return true
   116  }
   117  
   118  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   119  func (id *ClassID) MarshalUnsafe(dst []byte) []byte {
   120      size := id.SizeBytes()
   121      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(id), uintptr(size))
   122      return dst[size:]
   123  }
   124  
   125  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   126  func (id *ClassID) UnmarshalUnsafe(src []byte) []byte {
   127      size := id.SizeBytes()
   128      gohacks.Memmove(unsafe.Pointer(id), unsafe.Pointer(&src[0]), uintptr(size))
   129      return src[size:]
   130  }
   131  
   132  // CopyOutN implements marshal.Marshallable.CopyOutN.
   133  func (id *ClassID) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   134      // Construct a slice backed by dst's underlying memory.
   135      var buf []byte
   136      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   137      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(id)))
   138      hdr.Len = id.SizeBytes()
   139      hdr.Cap = id.SizeBytes()
   140  
   141      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   142      // Since we bypassed the compiler's escape analysis, indicate that id
   143      // must live until the use above.
   144      runtime.KeepAlive(id) // escapes: replaced by intrinsic.
   145      return length, err
   146  }
   147  
   148  // CopyOut implements marshal.Marshallable.CopyOut.
   149  func (id *ClassID) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   150      return id.CopyOutN(cc, addr, id.SizeBytes())
   151  }
   152  
   153  // CopyInN implements marshal.Marshallable.CopyInN.
   154  func (id *ClassID) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   155      // Construct a slice backed by dst's underlying memory.
   156      var buf []byte
   157      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   158      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(id)))
   159      hdr.Len = id.SizeBytes()
   160      hdr.Cap = id.SizeBytes()
   161  
   162      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   163      // Since we bypassed the compiler's escape analysis, indicate that id
   164      // must live until the use above.
   165      runtime.KeepAlive(id) // escapes: replaced by intrinsic.
   166      return length, err
   167  }
   168  
   169  // CopyIn implements marshal.Marshallable.CopyIn.
   170  func (id *ClassID) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   171      return id.CopyInN(cc, addr, id.SizeBytes())
   172  }
   173  
   174  // WriteTo implements io.WriterTo.WriteTo.
   175  func (id *ClassID) WriteTo(writer io.Writer) (int64, error) {
   176      // Construct a slice backed by dst's underlying memory.
   177      var buf []byte
   178      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   179      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(id)))
   180      hdr.Len = id.SizeBytes()
   181      hdr.Cap = id.SizeBytes()
   182  
   183      length, err := writer.Write(buf)
   184      // Since we bypassed the compiler's escape analysis, indicate that id
   185      // must live until the use above.
   186      runtime.KeepAlive(id) // escapes: replaced by intrinsic.
   187      return int64(length), err
   188  }
   189  
   190  // SizeBytes implements marshal.Marshallable.SizeBytes.
   191  func (n *NV0005_ALLOC_PARAMETERS) SizeBytes() int {
   192      return 8 +
   193          (*Handle)(nil).SizeBytes() +
   194          (*Handle)(nil).SizeBytes() +
   195          (*P64)(nil).SizeBytes()
   196  }
   197  
   198  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   199  func (n *NV0005_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
   200      dst = n.HParentClient.MarshalUnsafe(dst)
   201      dst = n.HSrcResource.MarshalUnsafe(dst)
   202      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HClass))
   203      dst = dst[4:]
   204      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NotifyIndex))
   205      dst = dst[4:]
   206      dst = n.Data.MarshalUnsafe(dst)
   207      return dst
   208  }
   209  
   210  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   211  func (n *NV0005_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   212      src = n.HParentClient.UnmarshalUnsafe(src)
   213      src = n.HSrcResource.UnmarshalUnsafe(src)
   214      n.HClass = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   215      src = src[4:]
   216      n.NotifyIndex = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   217      src = src[4:]
   218      src = n.Data.UnmarshalUnsafe(src)
   219      return src
   220  }
   221  
   222  // Packed implements marshal.Marshallable.Packed.
   223  //go:nosplit
   224  func (n *NV0005_ALLOC_PARAMETERS) Packed() bool {
   225      return n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed()
   226  }
   227  
   228  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   229  func (n *NV0005_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   230      if n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   231          size := n.SizeBytes()
   232          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   233          return dst[size:]
   234      }
   235      // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
   236      return n.MarshalBytes(dst)
   237  }
   238  
   239  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   240  func (n *NV0005_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   241      if n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   242          size := n.SizeBytes()
   243          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   244          return src[size:]
   245      }
   246      // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
   247      return n.UnmarshalBytes(src)
   248  }
   249  
   250  // CopyOutN implements marshal.Marshallable.CopyOutN.
   251  func (n *NV0005_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   252      if !n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   253          // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   254          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   255          n.MarshalBytes(buf) // escapes: fallback.
   256          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   257      }
   258  
   259      // Construct a slice backed by dst's underlying memory.
   260      var buf []byte
   261      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   262      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   263      hdr.Len = n.SizeBytes()
   264      hdr.Cap = n.SizeBytes()
   265  
   266      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   267      // Since we bypassed the compiler's escape analysis, indicate that n
   268      // must live until the use above.
   269      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   270      return length, err
   271  }
   272  
   273  // CopyOut implements marshal.Marshallable.CopyOut.
   274  func (n *NV0005_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   275      return n.CopyOutN(cc, addr, n.SizeBytes())
   276  }
   277  
   278  // CopyInN implements marshal.Marshallable.CopyInN.
   279  func (n *NV0005_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   280      if !n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   281          // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
   282          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   283          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   284          // Unmarshal unconditionally. If we had a short copy-in, this results in a
   285          // partially unmarshalled struct.
   286          n.UnmarshalBytes(buf) // escapes: fallback.
   287          return length, err
   288      }
   289  
   290      // Construct a slice backed by dst's underlying memory.
   291      var buf []byte
   292      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   293      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   294      hdr.Len = n.SizeBytes()
   295      hdr.Cap = n.SizeBytes()
   296  
   297      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   298      // Since we bypassed the compiler's escape analysis, indicate that n
   299      // must live until the use above.
   300      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   301      return length, err
   302  }
   303  
   304  // CopyIn implements marshal.Marshallable.CopyIn.
   305  func (n *NV0005_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   306      return n.CopyInN(cc, addr, n.SizeBytes())
   307  }
   308  
   309  // WriteTo implements io.WriterTo.WriteTo.
   310  func (n *NV0005_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   311      if !n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   312          // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   313          buf := make([]byte, n.SizeBytes())
   314          n.MarshalBytes(buf)
   315          length, err := writer.Write(buf)
   316          return int64(length), err
   317      }
   318  
   319      // Construct a slice backed by dst's underlying memory.
   320      var buf []byte
   321      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   322      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   323      hdr.Len = n.SizeBytes()
   324      hdr.Cap = n.SizeBytes()
   325  
   326      length, err := writer.Write(buf)
   327      // Since we bypassed the compiler's escape analysis, indicate that n
   328      // must live until the use above.
   329      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   330      return int64(length), err
   331  }
   332  
   333  // SizeBytes implements marshal.Marshallable.SizeBytes.
   334  func (n *NV0080_ALLOC_PARAMETERS) SizeBytes() int {
   335      return 36 +
   336          (*Handle)(nil).SizeBytes() +
   337          (*Handle)(nil).SizeBytes() +
   338          (*Handle)(nil).SizeBytes() +
   339          1*4 +
   340          1*4
   341  }
   342  
   343  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   344  func (n *NV0080_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
   345      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.DeviceID))
   346      dst = dst[4:]
   347      dst = n.HClientShare.MarshalUnsafe(dst)
   348      dst = n.HTargetClient.MarshalUnsafe(dst)
   349      dst = n.HTargetDevice.MarshalUnsafe(dst)
   350      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
   351      dst = dst[4:]
   352      for idx := 0; idx < 4; idx++ {
   353          dst[0] = byte(n.Pad0[idx])
   354          dst = dst[1:]
   355      }
   356      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VASpaceSize))
   357      dst = dst[8:]
   358      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VAStartInternal))
   359      dst = dst[8:]
   360      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VALimitInternal))
   361      dst = dst[8:]
   362      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.VAMode))
   363      dst = dst[4:]
   364      for idx := 0; idx < 4; idx++ {
   365          dst[0] = byte(n.Pad1[idx])
   366          dst = dst[1:]
   367      }
   368      return dst
   369  }
   370  
   371  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   372  func (n *NV0080_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   373      n.DeviceID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   374      src = src[4:]
   375      src = n.HClientShare.UnmarshalUnsafe(src)
   376      src = n.HTargetClient.UnmarshalUnsafe(src)
   377      src = n.HTargetDevice.UnmarshalUnsafe(src)
   378      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   379      src = src[4:]
   380      for idx := 0; idx < 4; idx++ {
   381          n.Pad0[idx] = src[0]
   382          src = src[1:]
   383      }
   384      n.VASpaceSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   385      src = src[8:]
   386      n.VAStartInternal = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   387      src = src[8:]
   388      n.VALimitInternal = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   389      src = src[8:]
   390      n.VAMode = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   391      src = src[4:]
   392      for idx := 0; idx < 4; idx++ {
   393          n.Pad1[idx] = src[0]
   394          src = src[1:]
   395      }
   396      return src
   397  }
   398  
   399  // Packed implements marshal.Marshallable.Packed.
   400  //go:nosplit
   401  func (n *NV0080_ALLOC_PARAMETERS) Packed() bool {
   402      return n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed()
   403  }
   404  
   405  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   406  func (n *NV0080_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   407      if n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   408          size := n.SizeBytes()
   409          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   410          return dst[size:]
   411      }
   412      // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
   413      return n.MarshalBytes(dst)
   414  }
   415  
   416  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   417  func (n *NV0080_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   418      if n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   419          size := n.SizeBytes()
   420          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   421          return src[size:]
   422      }
   423      // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
   424      return n.UnmarshalBytes(src)
   425  }
   426  
   427  // CopyOutN implements marshal.Marshallable.CopyOutN.
   428  func (n *NV0080_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   429      if !n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   430          // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   431          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   432          n.MarshalBytes(buf) // escapes: fallback.
   433          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   434      }
   435  
   436      // Construct a slice backed by dst's underlying memory.
   437      var buf []byte
   438      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   439      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   440      hdr.Len = n.SizeBytes()
   441      hdr.Cap = n.SizeBytes()
   442  
   443      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   444      // Since we bypassed the compiler's escape analysis, indicate that n
   445      // must live until the use above.
   446      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   447      return length, err
   448  }
   449  
   450  // CopyOut implements marshal.Marshallable.CopyOut.
   451  func (n *NV0080_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   452      return n.CopyOutN(cc, addr, n.SizeBytes())
   453  }
   454  
   455  // CopyInN implements marshal.Marshallable.CopyInN.
   456  func (n *NV0080_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   457      if !n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   458          // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
   459          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   460          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   461          // Unmarshal unconditionally. If we had a short copy-in, this results in a
   462          // partially unmarshalled struct.
   463          n.UnmarshalBytes(buf) // escapes: fallback.
   464          return length, err
   465      }
   466  
   467      // Construct a slice backed by dst's underlying memory.
   468      var buf []byte
   469      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   470      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   471      hdr.Len = n.SizeBytes()
   472      hdr.Cap = n.SizeBytes()
   473  
   474      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   475      // Since we bypassed the compiler's escape analysis, indicate that n
   476      // must live until the use above.
   477      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   478      return length, err
   479  }
   480  
   481  // CopyIn implements marshal.Marshallable.CopyIn.
   482  func (n *NV0080_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   483      return n.CopyInN(cc, addr, n.SizeBytes())
   484  }
   485  
   486  // WriteTo implements io.WriterTo.WriteTo.
   487  func (n *NV0080_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   488      if !n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   489          // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   490          buf := make([]byte, n.SizeBytes())
   491          n.MarshalBytes(buf)
   492          length, err := writer.Write(buf)
   493          return int64(length), err
   494      }
   495  
   496      // Construct a slice backed by dst's underlying memory.
   497      var buf []byte
   498      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   499      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   500      hdr.Len = n.SizeBytes()
   501      hdr.Cap = n.SizeBytes()
   502  
   503      length, err := writer.Write(buf)
   504      // Since we bypassed the compiler's escape analysis, indicate that n
   505      // must live until the use above.
   506      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   507      return int64(length), err
   508  }
   509  
   510  // SizeBytes implements marshal.Marshallable.SizeBytes.
   511  func (n *NV00F8_ALLOCATION_PARAMETERS) SizeBytes() int {
   512      return 32 +
   513          (*nv00f8Map)(nil).SizeBytes()
   514  }
   515  
   516  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   517  func (n *NV00F8_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
   518      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Alignment))
   519      dst = dst[8:]
   520      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.AllocSize))
   521      dst = dst[8:]
   522      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.PageSize))
   523      dst = dst[8:]
   524      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.AllocFlags))
   525      dst = dst[4:]
   526      // Padding: dst[:sizeof(uint32)] ~= uint32(0)
   527      dst = dst[4:]
   528      dst = n.Map.MarshalUnsafe(dst)
   529      return dst
   530  }
   531  
   532  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   533  func (n *NV00F8_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   534      n.Alignment = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   535      src = src[8:]
   536      n.AllocSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   537      src = src[8:]
   538      n.PageSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   539      src = src[8:]
   540      n.AllocFlags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   541      src = src[4:]
   542      // Padding: var _ uint32 ~= src[:sizeof(uint32)]
   543      src = src[4:]
   544      src = n.Map.UnmarshalUnsafe(src)
   545      return src
   546  }
   547  
   548  // Packed implements marshal.Marshallable.Packed.
   549  //go:nosplit
   550  func (n *NV00F8_ALLOCATION_PARAMETERS) Packed() bool {
   551      return n.Map.Packed()
   552  }
   553  
   554  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   555  func (n *NV00F8_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   556      if n.Map.Packed() {
   557          size := n.SizeBytes()
   558          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   559          return dst[size:]
   560      }
   561      // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
   562      return n.MarshalBytes(dst)
   563  }
   564  
   565  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   566  func (n *NV00F8_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   567      if n.Map.Packed() {
   568          size := n.SizeBytes()
   569          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   570          return src[size:]
   571      }
   572      // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
   573      return n.UnmarshalBytes(src)
   574  }
   575  
   576  // CopyOutN implements marshal.Marshallable.CopyOutN.
   577  func (n *NV00F8_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   578      if !n.Map.Packed() {
   579          // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   580          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   581          n.MarshalBytes(buf) // escapes: fallback.
   582          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   583      }
   584  
   585      // Construct a slice backed by dst's underlying memory.
   586      var buf []byte
   587      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   588      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   589      hdr.Len = n.SizeBytes()
   590      hdr.Cap = n.SizeBytes()
   591  
   592      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   593      // Since we bypassed the compiler's escape analysis, indicate that n
   594      // must live until the use above.
   595      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   596      return length, err
   597  }
   598  
   599  // CopyOut implements marshal.Marshallable.CopyOut.
   600  func (n *NV00F8_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   601      return n.CopyOutN(cc, addr, n.SizeBytes())
   602  }
   603  
   604  // CopyInN implements marshal.Marshallable.CopyInN.
   605  func (n *NV00F8_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   606      if !n.Map.Packed() {
   607          // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
   608          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   609          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   610          // Unmarshal unconditionally. If we had a short copy-in, this results in a
   611          // partially unmarshalled struct.
   612          n.UnmarshalBytes(buf) // escapes: fallback.
   613          return length, err
   614      }
   615  
   616      // Construct a slice backed by dst's underlying memory.
   617      var buf []byte
   618      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   619      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   620      hdr.Len = n.SizeBytes()
   621      hdr.Cap = n.SizeBytes()
   622  
   623      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   624      // Since we bypassed the compiler's escape analysis, indicate that n
   625      // must live until the use above.
   626      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   627      return length, err
   628  }
   629  
   630  // CopyIn implements marshal.Marshallable.CopyIn.
   631  func (n *NV00F8_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   632      return n.CopyInN(cc, addr, n.SizeBytes())
   633  }
   634  
   635  // WriteTo implements io.WriterTo.WriteTo.
   636  func (n *NV00F8_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   637      if !n.Map.Packed() {
   638          // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   639          buf := make([]byte, n.SizeBytes())
   640          n.MarshalBytes(buf)
   641          length, err := writer.Write(buf)
   642          return int64(length), err
   643      }
   644  
   645      // Construct a slice backed by dst's underlying memory.
   646      var buf []byte
   647      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   648      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   649      hdr.Len = n.SizeBytes()
   650      hdr.Cap = n.SizeBytes()
   651  
   652      length, err := writer.Write(buf)
   653      // Since we bypassed the compiler's escape analysis, indicate that n
   654      // must live until the use above.
   655      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   656      return int64(length), err
   657  }
   658  
   659  // SizeBytes implements marshal.Marshallable.SizeBytes.
   660  func (n *NV2080_ALLOC_PARAMETERS) SizeBytes() int {
   661      return 4
   662  }
   663  
   664  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   665  func (n *NV2080_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
   666      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDeviceID))
   667      dst = dst[4:]
   668      return dst
   669  }
   670  
   671  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   672  func (n *NV2080_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   673      n.SubDeviceID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   674      src = src[4:]
   675      return src
   676  }
   677  
   678  // Packed implements marshal.Marshallable.Packed.
   679  //go:nosplit
   680  func (n *NV2080_ALLOC_PARAMETERS) Packed() bool {
   681      return true
   682  }
   683  
   684  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   685  func (n *NV2080_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   686      size := n.SizeBytes()
   687      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   688      return dst[size:]
   689  }
   690  
   691  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   692  func (n *NV2080_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   693      size := n.SizeBytes()
   694      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   695      return src[size:]
   696  }
   697  
   698  // CopyOutN implements marshal.Marshallable.CopyOutN.
   699  func (n *NV2080_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   700      // Construct a slice backed by dst's underlying memory.
   701      var buf []byte
   702      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   703      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   704      hdr.Len = n.SizeBytes()
   705      hdr.Cap = n.SizeBytes()
   706  
   707      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   708      // Since we bypassed the compiler's escape analysis, indicate that n
   709      // must live until the use above.
   710      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   711      return length, err
   712  }
   713  
   714  // CopyOut implements marshal.Marshallable.CopyOut.
   715  func (n *NV2080_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   716      return n.CopyOutN(cc, addr, n.SizeBytes())
   717  }
   718  
   719  // CopyInN implements marshal.Marshallable.CopyInN.
   720  func (n *NV2080_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   721      // Construct a slice backed by dst's underlying memory.
   722      var buf []byte
   723      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   724      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   725      hdr.Len = n.SizeBytes()
   726      hdr.Cap = n.SizeBytes()
   727  
   728      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   729      // Since we bypassed the compiler's escape analysis, indicate that n
   730      // must live until the use above.
   731      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   732      return length, err
   733  }
   734  
   735  // CopyIn implements marshal.Marshallable.CopyIn.
   736  func (n *NV2080_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   737      return n.CopyInN(cc, addr, n.SizeBytes())
   738  }
   739  
   740  // WriteTo implements io.WriterTo.WriteTo.
   741  func (n *NV2080_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   742      // Construct a slice backed by dst's underlying memory.
   743      var buf []byte
   744      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   745      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   746      hdr.Len = n.SizeBytes()
   747      hdr.Cap = n.SizeBytes()
   748  
   749      length, err := writer.Write(buf)
   750      // Since we bypassed the compiler's escape analysis, indicate that n
   751      // must live until the use above.
   752      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   753      return int64(length), err
   754  }
   755  
   756  // SizeBytes implements marshal.Marshallable.SizeBytes.
   757  func (n *NV2081_ALLOC_PARAMETERS) SizeBytes() int {
   758      return 4
   759  }
   760  
   761  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   762  func (n *NV2081_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
   763      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Reserved))
   764      dst = dst[4:]
   765      return dst
   766  }
   767  
   768  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   769  func (n *NV2081_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   770      n.Reserved = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   771      src = src[4:]
   772      return src
   773  }
   774  
   775  // Packed implements marshal.Marshallable.Packed.
   776  //go:nosplit
   777  func (n *NV2081_ALLOC_PARAMETERS) Packed() bool {
   778      return true
   779  }
   780  
   781  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   782  func (n *NV2081_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   783      size := n.SizeBytes()
   784      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   785      return dst[size:]
   786  }
   787  
   788  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   789  func (n *NV2081_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   790      size := n.SizeBytes()
   791      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   792      return src[size:]
   793  }
   794  
   795  // CopyOutN implements marshal.Marshallable.CopyOutN.
   796  func (n *NV2081_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   797      // Construct a slice backed by dst's underlying memory.
   798      var buf []byte
   799      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   800      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   801      hdr.Len = n.SizeBytes()
   802      hdr.Cap = n.SizeBytes()
   803  
   804      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   805      // Since we bypassed the compiler's escape analysis, indicate that n
   806      // must live until the use above.
   807      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   808      return length, err
   809  }
   810  
   811  // CopyOut implements marshal.Marshallable.CopyOut.
   812  func (n *NV2081_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   813      return n.CopyOutN(cc, addr, n.SizeBytes())
   814  }
   815  
   816  // CopyInN implements marshal.Marshallable.CopyInN.
   817  func (n *NV2081_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   818      // Construct a slice backed by dst's underlying memory.
   819      var buf []byte
   820      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   821      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   822      hdr.Len = n.SizeBytes()
   823      hdr.Cap = n.SizeBytes()
   824  
   825      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   826      // Since we bypassed the compiler's escape analysis, indicate that n
   827      // must live until the use above.
   828      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   829      return length, err
   830  }
   831  
   832  // CopyIn implements marshal.Marshallable.CopyIn.
   833  func (n *NV2081_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   834      return n.CopyInN(cc, addr, n.SizeBytes())
   835  }
   836  
   837  // WriteTo implements io.WriterTo.WriteTo.
   838  func (n *NV2081_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   839      // Construct a slice backed by dst's underlying memory.
   840      var buf []byte
   841      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   842      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   843      hdr.Len = n.SizeBytes()
   844      hdr.Cap = n.SizeBytes()
   845  
   846      length, err := writer.Write(buf)
   847      // Since we bypassed the compiler's escape analysis, indicate that n
   848      // must live until the use above.
   849      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   850      return int64(length), err
   851  }
   852  
   853  // SizeBytes implements marshal.Marshallable.SizeBytes.
   854  func (n *NV503B_ALLOC_PARAMETERS) SizeBytes() int {
   855      return 32 +
   856          (*Handle)(nil).SizeBytes() +
   857          (*Handle)(nil).SizeBytes() +
   858          (*NV503B_BAR1_P2P_DMA_INFO)(nil).SizeBytes() +
   859          (*NV503B_BAR1_P2P_DMA_INFO)(nil).SizeBytes()
   860  }
   861  
   862  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   863  func (n *NV503B_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
   864      dst = n.HSubDevice.MarshalUnsafe(dst)
   865      dst = n.HPeerSubDevice.MarshalUnsafe(dst)
   866      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDevicePeerIDMask))
   867      dst = dst[4:]
   868      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.PeerSubDevicePeerIDMask))
   869      dst = dst[4:]
   870      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.MailboxBar1Addr))
   871      dst = dst[8:]
   872      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.MailboxTotalSize))
   873      dst = dst[4:]
   874      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
   875      dst = dst[4:]
   876      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDeviceEgmPeerIDMask))
   877      dst = dst[4:]
   878      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.PeerSubDeviceEgmPeerIDMask))
   879      dst = dst[4:]
   880      dst = n.L2pBar1P2PDmaInfo.MarshalUnsafe(dst)
   881      dst = n.P2lBar1P2PDmaInfo.MarshalUnsafe(dst)
   882      return dst
   883  }
   884  
   885  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   886  func (n *NV503B_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   887      src = n.HSubDevice.UnmarshalUnsafe(src)
   888      src = n.HPeerSubDevice.UnmarshalUnsafe(src)
   889      n.SubDevicePeerIDMask = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   890      src = src[4:]
   891      n.PeerSubDevicePeerIDMask = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   892      src = src[4:]
   893      n.MailboxBar1Addr = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   894      src = src[8:]
   895      n.MailboxTotalSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   896      src = src[4:]
   897      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   898      src = src[4:]
   899      n.SubDeviceEgmPeerIDMask = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   900      src = src[4:]
   901      n.PeerSubDeviceEgmPeerIDMask = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   902      src = src[4:]
   903      src = n.L2pBar1P2PDmaInfo.UnmarshalUnsafe(src)
   904      src = n.P2lBar1P2PDmaInfo.UnmarshalUnsafe(src)
   905      return src
   906  }
   907  
   908  // Packed implements marshal.Marshallable.Packed.
   909  //go:nosplit
   910  func (n *NV503B_ALLOC_PARAMETERS) Packed() bool {
   911      return n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed()
   912  }
   913  
   914  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   915  func (n *NV503B_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   916      if n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   917          size := n.SizeBytes()
   918          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   919          return dst[size:]
   920      }
   921      // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
   922      return n.MarshalBytes(dst)
   923  }
   924  
   925  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   926  func (n *NV503B_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   927      if n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   928          size := n.SizeBytes()
   929          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   930          return src[size:]
   931      }
   932      // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
   933      return n.UnmarshalBytes(src)
   934  }
   935  
   936  // CopyOutN implements marshal.Marshallable.CopyOutN.
   937  func (n *NV503B_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   938      if !n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   939          // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   940          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   941          n.MarshalBytes(buf) // escapes: fallback.
   942          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   943      }
   944  
   945      // Construct a slice backed by dst's underlying memory.
   946      var buf []byte
   947      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   948      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   949      hdr.Len = n.SizeBytes()
   950      hdr.Cap = n.SizeBytes()
   951  
   952      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   953      // Since we bypassed the compiler's escape analysis, indicate that n
   954      // must live until the use above.
   955      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   956      return length, err
   957  }
   958  
   959  // CopyOut implements marshal.Marshallable.CopyOut.
   960  func (n *NV503B_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   961      return n.CopyOutN(cc, addr, n.SizeBytes())
   962  }
   963  
   964  // CopyInN implements marshal.Marshallable.CopyInN.
   965  func (n *NV503B_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   966      if !n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   967          // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
   968          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   969          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   970          // Unmarshal unconditionally. If we had a short copy-in, this results in a
   971          // partially unmarshalled struct.
   972          n.UnmarshalBytes(buf) // escapes: fallback.
   973          return length, err
   974      }
   975  
   976      // Construct a slice backed by dst's underlying memory.
   977      var buf []byte
   978      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   979      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   980      hdr.Len = n.SizeBytes()
   981      hdr.Cap = n.SizeBytes()
   982  
   983      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   984      // Since we bypassed the compiler's escape analysis, indicate that n
   985      // must live until the use above.
   986      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   987      return length, err
   988  }
   989  
   990  // CopyIn implements marshal.Marshallable.CopyIn.
   991  func (n *NV503B_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   992      return n.CopyInN(cc, addr, n.SizeBytes())
   993  }
   994  
   995  // WriteTo implements io.WriterTo.WriteTo.
   996  func (n *NV503B_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   997      if !n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   998          // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   999          buf := make([]byte, n.SizeBytes())
  1000          n.MarshalBytes(buf)
  1001          length, err := writer.Write(buf)
  1002          return int64(length), err
  1003      }
  1004  
  1005      // Construct a slice backed by dst's underlying memory.
  1006      var buf []byte
  1007      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1008      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1009      hdr.Len = n.SizeBytes()
  1010      hdr.Cap = n.SizeBytes()
  1011  
  1012      length, err := writer.Write(buf)
  1013      // Since we bypassed the compiler's escape analysis, indicate that n
  1014      // must live until the use above.
  1015      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1016      return int64(length), err
  1017  }
  1018  
  1019  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1020  func (n *NV503B_BAR1_P2P_DMA_INFO) SizeBytes() int {
  1021      return 16
  1022  }
  1023  
  1024  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1025  func (n *NV503B_BAR1_P2P_DMA_INFO) MarshalBytes(dst []byte) []byte {
  1026      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.DmaAddress))
  1027      dst = dst[8:]
  1028      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.DmaSize))
  1029      dst = dst[8:]
  1030      return dst
  1031  }
  1032  
  1033  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1034  func (n *NV503B_BAR1_P2P_DMA_INFO) UnmarshalBytes(src []byte) []byte {
  1035      n.DmaAddress = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  1036      src = src[8:]
  1037      n.DmaSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  1038      src = src[8:]
  1039      return src
  1040  }
  1041  
  1042  // Packed implements marshal.Marshallable.Packed.
  1043  //go:nosplit
  1044  func (n *NV503B_BAR1_P2P_DMA_INFO) Packed() bool {
  1045      return true
  1046  }
  1047  
  1048  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1049  func (n *NV503B_BAR1_P2P_DMA_INFO) MarshalUnsafe(dst []byte) []byte {
  1050      size := n.SizeBytes()
  1051      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1052      return dst[size:]
  1053  }
  1054  
  1055  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1056  func (n *NV503B_BAR1_P2P_DMA_INFO) UnmarshalUnsafe(src []byte) []byte {
  1057      size := n.SizeBytes()
  1058      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1059      return src[size:]
  1060  }
  1061  
  1062  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1063  func (n *NV503B_BAR1_P2P_DMA_INFO) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1064      // Construct a slice backed by dst's underlying memory.
  1065      var buf []byte
  1066      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1067      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1068      hdr.Len = n.SizeBytes()
  1069      hdr.Cap = n.SizeBytes()
  1070  
  1071      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1072      // Since we bypassed the compiler's escape analysis, indicate that n
  1073      // must live until the use above.
  1074      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1075      return length, err
  1076  }
  1077  
  1078  // CopyOut implements marshal.Marshallable.CopyOut.
  1079  func (n *NV503B_BAR1_P2P_DMA_INFO) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1080      return n.CopyOutN(cc, addr, n.SizeBytes())
  1081  }
  1082  
  1083  // CopyInN implements marshal.Marshallable.CopyInN.
  1084  func (n *NV503B_BAR1_P2P_DMA_INFO) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1085      // Construct a slice backed by dst's underlying memory.
  1086      var buf []byte
  1087      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1088      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1089      hdr.Len = n.SizeBytes()
  1090      hdr.Cap = n.SizeBytes()
  1091  
  1092      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1093      // Since we bypassed the compiler's escape analysis, indicate that n
  1094      // must live until the use above.
  1095      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1096      return length, err
  1097  }
  1098  
  1099  // CopyIn implements marshal.Marshallable.CopyIn.
  1100  func (n *NV503B_BAR1_P2P_DMA_INFO) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1101      return n.CopyInN(cc, addr, n.SizeBytes())
  1102  }
  1103  
  1104  // WriteTo implements io.WriterTo.WriteTo.
  1105  func (n *NV503B_BAR1_P2P_DMA_INFO) WriteTo(writer io.Writer) (int64, error) {
  1106      // Construct a slice backed by dst's underlying memory.
  1107      var buf []byte
  1108      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1109      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1110      hdr.Len = n.SizeBytes()
  1111      hdr.Cap = n.SizeBytes()
  1112  
  1113      length, err := writer.Write(buf)
  1114      // Since we bypassed the compiler's escape analysis, indicate that n
  1115      // must live until the use above.
  1116      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1117      return int64(length), err
  1118  }
  1119  
  1120  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1121  func (n *NV503C_ALLOC_PARAMETERS) SizeBytes() int {
  1122      return 4
  1123  }
  1124  
  1125  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1126  func (n *NV503C_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1127      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  1128      dst = dst[4:]
  1129      return dst
  1130  }
  1131  
  1132  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1133  func (n *NV503C_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1134      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1135      src = src[4:]
  1136      return src
  1137  }
  1138  
  1139  // Packed implements marshal.Marshallable.Packed.
  1140  //go:nosplit
  1141  func (n *NV503C_ALLOC_PARAMETERS) Packed() bool {
  1142      return true
  1143  }
  1144  
  1145  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1146  func (n *NV503C_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  1147      size := n.SizeBytes()
  1148      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1149      return dst[size:]
  1150  }
  1151  
  1152  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1153  func (n *NV503C_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  1154      size := n.SizeBytes()
  1155      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1156      return src[size:]
  1157  }
  1158  
  1159  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1160  func (n *NV503C_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1161      // Construct a slice backed by dst's underlying memory.
  1162      var buf []byte
  1163      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1164      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1165      hdr.Len = n.SizeBytes()
  1166      hdr.Cap = n.SizeBytes()
  1167  
  1168      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1169      // Since we bypassed the compiler's escape analysis, indicate that n
  1170      // must live until the use above.
  1171      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1172      return length, err
  1173  }
  1174  
  1175  // CopyOut implements marshal.Marshallable.CopyOut.
  1176  func (n *NV503C_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1177      return n.CopyOutN(cc, addr, n.SizeBytes())
  1178  }
  1179  
  1180  // CopyInN implements marshal.Marshallable.CopyInN.
  1181  func (n *NV503C_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1182      // Construct a slice backed by dst's underlying memory.
  1183      var buf []byte
  1184      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1185      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1186      hdr.Len = n.SizeBytes()
  1187      hdr.Cap = n.SizeBytes()
  1188  
  1189      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1190      // Since we bypassed the compiler's escape analysis, indicate that n
  1191      // must live until the use above.
  1192      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1193      return length, err
  1194  }
  1195  
  1196  // CopyIn implements marshal.Marshallable.CopyIn.
  1197  func (n *NV503C_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1198      return n.CopyInN(cc, addr, n.SizeBytes())
  1199  }
  1200  
  1201  // WriteTo implements io.WriterTo.WriteTo.
  1202  func (n *NV503C_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  1203      // Construct a slice backed by dst's underlying memory.
  1204      var buf []byte
  1205      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1206      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1207      hdr.Len = n.SizeBytes()
  1208      hdr.Cap = n.SizeBytes()
  1209  
  1210      length, err := writer.Write(buf)
  1211      // Since we bypassed the compiler's escape analysis, indicate that n
  1212      // must live until the use above.
  1213      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1214      return int64(length), err
  1215  }
  1216  
  1217  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1218  func (n *NV83DE_ALLOC_PARAMETERS) SizeBytes() int {
  1219      return 0 +
  1220          (*Handle)(nil).SizeBytes() +
  1221          (*Handle)(nil).SizeBytes() +
  1222          (*Handle)(nil).SizeBytes()
  1223  }
  1224  
  1225  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1226  func (n *NV83DE_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1227      dst = n.HDebuggerClient_Obsolete.MarshalUnsafe(dst)
  1228      dst = n.HAppClient.MarshalUnsafe(dst)
  1229      dst = n.HClass3DObject.MarshalUnsafe(dst)
  1230      return dst
  1231  }
  1232  
  1233  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1234  func (n *NV83DE_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1235      src = n.HDebuggerClient_Obsolete.UnmarshalUnsafe(src)
  1236      src = n.HAppClient.UnmarshalUnsafe(src)
  1237      src = n.HClass3DObject.UnmarshalUnsafe(src)
  1238      return src
  1239  }
  1240  
  1241  // Packed implements marshal.Marshallable.Packed.
  1242  //go:nosplit
  1243  func (n *NV83DE_ALLOC_PARAMETERS) Packed() bool {
  1244      return n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed()
  1245  }
  1246  
  1247  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1248  func (n *NV83DE_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  1249      if n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1250          size := n.SizeBytes()
  1251          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1252          return dst[size:]
  1253      }
  1254      // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
  1255      return n.MarshalBytes(dst)
  1256  }
  1257  
  1258  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1259  func (n *NV83DE_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  1260      if n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1261          size := n.SizeBytes()
  1262          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1263          return src[size:]
  1264      }
  1265      // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  1266      return n.UnmarshalBytes(src)
  1267  }
  1268  
  1269  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1270  func (n *NV83DE_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1271      if !n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1272          // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1273          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1274          n.MarshalBytes(buf) // escapes: fallback.
  1275          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1276      }
  1277  
  1278      // Construct a slice backed by dst's underlying memory.
  1279      var buf []byte
  1280      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1281      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1282      hdr.Len = n.SizeBytes()
  1283      hdr.Cap = n.SizeBytes()
  1284  
  1285      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1286      // Since we bypassed the compiler's escape analysis, indicate that n
  1287      // must live until the use above.
  1288      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1289      return length, err
  1290  }
  1291  
  1292  // CopyOut implements marshal.Marshallable.CopyOut.
  1293  func (n *NV83DE_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1294      return n.CopyOutN(cc, addr, n.SizeBytes())
  1295  }
  1296  
  1297  // CopyInN implements marshal.Marshallable.CopyInN.
  1298  func (n *NV83DE_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1299      if !n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1300          // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  1301          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1302          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1303          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  1304          // partially unmarshalled struct.
  1305          n.UnmarshalBytes(buf) // escapes: fallback.
  1306          return length, err
  1307      }
  1308  
  1309      // Construct a slice backed by dst's underlying memory.
  1310      var buf []byte
  1311      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1312      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1313      hdr.Len = n.SizeBytes()
  1314      hdr.Cap = n.SizeBytes()
  1315  
  1316      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1317      // Since we bypassed the compiler's escape analysis, indicate that n
  1318      // must live until the use above.
  1319      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1320      return length, err
  1321  }
  1322  
  1323  // CopyIn implements marshal.Marshallable.CopyIn.
  1324  func (n *NV83DE_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1325      return n.CopyInN(cc, addr, n.SizeBytes())
  1326  }
  1327  
  1328  // WriteTo implements io.WriterTo.WriteTo.
  1329  func (n *NV83DE_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  1330      if !n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1331          // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1332          buf := make([]byte, n.SizeBytes())
  1333          n.MarshalBytes(buf)
  1334          length, err := writer.Write(buf)
  1335          return int64(length), err
  1336      }
  1337  
  1338      // Construct a slice backed by dst's underlying memory.
  1339      var buf []byte
  1340      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1341      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1342      hdr.Len = n.SizeBytes()
  1343      hdr.Cap = n.SizeBytes()
  1344  
  1345      length, err := writer.Write(buf)
  1346      // Since we bypassed the compiler's escape analysis, indicate that n
  1347      // must live until the use above.
  1348      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1349      return int64(length), err
  1350  }
  1351  
  1352  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1353  func (n *NVB0B5_ALLOCATION_PARAMETERS) SizeBytes() int {
  1354      return 8
  1355  }
  1356  
  1357  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1358  func (n *NVB0B5_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1359      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Version))
  1360      dst = dst[4:]
  1361      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EngineType))
  1362      dst = dst[4:]
  1363      return dst
  1364  }
  1365  
  1366  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1367  func (n *NVB0B5_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1368      n.Version = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1369      src = src[4:]
  1370      n.EngineType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1371      src = src[4:]
  1372      return src
  1373  }
  1374  
  1375  // Packed implements marshal.Marshallable.Packed.
  1376  //go:nosplit
  1377  func (n *NVB0B5_ALLOCATION_PARAMETERS) Packed() bool {
  1378      return true
  1379  }
  1380  
  1381  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1382  func (n *NVB0B5_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  1383      size := n.SizeBytes()
  1384      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1385      return dst[size:]
  1386  }
  1387  
  1388  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1389  func (n *NVB0B5_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  1390      size := n.SizeBytes()
  1391      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1392      return src[size:]
  1393  }
  1394  
  1395  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1396  func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1397      // Construct a slice backed by dst's underlying memory.
  1398      var buf []byte
  1399      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1400      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1401      hdr.Len = n.SizeBytes()
  1402      hdr.Cap = n.SizeBytes()
  1403  
  1404      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1405      // Since we bypassed the compiler's escape analysis, indicate that n
  1406      // must live until the use above.
  1407      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1408      return length, err
  1409  }
  1410  
  1411  // CopyOut implements marshal.Marshallable.CopyOut.
  1412  func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1413      return n.CopyOutN(cc, addr, n.SizeBytes())
  1414  }
  1415  
  1416  // CopyInN implements marshal.Marshallable.CopyInN.
  1417  func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1418      // Construct a slice backed by dst's underlying memory.
  1419      var buf []byte
  1420      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1421      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1422      hdr.Len = n.SizeBytes()
  1423      hdr.Cap = n.SizeBytes()
  1424  
  1425      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1426      // Since we bypassed the compiler's escape analysis, indicate that n
  1427      // must live until the use above.
  1428      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1429      return length, err
  1430  }
  1431  
  1432  // CopyIn implements marshal.Marshallable.CopyIn.
  1433  func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1434      return n.CopyInN(cc, addr, n.SizeBytes())
  1435  }
  1436  
  1437  // WriteTo implements io.WriterTo.WriteTo.
  1438  func (n *NVB0B5_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  1439      // Construct a slice backed by dst's underlying memory.
  1440      var buf []byte
  1441      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1442      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1443      hdr.Len = n.SizeBytes()
  1444      hdr.Cap = n.SizeBytes()
  1445  
  1446      length, err := writer.Write(buf)
  1447      // Since we bypassed the compiler's escape analysis, indicate that n
  1448      // must live until the use above.
  1449      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1450      return int64(length), err
  1451  }
  1452  
  1453  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1454  func (n *NV_CHANNEL_ALLOC_PARAMS) SizeBytes() int {
  1455      return 40 +
  1456          (*Handle)(nil).SizeBytes() +
  1457          (*Handle)(nil).SizeBytes() +
  1458          (*Handle)(nil).SizeBytes() +
  1459          (*Handle)(nil).SizeBytes() +
  1460          (*Handle)(nil).SizeBytes()*NV_MAX_SUBDEVICES +
  1461          8*NV_MAX_SUBDEVICES +
  1462          (*Handle)(nil).SizeBytes() +
  1463          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1464          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1465          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1466          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1467          (*Handle)(nil).SizeBytes() +
  1468          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1469          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1470          4*CC_CHAN_ALLOC_IV_SIZE_DWORD +
  1471          4*CC_CHAN_ALLOC_IV_SIZE_DWORD +
  1472          4*CC_CHAN_ALLOC_NONCE_SIZE_DWORD
  1473  }
  1474  
  1475  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1476  func (n *NV_CHANNEL_ALLOC_PARAMS) MarshalBytes(dst []byte) []byte {
  1477      dst = n.HObjectError.MarshalUnsafe(dst)
  1478      dst = n.HObjectBuffer.MarshalUnsafe(dst)
  1479      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.GPFIFOOffset))
  1480      dst = dst[8:]
  1481      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.GPFIFOEntries))
  1482      dst = dst[4:]
  1483      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  1484      dst = dst[4:]
  1485      dst = n.HContextShare.MarshalUnsafe(dst)
  1486      dst = n.HVASpace.MarshalUnsafe(dst)
  1487      for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ {
  1488          dst = n.HUserdMemory[idx].MarshalUnsafe(dst)
  1489      }
  1490      for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ {
  1491          hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.UserdOffset[idx]))
  1492          dst = dst[8:]
  1493      }
  1494      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EngineType))
  1495      dst = dst[4:]
  1496      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.CID))
  1497      dst = dst[4:]
  1498      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDeviceID))
  1499      dst = dst[4:]
  1500      dst = n.HObjectECCError.MarshalUnsafe(dst)
  1501      dst = n.InstanceMem.MarshalUnsafe(dst)
  1502      dst = n.UserdMem.MarshalUnsafe(dst)
  1503      dst = n.RamfcMem.MarshalUnsafe(dst)
  1504      dst = n.MthdbufMem.MarshalUnsafe(dst)
  1505      dst = n.HPhysChannelGroup.MarshalUnsafe(dst)
  1506      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.InternalFlags))
  1507      dst = dst[4:]
  1508      dst = n.ErrorNotifierMem.MarshalUnsafe(dst)
  1509      dst = n.ECCErrorNotifierMem.MarshalUnsafe(dst)
  1510      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ProcessID))
  1511      dst = dst[4:]
  1512      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubProcessID))
  1513      dst = dst[4:]
  1514      for idx := 0; idx < CC_CHAN_ALLOC_IV_SIZE_DWORD; idx++ {
  1515          hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EncryptIv[idx]))
  1516          dst = dst[4:]
  1517      }
  1518      for idx := 0; idx < CC_CHAN_ALLOC_IV_SIZE_DWORD; idx++ {
  1519          hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.DecryptIv[idx]))
  1520          dst = dst[4:]
  1521      }
  1522      for idx := 0; idx < CC_CHAN_ALLOC_NONCE_SIZE_DWORD; idx++ {
  1523          hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HmacNonce[idx]))
  1524          dst = dst[4:]
  1525      }
  1526      return dst
  1527  }
  1528  
  1529  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1530  func (n *NV_CHANNEL_ALLOC_PARAMS) UnmarshalBytes(src []byte) []byte {
  1531      src = n.HObjectError.UnmarshalUnsafe(src)
  1532      src = n.HObjectBuffer.UnmarshalUnsafe(src)
  1533      n.GPFIFOOffset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  1534      src = src[8:]
  1535      n.GPFIFOEntries = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1536      src = src[4:]
  1537      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1538      src = src[4:]
  1539      src = n.HContextShare.UnmarshalUnsafe(src)
  1540      src = n.HVASpace.UnmarshalUnsafe(src)
  1541      for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ {
  1542          src = n.HUserdMemory[idx].UnmarshalUnsafe(src)
  1543      }
  1544      for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ {
  1545          n.UserdOffset[idx] = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  1546          src = src[8:]
  1547      }
  1548      n.EngineType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1549      src = src[4:]
  1550      n.CID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1551      src = src[4:]
  1552      n.SubDeviceID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1553      src = src[4:]
  1554      src = n.HObjectECCError.UnmarshalUnsafe(src)
  1555      src = n.InstanceMem.UnmarshalUnsafe(src)
  1556      src = n.UserdMem.UnmarshalUnsafe(src)
  1557      src = n.RamfcMem.UnmarshalUnsafe(src)
  1558      src = n.MthdbufMem.UnmarshalUnsafe(src)
  1559      src = n.HPhysChannelGroup.UnmarshalUnsafe(src)
  1560      n.InternalFlags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1561      src = src[4:]
  1562      src = n.ErrorNotifierMem.UnmarshalUnsafe(src)
  1563      src = n.ECCErrorNotifierMem.UnmarshalUnsafe(src)
  1564      n.ProcessID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1565      src = src[4:]
  1566      n.SubProcessID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1567      src = src[4:]
  1568      for idx := 0; idx < CC_CHAN_ALLOC_IV_SIZE_DWORD; idx++ {
  1569          n.EncryptIv[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1570          src = src[4:]
  1571      }
  1572      for idx := 0; idx < CC_CHAN_ALLOC_IV_SIZE_DWORD; idx++ {
  1573          n.DecryptIv[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1574          src = src[4:]
  1575      }
  1576      for idx := 0; idx < CC_CHAN_ALLOC_NONCE_SIZE_DWORD; idx++ {
  1577          n.HmacNonce[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1578          src = src[4:]
  1579      }
  1580      return src
  1581  }
  1582  
  1583  // Packed implements marshal.Marshallable.Packed.
  1584  //go:nosplit
  1585  func (n *NV_CHANNEL_ALLOC_PARAMS) Packed() bool {
  1586      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()
  1587  }
  1588  
  1589  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1590  func (n *NV_CHANNEL_ALLOC_PARAMS) MarshalUnsafe(dst []byte) []byte {
  1591      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() {
  1592          size := n.SizeBytes()
  1593          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1594          return dst[size:]
  1595      }
  1596      // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  1597      return n.MarshalBytes(dst)
  1598  }
  1599  
  1600  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1601  func (n *NV_CHANNEL_ALLOC_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  1602      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() {
  1603          size := n.SizeBytes()
  1604          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1605          return src[size:]
  1606      }
  1607      // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  1608      return n.UnmarshalBytes(src)
  1609  }
  1610  
  1611  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1612  func (n *NV_CHANNEL_ALLOC_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1613      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() {
  1614          // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1615          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1616          n.MarshalBytes(buf) // escapes: fallback.
  1617          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1618      }
  1619  
  1620      // Construct a slice backed by dst's underlying memory.
  1621      var buf []byte
  1622      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1623      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1624      hdr.Len = n.SizeBytes()
  1625      hdr.Cap = n.SizeBytes()
  1626  
  1627      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1628      // Since we bypassed the compiler's escape analysis, indicate that n
  1629      // must live until the use above.
  1630      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1631      return length, err
  1632  }
  1633  
  1634  // CopyOut implements marshal.Marshallable.CopyOut.
  1635  func (n *NV_CHANNEL_ALLOC_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1636      return n.CopyOutN(cc, addr, n.SizeBytes())
  1637  }
  1638  
  1639  // CopyInN implements marshal.Marshallable.CopyInN.
  1640  func (n *NV_CHANNEL_ALLOC_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1641      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() {
  1642          // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  1643          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1644          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1645          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  1646          // partially unmarshalled struct.
  1647          n.UnmarshalBytes(buf) // escapes: fallback.
  1648          return length, err
  1649      }
  1650  
  1651      // Construct a slice backed by dst's underlying memory.
  1652      var buf []byte
  1653      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1654      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1655      hdr.Len = n.SizeBytes()
  1656      hdr.Cap = n.SizeBytes()
  1657  
  1658      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1659      // Since we bypassed the compiler's escape analysis, indicate that n
  1660      // must live until the use above.
  1661      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1662      return length, err
  1663  }
  1664  
  1665  // CopyIn implements marshal.Marshallable.CopyIn.
  1666  func (n *NV_CHANNEL_ALLOC_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1667      return n.CopyInN(cc, addr, n.SizeBytes())
  1668  }
  1669  
  1670  // WriteTo implements io.WriterTo.WriteTo.
  1671  func (n *NV_CHANNEL_ALLOC_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  1672      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() {
  1673          // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1674          buf := make([]byte, n.SizeBytes())
  1675          n.MarshalBytes(buf)
  1676          length, err := writer.Write(buf)
  1677          return int64(length), err
  1678      }
  1679  
  1680      // Construct a slice backed by dst's underlying memory.
  1681      var buf []byte
  1682      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1683      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1684      hdr.Len = n.SizeBytes()
  1685      hdr.Cap = n.SizeBytes()
  1686  
  1687      length, err := writer.Write(buf)
  1688      // Since we bypassed the compiler's escape analysis, indicate that n
  1689      // must live until the use above.
  1690      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1691      return int64(length), err
  1692  }
  1693  
  1694  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1695  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) SizeBytes() int {
  1696      return 5 +
  1697          (*Handle)(nil).SizeBytes() +
  1698          (*Handle)(nil).SizeBytes() +
  1699          (*Handle)(nil).SizeBytes() +
  1700          1*3
  1701  }
  1702  
  1703  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1704  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1705      dst = n.HObjectError.MarshalUnsafe(dst)
  1706      dst = n.HObjectECCError.MarshalUnsafe(dst)
  1707      dst = n.HVASpace.MarshalUnsafe(dst)
  1708      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EngineType))
  1709      dst = dst[4:]
  1710      dst[0] = byte(n.BIsCallingContextVgpuPlugin)
  1711      dst = dst[1:]
  1712      for idx := 0; idx < 3; idx++ {
  1713          dst[0] = byte(n.Pad0[idx])
  1714          dst = dst[1:]
  1715      }
  1716      return dst
  1717  }
  1718  
  1719  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1720  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1721      src = n.HObjectError.UnmarshalUnsafe(src)
  1722      src = n.HObjectECCError.UnmarshalUnsafe(src)
  1723      src = n.HVASpace.UnmarshalUnsafe(src)
  1724      n.EngineType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1725      src = src[4:]
  1726      n.BIsCallingContextVgpuPlugin = uint8(src[0])
  1727      src = src[1:]
  1728      for idx := 0; idx < 3; idx++ {
  1729          n.Pad0[idx] = src[0]
  1730          src = src[1:]
  1731      }
  1732      return src
  1733  }
  1734  
  1735  // Packed implements marshal.Marshallable.Packed.
  1736  //go:nosplit
  1737  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) Packed() bool {
  1738      return n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed()
  1739  }
  1740  
  1741  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1742  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  1743      if n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1744          size := n.SizeBytes()
  1745          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1746          return dst[size:]
  1747      }
  1748      // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
  1749      return n.MarshalBytes(dst)
  1750  }
  1751  
  1752  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1753  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  1754      if n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1755          size := n.SizeBytes()
  1756          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1757          return src[size:]
  1758      }
  1759      // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  1760      return n.UnmarshalBytes(src)
  1761  }
  1762  
  1763  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1764  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1765      if !n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1766          // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1767          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1768          n.MarshalBytes(buf) // escapes: fallback.
  1769          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1770      }
  1771  
  1772      // Construct a slice backed by dst's underlying memory.
  1773      var buf []byte
  1774      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1775      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1776      hdr.Len = n.SizeBytes()
  1777      hdr.Cap = n.SizeBytes()
  1778  
  1779      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1780      // Since we bypassed the compiler's escape analysis, indicate that n
  1781      // must live until the use above.
  1782      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1783      return length, err
  1784  }
  1785  
  1786  // CopyOut implements marshal.Marshallable.CopyOut.
  1787  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1788      return n.CopyOutN(cc, addr, n.SizeBytes())
  1789  }
  1790  
  1791  // CopyInN implements marshal.Marshallable.CopyInN.
  1792  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1793      if !n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1794          // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  1795          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1796          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1797          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  1798          // partially unmarshalled struct.
  1799          n.UnmarshalBytes(buf) // escapes: fallback.
  1800          return length, err
  1801      }
  1802  
  1803      // Construct a slice backed by dst's underlying memory.
  1804      var buf []byte
  1805      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1806      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1807      hdr.Len = n.SizeBytes()
  1808      hdr.Cap = n.SizeBytes()
  1809  
  1810      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1811      // Since we bypassed the compiler's escape analysis, indicate that n
  1812      // must live until the use above.
  1813      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1814      return length, err
  1815  }
  1816  
  1817  // CopyIn implements marshal.Marshallable.CopyIn.
  1818  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1819      return n.CopyInN(cc, addr, n.SizeBytes())
  1820  }
  1821  
  1822  // WriteTo implements io.WriterTo.WriteTo.
  1823  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  1824      if !n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1825          // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1826          buf := make([]byte, n.SizeBytes())
  1827          n.MarshalBytes(buf)
  1828          length, err := writer.Write(buf)
  1829          return int64(length), err
  1830      }
  1831  
  1832      // Construct a slice backed by dst's underlying memory.
  1833      var buf []byte
  1834      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1835      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1836      hdr.Len = n.SizeBytes()
  1837      hdr.Cap = n.SizeBytes()
  1838  
  1839      length, err := writer.Write(buf)
  1840      // Since we bypassed the compiler's escape analysis, indicate that n
  1841      // must live until the use above.
  1842      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1843      return int64(length), err
  1844  }
  1845  
  1846  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1847  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) SizeBytes() int {
  1848      return 4 +
  1849          (*Handle)(nil).SizeBytes()
  1850  }
  1851  
  1852  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1853  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) MarshalBytes(dst []byte) []byte {
  1854      dst = n.Handle.MarshalUnsafe(dst)
  1855      // Padding: dst[:sizeof(uint32)] ~= uint32(0)
  1856      dst = dst[4:]
  1857      return dst
  1858  }
  1859  
  1860  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1861  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) UnmarshalBytes(src []byte) []byte {
  1862      src = n.Handle.UnmarshalUnsafe(src)
  1863      // Padding: var _ uint32 ~= src[:sizeof(uint32)]
  1864      src = src[4:]
  1865      return src
  1866  }
  1867  
  1868  // Packed implements marshal.Marshallable.Packed.
  1869  //go:nosplit
  1870  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) Packed() bool {
  1871      return n.Handle.Packed()
  1872  }
  1873  
  1874  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1875  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) MarshalUnsafe(dst []byte) []byte {
  1876      if n.Handle.Packed() {
  1877          size := n.SizeBytes()
  1878          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1879          return dst[size:]
  1880      }
  1881      // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  1882      return n.MarshalBytes(dst)
  1883  }
  1884  
  1885  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1886  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  1887      if n.Handle.Packed() {
  1888          size := n.SizeBytes()
  1889          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1890          return src[size:]
  1891      }
  1892      // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  1893      return n.UnmarshalBytes(src)
  1894  }
  1895  
  1896  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1897  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1898      if !n.Handle.Packed() {
  1899          // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1900          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1901          n.MarshalBytes(buf) // escapes: fallback.
  1902          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1903      }
  1904  
  1905      // Construct a slice backed by dst's underlying memory.
  1906      var buf []byte
  1907      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1908      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1909      hdr.Len = n.SizeBytes()
  1910      hdr.Cap = n.SizeBytes()
  1911  
  1912      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1913      // Since we bypassed the compiler's escape analysis, indicate that n
  1914      // must live until the use above.
  1915      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1916      return length, err
  1917  }
  1918  
  1919  // CopyOut implements marshal.Marshallable.CopyOut.
  1920  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1921      return n.CopyOutN(cc, addr, n.SizeBytes())
  1922  }
  1923  
  1924  // CopyInN implements marshal.Marshallable.CopyInN.
  1925  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1926      if !n.Handle.Packed() {
  1927          // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  1928          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1929          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1930          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  1931          // partially unmarshalled struct.
  1932          n.UnmarshalBytes(buf) // escapes: fallback.
  1933          return length, err
  1934      }
  1935  
  1936      // Construct a slice backed by dst's underlying memory.
  1937      var buf []byte
  1938      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1939      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1940      hdr.Len = n.SizeBytes()
  1941      hdr.Cap = n.SizeBytes()
  1942  
  1943      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1944      // Since we bypassed the compiler's escape analysis, indicate that n
  1945      // must live until the use above.
  1946      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1947      return length, err
  1948  }
  1949  
  1950  // CopyIn implements marshal.Marshallable.CopyIn.
  1951  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1952      return n.CopyInN(cc, addr, n.SizeBytes())
  1953  }
  1954  
  1955  // WriteTo implements io.WriterTo.WriteTo.
  1956  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  1957      if !n.Handle.Packed() {
  1958          // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1959          buf := make([]byte, n.SizeBytes())
  1960          n.MarshalBytes(buf)
  1961          length, err := writer.Write(buf)
  1962          return int64(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 := writer.Write(buf)
  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 int64(length), err
  1977  }
  1978  
  1979  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1980  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) SizeBytes() int {
  1981      return 8 +
  1982          (*Handle)(nil).SizeBytes()
  1983  }
  1984  
  1985  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1986  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1987      dst = n.HVASpace.MarshalUnsafe(dst)
  1988      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  1989      dst = dst[4:]
  1990      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubctxID))
  1991      dst = dst[4:]
  1992      return dst
  1993  }
  1994  
  1995  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1996  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1997      src = n.HVASpace.UnmarshalUnsafe(src)
  1998      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1999      src = src[4:]
  2000      n.SubctxID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2001      src = src[4:]
  2002      return src
  2003  }
  2004  
  2005  // Packed implements marshal.Marshallable.Packed.
  2006  //go:nosplit
  2007  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) Packed() bool {
  2008      return n.HVASpace.Packed()
  2009  }
  2010  
  2011  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2012  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  2013      if n.HVASpace.Packed() {
  2014          size := n.SizeBytes()
  2015          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2016          return dst[size:]
  2017      }
  2018      // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
  2019      return n.MarshalBytes(dst)
  2020  }
  2021  
  2022  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2023  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  2024      if n.HVASpace.Packed() {
  2025          size := n.SizeBytes()
  2026          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2027          return src[size:]
  2028      }
  2029      // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  2030      return n.UnmarshalBytes(src)
  2031  }
  2032  
  2033  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2034  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2035      if !n.HVASpace.Packed() {
  2036          // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2037          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2038          n.MarshalBytes(buf) // escapes: fallback.
  2039          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2040      }
  2041  
  2042      // Construct a slice backed by dst's underlying memory.
  2043      var buf []byte
  2044      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2045      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2046      hdr.Len = n.SizeBytes()
  2047      hdr.Cap = n.SizeBytes()
  2048  
  2049      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2050      // Since we bypassed the compiler's escape analysis, indicate that n
  2051      // must live until the use above.
  2052      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2053      return length, err
  2054  }
  2055  
  2056  // CopyOut implements marshal.Marshallable.CopyOut.
  2057  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2058      return n.CopyOutN(cc, addr, n.SizeBytes())
  2059  }
  2060  
  2061  // CopyInN implements marshal.Marshallable.CopyInN.
  2062  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2063      if !n.HVASpace.Packed() {
  2064          // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  2065          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2066          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2067          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  2068          // partially unmarshalled struct.
  2069          n.UnmarshalBytes(buf) // escapes: fallback.
  2070          return length, err
  2071      }
  2072  
  2073      // Construct a slice backed by dst's underlying memory.
  2074      var buf []byte
  2075      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2076      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2077      hdr.Len = n.SizeBytes()
  2078      hdr.Cap = n.SizeBytes()
  2079  
  2080      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2081      // Since we bypassed the compiler's escape analysis, indicate that n
  2082      // must live until the use above.
  2083      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2084      return length, err
  2085  }
  2086  
  2087  // CopyIn implements marshal.Marshallable.CopyIn.
  2088  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2089      return n.CopyInN(cc, addr, n.SizeBytes())
  2090  }
  2091  
  2092  // WriteTo implements io.WriterTo.WriteTo.
  2093  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  2094      if !n.HVASpace.Packed() {
  2095          // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2096          buf := make([]byte, n.SizeBytes())
  2097          n.MarshalBytes(buf)
  2098          length, err := writer.Write(buf)
  2099          return int64(length), err
  2100      }
  2101  
  2102      // Construct a slice backed by dst's underlying memory.
  2103      var buf []byte
  2104      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2105      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2106      hdr.Len = n.SizeBytes()
  2107      hdr.Cap = n.SizeBytes()
  2108  
  2109      length, err := writer.Write(buf)
  2110      // Since we bypassed the compiler's escape analysis, indicate that n
  2111      // must live until the use above.
  2112      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2113      return int64(length), err
  2114  }
  2115  
  2116  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2117  func (n *NV_GR_ALLOCATION_PARAMETERS) SizeBytes() int {
  2118      return 16
  2119  }
  2120  
  2121  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2122  func (n *NV_GR_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  2123      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Version))
  2124      dst = dst[4:]
  2125      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  2126      dst = dst[4:]
  2127      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Size))
  2128      dst = dst[4:]
  2129      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Caps))
  2130      dst = dst[4:]
  2131      return dst
  2132  }
  2133  
  2134  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2135  func (n *NV_GR_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  2136      n.Version = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2137      src = src[4:]
  2138      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2139      src = src[4:]
  2140      n.Size = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2141      src = src[4:]
  2142      n.Caps = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2143      src = src[4:]
  2144      return src
  2145  }
  2146  
  2147  // Packed implements marshal.Marshallable.Packed.
  2148  //go:nosplit
  2149  func (n *NV_GR_ALLOCATION_PARAMETERS) Packed() bool {
  2150      return true
  2151  }
  2152  
  2153  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2154  func (n *NV_GR_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  2155      size := n.SizeBytes()
  2156      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2157      return dst[size:]
  2158  }
  2159  
  2160  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2161  func (n *NV_GR_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  2162      size := n.SizeBytes()
  2163      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2164      return src[size:]
  2165  }
  2166  
  2167  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2168  func (n *NV_GR_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2169      // Construct a slice backed by dst's underlying memory.
  2170      var buf []byte
  2171      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2172      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2173      hdr.Len = n.SizeBytes()
  2174      hdr.Cap = n.SizeBytes()
  2175  
  2176      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2177      // Since we bypassed the compiler's escape analysis, indicate that n
  2178      // must live until the use above.
  2179      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2180      return length, err
  2181  }
  2182  
  2183  // CopyOut implements marshal.Marshallable.CopyOut.
  2184  func (n *NV_GR_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2185      return n.CopyOutN(cc, addr, n.SizeBytes())
  2186  }
  2187  
  2188  // CopyInN implements marshal.Marshallable.CopyInN.
  2189  func (n *NV_GR_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2190      // Construct a slice backed by dst's underlying memory.
  2191      var buf []byte
  2192      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2193      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2194      hdr.Len = n.SizeBytes()
  2195      hdr.Cap = n.SizeBytes()
  2196  
  2197      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2198      // Since we bypassed the compiler's escape analysis, indicate that n
  2199      // must live until the use above.
  2200      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2201      return length, err
  2202  }
  2203  
  2204  // CopyIn implements marshal.Marshallable.CopyIn.
  2205  func (n *NV_GR_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2206      return n.CopyInN(cc, addr, n.SizeBytes())
  2207  }
  2208  
  2209  // WriteTo implements io.WriterTo.WriteTo.
  2210  func (n *NV_GR_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  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 := writer.Write(buf)
  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 int64(length), err
  2223  }
  2224  
  2225  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2226  func (n *NV_HOPPER_USERMODE_A_PARAMS) SizeBytes() int {
  2227      return 2
  2228  }
  2229  
  2230  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2231  func (n *NV_HOPPER_USERMODE_A_PARAMS) MarshalBytes(dst []byte) []byte {
  2232      dst[0] = byte(n.Bar1Mapping)
  2233      dst = dst[1:]
  2234      dst[0] = byte(n.Priv)
  2235      dst = dst[1:]
  2236      return dst
  2237  }
  2238  
  2239  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2240  func (n *NV_HOPPER_USERMODE_A_PARAMS) UnmarshalBytes(src []byte) []byte {
  2241      n.Bar1Mapping = uint8(src[0])
  2242      src = src[1:]
  2243      n.Priv = uint8(src[0])
  2244      src = src[1:]
  2245      return src
  2246  }
  2247  
  2248  // Packed implements marshal.Marshallable.Packed.
  2249  //go:nosplit
  2250  func (n *NV_HOPPER_USERMODE_A_PARAMS) Packed() bool {
  2251      return true
  2252  }
  2253  
  2254  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2255  func (n *NV_HOPPER_USERMODE_A_PARAMS) MarshalUnsafe(dst []byte) []byte {
  2256      size := n.SizeBytes()
  2257      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2258      return dst[size:]
  2259  }
  2260  
  2261  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2262  func (n *NV_HOPPER_USERMODE_A_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  2263      size := n.SizeBytes()
  2264      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2265      return src[size:]
  2266  }
  2267  
  2268  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2269  func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2270      // Construct a slice backed by dst's underlying memory.
  2271      var buf []byte
  2272      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2273      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2274      hdr.Len = n.SizeBytes()
  2275      hdr.Cap = n.SizeBytes()
  2276  
  2277      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2278      // Since we bypassed the compiler's escape analysis, indicate that n
  2279      // must live until the use above.
  2280      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2281      return length, err
  2282  }
  2283  
  2284  // CopyOut implements marshal.Marshallable.CopyOut.
  2285  func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2286      return n.CopyOutN(cc, addr, n.SizeBytes())
  2287  }
  2288  
  2289  // CopyInN implements marshal.Marshallable.CopyInN.
  2290  func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2291      // Construct a slice backed by dst's underlying memory.
  2292      var buf []byte
  2293      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2294      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2295      hdr.Len = n.SizeBytes()
  2296      hdr.Cap = n.SizeBytes()
  2297  
  2298      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2299      // Since we bypassed the compiler's escape analysis, indicate that n
  2300      // must live until the use above.
  2301      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2302      return length, err
  2303  }
  2304  
  2305  // CopyIn implements marshal.Marshallable.CopyIn.
  2306  func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2307      return n.CopyInN(cc, addr, n.SizeBytes())
  2308  }
  2309  
  2310  // WriteTo implements io.WriterTo.WriteTo.
  2311  func (n *NV_HOPPER_USERMODE_A_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  2312      // Construct a slice backed by dst's underlying memory.
  2313      var buf []byte
  2314      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2315      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2316      hdr.Len = n.SizeBytes()
  2317      hdr.Cap = n.SizeBytes()
  2318  
  2319      length, err := writer.Write(buf)
  2320      // Since we bypassed the compiler's escape analysis, indicate that n
  2321      // must live until the use above.
  2322      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2323      return int64(length), err
  2324  }
  2325  
  2326  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2327  func (n *NV_MEMORY_ALLOCATION_PARAMS) SizeBytes() int {
  2328      return 108 +
  2329          (*P64)(nil).SizeBytes() +
  2330          (*Handle)(nil).SizeBytes()
  2331  }
  2332  
  2333  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2334  func (n *NV_MEMORY_ALLOCATION_PARAMS) MarshalBytes(dst []byte) []byte {
  2335      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Owner))
  2336      dst = dst[4:]
  2337      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Type))
  2338      dst = dst[4:]
  2339      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  2340      dst = dst[4:]
  2341      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Width))
  2342      dst = dst[4:]
  2343      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Height))
  2344      dst = dst[4:]
  2345      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Pitch))
  2346      dst = dst[4:]
  2347      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Attr))
  2348      dst = dst[4:]
  2349      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Attr2))
  2350      dst = dst[4:]
  2351      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Format))
  2352      dst = dst[4:]
  2353      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ComprCovg))
  2354      dst = dst[4:]
  2355      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ZcullCovg))
  2356      dst = dst[4:]
  2357      // Padding: dst[:sizeof(uint32)] ~= uint32(0)
  2358      dst = dst[4:]
  2359      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.RangeLo))
  2360      dst = dst[8:]
  2361      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.RangeHi))
  2362      dst = dst[8:]
  2363      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Size))
  2364      dst = dst[8:]
  2365      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Alignment))
  2366      dst = dst[8:]
  2367      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Offset))
  2368      dst = dst[8:]
  2369      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Limit))
  2370      dst = dst[8:]
  2371      dst = n.Address.MarshalUnsafe(dst)
  2372      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.CtagOffset))
  2373      dst = dst[4:]
  2374      dst = n.HVASpace.MarshalUnsafe(dst)
  2375      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.InternalFlags))
  2376      dst = dst[4:]
  2377      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Tag))
  2378      dst = dst[4:]
  2379      return dst
  2380  }
  2381  
  2382  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2383  func (n *NV_MEMORY_ALLOCATION_PARAMS) UnmarshalBytes(src []byte) []byte {
  2384      n.Owner = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2385      src = src[4:]
  2386      n.Type = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2387      src = src[4:]
  2388      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2389      src = src[4:]
  2390      n.Width = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2391      src = src[4:]
  2392      n.Height = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2393      src = src[4:]
  2394      n.Pitch = int32(hostarch.ByteOrder.Uint32(src[:4]))
  2395      src = src[4:]
  2396      n.Attr = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2397      src = src[4:]
  2398      n.Attr2 = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2399      src = src[4:]
  2400      n.Format = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2401      src = src[4:]
  2402      n.ComprCovg = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2403      src = src[4:]
  2404      n.ZcullCovg = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2405      src = src[4:]
  2406      // Padding: var _ uint32 ~= src[:sizeof(uint32)]
  2407      src = src[4:]
  2408      n.RangeLo = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2409      src = src[8:]
  2410      n.RangeHi = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2411      src = src[8:]
  2412      n.Size = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2413      src = src[8:]
  2414      n.Alignment = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2415      src = src[8:]
  2416      n.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2417      src = src[8:]
  2418      n.Limit = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2419      src = src[8:]
  2420      src = n.Address.UnmarshalUnsafe(src)
  2421      n.CtagOffset = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2422      src = src[4:]
  2423      src = n.HVASpace.UnmarshalUnsafe(src)
  2424      n.InternalFlags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2425      src = src[4:]
  2426      n.Tag = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2427      src = src[4:]
  2428      return src
  2429  }
  2430  
  2431  // Packed implements marshal.Marshallable.Packed.
  2432  //go:nosplit
  2433  func (n *NV_MEMORY_ALLOCATION_PARAMS) Packed() bool {
  2434      return n.Address.Packed() && n.HVASpace.Packed()
  2435  }
  2436  
  2437  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2438  func (n *NV_MEMORY_ALLOCATION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  2439      if n.Address.Packed() && n.HVASpace.Packed() {
  2440          size := n.SizeBytes()
  2441          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2442          return dst[size:]
  2443      }
  2444      // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  2445      return n.MarshalBytes(dst)
  2446  }
  2447  
  2448  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2449  func (n *NV_MEMORY_ALLOCATION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  2450      if n.Address.Packed() && n.HVASpace.Packed() {
  2451          size := n.SizeBytes()
  2452          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2453          return src[size:]
  2454      }
  2455      // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  2456      return n.UnmarshalBytes(src)
  2457  }
  2458  
  2459  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2460  func (n *NV_MEMORY_ALLOCATION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2461      if !n.Address.Packed() && n.HVASpace.Packed() {
  2462          // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2463          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2464          n.MarshalBytes(buf) // escapes: fallback.
  2465          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2466      }
  2467  
  2468      // Construct a slice backed by dst's underlying memory.
  2469      var buf []byte
  2470      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2471      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2472      hdr.Len = n.SizeBytes()
  2473      hdr.Cap = n.SizeBytes()
  2474  
  2475      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2476      // Since we bypassed the compiler's escape analysis, indicate that n
  2477      // must live until the use above.
  2478      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2479      return length, err
  2480  }
  2481  
  2482  // CopyOut implements marshal.Marshallable.CopyOut.
  2483  func (n *NV_MEMORY_ALLOCATION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2484      return n.CopyOutN(cc, addr, n.SizeBytes())
  2485  }
  2486  
  2487  // CopyInN implements marshal.Marshallable.CopyInN.
  2488  func (n *NV_MEMORY_ALLOCATION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2489      if !n.Address.Packed() && n.HVASpace.Packed() {
  2490          // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  2491          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2492          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2493          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  2494          // partially unmarshalled struct.
  2495          n.UnmarshalBytes(buf) // escapes: fallback.
  2496          return length, err
  2497      }
  2498  
  2499      // Construct a slice backed by dst's underlying memory.
  2500      var buf []byte
  2501      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2502      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2503      hdr.Len = n.SizeBytes()
  2504      hdr.Cap = n.SizeBytes()
  2505  
  2506      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2507      // Since we bypassed the compiler's escape analysis, indicate that n
  2508      // must live until the use above.
  2509      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2510      return length, err
  2511  }
  2512  
  2513  // CopyIn implements marshal.Marshallable.CopyIn.
  2514  func (n *NV_MEMORY_ALLOCATION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2515      return n.CopyInN(cc, addr, n.SizeBytes())
  2516  }
  2517  
  2518  // WriteTo implements io.WriterTo.WriteTo.
  2519  func (n *NV_MEMORY_ALLOCATION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  2520      if !n.Address.Packed() && n.HVASpace.Packed() {
  2521          // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2522          buf := make([]byte, n.SizeBytes())
  2523          n.MarshalBytes(buf)
  2524          length, err := writer.Write(buf)
  2525          return int64(length), err
  2526      }
  2527  
  2528      // Construct a slice backed by dst's underlying memory.
  2529      var buf []byte
  2530      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2531      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2532      hdr.Len = n.SizeBytes()
  2533      hdr.Cap = n.SizeBytes()
  2534  
  2535      length, err := writer.Write(buf)
  2536      // Since we bypassed the compiler's escape analysis, indicate that n
  2537      // must live until the use above.
  2538      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2539      return int64(length), err
  2540  }
  2541  
  2542  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2543  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) SizeBytes() int {
  2544      return 8 +
  2545          (*NV_MEMORY_ALLOCATION_PARAMS)(nil).SizeBytes()
  2546  }
  2547  
  2548  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2549  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) MarshalBytes(dst []byte) []byte {
  2550      dst = n.NV_MEMORY_ALLOCATION_PARAMS.MarshalUnsafe(dst)
  2551      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NumaNode))
  2552      dst = dst[4:]
  2553      // Padding: dst[:sizeof(uint32)] ~= uint32(0)
  2554      dst = dst[4:]
  2555      return dst
  2556  }
  2557  
  2558  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2559  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) UnmarshalBytes(src []byte) []byte {
  2560      src = n.NV_MEMORY_ALLOCATION_PARAMS.UnmarshalUnsafe(src)
  2561      n.NumaNode = int32(hostarch.ByteOrder.Uint32(src[:4]))
  2562      src = src[4:]
  2563      // Padding: var _ uint32 ~= src[:sizeof(uint32)]
  2564      src = src[4:]
  2565      return src
  2566  }
  2567  
  2568  // Packed implements marshal.Marshallable.Packed.
  2569  //go:nosplit
  2570  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) Packed() bool {
  2571      return n.NV_MEMORY_ALLOCATION_PARAMS.Packed()
  2572  }
  2573  
  2574  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2575  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) MarshalUnsafe(dst []byte) []byte {
  2576      if n.NV_MEMORY_ALLOCATION_PARAMS.Packed() {
  2577          size := n.SizeBytes()
  2578          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2579          return dst[size:]
  2580      }
  2581      // Type NV_MEMORY_ALLOCATION_PARAMS_V545 doesn't have a packed layout in memory, fallback to MarshalBytes.
  2582      return n.MarshalBytes(dst)
  2583  }
  2584  
  2585  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2586  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) UnmarshalUnsafe(src []byte) []byte {
  2587      if n.NV_MEMORY_ALLOCATION_PARAMS.Packed() {
  2588          size := n.SizeBytes()
  2589          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2590          return src[size:]
  2591      }
  2592      // Type NV_MEMORY_ALLOCATION_PARAMS_V545 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  2593      return n.UnmarshalBytes(src)
  2594  }
  2595  
  2596  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2597  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2598      if !n.NV_MEMORY_ALLOCATION_PARAMS.Packed() {
  2599          // Type NV_MEMORY_ALLOCATION_PARAMS_V545 doesn't have a packed layout in memory, fall back to MarshalBytes.
  2600          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2601          n.MarshalBytes(buf) // escapes: fallback.
  2602          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2603      }
  2604  
  2605      // Construct a slice backed by dst's underlying memory.
  2606      var buf []byte
  2607      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2608      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2609      hdr.Len = n.SizeBytes()
  2610      hdr.Cap = n.SizeBytes()
  2611  
  2612      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2613      // Since we bypassed the compiler's escape analysis, indicate that n
  2614      // must live until the use above.
  2615      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2616      return length, err
  2617  }
  2618  
  2619  // CopyOut implements marshal.Marshallable.CopyOut.
  2620  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2621      return n.CopyOutN(cc, addr, n.SizeBytes())
  2622  }
  2623  
  2624  // CopyInN implements marshal.Marshallable.CopyInN.
  2625  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2626      if !n.NV_MEMORY_ALLOCATION_PARAMS.Packed() {
  2627          // Type NV_MEMORY_ALLOCATION_PARAMS_V545 doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  2628          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2629          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2630          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  2631          // partially unmarshalled struct.
  2632          n.UnmarshalBytes(buf) // escapes: fallback.
  2633          return length, err
  2634      }
  2635  
  2636      // Construct a slice backed by dst's underlying memory.
  2637      var buf []byte
  2638      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2639      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2640      hdr.Len = n.SizeBytes()
  2641      hdr.Cap = n.SizeBytes()
  2642  
  2643      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2644      // Since we bypassed the compiler's escape analysis, indicate that n
  2645      // must live until the use above.
  2646      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2647      return length, err
  2648  }
  2649  
  2650  // CopyIn implements marshal.Marshallable.CopyIn.
  2651  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2652      return n.CopyInN(cc, addr, n.SizeBytes())
  2653  }
  2654  
  2655  // WriteTo implements io.WriterTo.WriteTo.
  2656  func (n *NV_MEMORY_ALLOCATION_PARAMS_V545) WriteTo(writer io.Writer) (int64, error) {
  2657      if !n.NV_MEMORY_ALLOCATION_PARAMS.Packed() {
  2658          // Type NV_MEMORY_ALLOCATION_PARAMS_V545 doesn't have a packed layout in memory, fall back to MarshalBytes.
  2659          buf := make([]byte, n.SizeBytes())
  2660          n.MarshalBytes(buf)
  2661          length, err := writer.Write(buf)
  2662          return int64(length), err
  2663      }
  2664  
  2665      // Construct a slice backed by dst's underlying memory.
  2666      var buf []byte
  2667      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2668      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2669      hdr.Len = n.SizeBytes()
  2670      hdr.Cap = n.SizeBytes()
  2671  
  2672      length, err := writer.Write(buf)
  2673      // Since we bypassed the compiler's escape analysis, indicate that n
  2674      // must live until the use above.
  2675      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2676      return int64(length), err
  2677  }
  2678  
  2679  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2680  func (n *NV_MEMORY_DESC_PARAMS) SizeBytes() int {
  2681      return 24
  2682  }
  2683  
  2684  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2685  func (n *NV_MEMORY_DESC_PARAMS) MarshalBytes(dst []byte) []byte {
  2686      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Base))
  2687      dst = dst[8:]
  2688      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Size))
  2689      dst = dst[8:]
  2690      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.AddressSpace))
  2691      dst = dst[4:]
  2692      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.CacheAttrib))
  2693      dst = dst[4:]
  2694      return dst
  2695  }
  2696  
  2697  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2698  func (n *NV_MEMORY_DESC_PARAMS) UnmarshalBytes(src []byte) []byte {
  2699      n.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2700      src = src[8:]
  2701      n.Size = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2702      src = src[8:]
  2703      n.AddressSpace = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2704      src = src[4:]
  2705      n.CacheAttrib = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2706      src = src[4:]
  2707      return src
  2708  }
  2709  
  2710  // Packed implements marshal.Marshallable.Packed.
  2711  //go:nosplit
  2712  func (n *NV_MEMORY_DESC_PARAMS) Packed() bool {
  2713      return true
  2714  }
  2715  
  2716  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2717  func (n *NV_MEMORY_DESC_PARAMS) MarshalUnsafe(dst []byte) []byte {
  2718      size := n.SizeBytes()
  2719      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2720      return dst[size:]
  2721  }
  2722  
  2723  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2724  func (n *NV_MEMORY_DESC_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  2725      size := n.SizeBytes()
  2726      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2727      return src[size:]
  2728  }
  2729  
  2730  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2731  func (n *NV_MEMORY_DESC_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2732      // Construct a slice backed by dst's underlying memory.
  2733      var buf []byte
  2734      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2735      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2736      hdr.Len = n.SizeBytes()
  2737      hdr.Cap = n.SizeBytes()
  2738  
  2739      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2740      // Since we bypassed the compiler's escape analysis, indicate that n
  2741      // must live until the use above.
  2742      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2743      return length, err
  2744  }
  2745  
  2746  // CopyOut implements marshal.Marshallable.CopyOut.
  2747  func (n *NV_MEMORY_DESC_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2748      return n.CopyOutN(cc, addr, n.SizeBytes())
  2749  }
  2750  
  2751  // CopyInN implements marshal.Marshallable.CopyInN.
  2752  func (n *NV_MEMORY_DESC_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2753      // Construct a slice backed by dst's underlying memory.
  2754      var buf []byte
  2755      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2756      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2757      hdr.Len = n.SizeBytes()
  2758      hdr.Cap = n.SizeBytes()
  2759  
  2760      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2761      // Since we bypassed the compiler's escape analysis, indicate that n
  2762      // must live until the use above.
  2763      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2764      return length, err
  2765  }
  2766  
  2767  // CopyIn implements marshal.Marshallable.CopyIn.
  2768  func (n *NV_MEMORY_DESC_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2769      return n.CopyInN(cc, addr, n.SizeBytes())
  2770  }
  2771  
  2772  // WriteTo implements io.WriterTo.WriteTo.
  2773  func (n *NV_MEMORY_DESC_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  2774      // Construct a slice backed by dst's underlying memory.
  2775      var buf []byte
  2776      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2777      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2778      hdr.Len = n.SizeBytes()
  2779      hdr.Cap = n.SizeBytes()
  2780  
  2781      length, err := writer.Write(buf)
  2782      // Since we bypassed the compiler's escape analysis, indicate that n
  2783      // must live until the use above.
  2784      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2785      return int64(length), err
  2786  }
  2787  
  2788  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2789  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) SizeBytes() int {
  2790      return 44 +
  2791          1*4
  2792  }
  2793  
  2794  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2795  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  2796      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Index))
  2797      dst = dst[4:]
  2798      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  2799      dst = dst[4:]
  2800      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VASize))
  2801      dst = dst[8:]
  2802      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VAStartInternal))
  2803      dst = dst[8:]
  2804      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VALimitInternal))
  2805      dst = dst[8:]
  2806      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.BigPageSize))
  2807      dst = dst[4:]
  2808      for idx := 0; idx < 4; idx++ {
  2809          dst[0] = byte(n.Pad0[idx])
  2810          dst = dst[1:]
  2811      }
  2812      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VABase))
  2813      dst = dst[8:]
  2814      return dst
  2815  }
  2816  
  2817  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2818  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  2819      n.Index = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2820      src = src[4:]
  2821      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2822      src = src[4:]
  2823      n.VASize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2824      src = src[8:]
  2825      n.VAStartInternal = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2826      src = src[8:]
  2827      n.VALimitInternal = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2828      src = src[8:]
  2829      n.BigPageSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2830      src = src[4:]
  2831      for idx := 0; idx < 4; idx++ {
  2832          n.Pad0[idx] = src[0]
  2833          src = src[1:]
  2834      }
  2835      n.VABase = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2836      src = src[8:]
  2837      return src
  2838  }
  2839  
  2840  // Packed implements marshal.Marshallable.Packed.
  2841  //go:nosplit
  2842  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) Packed() bool {
  2843      return true
  2844  }
  2845  
  2846  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2847  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  2848      size := n.SizeBytes()
  2849      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2850      return dst[size:]
  2851  }
  2852  
  2853  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2854  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  2855      size := n.SizeBytes()
  2856      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2857      return src[size:]
  2858  }
  2859  
  2860  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2861  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2862      // Construct a slice backed by dst's underlying memory.
  2863      var buf []byte
  2864      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2865      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2866      hdr.Len = n.SizeBytes()
  2867      hdr.Cap = n.SizeBytes()
  2868  
  2869      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2870      // Since we bypassed the compiler's escape analysis, indicate that n
  2871      // must live until the use above.
  2872      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2873      return length, err
  2874  }
  2875  
  2876  // CopyOut implements marshal.Marshallable.CopyOut.
  2877  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2878      return n.CopyOutN(cc, addr, n.SizeBytes())
  2879  }
  2880  
  2881  // CopyInN implements marshal.Marshallable.CopyInN.
  2882  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2883      // Construct a slice backed by dst's underlying memory.
  2884      var buf []byte
  2885      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2886      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2887      hdr.Len = n.SizeBytes()
  2888      hdr.Cap = n.SizeBytes()
  2889  
  2890      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2891      // Since we bypassed the compiler's escape analysis, indicate that n
  2892      // must live until the use above.
  2893      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2894      return length, err
  2895  }
  2896  
  2897  // CopyIn implements marshal.Marshallable.CopyIn.
  2898  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2899      return n.CopyInN(cc, addr, n.SizeBytes())
  2900  }
  2901  
  2902  // WriteTo implements io.WriterTo.WriteTo.
  2903  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  2904      // Construct a slice backed by dst's underlying memory.
  2905      var buf []byte
  2906      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2907      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2908      hdr.Len = n.SizeBytes()
  2909      hdr.Cap = n.SizeBytes()
  2910  
  2911      length, err := writer.Write(buf)
  2912      // Since we bypassed the compiler's escape analysis, indicate that n
  2913      // must live until the use above.
  2914      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2915      return int64(length), err
  2916  }
  2917  
  2918  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2919  func (n *nv00f8Map) SizeBytes() int {
  2920      return 12 +
  2921          (*Handle)(nil).SizeBytes()
  2922  }
  2923  
  2924  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2925  func (n *nv00f8Map) MarshalBytes(dst []byte) []byte {
  2926      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.offset))
  2927      dst = dst[8:]
  2928      dst = n.hVidMem.MarshalUnsafe(dst)
  2929      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.flags))
  2930      dst = dst[4:]
  2931      return dst
  2932  }
  2933  
  2934  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2935  func (n *nv00f8Map) UnmarshalBytes(src []byte) []byte {
  2936      n.offset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2937      src = src[8:]
  2938      src = n.hVidMem.UnmarshalUnsafe(src)
  2939      n.flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2940      src = src[4:]
  2941      return src
  2942  }
  2943  
  2944  // Packed implements marshal.Marshallable.Packed.
  2945  //go:nosplit
  2946  func (n *nv00f8Map) Packed() bool {
  2947      return n.hVidMem.Packed()
  2948  }
  2949  
  2950  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2951  func (n *nv00f8Map) MarshalUnsafe(dst []byte) []byte {
  2952      if n.hVidMem.Packed() {
  2953          size := n.SizeBytes()
  2954          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2955          return dst[size:]
  2956      }
  2957      // Type nv00f8Map doesn't have a packed layout in memory, fallback to MarshalBytes.
  2958      return n.MarshalBytes(dst)
  2959  }
  2960  
  2961  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2962  func (n *nv00f8Map) UnmarshalUnsafe(src []byte) []byte {
  2963      if n.hVidMem.Packed() {
  2964          size := n.SizeBytes()
  2965          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2966          return src[size:]
  2967      }
  2968      // Type nv00f8Map doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  2969      return n.UnmarshalBytes(src)
  2970  }
  2971  
  2972  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2973  func (n *nv00f8Map) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2974      if !n.hVidMem.Packed() {
  2975          // Type nv00f8Map doesn't have a packed layout in memory, fall back to MarshalBytes.
  2976          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2977          n.MarshalBytes(buf) // escapes: fallback.
  2978          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2979      }
  2980  
  2981      // Construct a slice backed by dst's underlying memory.
  2982      var buf []byte
  2983      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2984      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2985      hdr.Len = n.SizeBytes()
  2986      hdr.Cap = n.SizeBytes()
  2987  
  2988      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2989      // Since we bypassed the compiler's escape analysis, indicate that n
  2990      // must live until the use above.
  2991      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2992      return length, err
  2993  }
  2994  
  2995  // CopyOut implements marshal.Marshallable.CopyOut.
  2996  func (n *nv00f8Map) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2997      return n.CopyOutN(cc, addr, n.SizeBytes())
  2998  }
  2999  
  3000  // CopyInN implements marshal.Marshallable.CopyInN.
  3001  func (n *nv00f8Map) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3002      if !n.hVidMem.Packed() {
  3003          // Type nv00f8Map doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3004          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3005          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3006          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3007          // partially unmarshalled struct.
  3008          n.UnmarshalBytes(buf) // escapes: fallback.
  3009          return length, err
  3010      }
  3011  
  3012      // Construct a slice backed by dst's underlying memory.
  3013      var buf []byte
  3014      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3015      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3016      hdr.Len = n.SizeBytes()
  3017      hdr.Cap = n.SizeBytes()
  3018  
  3019      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3020      // Since we bypassed the compiler's escape analysis, indicate that n
  3021      // must live until the use above.
  3022      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3023      return length, err
  3024  }
  3025  
  3026  // CopyIn implements marshal.Marshallable.CopyIn.
  3027  func (n *nv00f8Map) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3028      return n.CopyInN(cc, addr, n.SizeBytes())
  3029  }
  3030  
  3031  // WriteTo implements io.WriterTo.WriteTo.
  3032  func (n *nv00f8Map) WriteTo(writer io.Writer) (int64, error) {
  3033      if !n.hVidMem.Packed() {
  3034          // Type nv00f8Map doesn't have a packed layout in memory, fall back to MarshalBytes.
  3035          buf := make([]byte, n.SizeBytes())
  3036          n.MarshalBytes(buf)
  3037          length, err := writer.Write(buf)
  3038          return int64(length), err
  3039      }
  3040  
  3041      // Construct a slice backed by dst's underlying memory.
  3042      var buf []byte
  3043      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3044      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3045      hdr.Len = n.SizeBytes()
  3046      hdr.Cap = n.SizeBytes()
  3047  
  3048      length, err := writer.Write(buf)
  3049      // Since we bypassed the compiler's escape analysis, indicate that n
  3050      // must live until the use above.
  3051      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3052      return int64(length), err
  3053  }
  3054  
  3055  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3056  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) SizeBytes() int {
  3057      return 12 +
  3058          1*4 +
  3059          (*P64)(nil).SizeBytes() +
  3060          (*P64)(nil).SizeBytes() +
  3061          (*P64)(nil).SizeBytes()
  3062  }
  3063  
  3064  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3065  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) MarshalBytes(dst []byte) []byte {
  3066      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SizeOfStrings))
  3067      dst = dst[4:]
  3068      for idx := 0; idx < 4; idx++ {
  3069          dst[0] = byte(n.Pad[idx])
  3070          dst = dst[1:]
  3071      }
  3072      dst = n.PDriverVersionBuffer.MarshalUnsafe(dst)
  3073      dst = n.PVersionBuffer.MarshalUnsafe(dst)
  3074      dst = n.PTitleBuffer.MarshalUnsafe(dst)
  3075      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ChangelistNumber))
  3076      dst = dst[4:]
  3077      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.OfficialChangelistNumber))
  3078      dst = dst[4:]
  3079      return dst
  3080  }
  3081  
  3082  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3083  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) UnmarshalBytes(src []byte) []byte {
  3084      n.SizeOfStrings = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3085      src = src[4:]
  3086      for idx := 0; idx < 4; idx++ {
  3087          n.Pad[idx] = src[0]
  3088          src = src[1:]
  3089      }
  3090      src = n.PDriverVersionBuffer.UnmarshalUnsafe(src)
  3091      src = n.PVersionBuffer.UnmarshalUnsafe(src)
  3092      src = n.PTitleBuffer.UnmarshalUnsafe(src)
  3093      n.ChangelistNumber = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3094      src = src[4:]
  3095      n.OfficialChangelistNumber = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3096      src = src[4:]
  3097      return src
  3098  }
  3099  
  3100  // Packed implements marshal.Marshallable.Packed.
  3101  //go:nosplit
  3102  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) Packed() bool {
  3103      return n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed()
  3104  }
  3105  
  3106  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3107  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  3108      if n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  3109          size := n.SizeBytes()
  3110          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3111          return dst[size:]
  3112      }
  3113      // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  3114      return n.MarshalBytes(dst)
  3115  }
  3116  
  3117  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3118  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  3119      if n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  3120          size := n.SizeBytes()
  3121          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3122          return src[size:]
  3123      }
  3124      // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3125      return n.UnmarshalBytes(src)
  3126  }
  3127  
  3128  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3129  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3130      if !n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  3131          // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3132          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3133          n.MarshalBytes(buf) // escapes: fallback.
  3134          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3135      }
  3136  
  3137      // Construct a slice backed by dst's underlying memory.
  3138      var buf []byte
  3139      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3140      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3141      hdr.Len = n.SizeBytes()
  3142      hdr.Cap = n.SizeBytes()
  3143  
  3144      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3145      // Since we bypassed the compiler's escape analysis, indicate that n
  3146      // must live until the use above.
  3147      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3148      return length, err
  3149  }
  3150  
  3151  // CopyOut implements marshal.Marshallable.CopyOut.
  3152  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3153      return n.CopyOutN(cc, addr, n.SizeBytes())
  3154  }
  3155  
  3156  // CopyInN implements marshal.Marshallable.CopyInN.
  3157  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3158      if !n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  3159          // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3160          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3161          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3162          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3163          // partially unmarshalled struct.
  3164          n.UnmarshalBytes(buf) // escapes: fallback.
  3165          return length, err
  3166      }
  3167  
  3168      // Construct a slice backed by dst's underlying memory.
  3169      var buf []byte
  3170      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3171      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3172      hdr.Len = n.SizeBytes()
  3173      hdr.Cap = n.SizeBytes()
  3174  
  3175      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3176      // Since we bypassed the compiler's escape analysis, indicate that n
  3177      // must live until the use above.
  3178      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3179      return length, err
  3180  }
  3181  
  3182  // CopyIn implements marshal.Marshallable.CopyIn.
  3183  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3184      return n.CopyInN(cc, addr, n.SizeBytes())
  3185  }
  3186  
  3187  // WriteTo implements io.WriterTo.WriteTo.
  3188  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  3189      if !n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  3190          // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3191          buf := make([]byte, n.SizeBytes())
  3192          n.MarshalBytes(buf)
  3193          length, err := writer.Write(buf)
  3194          return int64(length), err
  3195      }
  3196  
  3197      // Construct a slice backed by dst's underlying memory.
  3198      var buf []byte
  3199      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3200      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3201      hdr.Len = n.SizeBytes()
  3202      hdr.Cap = n.SizeBytes()
  3203  
  3204      length, err := writer.Write(buf)
  3205      // Since we bypassed the compiler's escape analysis, indicate that n
  3206      // must live until the use above.
  3207      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3208      return int64(length), err
  3209  }
  3210  
  3211  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3212  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) SizeBytes() int {
  3213      return 4 +
  3214          1*4 +
  3215          (*P64)(nil).SizeBytes() +
  3216          (*P64)(nil).SizeBytes()
  3217  }
  3218  
  3219  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3220  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) MarshalBytes(dst []byte) []byte {
  3221      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NumChannels))
  3222      dst = dst[4:]
  3223      for idx := 0; idx < 4; idx++ {
  3224          dst[0] = byte(n.Pad[idx])
  3225          dst = dst[1:]
  3226      }
  3227      dst = n.PChannelHandleList.MarshalUnsafe(dst)
  3228      dst = n.PChannelList.MarshalUnsafe(dst)
  3229      return dst
  3230  }
  3231  
  3232  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3233  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) UnmarshalBytes(src []byte) []byte {
  3234      n.NumChannels = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3235      src = src[4:]
  3236      for idx := 0; idx < 4; idx++ {
  3237          n.Pad[idx] = src[0]
  3238          src = src[1:]
  3239      }
  3240      src = n.PChannelHandleList.UnmarshalUnsafe(src)
  3241      src = n.PChannelList.UnmarshalUnsafe(src)
  3242      return src
  3243  }
  3244  
  3245  // Packed implements marshal.Marshallable.Packed.
  3246  //go:nosplit
  3247  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) Packed() bool {
  3248      return n.PChannelHandleList.Packed() && n.PChannelList.Packed()
  3249  }
  3250  
  3251  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3252  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) MarshalUnsafe(dst []byte) []byte {
  3253      if n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  3254          size := n.SizeBytes()
  3255          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3256          return dst[size:]
  3257      }
  3258      // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  3259      return n.MarshalBytes(dst)
  3260  }
  3261  
  3262  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3263  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  3264      if n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  3265          size := n.SizeBytes()
  3266          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3267          return src[size:]
  3268      }
  3269      // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3270      return n.UnmarshalBytes(src)
  3271  }
  3272  
  3273  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3274  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3275      if !n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  3276          // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3277          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3278          n.MarshalBytes(buf) // escapes: fallback.
  3279          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3280      }
  3281  
  3282      // Construct a slice backed by dst's underlying memory.
  3283      var buf []byte
  3284      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3285      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3286      hdr.Len = n.SizeBytes()
  3287      hdr.Cap = n.SizeBytes()
  3288  
  3289      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3290      // Since we bypassed the compiler's escape analysis, indicate that n
  3291      // must live until the use above.
  3292      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3293      return length, err
  3294  }
  3295  
  3296  // CopyOut implements marshal.Marshallable.CopyOut.
  3297  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3298      return n.CopyOutN(cc, addr, n.SizeBytes())
  3299  }
  3300  
  3301  // CopyInN implements marshal.Marshallable.CopyInN.
  3302  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3303      if !n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  3304          // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3305          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3306          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3307          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3308          // partially unmarshalled struct.
  3309          n.UnmarshalBytes(buf) // escapes: fallback.
  3310          return length, err
  3311      }
  3312  
  3313      // Construct a slice backed by dst's underlying memory.
  3314      var buf []byte
  3315      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3316      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3317      hdr.Len = n.SizeBytes()
  3318      hdr.Cap = n.SizeBytes()
  3319  
  3320      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3321      // Since we bypassed the compiler's escape analysis, indicate that n
  3322      // must live until the use above.
  3323      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3324      return length, err
  3325  }
  3326  
  3327  // CopyIn implements marshal.Marshallable.CopyIn.
  3328  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3329      return n.CopyInN(cc, addr, n.SizeBytes())
  3330  }
  3331  
  3332  // WriteTo implements io.WriterTo.WriteTo.
  3333  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  3334      if !n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  3335          // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3336          buf := make([]byte, n.SizeBytes())
  3337          n.MarshalBytes(buf)
  3338          length, err := writer.Write(buf)
  3339          return int64(length), err
  3340      }
  3341  
  3342      // Construct a slice backed by dst's underlying memory.
  3343      var buf []byte
  3344      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3345      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3346      hdr.Len = n.SizeBytes()
  3347      hdr.Cap = n.SizeBytes()
  3348  
  3349      length, err := writer.Write(buf)
  3350      // Since we bypassed the compiler's escape analysis, indicate that n
  3351      // must live until the use above.
  3352      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3353      return int64(length), err
  3354  }
  3355  
  3356  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3357  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) SizeBytes() int {
  3358      return 4 +
  3359          1*4 +
  3360          (*P64)(nil).SizeBytes()
  3361  }
  3362  
  3363  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3364  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) MarshalBytes(dst []byte) []byte {
  3365      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NumClasses))
  3366      dst = dst[4:]
  3367      for idx := 0; idx < 4; idx++ {
  3368          dst[0] = byte(n.Pad[idx])
  3369          dst = dst[1:]
  3370      }
  3371      dst = n.ClassList.MarshalUnsafe(dst)
  3372      return dst
  3373  }
  3374  
  3375  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3376  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) UnmarshalBytes(src []byte) []byte {
  3377      n.NumClasses = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3378      src = src[4:]
  3379      for idx := 0; idx < 4; idx++ {
  3380          n.Pad[idx] = src[0]
  3381          src = src[1:]
  3382      }
  3383      src = n.ClassList.UnmarshalUnsafe(src)
  3384      return src
  3385  }
  3386  
  3387  // Packed implements marshal.Marshallable.Packed.
  3388  //go:nosplit
  3389  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) Packed() bool {
  3390      return n.ClassList.Packed()
  3391  }
  3392  
  3393  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3394  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) MarshalUnsafe(dst []byte) []byte {
  3395      if n.ClassList.Packed() {
  3396          size := n.SizeBytes()
  3397          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3398          return dst[size:]
  3399      }
  3400      // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  3401      return n.MarshalBytes(dst)
  3402  }
  3403  
  3404  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3405  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  3406      if n.ClassList.Packed() {
  3407          size := n.SizeBytes()
  3408          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3409          return src[size:]
  3410      }
  3411      // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3412      return n.UnmarshalBytes(src)
  3413  }
  3414  
  3415  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3416  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3417      if !n.ClassList.Packed() {
  3418          // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3419          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3420          n.MarshalBytes(buf) // escapes: fallback.
  3421          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3422      }
  3423  
  3424      // Construct a slice backed by dst's underlying memory.
  3425      var buf []byte
  3426      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3427      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3428      hdr.Len = n.SizeBytes()
  3429      hdr.Cap = n.SizeBytes()
  3430  
  3431      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3432      // Since we bypassed the compiler's escape analysis, indicate that n
  3433      // must live until the use above.
  3434      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3435      return length, err
  3436  }
  3437  
  3438  // CopyOut implements marshal.Marshallable.CopyOut.
  3439  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3440      return n.CopyOutN(cc, addr, n.SizeBytes())
  3441  }
  3442  
  3443  // CopyInN implements marshal.Marshallable.CopyInN.
  3444  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3445      if !n.ClassList.Packed() {
  3446          // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3447          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3448          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3449          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3450          // partially unmarshalled struct.
  3451          n.UnmarshalBytes(buf) // escapes: fallback.
  3452          return length, err
  3453      }
  3454  
  3455      // Construct a slice backed by dst's underlying memory.
  3456      var buf []byte
  3457      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3458      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3459      hdr.Len = n.SizeBytes()
  3460      hdr.Cap = n.SizeBytes()
  3461  
  3462      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3463      // Since we bypassed the compiler's escape analysis, indicate that n
  3464      // must live until the use above.
  3465      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3466      return length, err
  3467  }
  3468  
  3469  // CopyIn implements marshal.Marshallable.CopyIn.
  3470  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3471      return n.CopyInN(cc, addr, n.SizeBytes())
  3472  }
  3473  
  3474  // WriteTo implements io.WriterTo.WriteTo.
  3475  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  3476      if !n.ClassList.Packed() {
  3477          // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3478          buf := make([]byte, n.SizeBytes())
  3479          n.MarshalBytes(buf)
  3480          length, err := writer.Write(buf)
  3481          return int64(length), err
  3482      }
  3483  
  3484      // Construct a slice backed by dst's underlying memory.
  3485      var buf []byte
  3486      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3487      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3488      hdr.Len = n.SizeBytes()
  3489      hdr.Cap = n.SizeBytes()
  3490  
  3491      length, err := writer.Write(buf)
  3492      // Since we bypassed the compiler's escape analysis, indicate that n
  3493      // must live until the use above.
  3494      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3495      return int64(length), err
  3496  }
  3497  
  3498  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3499  func (n *NV0080_CTRL_GR_ROUTE_INFO) SizeBytes() int {
  3500      return 12 +
  3501          1*4
  3502  }
  3503  
  3504  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3505  func (n *NV0080_CTRL_GR_ROUTE_INFO) MarshalBytes(dst []byte) []byte {
  3506      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  3507      dst = dst[4:]
  3508      for idx := 0; idx < 4; idx++ {
  3509          dst[0] = byte(n.Pad[idx])
  3510          dst = dst[1:]
  3511      }
  3512      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Route))
  3513      dst = dst[8:]
  3514      return dst
  3515  }
  3516  
  3517  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3518  func (n *NV0080_CTRL_GR_ROUTE_INFO) UnmarshalBytes(src []byte) []byte {
  3519      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3520      src = src[4:]
  3521      for idx := 0; idx < 4; idx++ {
  3522          n.Pad[idx] = src[0]
  3523          src = src[1:]
  3524      }
  3525      n.Route = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  3526      src = src[8:]
  3527      return src
  3528  }
  3529  
  3530  // Packed implements marshal.Marshallable.Packed.
  3531  //go:nosplit
  3532  func (n *NV0080_CTRL_GR_ROUTE_INFO) Packed() bool {
  3533      return true
  3534  }
  3535  
  3536  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3537  func (n *NV0080_CTRL_GR_ROUTE_INFO) MarshalUnsafe(dst []byte) []byte {
  3538      size := n.SizeBytes()
  3539      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3540      return dst[size:]
  3541  }
  3542  
  3543  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3544  func (n *NV0080_CTRL_GR_ROUTE_INFO) UnmarshalUnsafe(src []byte) []byte {
  3545      size := n.SizeBytes()
  3546      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3547      return src[size:]
  3548  }
  3549  
  3550  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3551  func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3552      // Construct a slice backed by dst's underlying memory.
  3553      var buf []byte
  3554      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3555      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3556      hdr.Len = n.SizeBytes()
  3557      hdr.Cap = n.SizeBytes()
  3558  
  3559      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3560      // Since we bypassed the compiler's escape analysis, indicate that n
  3561      // must live until the use above.
  3562      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3563      return length, err
  3564  }
  3565  
  3566  // CopyOut implements marshal.Marshallable.CopyOut.
  3567  func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3568      return n.CopyOutN(cc, addr, n.SizeBytes())
  3569  }
  3570  
  3571  // CopyInN implements marshal.Marshallable.CopyInN.
  3572  func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3573      // Construct a slice backed by dst's underlying memory.
  3574      var buf []byte
  3575      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3576      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3577      hdr.Len = n.SizeBytes()
  3578      hdr.Cap = n.SizeBytes()
  3579  
  3580      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3581      // Since we bypassed the compiler's escape analysis, indicate that n
  3582      // must live until the use above.
  3583      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3584      return length, err
  3585  }
  3586  
  3587  // CopyIn implements marshal.Marshallable.CopyIn.
  3588  func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3589      return n.CopyInN(cc, addr, n.SizeBytes())
  3590  }
  3591  
  3592  // WriteTo implements io.WriterTo.WriteTo.
  3593  func (n *NV0080_CTRL_GR_ROUTE_INFO) WriteTo(writer io.Writer) (int64, error) {
  3594      // Construct a slice backed by dst's underlying memory.
  3595      var buf []byte
  3596      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3597      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3598      hdr.Len = n.SizeBytes()
  3599      hdr.Cap = n.SizeBytes()
  3600  
  3601      length, err := writer.Write(buf)
  3602      // Since we bypassed the compiler's escape analysis, indicate that n
  3603      // must live until the use above.
  3604      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3605      return int64(length), err
  3606  }
  3607  
  3608  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3609  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) SizeBytes() int {
  3610      return 7 +
  3611          1*3 +
  3612          1*6 +
  3613          (*P64)(nil).SizeBytes() +
  3614          (*Handle)(nil).SizeBytes()*NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES +
  3615          (*Handle)(nil).SizeBytes()*NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES
  3616  }
  3617  
  3618  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3619  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) MarshalBytes(dst []byte) []byte {
  3620      dst[0] = byte(n.BDisable)
  3621      dst = dst[1:]
  3622      for idx := 0; idx < 3; idx++ {
  3623          dst[0] = byte(n.Pad1[idx])
  3624          dst = dst[1:]
  3625      }
  3626      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NumChannels))
  3627      dst = dst[4:]
  3628      dst[0] = byte(n.BOnlyDisableScheduling)
  3629      dst = dst[1:]
  3630      dst[0] = byte(n.BRewindGpPut)
  3631      dst = dst[1:]
  3632      for idx := 0; idx < 6; idx++ {
  3633          dst[0] = byte(n.Pad2[idx])
  3634          dst = dst[1:]
  3635      }
  3636      dst = n.PRunlistPreemptEvent.MarshalUnsafe(dst)
  3637      for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ {
  3638          dst = n.HClientList[idx].MarshalUnsafe(dst)
  3639      }
  3640      for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ {
  3641          dst = n.HChannelList[idx].MarshalUnsafe(dst)
  3642      }
  3643      return dst
  3644  }
  3645  
  3646  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3647  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) UnmarshalBytes(src []byte) []byte {
  3648      n.BDisable = uint8(src[0])
  3649      src = src[1:]
  3650      for idx := 0; idx < 3; idx++ {
  3651          n.Pad1[idx] = src[0]
  3652          src = src[1:]
  3653      }
  3654      n.NumChannels = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3655      src = src[4:]
  3656      n.BOnlyDisableScheduling = uint8(src[0])
  3657      src = src[1:]
  3658      n.BRewindGpPut = uint8(src[0])
  3659      src = src[1:]
  3660      for idx := 0; idx < 6; idx++ {
  3661          n.Pad2[idx] = src[0]
  3662          src = src[1:]
  3663      }
  3664      src = n.PRunlistPreemptEvent.UnmarshalUnsafe(src)
  3665      for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ {
  3666          src = n.HClientList[idx].UnmarshalUnsafe(src)
  3667      }
  3668      for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ {
  3669          src = n.HChannelList[idx].UnmarshalUnsafe(src)
  3670      }
  3671      return src
  3672  }
  3673  
  3674  // Packed implements marshal.Marshallable.Packed.
  3675  //go:nosplit
  3676  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) Packed() bool {
  3677      return n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed()
  3678  }
  3679  
  3680  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3681  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) MarshalUnsafe(dst []byte) []byte {
  3682      if n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3683          size := n.SizeBytes()
  3684          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3685          return dst[size:]
  3686      }
  3687      // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  3688      return n.MarshalBytes(dst)
  3689  }
  3690  
  3691  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3692  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  3693      if n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3694          size := n.SizeBytes()
  3695          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3696          return src[size:]
  3697      }
  3698      // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3699      return n.UnmarshalBytes(src)
  3700  }
  3701  
  3702  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3703  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3704      if !n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3705          // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3706          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3707          n.MarshalBytes(buf) // escapes: fallback.
  3708          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3709      }
  3710  
  3711      // Construct a slice backed by dst's underlying memory.
  3712      var buf []byte
  3713      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3714      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3715      hdr.Len = n.SizeBytes()
  3716      hdr.Cap = n.SizeBytes()
  3717  
  3718      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3719      // Since we bypassed the compiler's escape analysis, indicate that n
  3720      // must live until the use above.
  3721      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3722      return length, err
  3723  }
  3724  
  3725  // CopyOut implements marshal.Marshallable.CopyOut.
  3726  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3727      return n.CopyOutN(cc, addr, n.SizeBytes())
  3728  }
  3729  
  3730  // CopyInN implements marshal.Marshallable.CopyInN.
  3731  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3732      if !n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3733          // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3734          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3735          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3736          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3737          // partially unmarshalled struct.
  3738          n.UnmarshalBytes(buf) // escapes: fallback.
  3739          return length, err
  3740      }
  3741  
  3742      // Construct a slice backed by dst's underlying memory.
  3743      var buf []byte
  3744      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3745      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3746      hdr.Len = n.SizeBytes()
  3747      hdr.Cap = n.SizeBytes()
  3748  
  3749      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3750      // Since we bypassed the compiler's escape analysis, indicate that n
  3751      // must live until the use above.
  3752      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3753      return length, err
  3754  }
  3755  
  3756  // CopyIn implements marshal.Marshallable.CopyIn.
  3757  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3758      return n.CopyInN(cc, addr, n.SizeBytes())
  3759  }
  3760  
  3761  // WriteTo implements io.WriterTo.WriteTo.
  3762  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  3763      if !n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3764          // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3765          buf := make([]byte, n.SizeBytes())
  3766          n.MarshalBytes(buf)
  3767          length, err := writer.Write(buf)
  3768          return int64(length), err
  3769      }
  3770  
  3771      // Construct a slice backed by dst's underlying memory.
  3772      var buf []byte
  3773      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3774      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3775      hdr.Len = n.SizeBytes()
  3776      hdr.Cap = n.SizeBytes()
  3777  
  3778      length, err := writer.Write(buf)
  3779      // Since we bypassed the compiler's escape analysis, indicate that n
  3780      // must live until the use above.
  3781      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3782      return int64(length), err
  3783  }
  3784  
  3785  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3786  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) SizeBytes() int {
  3787      return 4 +
  3788          1*4 +
  3789          (*P64)(nil).SizeBytes() +
  3790          (*NV0080_CTRL_GR_ROUTE_INFO)(nil).SizeBytes()
  3791  }
  3792  
  3793  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3794  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) MarshalBytes(dst []byte) []byte {
  3795      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.GRInfoListSize))
  3796      dst = dst[4:]
  3797      for idx := 0; idx < 4; idx++ {
  3798          dst[0] = byte(n.Pad[idx])
  3799          dst = dst[1:]
  3800      }
  3801      dst = n.GRInfoList.MarshalUnsafe(dst)
  3802      dst = n.GRRouteInfo.MarshalUnsafe(dst)
  3803      return dst
  3804  }
  3805  
  3806  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3807  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) UnmarshalBytes(src []byte) []byte {
  3808      n.GRInfoListSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3809      src = src[4:]
  3810      for idx := 0; idx < 4; idx++ {
  3811          n.Pad[idx] = src[0]
  3812          src = src[1:]
  3813      }
  3814      src = n.GRInfoList.UnmarshalUnsafe(src)
  3815      src = n.GRRouteInfo.UnmarshalUnsafe(src)
  3816      return src
  3817  }
  3818  
  3819  // Packed implements marshal.Marshallable.Packed.
  3820  //go:nosplit
  3821  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) Packed() bool {
  3822      return n.GRInfoList.Packed() && n.GRRouteInfo.Packed()
  3823  }
  3824  
  3825  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3826  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) MarshalUnsafe(dst []byte) []byte {
  3827      if n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3828          size := n.SizeBytes()
  3829          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3830          return dst[size:]
  3831      }
  3832      // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  3833      return n.MarshalBytes(dst)
  3834  }
  3835  
  3836  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3837  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  3838      if n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3839          size := n.SizeBytes()
  3840          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3841          return src[size:]
  3842      }
  3843      // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3844      return n.UnmarshalBytes(src)
  3845  }
  3846  
  3847  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3848  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3849      if !n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3850          // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3851          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3852          n.MarshalBytes(buf) // escapes: fallback.
  3853          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3854      }
  3855  
  3856      // Construct a slice backed by dst's underlying memory.
  3857      var buf []byte
  3858      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3859      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3860      hdr.Len = n.SizeBytes()
  3861      hdr.Cap = n.SizeBytes()
  3862  
  3863      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3864      // Since we bypassed the compiler's escape analysis, indicate that n
  3865      // must live until the use above.
  3866      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3867      return length, err
  3868  }
  3869  
  3870  // CopyOut implements marshal.Marshallable.CopyOut.
  3871  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3872      return n.CopyOutN(cc, addr, n.SizeBytes())
  3873  }
  3874  
  3875  // CopyInN implements marshal.Marshallable.CopyInN.
  3876  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3877      if !n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3878          // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3879          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3880          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3881          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3882          // partially unmarshalled struct.
  3883          n.UnmarshalBytes(buf) // escapes: fallback.
  3884          return length, err
  3885      }
  3886  
  3887      // Construct a slice backed by dst's underlying memory.
  3888      var buf []byte
  3889      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3890      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3891      hdr.Len = n.SizeBytes()
  3892      hdr.Cap = n.SizeBytes()
  3893  
  3894      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3895      // Since we bypassed the compiler's escape analysis, indicate that n
  3896      // must live until the use above.
  3897      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3898      return length, err
  3899  }
  3900  
  3901  // CopyIn implements marshal.Marshallable.CopyIn.
  3902  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3903      return n.CopyInN(cc, addr, n.SizeBytes())
  3904  }
  3905  
  3906  // WriteTo implements io.WriterTo.WriteTo.
  3907  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  3908      if !n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3909          // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3910          buf := make([]byte, n.SizeBytes())
  3911          n.MarshalBytes(buf)
  3912          length, err := writer.Write(buf)
  3913          return int64(length), err
  3914      }
  3915  
  3916      // Construct a slice backed by dst's underlying memory.
  3917      var buf []byte
  3918      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3919      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3920      hdr.Len = n.SizeBytes()
  3921      hdr.Cap = n.SizeBytes()
  3922  
  3923      length, err := writer.Write(buf)
  3924      // Since we bypassed the compiler's escape analysis, indicate that n
  3925      // must live until the use above.
  3926      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3927      return int64(length), err
  3928  }
  3929  
  3930  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3931  func (n *NVXXXX_CTRL_XXX_INFO) SizeBytes() int {
  3932      return 8
  3933  }
  3934  
  3935  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3936  func (n *NVXXXX_CTRL_XXX_INFO) MarshalBytes(dst []byte) []byte {
  3937      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Index))
  3938      dst = dst[4:]
  3939      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Data))
  3940      dst = dst[4:]
  3941      return dst
  3942  }
  3943  
  3944  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3945  func (n *NVXXXX_CTRL_XXX_INFO) UnmarshalBytes(src []byte) []byte {
  3946      n.Index = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3947      src = src[4:]
  3948      n.Data = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3949      src = src[4:]
  3950      return src
  3951  }
  3952  
  3953  // Packed implements marshal.Marshallable.Packed.
  3954  //go:nosplit
  3955  func (n *NVXXXX_CTRL_XXX_INFO) Packed() bool {
  3956      return true
  3957  }
  3958  
  3959  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3960  func (n *NVXXXX_CTRL_XXX_INFO) MarshalUnsafe(dst []byte) []byte {
  3961      size := n.SizeBytes()
  3962      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3963      return dst[size:]
  3964  }
  3965  
  3966  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3967  func (n *NVXXXX_CTRL_XXX_INFO) UnmarshalUnsafe(src []byte) []byte {
  3968      size := n.SizeBytes()
  3969      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3970      return src[size:]
  3971  }
  3972  
  3973  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3974  func (n *NVXXXX_CTRL_XXX_INFO) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3975      // Construct a slice backed by dst's underlying memory.
  3976      var buf []byte
  3977      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3978      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3979      hdr.Len = n.SizeBytes()
  3980      hdr.Cap = n.SizeBytes()
  3981  
  3982      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3983      // Since we bypassed the compiler's escape analysis, indicate that n
  3984      // must live until the use above.
  3985      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3986      return length, err
  3987  }
  3988  
  3989  // CopyOut implements marshal.Marshallable.CopyOut.
  3990  func (n *NVXXXX_CTRL_XXX_INFO) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3991      return n.CopyOutN(cc, addr, n.SizeBytes())
  3992  }
  3993  
  3994  // CopyInN implements marshal.Marshallable.CopyInN.
  3995  func (n *NVXXXX_CTRL_XXX_INFO) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3996      // Construct a slice backed by dst's underlying memory.
  3997      var buf []byte
  3998      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3999      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4000      hdr.Len = n.SizeBytes()
  4001      hdr.Cap = n.SizeBytes()
  4002  
  4003      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4004      // Since we bypassed the compiler's escape analysis, indicate that n
  4005      // must live until the use above.
  4006      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4007      return length, err
  4008  }
  4009  
  4010  // CopyIn implements marshal.Marshallable.CopyIn.
  4011  func (n *NVXXXX_CTRL_XXX_INFO) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4012      return n.CopyInN(cc, addr, n.SizeBytes())
  4013  }
  4014  
  4015  // WriteTo implements io.WriterTo.WriteTo.
  4016  func (n *NVXXXX_CTRL_XXX_INFO) WriteTo(writer io.Writer) (int64, error) {
  4017      // Construct a slice backed by dst's underlying memory.
  4018      var buf []byte
  4019      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4020      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4021      hdr.Len = n.SizeBytes()
  4022      hdr.Cap = n.SizeBytes()
  4023  
  4024      length, err := writer.Write(buf)
  4025      // Since we bypassed the compiler's escape analysis, indicate that n
  4026      // must live until the use above.
  4027      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4028      return int64(length), err
  4029  }
  4030  
  4031  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4032  func (i *IoctlAllocOSEvent) SizeBytes() int {
  4033      return 8 +
  4034          (*Handle)(nil).SizeBytes() +
  4035          (*Handle)(nil).SizeBytes()
  4036  }
  4037  
  4038  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4039  func (i *IoctlAllocOSEvent) MarshalBytes(dst []byte) []byte {
  4040      dst = i.HClient.MarshalUnsafe(dst)
  4041      dst = i.HDevice.MarshalUnsafe(dst)
  4042      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD))
  4043      dst = dst[4:]
  4044      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Status))
  4045      dst = dst[4:]
  4046      return dst
  4047  }
  4048  
  4049  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4050  func (i *IoctlAllocOSEvent) UnmarshalBytes(src []byte) []byte {
  4051      src = i.HClient.UnmarshalUnsafe(src)
  4052      src = i.HDevice.UnmarshalUnsafe(src)
  4053      i.FD = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4054      src = src[4:]
  4055      i.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4056      src = src[4:]
  4057      return src
  4058  }
  4059  
  4060  // Packed implements marshal.Marshallable.Packed.
  4061  //go:nosplit
  4062  func (i *IoctlAllocOSEvent) Packed() bool {
  4063      return i.HClient.Packed() && i.HDevice.Packed()
  4064  }
  4065  
  4066  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4067  func (i *IoctlAllocOSEvent) MarshalUnsafe(dst []byte) []byte {
  4068      if i.HClient.Packed() && i.HDevice.Packed() {
  4069          size := i.SizeBytes()
  4070          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4071          return dst[size:]
  4072      }
  4073      // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fallback to MarshalBytes.
  4074      return i.MarshalBytes(dst)
  4075  }
  4076  
  4077  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4078  func (i *IoctlAllocOSEvent) UnmarshalUnsafe(src []byte) []byte {
  4079      if i.HClient.Packed() && i.HDevice.Packed() {
  4080          size := i.SizeBytes()
  4081          gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4082          return src[size:]
  4083      }
  4084      // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4085      return i.UnmarshalBytes(src)
  4086  }
  4087  
  4088  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4089  func (i *IoctlAllocOSEvent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4090      if !i.HClient.Packed() && i.HDevice.Packed() {
  4091          // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes.
  4092          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4093          i.MarshalBytes(buf) // escapes: fallback.
  4094          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4095      }
  4096  
  4097      // Construct a slice backed by dst's underlying memory.
  4098      var buf []byte
  4099      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4100      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4101      hdr.Len = i.SizeBytes()
  4102      hdr.Cap = i.SizeBytes()
  4103  
  4104      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4105      // Since we bypassed the compiler's escape analysis, indicate that i
  4106      // must live until the use above.
  4107      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4108      return length, err
  4109  }
  4110  
  4111  // CopyOut implements marshal.Marshallable.CopyOut.
  4112  func (i *IoctlAllocOSEvent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4113      return i.CopyOutN(cc, addr, i.SizeBytes())
  4114  }
  4115  
  4116  // CopyInN implements marshal.Marshallable.CopyInN.
  4117  func (i *IoctlAllocOSEvent) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4118      if !i.HClient.Packed() && i.HDevice.Packed() {
  4119          // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4120          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4121          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4122          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4123          // partially unmarshalled struct.
  4124          i.UnmarshalBytes(buf) // escapes: fallback.
  4125          return length, err
  4126      }
  4127  
  4128      // Construct a slice backed by dst's underlying memory.
  4129      var buf []byte
  4130      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4131      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4132      hdr.Len = i.SizeBytes()
  4133      hdr.Cap = i.SizeBytes()
  4134  
  4135      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4136      // Since we bypassed the compiler's escape analysis, indicate that i
  4137      // must live until the use above.
  4138      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4139      return length, err
  4140  }
  4141  
  4142  // CopyIn implements marshal.Marshallable.CopyIn.
  4143  func (i *IoctlAllocOSEvent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4144      return i.CopyInN(cc, addr, i.SizeBytes())
  4145  }
  4146  
  4147  // WriteTo implements io.WriterTo.WriteTo.
  4148  func (i *IoctlAllocOSEvent) WriteTo(writer io.Writer) (int64, error) {
  4149      if !i.HClient.Packed() && i.HDevice.Packed() {
  4150          // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes.
  4151          buf := make([]byte, i.SizeBytes())
  4152          i.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(i)))
  4161      hdr.Len = i.SizeBytes()
  4162      hdr.Cap = i.SizeBytes()
  4163  
  4164      length, err := writer.Write(buf)
  4165      // Since we bypassed the compiler's escape analysis, indicate that i
  4166      // must live until the use above.
  4167      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4168      return int64(length), err
  4169  }
  4170  
  4171  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4172  func (i *IoctlFreeOSEvent) SizeBytes() int {
  4173      return 8 +
  4174          (*Handle)(nil).SizeBytes() +
  4175          (*Handle)(nil).SizeBytes()
  4176  }
  4177  
  4178  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4179  func (i *IoctlFreeOSEvent) MarshalBytes(dst []byte) []byte {
  4180      dst = i.HClient.MarshalUnsafe(dst)
  4181      dst = i.HDevice.MarshalUnsafe(dst)
  4182      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD))
  4183      dst = dst[4:]
  4184      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Status))
  4185      dst = dst[4:]
  4186      return dst
  4187  }
  4188  
  4189  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4190  func (i *IoctlFreeOSEvent) UnmarshalBytes(src []byte) []byte {
  4191      src = i.HClient.UnmarshalUnsafe(src)
  4192      src = i.HDevice.UnmarshalUnsafe(src)
  4193      i.FD = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4194      src = src[4:]
  4195      i.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4196      src = src[4:]
  4197      return src
  4198  }
  4199  
  4200  // Packed implements marshal.Marshallable.Packed.
  4201  //go:nosplit
  4202  func (i *IoctlFreeOSEvent) Packed() bool {
  4203      return i.HClient.Packed() && i.HDevice.Packed()
  4204  }
  4205  
  4206  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4207  func (i *IoctlFreeOSEvent) MarshalUnsafe(dst []byte) []byte {
  4208      if i.HClient.Packed() && i.HDevice.Packed() {
  4209          size := i.SizeBytes()
  4210          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4211          return dst[size:]
  4212      }
  4213      // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fallback to MarshalBytes.
  4214      return i.MarshalBytes(dst)
  4215  }
  4216  
  4217  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4218  func (i *IoctlFreeOSEvent) UnmarshalUnsafe(src []byte) []byte {
  4219      if i.HClient.Packed() && i.HDevice.Packed() {
  4220          size := i.SizeBytes()
  4221          gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4222          return src[size:]
  4223      }
  4224      // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4225      return i.UnmarshalBytes(src)
  4226  }
  4227  
  4228  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4229  func (i *IoctlFreeOSEvent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4230      if !i.HClient.Packed() && i.HDevice.Packed() {
  4231          // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes.
  4232          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4233          i.MarshalBytes(buf) // escapes: fallback.
  4234          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4235      }
  4236  
  4237      // Construct a slice backed by dst's underlying memory.
  4238      var buf []byte
  4239      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4240      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4241      hdr.Len = i.SizeBytes()
  4242      hdr.Cap = i.SizeBytes()
  4243  
  4244      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4245      // Since we bypassed the compiler's escape analysis, indicate that i
  4246      // must live until the use above.
  4247      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4248      return length, err
  4249  }
  4250  
  4251  // CopyOut implements marshal.Marshallable.CopyOut.
  4252  func (i *IoctlFreeOSEvent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4253      return i.CopyOutN(cc, addr, i.SizeBytes())
  4254  }
  4255  
  4256  // CopyInN implements marshal.Marshallable.CopyInN.
  4257  func (i *IoctlFreeOSEvent) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4258      if !i.HClient.Packed() && i.HDevice.Packed() {
  4259          // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4260          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4261          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4262          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4263          // partially unmarshalled struct.
  4264          i.UnmarshalBytes(buf) // escapes: fallback.
  4265          return length, err
  4266      }
  4267  
  4268      // Construct a slice backed by dst's underlying memory.
  4269      var buf []byte
  4270      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4271      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4272      hdr.Len = i.SizeBytes()
  4273      hdr.Cap = i.SizeBytes()
  4274  
  4275      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4276      // Since we bypassed the compiler's escape analysis, indicate that i
  4277      // must live until the use above.
  4278      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4279      return length, err
  4280  }
  4281  
  4282  // CopyIn implements marshal.Marshallable.CopyIn.
  4283  func (i *IoctlFreeOSEvent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4284      return i.CopyInN(cc, addr, i.SizeBytes())
  4285  }
  4286  
  4287  // WriteTo implements io.WriterTo.WriteTo.
  4288  func (i *IoctlFreeOSEvent) WriteTo(writer io.Writer) (int64, error) {
  4289      if !i.HClient.Packed() && i.HDevice.Packed() {
  4290          // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes.
  4291          buf := make([]byte, i.SizeBytes())
  4292          i.MarshalBytes(buf)
  4293          length, err := writer.Write(buf)
  4294          return int64(length), err
  4295      }
  4296  
  4297      // Construct a slice backed by dst's underlying memory.
  4298      var buf []byte
  4299      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4300      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4301      hdr.Len = i.SizeBytes()
  4302      hdr.Cap = i.SizeBytes()
  4303  
  4304      length, err := writer.Write(buf)
  4305      // Since we bypassed the compiler's escape analysis, indicate that i
  4306      // must live until the use above.
  4307      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4308      return int64(length), err
  4309  }
  4310  
  4311  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4312  func (i *IoctlNVOS02ParametersWithFD) SizeBytes() int {
  4313      return 4 +
  4314          (*NVOS02Parameters)(nil).SizeBytes() +
  4315          1*4
  4316  }
  4317  
  4318  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4319  func (i *IoctlNVOS02ParametersWithFD) MarshalBytes(dst []byte) []byte {
  4320      dst = i.Params.MarshalUnsafe(dst)
  4321      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD))
  4322      dst = dst[4:]
  4323      for idx := 0; idx < 4; idx++ {
  4324          dst[0] = byte(i.Pad0[idx])
  4325          dst = dst[1:]
  4326      }
  4327      return dst
  4328  }
  4329  
  4330  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4331  func (i *IoctlNVOS02ParametersWithFD) UnmarshalBytes(src []byte) []byte {
  4332      src = i.Params.UnmarshalUnsafe(src)
  4333      i.FD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  4334      src = src[4:]
  4335      for idx := 0; idx < 4; idx++ {
  4336          i.Pad0[idx] = src[0]
  4337          src = src[1:]
  4338      }
  4339      return src
  4340  }
  4341  
  4342  // Packed implements marshal.Marshallable.Packed.
  4343  //go:nosplit
  4344  func (i *IoctlNVOS02ParametersWithFD) Packed() bool {
  4345      return i.Params.Packed()
  4346  }
  4347  
  4348  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4349  func (i *IoctlNVOS02ParametersWithFD) MarshalUnsafe(dst []byte) []byte {
  4350      if i.Params.Packed() {
  4351          size := i.SizeBytes()
  4352          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4353          return dst[size:]
  4354      }
  4355      // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fallback to MarshalBytes.
  4356      return i.MarshalBytes(dst)
  4357  }
  4358  
  4359  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4360  func (i *IoctlNVOS02ParametersWithFD) UnmarshalUnsafe(src []byte) []byte {
  4361      if i.Params.Packed() {
  4362          size := i.SizeBytes()
  4363          gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4364          return src[size:]
  4365      }
  4366      // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4367      return i.UnmarshalBytes(src)
  4368  }
  4369  
  4370  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4371  func (i *IoctlNVOS02ParametersWithFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4372      if !i.Params.Packed() {
  4373          // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes.
  4374          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4375          i.MarshalBytes(buf) // escapes: fallback.
  4376          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4377      }
  4378  
  4379      // Construct a slice backed by dst's underlying memory.
  4380      var buf []byte
  4381      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4382      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4383      hdr.Len = i.SizeBytes()
  4384      hdr.Cap = i.SizeBytes()
  4385  
  4386      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4387      // Since we bypassed the compiler's escape analysis, indicate that i
  4388      // must live until the use above.
  4389      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4390      return length, err
  4391  }
  4392  
  4393  // CopyOut implements marshal.Marshallable.CopyOut.
  4394  func (i *IoctlNVOS02ParametersWithFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4395      return i.CopyOutN(cc, addr, i.SizeBytes())
  4396  }
  4397  
  4398  // CopyInN implements marshal.Marshallable.CopyInN.
  4399  func (i *IoctlNVOS02ParametersWithFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4400      if !i.Params.Packed() {
  4401          // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4402          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4403          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4404          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4405          // partially unmarshalled struct.
  4406          i.UnmarshalBytes(buf) // escapes: fallback.
  4407          return length, err
  4408      }
  4409  
  4410      // Construct a slice backed by dst's underlying memory.
  4411      var buf []byte
  4412      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4413      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4414      hdr.Len = i.SizeBytes()
  4415      hdr.Cap = i.SizeBytes()
  4416  
  4417      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4418      // Since we bypassed the compiler's escape analysis, indicate that i
  4419      // must live until the use above.
  4420      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4421      return length, err
  4422  }
  4423  
  4424  // CopyIn implements marshal.Marshallable.CopyIn.
  4425  func (i *IoctlNVOS02ParametersWithFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4426      return i.CopyInN(cc, addr, i.SizeBytes())
  4427  }
  4428  
  4429  // WriteTo implements io.WriterTo.WriteTo.
  4430  func (i *IoctlNVOS02ParametersWithFD) WriteTo(writer io.Writer) (int64, error) {
  4431      if !i.Params.Packed() {
  4432          // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes.
  4433          buf := make([]byte, i.SizeBytes())
  4434          i.MarshalBytes(buf)
  4435          length, err := writer.Write(buf)
  4436          return int64(length), err
  4437      }
  4438  
  4439      // Construct a slice backed by dst's underlying memory.
  4440      var buf []byte
  4441      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4442      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4443      hdr.Len = i.SizeBytes()
  4444      hdr.Cap = i.SizeBytes()
  4445  
  4446      length, err := writer.Write(buf)
  4447      // Since we bypassed the compiler's escape analysis, indicate that i
  4448      // must live until the use above.
  4449      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4450      return int64(length), err
  4451  }
  4452  
  4453  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4454  func (i *IoctlNVOS33ParametersWithFD) SizeBytes() int {
  4455      return 4 +
  4456          (*NVOS33Parameters)(nil).SizeBytes() +
  4457          1*4
  4458  }
  4459  
  4460  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4461  func (i *IoctlNVOS33ParametersWithFD) MarshalBytes(dst []byte) []byte {
  4462      dst = i.Params.MarshalUnsafe(dst)
  4463      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD))
  4464      dst = dst[4:]
  4465      for idx := 0; idx < 4; idx++ {
  4466          dst[0] = byte(i.Pad0[idx])
  4467          dst = dst[1:]
  4468      }
  4469      return dst
  4470  }
  4471  
  4472  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4473  func (i *IoctlNVOS33ParametersWithFD) UnmarshalBytes(src []byte) []byte {
  4474      src = i.Params.UnmarshalUnsafe(src)
  4475      i.FD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  4476      src = src[4:]
  4477      for idx := 0; idx < 4; idx++ {
  4478          i.Pad0[idx] = src[0]
  4479          src = src[1:]
  4480      }
  4481      return src
  4482  }
  4483  
  4484  // Packed implements marshal.Marshallable.Packed.
  4485  //go:nosplit
  4486  func (i *IoctlNVOS33ParametersWithFD) Packed() bool {
  4487      return i.Params.Packed()
  4488  }
  4489  
  4490  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4491  func (i *IoctlNVOS33ParametersWithFD) MarshalUnsafe(dst []byte) []byte {
  4492      if i.Params.Packed() {
  4493          size := i.SizeBytes()
  4494          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4495          return dst[size:]
  4496      }
  4497      // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fallback to MarshalBytes.
  4498      return i.MarshalBytes(dst)
  4499  }
  4500  
  4501  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4502  func (i *IoctlNVOS33ParametersWithFD) UnmarshalUnsafe(src []byte) []byte {
  4503      if i.Params.Packed() {
  4504          size := i.SizeBytes()
  4505          gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4506          return src[size:]
  4507      }
  4508      // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4509      return i.UnmarshalBytes(src)
  4510  }
  4511  
  4512  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4513  func (i *IoctlNVOS33ParametersWithFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4514      if !i.Params.Packed() {
  4515          // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes.
  4516          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4517          i.MarshalBytes(buf) // escapes: fallback.
  4518          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4519      }
  4520  
  4521      // Construct a slice backed by dst's underlying memory.
  4522      var buf []byte
  4523      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4524      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4525      hdr.Len = i.SizeBytes()
  4526      hdr.Cap = i.SizeBytes()
  4527  
  4528      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4529      // Since we bypassed the compiler's escape analysis, indicate that i
  4530      // must live until the use above.
  4531      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4532      return length, err
  4533  }
  4534  
  4535  // CopyOut implements marshal.Marshallable.CopyOut.
  4536  func (i *IoctlNVOS33ParametersWithFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4537      return i.CopyOutN(cc, addr, i.SizeBytes())
  4538  }
  4539  
  4540  // CopyInN implements marshal.Marshallable.CopyInN.
  4541  func (i *IoctlNVOS33ParametersWithFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4542      if !i.Params.Packed() {
  4543          // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4544          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4545          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4546          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4547          // partially unmarshalled struct.
  4548          i.UnmarshalBytes(buf) // escapes: fallback.
  4549          return length, err
  4550      }
  4551  
  4552      // Construct a slice backed by dst's underlying memory.
  4553      var buf []byte
  4554      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4555      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4556      hdr.Len = i.SizeBytes()
  4557      hdr.Cap = i.SizeBytes()
  4558  
  4559      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4560      // Since we bypassed the compiler's escape analysis, indicate that i
  4561      // must live until the use above.
  4562      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4563      return length, err
  4564  }
  4565  
  4566  // CopyIn implements marshal.Marshallable.CopyIn.
  4567  func (i *IoctlNVOS33ParametersWithFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4568      return i.CopyInN(cc, addr, i.SizeBytes())
  4569  }
  4570  
  4571  // WriteTo implements io.WriterTo.WriteTo.
  4572  func (i *IoctlNVOS33ParametersWithFD) WriteTo(writer io.Writer) (int64, error) {
  4573      if !i.Params.Packed() {
  4574          // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes.
  4575          buf := make([]byte, i.SizeBytes())
  4576          i.MarshalBytes(buf)
  4577          length, err := writer.Write(buf)
  4578          return int64(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(i)))
  4585      hdr.Len = i.SizeBytes()
  4586      hdr.Cap = i.SizeBytes()
  4587  
  4588      length, err := writer.Write(buf)
  4589      // Since we bypassed the compiler's escape analysis, indicate that i
  4590      // must live until the use above.
  4591      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4592      return int64(length), err
  4593  }
  4594  
  4595  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4596  func (i *IoctlRegisterFD) SizeBytes() int {
  4597      return 4
  4598  }
  4599  
  4600  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4601  func (i *IoctlRegisterFD) MarshalBytes(dst []byte) []byte {
  4602      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CtlFD))
  4603      dst = dst[4:]
  4604      return dst
  4605  }
  4606  
  4607  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4608  func (i *IoctlRegisterFD) UnmarshalBytes(src []byte) []byte {
  4609      i.CtlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  4610      src = src[4:]
  4611      return src
  4612  }
  4613  
  4614  // Packed implements marshal.Marshallable.Packed.
  4615  //go:nosplit
  4616  func (i *IoctlRegisterFD) Packed() bool {
  4617      return true
  4618  }
  4619  
  4620  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4621  func (i *IoctlRegisterFD) MarshalUnsafe(dst []byte) []byte {
  4622      size := i.SizeBytes()
  4623      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4624      return dst[size:]
  4625  }
  4626  
  4627  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4628  func (i *IoctlRegisterFD) UnmarshalUnsafe(src []byte) []byte {
  4629      size := i.SizeBytes()
  4630      gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4631      return src[size:]
  4632  }
  4633  
  4634  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4635  func (i *IoctlRegisterFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4636      // Construct a slice backed by dst's underlying memory.
  4637      var buf []byte
  4638      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4639      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4640      hdr.Len = i.SizeBytes()
  4641      hdr.Cap = i.SizeBytes()
  4642  
  4643      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4644      // Since we bypassed the compiler's escape analysis, indicate that i
  4645      // must live until the use above.
  4646      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4647      return length, err
  4648  }
  4649  
  4650  // CopyOut implements marshal.Marshallable.CopyOut.
  4651  func (i *IoctlRegisterFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4652      return i.CopyOutN(cc, addr, i.SizeBytes())
  4653  }
  4654  
  4655  // CopyInN implements marshal.Marshallable.CopyInN.
  4656  func (i *IoctlRegisterFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4657      // Construct a slice backed by dst's underlying memory.
  4658      var buf []byte
  4659      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4660      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4661      hdr.Len = i.SizeBytes()
  4662      hdr.Cap = i.SizeBytes()
  4663  
  4664      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4665      // Since we bypassed the compiler's escape analysis, indicate that i
  4666      // must live until the use above.
  4667      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4668      return length, err
  4669  }
  4670  
  4671  // CopyIn implements marshal.Marshallable.CopyIn.
  4672  func (i *IoctlRegisterFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4673      return i.CopyInN(cc, addr, i.SizeBytes())
  4674  }
  4675  
  4676  // WriteTo implements io.WriterTo.WriteTo.
  4677  func (i *IoctlRegisterFD) WriteTo(writer io.Writer) (int64, error) {
  4678      // Construct a slice backed by dst's underlying memory.
  4679      var buf []byte
  4680      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4681      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4682      hdr.Len = i.SizeBytes()
  4683      hdr.Cap = i.SizeBytes()
  4684  
  4685      length, err := writer.Write(buf)
  4686      // Since we bypassed the compiler's escape analysis, indicate that i
  4687      // must live until the use above.
  4688      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4689      return int64(length), err
  4690  }
  4691  
  4692  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4693  func (i *IoctlSysParams) SizeBytes() int {
  4694      return 8
  4695  }
  4696  
  4697  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4698  func (i *IoctlSysParams) MarshalBytes(dst []byte) []byte {
  4699      hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.MemblockSize))
  4700      dst = dst[8:]
  4701      return dst
  4702  }
  4703  
  4704  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4705  func (i *IoctlSysParams) UnmarshalBytes(src []byte) []byte {
  4706      i.MemblockSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  4707      src = src[8:]
  4708      return src
  4709  }
  4710  
  4711  // Packed implements marshal.Marshallable.Packed.
  4712  //go:nosplit
  4713  func (i *IoctlSysParams) Packed() bool {
  4714      return true
  4715  }
  4716  
  4717  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4718  func (i *IoctlSysParams) MarshalUnsafe(dst []byte) []byte {
  4719      size := i.SizeBytes()
  4720      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4721      return dst[size:]
  4722  }
  4723  
  4724  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4725  func (i *IoctlSysParams) UnmarshalUnsafe(src []byte) []byte {
  4726      size := i.SizeBytes()
  4727      gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4728      return src[size:]
  4729  }
  4730  
  4731  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4732  func (i *IoctlSysParams) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4733      // Construct a slice backed by dst's underlying memory.
  4734      var buf []byte
  4735      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4736      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4737      hdr.Len = i.SizeBytes()
  4738      hdr.Cap = i.SizeBytes()
  4739  
  4740      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4741      // Since we bypassed the compiler's escape analysis, indicate that i
  4742      // must live until the use above.
  4743      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4744      return length, err
  4745  }
  4746  
  4747  // CopyOut implements marshal.Marshallable.CopyOut.
  4748  func (i *IoctlSysParams) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4749      return i.CopyOutN(cc, addr, i.SizeBytes())
  4750  }
  4751  
  4752  // CopyInN implements marshal.Marshallable.CopyInN.
  4753  func (i *IoctlSysParams) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4754      // Construct a slice backed by dst's underlying memory.
  4755      var buf []byte
  4756      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4757      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4758      hdr.Len = i.SizeBytes()
  4759      hdr.Cap = i.SizeBytes()
  4760  
  4761      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4762      // Since we bypassed the compiler's escape analysis, indicate that i
  4763      // must live until the use above.
  4764      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4765      return length, err
  4766  }
  4767  
  4768  // CopyIn implements marshal.Marshallable.CopyIn.
  4769  func (i *IoctlSysParams) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4770      return i.CopyInN(cc, addr, i.SizeBytes())
  4771  }
  4772  
  4773  // WriteTo implements io.WriterTo.WriteTo.
  4774  func (i *IoctlSysParams) WriteTo(writer io.Writer) (int64, error) {
  4775      // Construct a slice backed by dst's underlying memory.
  4776      var buf []byte
  4777      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4778      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4779      hdr.Len = i.SizeBytes()
  4780      hdr.Cap = i.SizeBytes()
  4781  
  4782      length, err := writer.Write(buf)
  4783      // Since we bypassed the compiler's escape analysis, indicate that i
  4784      // must live until the use above.
  4785      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4786      return int64(length), err
  4787  }
  4788  
  4789  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4790  func (i *IoctlWaitOpenComplete) SizeBytes() int {
  4791      return 8
  4792  }
  4793  
  4794  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4795  func (i *IoctlWaitOpenComplete) MarshalBytes(dst []byte) []byte {
  4796      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Rc))
  4797      dst = dst[4:]
  4798      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.AdapterStatus))
  4799      dst = dst[4:]
  4800      return dst
  4801  }
  4802  
  4803  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4804  func (i *IoctlWaitOpenComplete) UnmarshalBytes(src []byte) []byte {
  4805      i.Rc = int32(hostarch.ByteOrder.Uint32(src[:4]))
  4806      src = src[4:]
  4807      i.AdapterStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4808      src = src[4:]
  4809      return src
  4810  }
  4811  
  4812  // Packed implements marshal.Marshallable.Packed.
  4813  //go:nosplit
  4814  func (i *IoctlWaitOpenComplete) Packed() bool {
  4815      return true
  4816  }
  4817  
  4818  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4819  func (i *IoctlWaitOpenComplete) MarshalUnsafe(dst []byte) []byte {
  4820      size := i.SizeBytes()
  4821      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4822      return dst[size:]
  4823  }
  4824  
  4825  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4826  func (i *IoctlWaitOpenComplete) UnmarshalUnsafe(src []byte) []byte {
  4827      size := i.SizeBytes()
  4828      gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4829      return src[size:]
  4830  }
  4831  
  4832  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4833  func (i *IoctlWaitOpenComplete) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4834      // Construct a slice backed by dst's underlying memory.
  4835      var buf []byte
  4836      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4837      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4838      hdr.Len = i.SizeBytes()
  4839      hdr.Cap = i.SizeBytes()
  4840  
  4841      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4842      // Since we bypassed the compiler's escape analysis, indicate that i
  4843      // must live until the use above.
  4844      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4845      return length, err
  4846  }
  4847  
  4848  // CopyOut implements marshal.Marshallable.CopyOut.
  4849  func (i *IoctlWaitOpenComplete) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4850      return i.CopyOutN(cc, addr, i.SizeBytes())
  4851  }
  4852  
  4853  // CopyInN implements marshal.Marshallable.CopyInN.
  4854  func (i *IoctlWaitOpenComplete) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4855      // Construct a slice backed by dst's underlying memory.
  4856      var buf []byte
  4857      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4858      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4859      hdr.Len = i.SizeBytes()
  4860      hdr.Cap = i.SizeBytes()
  4861  
  4862      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4863      // Since we bypassed the compiler's escape analysis, indicate that i
  4864      // must live until the use above.
  4865      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4866      return length, err
  4867  }
  4868  
  4869  // CopyIn implements marshal.Marshallable.CopyIn.
  4870  func (i *IoctlWaitOpenComplete) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4871      return i.CopyInN(cc, addr, i.SizeBytes())
  4872  }
  4873  
  4874  // WriteTo implements io.WriterTo.WriteTo.
  4875  func (i *IoctlWaitOpenComplete) WriteTo(writer io.Writer) (int64, error) {
  4876      // Construct a slice backed by dst's underlying memory.
  4877      var buf []byte
  4878      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4879      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4880      hdr.Len = i.SizeBytes()
  4881      hdr.Cap = i.SizeBytes()
  4882  
  4883      length, err := writer.Write(buf)
  4884      // Since we bypassed the compiler's escape analysis, indicate that i
  4885      // must live until the use above.
  4886      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4887      return int64(length), err
  4888  }
  4889  
  4890  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4891  func (n *NVOS00Parameters) SizeBytes() int {
  4892      return 4 +
  4893          (*Handle)(nil).SizeBytes() +
  4894          (*Handle)(nil).SizeBytes() +
  4895          (*Handle)(nil).SizeBytes()
  4896  }
  4897  
  4898  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4899  func (n *NVOS00Parameters) MarshalBytes(dst []byte) []byte {
  4900      dst = n.HRoot.MarshalUnsafe(dst)
  4901      dst = n.HObjectParent.MarshalUnsafe(dst)
  4902      dst = n.HObjectOld.MarshalUnsafe(dst)
  4903      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  4904      dst = dst[4:]
  4905      return dst
  4906  }
  4907  
  4908  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4909  func (n *NVOS00Parameters) UnmarshalBytes(src []byte) []byte {
  4910      src = n.HRoot.UnmarshalUnsafe(src)
  4911      src = n.HObjectParent.UnmarshalUnsafe(src)
  4912      src = n.HObjectOld.UnmarshalUnsafe(src)
  4913      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4914      src = src[4:]
  4915      return src
  4916  }
  4917  
  4918  // Packed implements marshal.Marshallable.Packed.
  4919  //go:nosplit
  4920  func (n *NVOS00Parameters) Packed() bool {
  4921      return n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed()
  4922  }
  4923  
  4924  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4925  func (n *NVOS00Parameters) MarshalUnsafe(dst []byte) []byte {
  4926      if n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  4927          size := n.SizeBytes()
  4928          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  4929          return dst[size:]
  4930      }
  4931      // Type NVOS00Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  4932      return n.MarshalBytes(dst)
  4933  }
  4934  
  4935  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4936  func (n *NVOS00Parameters) UnmarshalUnsafe(src []byte) []byte {
  4937      if n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  4938          size := n.SizeBytes()
  4939          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  4940          return src[size:]
  4941      }
  4942      // Type NVOS00Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4943      return n.UnmarshalBytes(src)
  4944  }
  4945  
  4946  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4947  func (n *NVOS00Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4948      if !n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  4949          // Type NVOS00Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  4950          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  4951          n.MarshalBytes(buf) // escapes: fallback.
  4952          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4953      }
  4954  
  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(n)))
  4959      hdr.Len = n.SizeBytes()
  4960      hdr.Cap = n.SizeBytes()
  4961  
  4962      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4963      // Since we bypassed the compiler's escape analysis, indicate that n
  4964      // must live until the use above.
  4965      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4966      return length, err
  4967  }
  4968  
  4969  // CopyOut implements marshal.Marshallable.CopyOut.
  4970  func (n *NVOS00Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4971      return n.CopyOutN(cc, addr, n.SizeBytes())
  4972  }
  4973  
  4974  // CopyInN implements marshal.Marshallable.CopyInN.
  4975  func (n *NVOS00Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4976      if !n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  4977          // Type NVOS00Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4978          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  4979          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4980          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4981          // partially unmarshalled struct.
  4982          n.UnmarshalBytes(buf) // escapes: fallback.
  4983          return length, err
  4984      }
  4985  
  4986      // Construct a slice backed by dst's underlying memory.
  4987      var buf []byte
  4988      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4989      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4990      hdr.Len = n.SizeBytes()
  4991      hdr.Cap = n.SizeBytes()
  4992  
  4993      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4994      // Since we bypassed the compiler's escape analysis, indicate that n
  4995      // must live until the use above.
  4996      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4997      return length, err
  4998  }
  4999  
  5000  // CopyIn implements marshal.Marshallable.CopyIn.
  5001  func (n *NVOS00Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5002      return n.CopyInN(cc, addr, n.SizeBytes())
  5003  }
  5004  
  5005  // WriteTo implements io.WriterTo.WriteTo.
  5006  func (n *NVOS00Parameters) WriteTo(writer io.Writer) (int64, error) {
  5007      if !n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  5008          // Type NVOS00Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5009          buf := make([]byte, n.SizeBytes())
  5010          n.MarshalBytes(buf)
  5011          length, err := writer.Write(buf)
  5012          return int64(length), err
  5013      }
  5014  
  5015      // Construct a slice backed by dst's underlying memory.
  5016      var buf []byte
  5017      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5018      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5019      hdr.Len = n.SizeBytes()
  5020      hdr.Cap = n.SizeBytes()
  5021  
  5022      length, err := writer.Write(buf)
  5023      // Since we bypassed the compiler's escape analysis, indicate that n
  5024      // must live until the use above.
  5025      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5026      return int64(length), err
  5027  }
  5028  
  5029  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5030  func (n *NVOS02Parameters) SizeBytes() int {
  5031      return 16 +
  5032          (*Handle)(nil).SizeBytes() +
  5033          (*Handle)(nil).SizeBytes() +
  5034          (*Handle)(nil).SizeBytes() +
  5035          (*ClassID)(nil).SizeBytes() +
  5036          1*4 +
  5037          (*P64)(nil).SizeBytes() +
  5038          1*4
  5039  }
  5040  
  5041  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5042  func (n *NVOS02Parameters) MarshalBytes(dst []byte) []byte {
  5043      dst = n.HRoot.MarshalUnsafe(dst)
  5044      dst = n.HObjectParent.MarshalUnsafe(dst)
  5045      dst = n.HObjectNew.MarshalUnsafe(dst)
  5046      dst = n.HClass.MarshalUnsafe(dst)
  5047      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  5048      dst = dst[4:]
  5049      for idx := 0; idx < 4; idx++ {
  5050          dst[0] = byte(n.Pad0[idx])
  5051          dst = dst[1:]
  5052      }
  5053      dst = n.PMemory.MarshalUnsafe(dst)
  5054      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Limit))
  5055      dst = dst[8:]
  5056      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5057      dst = dst[4:]
  5058      for idx := 0; idx < 4; idx++ {
  5059          dst[0] = byte(n.Pad1[idx])
  5060          dst = dst[1:]
  5061      }
  5062      return dst
  5063  }
  5064  
  5065  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5066  func (n *NVOS02Parameters) UnmarshalBytes(src []byte) []byte {
  5067      src = n.HRoot.UnmarshalUnsafe(src)
  5068      src = n.HObjectParent.UnmarshalUnsafe(src)
  5069      src = n.HObjectNew.UnmarshalUnsafe(src)
  5070      src = n.HClass.UnmarshalUnsafe(src)
  5071      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5072      src = src[4:]
  5073      for idx := 0; idx < 4; idx++ {
  5074          n.Pad0[idx] = src[0]
  5075          src = src[1:]
  5076      }
  5077      src = n.PMemory.UnmarshalUnsafe(src)
  5078      n.Limit = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  5079      src = src[8:]
  5080      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5081      src = src[4:]
  5082      for idx := 0; idx < 4; idx++ {
  5083          n.Pad1[idx] = src[0]
  5084          src = src[1:]
  5085      }
  5086      return src
  5087  }
  5088  
  5089  // Packed implements marshal.Marshallable.Packed.
  5090  //go:nosplit
  5091  func (n *NVOS02Parameters) Packed() bool {
  5092      return n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed()
  5093  }
  5094  
  5095  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5096  func (n *NVOS02Parameters) MarshalUnsafe(dst []byte) []byte {
  5097      if n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  5098          size := n.SizeBytes()
  5099          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5100          return dst[size:]
  5101      }
  5102      // Type NVOS02Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5103      return n.MarshalBytes(dst)
  5104  }
  5105  
  5106  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5107  func (n *NVOS02Parameters) UnmarshalUnsafe(src []byte) []byte {
  5108      if n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  5109          size := n.SizeBytes()
  5110          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5111          return src[size:]
  5112      }
  5113      // Type NVOS02Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5114      return n.UnmarshalBytes(src)
  5115  }
  5116  
  5117  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5118  func (n *NVOS02Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5119      if !n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  5120          // Type NVOS02Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5121          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5122          n.MarshalBytes(buf) // escapes: fallback.
  5123          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5124      }
  5125  
  5126      // Construct a slice backed by dst's underlying memory.
  5127      var buf []byte
  5128      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5129      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5130      hdr.Len = n.SizeBytes()
  5131      hdr.Cap = n.SizeBytes()
  5132  
  5133      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5134      // Since we bypassed the compiler's escape analysis, indicate that n
  5135      // must live until the use above.
  5136      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5137      return length, err
  5138  }
  5139  
  5140  // CopyOut implements marshal.Marshallable.CopyOut.
  5141  func (n *NVOS02Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5142      return n.CopyOutN(cc, addr, n.SizeBytes())
  5143  }
  5144  
  5145  // CopyInN implements marshal.Marshallable.CopyInN.
  5146  func (n *NVOS02Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5147      if !n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  5148          // Type NVOS02Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5149          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5150          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5151          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5152          // partially unmarshalled struct.
  5153          n.UnmarshalBytes(buf) // escapes: fallback.
  5154          return length, err
  5155      }
  5156  
  5157      // Construct a slice backed by dst's underlying memory.
  5158      var buf []byte
  5159      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5160      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5161      hdr.Len = n.SizeBytes()
  5162      hdr.Cap = n.SizeBytes()
  5163  
  5164      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5165      // Since we bypassed the compiler's escape analysis, indicate that n
  5166      // must live until the use above.
  5167      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5168      return length, err
  5169  }
  5170  
  5171  // CopyIn implements marshal.Marshallable.CopyIn.
  5172  func (n *NVOS02Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5173      return n.CopyInN(cc, addr, n.SizeBytes())
  5174  }
  5175  
  5176  // WriteTo implements io.WriterTo.WriteTo.
  5177  func (n *NVOS02Parameters) WriteTo(writer io.Writer) (int64, error) {
  5178      if !n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  5179          // Type NVOS02Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5180          buf := make([]byte, n.SizeBytes())
  5181          n.MarshalBytes(buf)
  5182          length, err := writer.Write(buf)
  5183          return int64(length), err
  5184      }
  5185  
  5186      // Construct a slice backed by dst's underlying memory.
  5187      var buf []byte
  5188      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5189      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5190      hdr.Len = n.SizeBytes()
  5191      hdr.Cap = n.SizeBytes()
  5192  
  5193      length, err := writer.Write(buf)
  5194      // Since we bypassed the compiler's escape analysis, indicate that n
  5195      // must live until the use above.
  5196      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5197      return int64(length), err
  5198  }
  5199  
  5200  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5201  func (n *NVOS21Parameters) SizeBytes() int {
  5202      return 8 +
  5203          (*Handle)(nil).SizeBytes() +
  5204          (*Handle)(nil).SizeBytes() +
  5205          (*Handle)(nil).SizeBytes() +
  5206          (*ClassID)(nil).SizeBytes() +
  5207          (*P64)(nil).SizeBytes()
  5208  }
  5209  
  5210  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5211  func (n *NVOS21Parameters) MarshalBytes(dst []byte) []byte {
  5212      dst = n.HRoot.MarshalUnsafe(dst)
  5213      dst = n.HObjectParent.MarshalUnsafe(dst)
  5214      dst = n.HObjectNew.MarshalUnsafe(dst)
  5215      dst = n.HClass.MarshalUnsafe(dst)
  5216      dst = n.PAllocParms.MarshalUnsafe(dst)
  5217      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ParamsSize))
  5218      dst = dst[4:]
  5219      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5220      dst = dst[4:]
  5221      return dst
  5222  }
  5223  
  5224  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5225  func (n *NVOS21Parameters) UnmarshalBytes(src []byte) []byte {
  5226      src = n.HRoot.UnmarshalUnsafe(src)
  5227      src = n.HObjectParent.UnmarshalUnsafe(src)
  5228      src = n.HObjectNew.UnmarshalUnsafe(src)
  5229      src = n.HClass.UnmarshalUnsafe(src)
  5230      src = n.PAllocParms.UnmarshalUnsafe(src)
  5231      n.ParamsSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5232      src = src[4:]
  5233      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5234      src = src[4:]
  5235      return src
  5236  }
  5237  
  5238  // Packed implements marshal.Marshallable.Packed.
  5239  //go:nosplit
  5240  func (n *NVOS21Parameters) Packed() bool {
  5241      return n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed()
  5242  }
  5243  
  5244  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5245  func (n *NVOS21Parameters) MarshalUnsafe(dst []byte) []byte {
  5246      if n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  5247          size := n.SizeBytes()
  5248          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5249          return dst[size:]
  5250      }
  5251      // Type NVOS21Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5252      return n.MarshalBytes(dst)
  5253  }
  5254  
  5255  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5256  func (n *NVOS21Parameters) UnmarshalUnsafe(src []byte) []byte {
  5257      if n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  5258          size := n.SizeBytes()
  5259          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5260          return src[size:]
  5261      }
  5262      // Type NVOS21Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5263      return n.UnmarshalBytes(src)
  5264  }
  5265  
  5266  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5267  func (n *NVOS21Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5268      if !n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  5269          // Type NVOS21Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5270          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5271          n.MarshalBytes(buf) // escapes: fallback.
  5272          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5273      }
  5274  
  5275      // Construct a slice backed by dst's underlying memory.
  5276      var buf []byte
  5277      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5278      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5279      hdr.Len = n.SizeBytes()
  5280      hdr.Cap = n.SizeBytes()
  5281  
  5282      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5283      // Since we bypassed the compiler's escape analysis, indicate that n
  5284      // must live until the use above.
  5285      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5286      return length, err
  5287  }
  5288  
  5289  // CopyOut implements marshal.Marshallable.CopyOut.
  5290  func (n *NVOS21Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5291      return n.CopyOutN(cc, addr, n.SizeBytes())
  5292  }
  5293  
  5294  // CopyInN implements marshal.Marshallable.CopyInN.
  5295  func (n *NVOS21Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5296      if !n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  5297          // Type NVOS21Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5298          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5299          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5300          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5301          // partially unmarshalled struct.
  5302          n.UnmarshalBytes(buf) // escapes: fallback.
  5303          return length, err
  5304      }
  5305  
  5306      // Construct a slice backed by dst's underlying memory.
  5307      var buf []byte
  5308      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5309      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5310      hdr.Len = n.SizeBytes()
  5311      hdr.Cap = n.SizeBytes()
  5312  
  5313      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5314      // Since we bypassed the compiler's escape analysis, indicate that n
  5315      // must live until the use above.
  5316      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5317      return length, err
  5318  }
  5319  
  5320  // CopyIn implements marshal.Marshallable.CopyIn.
  5321  func (n *NVOS21Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5322      return n.CopyInN(cc, addr, n.SizeBytes())
  5323  }
  5324  
  5325  // WriteTo implements io.WriterTo.WriteTo.
  5326  func (n *NVOS21Parameters) WriteTo(writer io.Writer) (int64, error) {
  5327      if !n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  5328          // Type NVOS21Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5329          buf := make([]byte, n.SizeBytes())
  5330          n.MarshalBytes(buf)
  5331          length, err := writer.Write(buf)
  5332          return int64(length), err
  5333      }
  5334  
  5335      // Construct a slice backed by dst's underlying memory.
  5336      var buf []byte
  5337      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5338      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5339      hdr.Len = n.SizeBytes()
  5340      hdr.Cap = n.SizeBytes()
  5341  
  5342      length, err := writer.Write(buf)
  5343      // Since we bypassed the compiler's escape analysis, indicate that n
  5344      // must live until the use above.
  5345      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5346      return int64(length), err
  5347  }
  5348  
  5349  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5350  func (n *NVOS32Parameters) SizeBytes() int {
  5351      return 26 +
  5352          (*Handle)(nil).SizeBytes() +
  5353          (*Handle)(nil).SizeBytes() +
  5354          (*Handle)(nil).SizeBytes() +
  5355          1*2 +
  5356          1*144
  5357  }
  5358  
  5359  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5360  func (n *NVOS32Parameters) MarshalBytes(dst []byte) []byte {
  5361      dst = n.HRoot.MarshalUnsafe(dst)
  5362      dst = n.HObjectParent.MarshalUnsafe(dst)
  5363      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Function))
  5364      dst = dst[4:]
  5365      dst = n.HVASpace.MarshalUnsafe(dst)
  5366      hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.IVCHeapNumber))
  5367      dst = dst[2:]
  5368      for idx := 0; idx < 2; idx++ {
  5369          dst[0] = byte(n.Pad[idx])
  5370          dst = dst[1:]
  5371      }
  5372      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5373      dst = dst[4:]
  5374      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Total))
  5375      dst = dst[8:]
  5376      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Free))
  5377      dst = dst[8:]
  5378      for idx := 0; idx < 144; idx++ {
  5379          dst[0] = byte(n.Data[idx])
  5380          dst = dst[1:]
  5381      }
  5382      return dst
  5383  }
  5384  
  5385  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5386  func (n *NVOS32Parameters) UnmarshalBytes(src []byte) []byte {
  5387      src = n.HRoot.UnmarshalUnsafe(src)
  5388      src = n.HObjectParent.UnmarshalUnsafe(src)
  5389      n.Function = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5390      src = src[4:]
  5391      src = n.HVASpace.UnmarshalUnsafe(src)
  5392      n.IVCHeapNumber = int16(hostarch.ByteOrder.Uint16(src[:2]))
  5393      src = src[2:]
  5394      for idx := 0; idx < 2; idx++ {
  5395          n.Pad[idx] = src[0]
  5396          src = src[1:]
  5397      }
  5398      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5399      src = src[4:]
  5400      n.Total = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  5401      src = src[8:]
  5402      n.Free = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  5403      src = src[8:]
  5404      for idx := 0; idx < 144; idx++ {
  5405          n.Data[idx] = src[0]
  5406          src = src[1:]
  5407      }
  5408      return src
  5409  }
  5410  
  5411  // Packed implements marshal.Marshallable.Packed.
  5412  //go:nosplit
  5413  func (n *NVOS32Parameters) Packed() bool {
  5414      return n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed()
  5415  }
  5416  
  5417  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5418  func (n *NVOS32Parameters) MarshalUnsafe(dst []byte) []byte {
  5419      if n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  5420          size := n.SizeBytes()
  5421          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5422          return dst[size:]
  5423      }
  5424      // Type NVOS32Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5425      return n.MarshalBytes(dst)
  5426  }
  5427  
  5428  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5429  func (n *NVOS32Parameters) UnmarshalUnsafe(src []byte) []byte {
  5430      if n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  5431          size := n.SizeBytes()
  5432          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5433          return src[size:]
  5434      }
  5435      // Type NVOS32Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5436      return n.UnmarshalBytes(src)
  5437  }
  5438  
  5439  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5440  func (n *NVOS32Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5441      if !n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  5442          // Type NVOS32Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5443          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5444          n.MarshalBytes(buf) // escapes: fallback.
  5445          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5446      }
  5447  
  5448      // Construct a slice backed by dst's underlying memory.
  5449      var buf []byte
  5450      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5451      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5452      hdr.Len = n.SizeBytes()
  5453      hdr.Cap = n.SizeBytes()
  5454  
  5455      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5456      // Since we bypassed the compiler's escape analysis, indicate that n
  5457      // must live until the use above.
  5458      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5459      return length, err
  5460  }
  5461  
  5462  // CopyOut implements marshal.Marshallable.CopyOut.
  5463  func (n *NVOS32Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5464      return n.CopyOutN(cc, addr, n.SizeBytes())
  5465  }
  5466  
  5467  // CopyInN implements marshal.Marshallable.CopyInN.
  5468  func (n *NVOS32Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5469      if !n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  5470          // Type NVOS32Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5471          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5472          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5473          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5474          // partially unmarshalled struct.
  5475          n.UnmarshalBytes(buf) // escapes: fallback.
  5476          return length, err
  5477      }
  5478  
  5479      // Construct a slice backed by dst's underlying memory.
  5480      var buf []byte
  5481      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5482      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5483      hdr.Len = n.SizeBytes()
  5484      hdr.Cap = n.SizeBytes()
  5485  
  5486      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5487      // Since we bypassed the compiler's escape analysis, indicate that n
  5488      // must live until the use above.
  5489      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5490      return length, err
  5491  }
  5492  
  5493  // CopyIn implements marshal.Marshallable.CopyIn.
  5494  func (n *NVOS32Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5495      return n.CopyInN(cc, addr, n.SizeBytes())
  5496  }
  5497  
  5498  // WriteTo implements io.WriterTo.WriteTo.
  5499  func (n *NVOS32Parameters) WriteTo(writer io.Writer) (int64, error) {
  5500      if !n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  5501          // Type NVOS32Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5502          buf := make([]byte, n.SizeBytes())
  5503          n.MarshalBytes(buf)
  5504          length, err := writer.Write(buf)
  5505          return int64(length), err
  5506      }
  5507  
  5508      // Construct a slice backed by dst's underlying memory.
  5509      var buf []byte
  5510      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5511      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5512      hdr.Len = n.SizeBytes()
  5513      hdr.Cap = n.SizeBytes()
  5514  
  5515      length, err := writer.Write(buf)
  5516      // Since we bypassed the compiler's escape analysis, indicate that n
  5517      // must live until the use above.
  5518      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5519      return int64(length), err
  5520  }
  5521  
  5522  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5523  func (n *NVOS33Parameters) SizeBytes() int {
  5524      return 24 +
  5525          (*Handle)(nil).SizeBytes() +
  5526          (*Handle)(nil).SizeBytes() +
  5527          (*Handle)(nil).SizeBytes() +
  5528          1*4 +
  5529          (*P64)(nil).SizeBytes()
  5530  }
  5531  
  5532  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5533  func (n *NVOS33Parameters) MarshalBytes(dst []byte) []byte {
  5534      dst = n.HClient.MarshalUnsafe(dst)
  5535      dst = n.HDevice.MarshalUnsafe(dst)
  5536      dst = n.HMemory.MarshalUnsafe(dst)
  5537      for idx := 0; idx < 4; idx++ {
  5538          dst[0] = byte(n.Pad0[idx])
  5539          dst = dst[1:]
  5540      }
  5541      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Offset))
  5542      dst = dst[8:]
  5543      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Length))
  5544      dst = dst[8:]
  5545      dst = n.PLinearAddress.MarshalUnsafe(dst)
  5546      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5547      dst = dst[4:]
  5548      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  5549      dst = dst[4:]
  5550      return dst
  5551  }
  5552  
  5553  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5554  func (n *NVOS33Parameters) UnmarshalBytes(src []byte) []byte {
  5555      src = n.HClient.UnmarshalUnsafe(src)
  5556      src = n.HDevice.UnmarshalUnsafe(src)
  5557      src = n.HMemory.UnmarshalUnsafe(src)
  5558      for idx := 0; idx < 4; idx++ {
  5559          n.Pad0[idx] = src[0]
  5560          src = src[1:]
  5561      }
  5562      n.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  5563      src = src[8:]
  5564      n.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  5565      src = src[8:]
  5566      src = n.PLinearAddress.UnmarshalUnsafe(src)
  5567      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5568      src = src[4:]
  5569      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5570      src = src[4:]
  5571      return src
  5572  }
  5573  
  5574  // Packed implements marshal.Marshallable.Packed.
  5575  //go:nosplit
  5576  func (n *NVOS33Parameters) Packed() bool {
  5577      return n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed()
  5578  }
  5579  
  5580  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5581  func (n *NVOS33Parameters) MarshalUnsafe(dst []byte) []byte {
  5582      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5583          size := n.SizeBytes()
  5584          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5585          return dst[size:]
  5586      }
  5587      // Type NVOS33Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5588      return n.MarshalBytes(dst)
  5589  }
  5590  
  5591  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5592  func (n *NVOS33Parameters) UnmarshalUnsafe(src []byte) []byte {
  5593      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5594          size := n.SizeBytes()
  5595          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5596          return src[size:]
  5597      }
  5598      // Type NVOS33Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5599      return n.UnmarshalBytes(src)
  5600  }
  5601  
  5602  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5603  func (n *NVOS33Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5604      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5605          // Type NVOS33Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5606          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5607          n.MarshalBytes(buf) // escapes: fallback.
  5608          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5609      }
  5610  
  5611      // Construct a slice backed by dst's underlying memory.
  5612      var buf []byte
  5613      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5614      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5615      hdr.Len = n.SizeBytes()
  5616      hdr.Cap = n.SizeBytes()
  5617  
  5618      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5619      // Since we bypassed the compiler's escape analysis, indicate that n
  5620      // must live until the use above.
  5621      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5622      return length, err
  5623  }
  5624  
  5625  // CopyOut implements marshal.Marshallable.CopyOut.
  5626  func (n *NVOS33Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5627      return n.CopyOutN(cc, addr, n.SizeBytes())
  5628  }
  5629  
  5630  // CopyInN implements marshal.Marshallable.CopyInN.
  5631  func (n *NVOS33Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5632      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5633          // Type NVOS33Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5634          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5635          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5636          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5637          // partially unmarshalled struct.
  5638          n.UnmarshalBytes(buf) // escapes: fallback.
  5639          return length, err
  5640      }
  5641  
  5642      // Construct a slice backed by dst's underlying memory.
  5643      var buf []byte
  5644      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5645      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5646      hdr.Len = n.SizeBytes()
  5647      hdr.Cap = n.SizeBytes()
  5648  
  5649      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5650      // Since we bypassed the compiler's escape analysis, indicate that n
  5651      // must live until the use above.
  5652      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5653      return length, err
  5654  }
  5655  
  5656  // CopyIn implements marshal.Marshallable.CopyIn.
  5657  func (n *NVOS33Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5658      return n.CopyInN(cc, addr, n.SizeBytes())
  5659  }
  5660  
  5661  // WriteTo implements io.WriterTo.WriteTo.
  5662  func (n *NVOS33Parameters) WriteTo(writer io.Writer) (int64, error) {
  5663      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5664          // Type NVOS33Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5665          buf := make([]byte, n.SizeBytes())
  5666          n.MarshalBytes(buf)
  5667          length, err := writer.Write(buf)
  5668          return int64(length), err
  5669      }
  5670  
  5671      // Construct a slice backed by dst's underlying memory.
  5672      var buf []byte
  5673      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5674      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5675      hdr.Len = n.SizeBytes()
  5676      hdr.Cap = n.SizeBytes()
  5677  
  5678      length, err := writer.Write(buf)
  5679      // Since we bypassed the compiler's escape analysis, indicate that n
  5680      // must live until the use above.
  5681      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5682      return int64(length), err
  5683  }
  5684  
  5685  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5686  func (n *NVOS34Parameters) SizeBytes() int {
  5687      return 8 +
  5688          (*Handle)(nil).SizeBytes() +
  5689          (*Handle)(nil).SizeBytes() +
  5690          (*Handle)(nil).SizeBytes() +
  5691          1*4 +
  5692          (*P64)(nil).SizeBytes()
  5693  }
  5694  
  5695  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5696  func (n *NVOS34Parameters) MarshalBytes(dst []byte) []byte {
  5697      dst = n.HClient.MarshalUnsafe(dst)
  5698      dst = n.HDevice.MarshalUnsafe(dst)
  5699      dst = n.HMemory.MarshalUnsafe(dst)
  5700      for idx := 0; idx < 4; idx++ {
  5701          dst[0] = byte(n.Pad0[idx])
  5702          dst = dst[1:]
  5703      }
  5704      dst = n.PLinearAddress.MarshalUnsafe(dst)
  5705      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5706      dst = dst[4:]
  5707      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  5708      dst = dst[4:]
  5709      return dst
  5710  }
  5711  
  5712  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5713  func (n *NVOS34Parameters) UnmarshalBytes(src []byte) []byte {
  5714      src = n.HClient.UnmarshalUnsafe(src)
  5715      src = n.HDevice.UnmarshalUnsafe(src)
  5716      src = n.HMemory.UnmarshalUnsafe(src)
  5717      for idx := 0; idx < 4; idx++ {
  5718          n.Pad0[idx] = src[0]
  5719          src = src[1:]
  5720      }
  5721      src = n.PLinearAddress.UnmarshalUnsafe(src)
  5722      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5723      src = src[4:]
  5724      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5725      src = src[4:]
  5726      return src
  5727  }
  5728  
  5729  // Packed implements marshal.Marshallable.Packed.
  5730  //go:nosplit
  5731  func (n *NVOS34Parameters) Packed() bool {
  5732      return n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed()
  5733  }
  5734  
  5735  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5736  func (n *NVOS34Parameters) MarshalUnsafe(dst []byte) []byte {
  5737      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5738          size := n.SizeBytes()
  5739          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5740          return dst[size:]
  5741      }
  5742      // Type NVOS34Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5743      return n.MarshalBytes(dst)
  5744  }
  5745  
  5746  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5747  func (n *NVOS34Parameters) UnmarshalUnsafe(src []byte) []byte {
  5748      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5749          size := n.SizeBytes()
  5750          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5751          return src[size:]
  5752      }
  5753      // Type NVOS34Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5754      return n.UnmarshalBytes(src)
  5755  }
  5756  
  5757  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5758  func (n *NVOS34Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5759      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5760          // Type NVOS34Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5761          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5762          n.MarshalBytes(buf) // escapes: fallback.
  5763          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5764      }
  5765  
  5766      // Construct a slice backed by dst's underlying memory.
  5767      var buf []byte
  5768      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5769      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5770      hdr.Len = n.SizeBytes()
  5771      hdr.Cap = n.SizeBytes()
  5772  
  5773      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5774      // Since we bypassed the compiler's escape analysis, indicate that n
  5775      // must live until the use above.
  5776      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5777      return length, err
  5778  }
  5779  
  5780  // CopyOut implements marshal.Marshallable.CopyOut.
  5781  func (n *NVOS34Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5782      return n.CopyOutN(cc, addr, n.SizeBytes())
  5783  }
  5784  
  5785  // CopyInN implements marshal.Marshallable.CopyInN.
  5786  func (n *NVOS34Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5787      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5788          // Type NVOS34Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5789          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5790          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5791          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5792          // partially unmarshalled struct.
  5793          n.UnmarshalBytes(buf) // escapes: fallback.
  5794          return length, err
  5795      }
  5796  
  5797      // Construct a slice backed by dst's underlying memory.
  5798      var buf []byte
  5799      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5800      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5801      hdr.Len = n.SizeBytes()
  5802      hdr.Cap = n.SizeBytes()
  5803  
  5804      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5805      // Since we bypassed the compiler's escape analysis, indicate that n
  5806      // must live until the use above.
  5807      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5808      return length, err
  5809  }
  5810  
  5811  // CopyIn implements marshal.Marshallable.CopyIn.
  5812  func (n *NVOS34Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5813      return n.CopyInN(cc, addr, n.SizeBytes())
  5814  }
  5815  
  5816  // WriteTo implements io.WriterTo.WriteTo.
  5817  func (n *NVOS34Parameters) WriteTo(writer io.Writer) (int64, error) {
  5818      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5819          // Type NVOS34Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5820          buf := make([]byte, n.SizeBytes())
  5821          n.MarshalBytes(buf)
  5822          length, err := writer.Write(buf)
  5823          return int64(length), err
  5824      }
  5825  
  5826      // Construct a slice backed by dst's underlying memory.
  5827      var buf []byte
  5828      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5829      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5830      hdr.Len = n.SizeBytes()
  5831      hdr.Cap = n.SizeBytes()
  5832  
  5833      length, err := writer.Write(buf)
  5834      // Since we bypassed the compiler's escape analysis, indicate that n
  5835      // must live until the use above.
  5836      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5837      return int64(length), err
  5838  }
  5839  
  5840  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5841  func (n *NVOS54Parameters) SizeBytes() int {
  5842      return 16 +
  5843          (*Handle)(nil).SizeBytes() +
  5844          (*Handle)(nil).SizeBytes() +
  5845          (*P64)(nil).SizeBytes()
  5846  }
  5847  
  5848  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5849  func (n *NVOS54Parameters) MarshalBytes(dst []byte) []byte {
  5850      dst = n.HClient.MarshalUnsafe(dst)
  5851      dst = n.HObject.MarshalUnsafe(dst)
  5852      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Cmd))
  5853      dst = dst[4:]
  5854      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  5855      dst = dst[4:]
  5856      dst = n.Params.MarshalUnsafe(dst)
  5857      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ParamsSize))
  5858      dst = dst[4:]
  5859      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5860      dst = dst[4:]
  5861      return dst
  5862  }
  5863  
  5864  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5865  func (n *NVOS54Parameters) UnmarshalBytes(src []byte) []byte {
  5866      src = n.HClient.UnmarshalUnsafe(src)
  5867      src = n.HObject.UnmarshalUnsafe(src)
  5868      n.Cmd = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5869      src = src[4:]
  5870      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5871      src = src[4:]
  5872      src = n.Params.UnmarshalUnsafe(src)
  5873      n.ParamsSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5874      src = src[4:]
  5875      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5876      src = src[4:]
  5877      return src
  5878  }
  5879  
  5880  // Packed implements marshal.Marshallable.Packed.
  5881  //go:nosplit
  5882  func (n *NVOS54Parameters) Packed() bool {
  5883      return n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed()
  5884  }
  5885  
  5886  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5887  func (n *NVOS54Parameters) MarshalUnsafe(dst []byte) []byte {
  5888      if n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5889          size := n.SizeBytes()
  5890          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5891          return dst[size:]
  5892      }
  5893      // Type NVOS54Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5894      return n.MarshalBytes(dst)
  5895  }
  5896  
  5897  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5898  func (n *NVOS54Parameters) UnmarshalUnsafe(src []byte) []byte {
  5899      if n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5900          size := n.SizeBytes()
  5901          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5902          return src[size:]
  5903      }
  5904      // Type NVOS54Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5905      return n.UnmarshalBytes(src)
  5906  }
  5907  
  5908  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5909  func (n *NVOS54Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5910      if !n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5911          // Type NVOS54Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5912          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5913          n.MarshalBytes(buf) // escapes: fallback.
  5914          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5915      }
  5916  
  5917      // Construct a slice backed by dst's underlying memory.
  5918      var buf []byte
  5919      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5920      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5921      hdr.Len = n.SizeBytes()
  5922      hdr.Cap = n.SizeBytes()
  5923  
  5924      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5925      // Since we bypassed the compiler's escape analysis, indicate that n
  5926      // must live until the use above.
  5927      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5928      return length, err
  5929  }
  5930  
  5931  // CopyOut implements marshal.Marshallable.CopyOut.
  5932  func (n *NVOS54Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5933      return n.CopyOutN(cc, addr, n.SizeBytes())
  5934  }
  5935  
  5936  // CopyInN implements marshal.Marshallable.CopyInN.
  5937  func (n *NVOS54Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5938      if !n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5939          // Type NVOS54Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5940          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5941          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5942          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5943          // partially unmarshalled struct.
  5944          n.UnmarshalBytes(buf) // escapes: fallback.
  5945          return length, err
  5946      }
  5947  
  5948      // Construct a slice backed by dst's underlying memory.
  5949      var buf []byte
  5950      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5951      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5952      hdr.Len = n.SizeBytes()
  5953      hdr.Cap = n.SizeBytes()
  5954  
  5955      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5956      // Since we bypassed the compiler's escape analysis, indicate that n
  5957      // must live until the use above.
  5958      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5959      return length, err
  5960  }
  5961  
  5962  // CopyIn implements marshal.Marshallable.CopyIn.
  5963  func (n *NVOS54Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5964      return n.CopyInN(cc, addr, n.SizeBytes())
  5965  }
  5966  
  5967  // WriteTo implements io.WriterTo.WriteTo.
  5968  func (n *NVOS54Parameters) WriteTo(writer io.Writer) (int64, error) {
  5969      if !n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5970          // Type NVOS54Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5971          buf := make([]byte, n.SizeBytes())
  5972          n.MarshalBytes(buf)
  5973          length, err := writer.Write(buf)
  5974          return int64(length), err
  5975      }
  5976  
  5977      // Construct a slice backed by dst's underlying memory.
  5978      var buf []byte
  5979      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5980      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5981      hdr.Len = n.SizeBytes()
  5982      hdr.Cap = n.SizeBytes()
  5983  
  5984      length, err := writer.Write(buf)
  5985      // Since we bypassed the compiler's escape analysis, indicate that n
  5986      // must live until the use above.
  5987      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5988      return int64(length), err
  5989  }
  5990  
  5991  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5992  func (n *NVOS55Parameters) SizeBytes() int {
  5993      return 8 +
  5994          (*Handle)(nil).SizeBytes() +
  5995          (*Handle)(nil).SizeBytes() +
  5996          (*Handle)(nil).SizeBytes() +
  5997          (*Handle)(nil).SizeBytes() +
  5998          (*Handle)(nil).SizeBytes()
  5999  }
  6000  
  6001  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6002  func (n *NVOS55Parameters) MarshalBytes(dst []byte) []byte {
  6003      dst = n.HClient.MarshalUnsafe(dst)
  6004      dst = n.HParent.MarshalUnsafe(dst)
  6005      dst = n.HObject.MarshalUnsafe(dst)
  6006      dst = n.HClientSrc.MarshalUnsafe(dst)
  6007      dst = n.HObjectSrc.MarshalUnsafe(dst)
  6008      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  6009      dst = dst[4:]
  6010      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  6011      dst = dst[4:]
  6012      return dst
  6013  }
  6014  
  6015  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6016  func (n *NVOS55Parameters) UnmarshalBytes(src []byte) []byte {
  6017      src = n.HClient.UnmarshalUnsafe(src)
  6018      src = n.HParent.UnmarshalUnsafe(src)
  6019      src = n.HObject.UnmarshalUnsafe(src)
  6020      src = n.HClientSrc.UnmarshalUnsafe(src)
  6021      src = n.HObjectSrc.UnmarshalUnsafe(src)
  6022      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6023      src = src[4:]
  6024      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6025      src = src[4:]
  6026      return src
  6027  }
  6028  
  6029  // Packed implements marshal.Marshallable.Packed.
  6030  //go:nosplit
  6031  func (n *NVOS55Parameters) Packed() bool {
  6032      return n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed()
  6033  }
  6034  
  6035  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6036  func (n *NVOS55Parameters) MarshalUnsafe(dst []byte) []byte {
  6037      if n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  6038          size := n.SizeBytes()
  6039          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  6040          return dst[size:]
  6041      }
  6042      // Type NVOS55Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  6043      return n.MarshalBytes(dst)
  6044  }
  6045  
  6046  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6047  func (n *NVOS55Parameters) UnmarshalUnsafe(src []byte) []byte {
  6048      if n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  6049          size := n.SizeBytes()
  6050          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  6051          return src[size:]
  6052      }
  6053      // Type NVOS55Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  6054      return n.UnmarshalBytes(src)
  6055  }
  6056  
  6057  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6058  func (n *NVOS55Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6059      if !n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  6060          // Type NVOS55Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6061          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6062          n.MarshalBytes(buf) // escapes: fallback.
  6063          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6064      }
  6065  
  6066      // Construct a slice backed by dst's underlying memory.
  6067      var buf []byte
  6068      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6069      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6070      hdr.Len = n.SizeBytes()
  6071      hdr.Cap = n.SizeBytes()
  6072  
  6073      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6074      // Since we bypassed the compiler's escape analysis, indicate that n
  6075      // must live until the use above.
  6076      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6077      return length, err
  6078  }
  6079  
  6080  // CopyOut implements marshal.Marshallable.CopyOut.
  6081  func (n *NVOS55Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6082      return n.CopyOutN(cc, addr, n.SizeBytes())
  6083  }
  6084  
  6085  // CopyInN implements marshal.Marshallable.CopyInN.
  6086  func (n *NVOS55Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6087      if !n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  6088          // Type NVOS55Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  6089          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6090          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6091          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  6092          // partially unmarshalled struct.
  6093          n.UnmarshalBytes(buf) // escapes: fallback.
  6094          return length, err
  6095      }
  6096  
  6097      // Construct a slice backed by dst's underlying memory.
  6098      var buf []byte
  6099      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6100      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6101      hdr.Len = n.SizeBytes()
  6102      hdr.Cap = n.SizeBytes()
  6103  
  6104      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6105      // Since we bypassed the compiler's escape analysis, indicate that n
  6106      // must live until the use above.
  6107      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6108      return length, err
  6109  }
  6110  
  6111  // CopyIn implements marshal.Marshallable.CopyIn.
  6112  func (n *NVOS55Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6113      return n.CopyInN(cc, addr, n.SizeBytes())
  6114  }
  6115  
  6116  // WriteTo implements io.WriterTo.WriteTo.
  6117  func (n *NVOS55Parameters) WriteTo(writer io.Writer) (int64, error) {
  6118      if !n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  6119          // Type NVOS55Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6120          buf := make([]byte, n.SizeBytes())
  6121          n.MarshalBytes(buf)
  6122          length, err := writer.Write(buf)
  6123          return int64(length), err
  6124      }
  6125  
  6126      // Construct a slice backed by dst's underlying memory.
  6127      var buf []byte
  6128      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6129      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6130      hdr.Len = n.SizeBytes()
  6131      hdr.Cap = n.SizeBytes()
  6132  
  6133      length, err := writer.Write(buf)
  6134      // Since we bypassed the compiler's escape analysis, indicate that n
  6135      // must live until the use above.
  6136      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6137      return int64(length), err
  6138  }
  6139  
  6140  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6141  func (n *NVOS56Parameters) SizeBytes() int {
  6142      return 4 +
  6143          (*Handle)(nil).SizeBytes() +
  6144          (*Handle)(nil).SizeBytes() +
  6145          (*Handle)(nil).SizeBytes() +
  6146          1*4 +
  6147          (*P64)(nil).SizeBytes() +
  6148          (*P64)(nil).SizeBytes() +
  6149          1*4
  6150  }
  6151  
  6152  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6153  func (n *NVOS56Parameters) MarshalBytes(dst []byte) []byte {
  6154      dst = n.HClient.MarshalUnsafe(dst)
  6155      dst = n.HDevice.MarshalUnsafe(dst)
  6156      dst = n.HMemory.MarshalUnsafe(dst)
  6157      for idx := 0; idx < 4; idx++ {
  6158          dst[0] = byte(n.Pad0[idx])
  6159          dst = dst[1:]
  6160      }
  6161      dst = n.POldCPUAddress.MarshalUnsafe(dst)
  6162      dst = n.PNewCPUAddress.MarshalUnsafe(dst)
  6163      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  6164      dst = dst[4:]
  6165      for idx := 0; idx < 4; idx++ {
  6166          dst[0] = byte(n.Pad1[idx])
  6167          dst = dst[1:]
  6168      }
  6169      return dst
  6170  }
  6171  
  6172  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6173  func (n *NVOS56Parameters) UnmarshalBytes(src []byte) []byte {
  6174      src = n.HClient.UnmarshalUnsafe(src)
  6175      src = n.HDevice.UnmarshalUnsafe(src)
  6176      src = n.HMemory.UnmarshalUnsafe(src)
  6177      for idx := 0; idx < 4; idx++ {
  6178          n.Pad0[idx] = src[0]
  6179          src = src[1:]
  6180      }
  6181      src = n.POldCPUAddress.UnmarshalUnsafe(src)
  6182      src = n.PNewCPUAddress.UnmarshalUnsafe(src)
  6183      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6184      src = src[4:]
  6185      for idx := 0; idx < 4; idx++ {
  6186          n.Pad1[idx] = src[0]
  6187          src = src[1:]
  6188      }
  6189      return src
  6190  }
  6191  
  6192  // Packed implements marshal.Marshallable.Packed.
  6193  //go:nosplit
  6194  func (n *NVOS56Parameters) Packed() bool {
  6195      return n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed()
  6196  }
  6197  
  6198  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6199  func (n *NVOS56Parameters) MarshalUnsafe(dst []byte) []byte {
  6200      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  6201          size := n.SizeBytes()
  6202          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  6203          return dst[size:]
  6204      }
  6205      // Type NVOS56Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  6206      return n.MarshalBytes(dst)
  6207  }
  6208  
  6209  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6210  func (n *NVOS56Parameters) UnmarshalUnsafe(src []byte) []byte {
  6211      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  6212          size := n.SizeBytes()
  6213          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  6214          return src[size:]
  6215      }
  6216      // Type NVOS56Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  6217      return n.UnmarshalBytes(src)
  6218  }
  6219  
  6220  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6221  func (n *NVOS56Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6222      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  6223          // Type NVOS56Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6224          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6225          n.MarshalBytes(buf) // escapes: fallback.
  6226          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6227      }
  6228  
  6229      // Construct a slice backed by dst's underlying memory.
  6230      var buf []byte
  6231      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6232      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6233      hdr.Len = n.SizeBytes()
  6234      hdr.Cap = n.SizeBytes()
  6235  
  6236      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6237      // Since we bypassed the compiler's escape analysis, indicate that n
  6238      // must live until the use above.
  6239      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6240      return length, err
  6241  }
  6242  
  6243  // CopyOut implements marshal.Marshallable.CopyOut.
  6244  func (n *NVOS56Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6245      return n.CopyOutN(cc, addr, n.SizeBytes())
  6246  }
  6247  
  6248  // CopyInN implements marshal.Marshallable.CopyInN.
  6249  func (n *NVOS56Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6250      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  6251          // Type NVOS56Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  6252          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6253          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6254          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  6255          // partially unmarshalled struct.
  6256          n.UnmarshalBytes(buf) // escapes: fallback.
  6257          return length, err
  6258      }
  6259  
  6260      // Construct a slice backed by dst's underlying memory.
  6261      var buf []byte
  6262      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6263      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6264      hdr.Len = n.SizeBytes()
  6265      hdr.Cap = n.SizeBytes()
  6266  
  6267      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6268      // Since we bypassed the compiler's escape analysis, indicate that n
  6269      // must live until the use above.
  6270      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6271      return length, err
  6272  }
  6273  
  6274  // CopyIn implements marshal.Marshallable.CopyIn.
  6275  func (n *NVOS56Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6276      return n.CopyInN(cc, addr, n.SizeBytes())
  6277  }
  6278  
  6279  // WriteTo implements io.WriterTo.WriteTo.
  6280  func (n *NVOS56Parameters) WriteTo(writer io.Writer) (int64, error) {
  6281      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  6282          // Type NVOS56Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6283          buf := make([]byte, n.SizeBytes())
  6284          n.MarshalBytes(buf)
  6285          length, err := writer.Write(buf)
  6286          return int64(length), err
  6287      }
  6288  
  6289      // Construct a slice backed by dst's underlying memory.
  6290      var buf []byte
  6291      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6292      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6293      hdr.Len = n.SizeBytes()
  6294      hdr.Cap = n.SizeBytes()
  6295  
  6296      length, err := writer.Write(buf)
  6297      // Since we bypassed the compiler's escape analysis, indicate that n
  6298      // must live until the use above.
  6299      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6300      return int64(length), err
  6301  }
  6302  
  6303  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6304  func (n *NVOS57Parameters) SizeBytes() int {
  6305      return 4 +
  6306          (*Handle)(nil).SizeBytes() +
  6307          (*Handle)(nil).SizeBytes() +
  6308          (*RS_SHARE_POLICY)(nil).SizeBytes()
  6309  }
  6310  
  6311  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6312  func (n *NVOS57Parameters) MarshalBytes(dst []byte) []byte {
  6313      dst = n.HClient.MarshalUnsafe(dst)
  6314      dst = n.HObject.MarshalUnsafe(dst)
  6315      dst = n.SharePolicy.MarshalUnsafe(dst)
  6316      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  6317      dst = dst[4:]
  6318      return dst
  6319  }
  6320  
  6321  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6322  func (n *NVOS57Parameters) UnmarshalBytes(src []byte) []byte {
  6323      src = n.HClient.UnmarshalUnsafe(src)
  6324      src = n.HObject.UnmarshalUnsafe(src)
  6325      src = n.SharePolicy.UnmarshalUnsafe(src)
  6326      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6327      src = src[4:]
  6328      return src
  6329  }
  6330  
  6331  // Packed implements marshal.Marshallable.Packed.
  6332  //go:nosplit
  6333  func (n *NVOS57Parameters) Packed() bool {
  6334      return n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed()
  6335  }
  6336  
  6337  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6338  func (n *NVOS57Parameters) MarshalUnsafe(dst []byte) []byte {
  6339      if n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  6340          size := n.SizeBytes()
  6341          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  6342          return dst[size:]
  6343      }
  6344      // Type NVOS57Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  6345      return n.MarshalBytes(dst)
  6346  }
  6347  
  6348  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6349  func (n *NVOS57Parameters) UnmarshalUnsafe(src []byte) []byte {
  6350      if n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  6351          size := n.SizeBytes()
  6352          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  6353          return src[size:]
  6354      }
  6355      // Type NVOS57Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  6356      return n.UnmarshalBytes(src)
  6357  }
  6358  
  6359  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6360  func (n *NVOS57Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6361      if !n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  6362          // Type NVOS57Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6363          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6364          n.MarshalBytes(buf) // escapes: fallback.
  6365          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6366      }
  6367  
  6368      // Construct a slice backed by dst's underlying memory.
  6369      var buf []byte
  6370      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6371      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6372      hdr.Len = n.SizeBytes()
  6373      hdr.Cap = n.SizeBytes()
  6374  
  6375      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6376      // Since we bypassed the compiler's escape analysis, indicate that n
  6377      // must live until the use above.
  6378      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6379      return length, err
  6380  }
  6381  
  6382  // CopyOut implements marshal.Marshallable.CopyOut.
  6383  func (n *NVOS57Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6384      return n.CopyOutN(cc, addr, n.SizeBytes())
  6385  }
  6386  
  6387  // CopyInN implements marshal.Marshallable.CopyInN.
  6388  func (n *NVOS57Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6389      if !n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  6390          // Type NVOS57Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  6391          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6392          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6393          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  6394          // partially unmarshalled struct.
  6395          n.UnmarshalBytes(buf) // escapes: fallback.
  6396          return length, err
  6397      }
  6398  
  6399      // Construct a slice backed by dst's underlying memory.
  6400      var buf []byte
  6401      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6402      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6403      hdr.Len = n.SizeBytes()
  6404      hdr.Cap = n.SizeBytes()
  6405  
  6406      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6407      // Since we bypassed the compiler's escape analysis, indicate that n
  6408      // must live until the use above.
  6409      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6410      return length, err
  6411  }
  6412  
  6413  // CopyIn implements marshal.Marshallable.CopyIn.
  6414  func (n *NVOS57Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6415      return n.CopyInN(cc, addr, n.SizeBytes())
  6416  }
  6417  
  6418  // WriteTo implements io.WriterTo.WriteTo.
  6419  func (n *NVOS57Parameters) WriteTo(writer io.Writer) (int64, error) {
  6420      if !n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  6421          // Type NVOS57Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6422          buf := make([]byte, n.SizeBytes())
  6423          n.MarshalBytes(buf)
  6424          length, err := writer.Write(buf)
  6425          return int64(length), err
  6426      }
  6427  
  6428      // Construct a slice backed by dst's underlying memory.
  6429      var buf []byte
  6430      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6431      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6432      hdr.Len = n.SizeBytes()
  6433      hdr.Cap = n.SizeBytes()
  6434  
  6435      length, err := writer.Write(buf)
  6436      // Since we bypassed the compiler's escape analysis, indicate that n
  6437      // must live until the use above.
  6438      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6439      return int64(length), err
  6440  }
  6441  
  6442  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6443  func (n *NVOS64Parameters) SizeBytes() int {
  6444      return 16 +
  6445          (*Handle)(nil).SizeBytes() +
  6446          (*Handle)(nil).SizeBytes() +
  6447          (*Handle)(nil).SizeBytes() +
  6448          (*ClassID)(nil).SizeBytes() +
  6449          (*P64)(nil).SizeBytes() +
  6450          (*P64)(nil).SizeBytes()
  6451  }
  6452  
  6453  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6454  func (n *NVOS64Parameters) MarshalBytes(dst []byte) []byte {
  6455      dst = n.HRoot.MarshalUnsafe(dst)
  6456      dst = n.HObjectParent.MarshalUnsafe(dst)
  6457      dst = n.HObjectNew.MarshalUnsafe(dst)
  6458      dst = n.HClass.MarshalUnsafe(dst)
  6459      dst = n.PAllocParms.MarshalUnsafe(dst)
  6460      dst = n.PRightsRequested.MarshalUnsafe(dst)
  6461      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ParamsSize))
  6462      dst = dst[4:]
  6463      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  6464      dst = dst[4:]
  6465      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  6466      dst = dst[4:]
  6467      // Padding: dst[:sizeof(uint32)] ~= uint32(0)
  6468      dst = dst[4:]
  6469      return dst
  6470  }
  6471  
  6472  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6473  func (n *NVOS64Parameters) UnmarshalBytes(src []byte) []byte {
  6474      src = n.HRoot.UnmarshalUnsafe(src)
  6475      src = n.HObjectParent.UnmarshalUnsafe(src)
  6476      src = n.HObjectNew.UnmarshalUnsafe(src)
  6477      src = n.HClass.UnmarshalUnsafe(src)
  6478      src = n.PAllocParms.UnmarshalUnsafe(src)
  6479      src = n.PRightsRequested.UnmarshalUnsafe(src)
  6480      n.ParamsSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6481      src = src[4:]
  6482      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6483      src = src[4:]
  6484      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6485      src = src[4:]
  6486      // Padding: var _ uint32 ~= src[:sizeof(uint32)]
  6487      src = src[4:]
  6488      return src
  6489  }
  6490  
  6491  // Packed implements marshal.Marshallable.Packed.
  6492  //go:nosplit
  6493  func (n *NVOS64Parameters) Packed() bool {
  6494      return n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed()
  6495  }
  6496  
  6497  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6498  func (n *NVOS64Parameters) MarshalUnsafe(dst []byte) []byte {
  6499      if n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6500          size := n.SizeBytes()
  6501          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  6502          return dst[size:]
  6503      }
  6504      // Type NVOS64Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  6505      return n.MarshalBytes(dst)
  6506  }
  6507  
  6508  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6509  func (n *NVOS64Parameters) UnmarshalUnsafe(src []byte) []byte {
  6510      if n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6511          size := n.SizeBytes()
  6512          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  6513          return src[size:]
  6514      }
  6515      // Type NVOS64Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  6516      return n.UnmarshalBytes(src)
  6517  }
  6518  
  6519  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6520  func (n *NVOS64Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6521      if !n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6522          // Type NVOS64Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6523          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6524          n.MarshalBytes(buf) // escapes: fallback.
  6525          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6526      }
  6527  
  6528      // Construct a slice backed by dst's underlying memory.
  6529      var buf []byte
  6530      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6531      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6532      hdr.Len = n.SizeBytes()
  6533      hdr.Cap = n.SizeBytes()
  6534  
  6535      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6536      // Since we bypassed the compiler's escape analysis, indicate that n
  6537      // must live until the use above.
  6538      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6539      return length, err
  6540  }
  6541  
  6542  // CopyOut implements marshal.Marshallable.CopyOut.
  6543  func (n *NVOS64Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6544      return n.CopyOutN(cc, addr, n.SizeBytes())
  6545  }
  6546  
  6547  // CopyInN implements marshal.Marshallable.CopyInN.
  6548  func (n *NVOS64Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6549      if !n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6550          // Type NVOS64Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  6551          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6552          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6553          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  6554          // partially unmarshalled struct.
  6555          n.UnmarshalBytes(buf) // escapes: fallback.
  6556          return length, err
  6557      }
  6558  
  6559      // Construct a slice backed by dst's underlying memory.
  6560      var buf []byte
  6561      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6562      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6563      hdr.Len = n.SizeBytes()
  6564      hdr.Cap = n.SizeBytes()
  6565  
  6566      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6567      // Since we bypassed the compiler's escape analysis, indicate that n
  6568      // must live until the use above.
  6569      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6570      return length, err
  6571  }
  6572  
  6573  // CopyIn implements marshal.Marshallable.CopyIn.
  6574  func (n *NVOS64Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6575      return n.CopyInN(cc, addr, n.SizeBytes())
  6576  }
  6577  
  6578  // WriteTo implements io.WriterTo.WriteTo.
  6579  func (n *NVOS64Parameters) WriteTo(writer io.Writer) (int64, error) {
  6580      if !n.HClass.Packed() && n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6581          // Type NVOS64Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6582          buf := make([]byte, n.SizeBytes())
  6583          n.MarshalBytes(buf)
  6584          length, err := writer.Write(buf)
  6585          return int64(length), err
  6586      }
  6587  
  6588      // Construct a slice backed by dst's underlying memory.
  6589      var buf []byte
  6590      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6591      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6592      hdr.Len = n.SizeBytes()
  6593      hdr.Cap = n.SizeBytes()
  6594  
  6595      length, err := writer.Write(buf)
  6596      // Since we bypassed the compiler's escape analysis, indicate that n
  6597      // must live until the use above.
  6598      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6599      return int64(length), err
  6600  }
  6601  
  6602  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6603  func (r *RMAPIVersion) SizeBytes() int {
  6604      return 8 +
  6605          1*64
  6606  }
  6607  
  6608  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6609  func (r *RMAPIVersion) MarshalBytes(dst []byte) []byte {
  6610      hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Cmd))
  6611      dst = dst[4:]
  6612      hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Reply))
  6613      dst = dst[4:]
  6614      for idx := 0; idx < 64; idx++ {
  6615          dst[0] = byte(r.VersionString[idx])
  6616          dst = dst[1:]
  6617      }
  6618      return dst
  6619  }
  6620  
  6621  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6622  func (r *RMAPIVersion) UnmarshalBytes(src []byte) []byte {
  6623      r.Cmd = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6624      src = src[4:]
  6625      r.Reply = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6626      src = src[4:]
  6627      for idx := 0; idx < 64; idx++ {
  6628          r.VersionString[idx] = src[0]
  6629          src = src[1:]
  6630      }
  6631      return src
  6632  }
  6633  
  6634  // Packed implements marshal.Marshallable.Packed.
  6635  //go:nosplit
  6636  func (r *RMAPIVersion) Packed() bool {
  6637      return true
  6638  }
  6639  
  6640  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6641  func (r *RMAPIVersion) MarshalUnsafe(dst []byte) []byte {
  6642      size := r.SizeBytes()
  6643      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size))
  6644      return dst[size:]
  6645  }
  6646  
  6647  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6648  func (r *RMAPIVersion) UnmarshalUnsafe(src []byte) []byte {
  6649      size := r.SizeBytes()
  6650      gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size))
  6651      return src[size:]
  6652  }
  6653  
  6654  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6655  func (r *RMAPIVersion) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6656      // Construct a slice backed by dst's underlying memory.
  6657      var buf []byte
  6658      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6659      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6660      hdr.Len = r.SizeBytes()
  6661      hdr.Cap = r.SizeBytes()
  6662  
  6663      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6664      // Since we bypassed the compiler's escape analysis, indicate that r
  6665      // must live until the use above.
  6666      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6667      return length, err
  6668  }
  6669  
  6670  // CopyOut implements marshal.Marshallable.CopyOut.
  6671  func (r *RMAPIVersion) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6672      return r.CopyOutN(cc, addr, r.SizeBytes())
  6673  }
  6674  
  6675  // CopyInN implements marshal.Marshallable.CopyInN.
  6676  func (r *RMAPIVersion) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6677      // Construct a slice backed by dst's underlying memory.
  6678      var buf []byte
  6679      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6680      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6681      hdr.Len = r.SizeBytes()
  6682      hdr.Cap = r.SizeBytes()
  6683  
  6684      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6685      // Since we bypassed the compiler's escape analysis, indicate that r
  6686      // must live until the use above.
  6687      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6688      return length, err
  6689  }
  6690  
  6691  // CopyIn implements marshal.Marshallable.CopyIn.
  6692  func (r *RMAPIVersion) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6693      return r.CopyInN(cc, addr, r.SizeBytes())
  6694  }
  6695  
  6696  // WriteTo implements io.WriterTo.WriteTo.
  6697  func (r *RMAPIVersion) WriteTo(writer io.Writer) (int64, error) {
  6698      // Construct a slice backed by dst's underlying memory.
  6699      var buf []byte
  6700      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6701      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6702      hdr.Len = r.SizeBytes()
  6703      hdr.Cap = r.SizeBytes()
  6704  
  6705      length, err := writer.Write(buf)
  6706      // Since we bypassed the compiler's escape analysis, indicate that r
  6707      // must live until the use above.
  6708      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6709      return int64(length), err
  6710  }
  6711  
  6712  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6713  func (h *Handle) SizeBytes() int {
  6714      return 4
  6715  }
  6716  
  6717  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6718  func (h *Handle) MarshalBytes(dst []byte) []byte {
  6719      hostarch.ByteOrder.PutUint32(dst[:4], uint32(h.Val))
  6720      dst = dst[4:]
  6721      return dst
  6722  }
  6723  
  6724  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6725  func (h *Handle) UnmarshalBytes(src []byte) []byte {
  6726      h.Val = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6727      src = src[4:]
  6728      return src
  6729  }
  6730  
  6731  // Packed implements marshal.Marshallable.Packed.
  6732  //go:nosplit
  6733  func (h *Handle) Packed() bool {
  6734      return true
  6735  }
  6736  
  6737  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6738  func (h *Handle) MarshalUnsafe(dst []byte) []byte {
  6739      size := h.SizeBytes()
  6740      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(h), uintptr(size))
  6741      return dst[size:]
  6742  }
  6743  
  6744  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6745  func (h *Handle) UnmarshalUnsafe(src []byte) []byte {
  6746      size := h.SizeBytes()
  6747      gohacks.Memmove(unsafe.Pointer(h), unsafe.Pointer(&src[0]), uintptr(size))
  6748      return src[size:]
  6749  }
  6750  
  6751  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6752  func (h *Handle) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6753      // Construct a slice backed by dst's underlying memory.
  6754      var buf []byte
  6755      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6756      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(h)))
  6757      hdr.Len = h.SizeBytes()
  6758      hdr.Cap = h.SizeBytes()
  6759  
  6760      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6761      // Since we bypassed the compiler's escape analysis, indicate that h
  6762      // must live until the use above.
  6763      runtime.KeepAlive(h) // escapes: replaced by intrinsic.
  6764      return length, err
  6765  }
  6766  
  6767  // CopyOut implements marshal.Marshallable.CopyOut.
  6768  func (h *Handle) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6769      return h.CopyOutN(cc, addr, h.SizeBytes())
  6770  }
  6771  
  6772  // CopyInN implements marshal.Marshallable.CopyInN.
  6773  func (h *Handle) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6774      // Construct a slice backed by dst's underlying memory.
  6775      var buf []byte
  6776      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6777      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(h)))
  6778      hdr.Len = h.SizeBytes()
  6779      hdr.Cap = h.SizeBytes()
  6780  
  6781      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6782      // Since we bypassed the compiler's escape analysis, indicate that h
  6783      // must live until the use above.
  6784      runtime.KeepAlive(h) // escapes: replaced by intrinsic.
  6785      return length, err
  6786  }
  6787  
  6788  // CopyIn implements marshal.Marshallable.CopyIn.
  6789  func (h *Handle) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6790      return h.CopyInN(cc, addr, h.SizeBytes())
  6791  }
  6792  
  6793  // WriteTo implements io.WriterTo.WriteTo.
  6794  func (h *Handle) WriteTo(writer io.Writer) (int64, error) {
  6795      // Construct a slice backed by dst's underlying memory.
  6796      var buf []byte
  6797      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6798      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(h)))
  6799      hdr.Len = h.SizeBytes()
  6800      hdr.Cap = h.SizeBytes()
  6801  
  6802      length, err := writer.Write(buf)
  6803      // Since we bypassed the compiler's escape analysis, indicate that h
  6804      // must live until the use above.
  6805      runtime.KeepAlive(h) // escapes: replaced by intrinsic.
  6806      return int64(length), err
  6807  }
  6808  
  6809  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6810  //go:nosplit
  6811  func (n *NvUUID) SizeBytes() int {
  6812      return 1 * 16
  6813  }
  6814  
  6815  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6816  func (n *NvUUID) MarshalBytes(dst []byte) []byte {
  6817      for idx := 0; idx < 16; idx++ {
  6818          dst[0] = byte(n[idx])
  6819          dst = dst[1:]
  6820      }
  6821      return dst
  6822  }
  6823  
  6824  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6825  func (n *NvUUID) UnmarshalBytes(src []byte) []byte {
  6826      for idx := 0; idx < 16; idx++ {
  6827          n[idx] = uint8(src[0])
  6828          src = src[1:]
  6829      }
  6830      return src
  6831  }
  6832  
  6833  // Packed implements marshal.Marshallable.Packed.
  6834  //go:nosplit
  6835  func (n *NvUUID) Packed() bool {
  6836      // Array newtypes are always packed.
  6837      return true
  6838  }
  6839  
  6840  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6841  func (n *NvUUID) MarshalUnsafe(dst []byte) []byte {
  6842      size := n.SizeBytes()
  6843      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&n[0]), uintptr(size))
  6844      return dst[size:]
  6845  }
  6846  
  6847  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6848  func (n *NvUUID) UnmarshalUnsafe(src []byte) []byte {
  6849      size := n.SizeBytes()
  6850      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  6851      return src[size:]
  6852  }
  6853  
  6854  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6855  func (n *NvUUID) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6856      // Construct a slice backed by dst's underlying memory.
  6857      var buf []byte
  6858      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6859      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6860      hdr.Len = n.SizeBytes()
  6861      hdr.Cap = n.SizeBytes()
  6862  
  6863      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6864      // Since we bypassed the compiler's escape analysis, indicate that n
  6865      // must live until the use above.
  6866      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6867      return length, err
  6868  }
  6869  
  6870  // CopyOut implements marshal.Marshallable.CopyOut.
  6871  func (n *NvUUID) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6872      return n.CopyOutN(cc, addr, n.SizeBytes())
  6873  }
  6874  
  6875  // CopyInN implements marshal.Marshallable.CopyInN.
  6876  func (n *NvUUID) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6877      // Construct a slice backed by dst's underlying memory.
  6878      var buf []byte
  6879      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6880      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6881      hdr.Len = n.SizeBytes()
  6882      hdr.Cap = n.SizeBytes()
  6883  
  6884      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6885      // Since we bypassed the compiler's escape analysis, indicate that n
  6886      // must live until the use above.
  6887      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6888      return length, err
  6889  }
  6890  
  6891  // CopyIn implements marshal.Marshallable.CopyIn.
  6892  func (n *NvUUID) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6893      return n.CopyInN(cc, addr, n.SizeBytes())
  6894  }
  6895  
  6896  // WriteTo implements io.WriterTo.WriteTo.
  6897  func (n *NvUUID) WriteTo(writer io.Writer) (int64, error) {
  6898      // Construct a slice backed by dst's underlying memory.
  6899      var buf []byte
  6900      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6901      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6902      hdr.Len = n.SizeBytes()
  6903      hdr.Cap = n.SizeBytes()
  6904  
  6905      length, err := writer.Write(buf)
  6906      // Since we bypassed the compiler's escape analysis, indicate that n
  6907      // must live until the use above.
  6908      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6909      return int64(length), err
  6910  }
  6911  
  6912  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6913  //go:nosplit
  6914  func (p *P64) SizeBytes() int {
  6915      return 8
  6916  }
  6917  
  6918  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6919  func (p *P64) MarshalBytes(dst []byte) []byte {
  6920      hostarch.ByteOrder.PutUint64(dst[:8], uint64(*p))
  6921      return dst[8:]
  6922  }
  6923  
  6924  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6925  func (p *P64) UnmarshalBytes(src []byte) []byte {
  6926      *p = P64(uint64(hostarch.ByteOrder.Uint64(src[:8])))
  6927      return src[8:]
  6928  }
  6929  
  6930  // Packed implements marshal.Marshallable.Packed.
  6931  //go:nosplit
  6932  func (p *P64) Packed() bool {
  6933      // Scalar newtypes are always packed.
  6934      return true
  6935  }
  6936  
  6937  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6938  func (p *P64) MarshalUnsafe(dst []byte) []byte {
  6939      size := p.SizeBytes()
  6940      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  6941      return dst[size:]
  6942  }
  6943  
  6944  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6945  func (p *P64) UnmarshalUnsafe(src []byte) []byte {
  6946      size := p.SizeBytes()
  6947      gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  6948      return src[size:]
  6949  }
  6950  
  6951  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6952  func (p *P64) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6953      // Construct a slice backed by dst's underlying memory.
  6954      var buf []byte
  6955      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6956      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  6957      hdr.Len = p.SizeBytes()
  6958      hdr.Cap = p.SizeBytes()
  6959  
  6960      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6961      // Since we bypassed the compiler's escape analysis, indicate that p
  6962      // must live until the use above.
  6963      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  6964      return length, err
  6965  }
  6966  
  6967  // CopyOut implements marshal.Marshallable.CopyOut.
  6968  func (p *P64) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6969      return p.CopyOutN(cc, addr, p.SizeBytes())
  6970  }
  6971  
  6972  // CopyInN implements marshal.Marshallable.CopyInN.
  6973  func (p *P64) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6974      // Construct a slice backed by dst's underlying memory.
  6975      var buf []byte
  6976      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6977      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  6978      hdr.Len = p.SizeBytes()
  6979      hdr.Cap = p.SizeBytes()
  6980  
  6981      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6982      // Since we bypassed the compiler's escape analysis, indicate that p
  6983      // must live until the use above.
  6984      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  6985      return length, err
  6986  }
  6987  
  6988  // CopyIn implements marshal.Marshallable.CopyIn.
  6989  func (p *P64) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6990      return p.CopyInN(cc, addr, p.SizeBytes())
  6991  }
  6992  
  6993  // WriteTo implements io.WriterTo.WriteTo.
  6994  func (p *P64) WriteTo(writer io.Writer) (int64, error) {
  6995      // Construct a slice backed by dst's underlying memory.
  6996      var buf []byte
  6997      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6998      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  6999      hdr.Len = p.SizeBytes()
  7000      hdr.Cap = p.SizeBytes()
  7001  
  7002      length, err := writer.Write(buf)
  7003      // Since we bypassed the compiler's escape analysis, indicate that p
  7004      // must live until the use above.
  7005      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  7006      return int64(length), err
  7007  }
  7008  
  7009  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7010  func (r *RS_ACCESS_MASK) SizeBytes() int {
  7011      return 0 +
  7012          4*SDK_RS_ACCESS_MAX_LIMBS
  7013  }
  7014  
  7015  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7016  func (r *RS_ACCESS_MASK) MarshalBytes(dst []byte) []byte {
  7017      for idx := 0; idx < SDK_RS_ACCESS_MAX_LIMBS; idx++ {
  7018          hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Limbs[idx]))
  7019          dst = dst[4:]
  7020      }
  7021      return dst
  7022  }
  7023  
  7024  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7025  func (r *RS_ACCESS_MASK) UnmarshalBytes(src []byte) []byte {
  7026      for idx := 0; idx < SDK_RS_ACCESS_MAX_LIMBS; idx++ {
  7027          r.Limbs[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7028          src = src[4:]
  7029      }
  7030      return src
  7031  }
  7032  
  7033  // Packed implements marshal.Marshallable.Packed.
  7034  //go:nosplit
  7035  func (r *RS_ACCESS_MASK) Packed() bool {
  7036      return true
  7037  }
  7038  
  7039  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7040  func (r *RS_ACCESS_MASK) MarshalUnsafe(dst []byte) []byte {
  7041      size := r.SizeBytes()
  7042      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size))
  7043      return dst[size:]
  7044  }
  7045  
  7046  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7047  func (r *RS_ACCESS_MASK) UnmarshalUnsafe(src []byte) []byte {
  7048      size := r.SizeBytes()
  7049      gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size))
  7050      return src[size:]
  7051  }
  7052  
  7053  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7054  func (r *RS_ACCESS_MASK) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7055      // Construct a slice backed by dst's underlying memory.
  7056      var buf []byte
  7057      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7058      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  7059      hdr.Len = r.SizeBytes()
  7060      hdr.Cap = r.SizeBytes()
  7061  
  7062      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7063      // Since we bypassed the compiler's escape analysis, indicate that r
  7064      // must live until the use above.
  7065      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  7066      return length, err
  7067  }
  7068  
  7069  // CopyOut implements marshal.Marshallable.CopyOut.
  7070  func (r *RS_ACCESS_MASK) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7071      return r.CopyOutN(cc, addr, r.SizeBytes())
  7072  }
  7073  
  7074  // CopyInN implements marshal.Marshallable.CopyInN.
  7075  func (r *RS_ACCESS_MASK) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  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(r)))
  7080      hdr.Len = r.SizeBytes()
  7081      hdr.Cap = r.SizeBytes()
  7082  
  7083      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7084      // Since we bypassed the compiler's escape analysis, indicate that r
  7085      // must live until the use above.
  7086      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  7087      return length, err
  7088  }
  7089  
  7090  // CopyIn implements marshal.Marshallable.CopyIn.
  7091  func (r *RS_ACCESS_MASK) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7092      return r.CopyInN(cc, addr, r.SizeBytes())
  7093  }
  7094  
  7095  // WriteTo implements io.WriterTo.WriteTo.
  7096  func (r *RS_ACCESS_MASK) WriteTo(writer io.Writer) (int64, error) {
  7097      // Construct a slice backed by dst's underlying memory.
  7098      var buf []byte
  7099      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7100      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  7101      hdr.Len = r.SizeBytes()
  7102      hdr.Cap = r.SizeBytes()
  7103  
  7104      length, err := writer.Write(buf)
  7105      // Since we bypassed the compiler's escape analysis, indicate that r
  7106      // must live until the use above.
  7107      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  7108      return int64(length), err
  7109  }
  7110  
  7111  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7112  func (r *RS_SHARE_POLICY) SizeBytes() int {
  7113      return 7 +
  7114          (*RS_ACCESS_MASK)(nil).SizeBytes() +
  7115          1*1
  7116  }
  7117  
  7118  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7119  func (r *RS_SHARE_POLICY) MarshalBytes(dst []byte) []byte {
  7120      hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Target))
  7121      dst = dst[4:]
  7122      dst = r.AccessMask.MarshalUnsafe(dst)
  7123      hostarch.ByteOrder.PutUint16(dst[:2], uint16(r.Type))
  7124      dst = dst[2:]
  7125      dst[0] = byte(r.Action)
  7126      dst = dst[1:]
  7127      for idx := 0; idx < 1; idx++ {
  7128          dst[0] = byte(r.Pad[idx])
  7129          dst = dst[1:]
  7130      }
  7131      return dst
  7132  }
  7133  
  7134  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7135  func (r *RS_SHARE_POLICY) UnmarshalBytes(src []byte) []byte {
  7136      r.Target = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7137      src = src[4:]
  7138      src = r.AccessMask.UnmarshalUnsafe(src)
  7139      r.Type = uint16(hostarch.ByteOrder.Uint16(src[:2]))
  7140      src = src[2:]
  7141      r.Action = uint8(src[0])
  7142      src = src[1:]
  7143      for idx := 0; idx < 1; idx++ {
  7144          r.Pad[idx] = src[0]
  7145          src = src[1:]
  7146      }
  7147      return src
  7148  }
  7149  
  7150  // Packed implements marshal.Marshallable.Packed.
  7151  //go:nosplit
  7152  func (r *RS_SHARE_POLICY) Packed() bool {
  7153      return r.AccessMask.Packed()
  7154  }
  7155  
  7156  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7157  func (r *RS_SHARE_POLICY) MarshalUnsafe(dst []byte) []byte {
  7158      if r.AccessMask.Packed() {
  7159          size := r.SizeBytes()
  7160          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size))
  7161          return dst[size:]
  7162      }
  7163      // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fallback to MarshalBytes.
  7164      return r.MarshalBytes(dst)
  7165  }
  7166  
  7167  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7168  func (r *RS_SHARE_POLICY) UnmarshalUnsafe(src []byte) []byte {
  7169      if r.AccessMask.Packed() {
  7170          size := r.SizeBytes()
  7171          gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size))
  7172          return src[size:]
  7173      }
  7174      // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  7175      return r.UnmarshalBytes(src)
  7176  }
  7177  
  7178  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7179  func (r *RS_SHARE_POLICY) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7180      if !r.AccessMask.Packed() {
  7181          // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fall back to MarshalBytes.
  7182          buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay.
  7183          r.MarshalBytes(buf) // escapes: fallback.
  7184          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7185      }
  7186  
  7187      // Construct a slice backed by dst's underlying memory.
  7188      var buf []byte
  7189      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7190      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  7191      hdr.Len = r.SizeBytes()
  7192      hdr.Cap = r.SizeBytes()
  7193  
  7194      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7195      // Since we bypassed the compiler's escape analysis, indicate that r
  7196      // must live until the use above.
  7197      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  7198      return length, err
  7199  }
  7200  
  7201  // CopyOut implements marshal.Marshallable.CopyOut.
  7202  func (r *RS_SHARE_POLICY) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7203      return r.CopyOutN(cc, addr, r.SizeBytes())
  7204  }
  7205  
  7206  // CopyInN implements marshal.Marshallable.CopyInN.
  7207  func (r *RS_SHARE_POLICY) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7208      if !r.AccessMask.Packed() {
  7209          // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  7210          buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay.
  7211          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7212          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  7213          // partially unmarshalled struct.
  7214          r.UnmarshalBytes(buf) // escapes: fallback.
  7215          return length, err
  7216      }
  7217  
  7218      // Construct a slice backed by dst's underlying memory.
  7219      var buf []byte
  7220      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7221      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  7222      hdr.Len = r.SizeBytes()
  7223      hdr.Cap = r.SizeBytes()
  7224  
  7225      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7226      // Since we bypassed the compiler's escape analysis, indicate that r
  7227      // must live until the use above.
  7228      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  7229      return length, err
  7230  }
  7231  
  7232  // CopyIn implements marshal.Marshallable.CopyIn.
  7233  func (r *RS_SHARE_POLICY) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7234      return r.CopyInN(cc, addr, r.SizeBytes())
  7235  }
  7236  
  7237  // WriteTo implements io.WriterTo.WriteTo.
  7238  func (r *RS_SHARE_POLICY) WriteTo(writer io.Writer) (int64, error) {
  7239      if !r.AccessMask.Packed() {
  7240          // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fall back to MarshalBytes.
  7241          buf := make([]byte, r.SizeBytes())
  7242          r.MarshalBytes(buf)
  7243          length, err := writer.Write(buf)
  7244          return int64(length), err
  7245      }
  7246  
  7247      // Construct a slice backed by dst's underlying memory.
  7248      var buf []byte
  7249      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7250      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  7251      hdr.Len = r.SizeBytes()
  7252      hdr.Cap = r.SizeBytes()
  7253  
  7254      length, err := writer.Write(buf)
  7255      // Since we bypassed the compiler's escape analysis, indicate that r
  7256      // must live until the use above.
  7257      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  7258      return int64(length), err
  7259  }
  7260  
  7261  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7262  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) SizeBytes() int {
  7263      return 28 +
  7264          (*UvmGpuMappingAttributes)(nil).SizeBytes()*UVM_MAX_GPUS +
  7265          1*4
  7266  }
  7267  
  7268  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7269  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) MarshalBytes(dst []byte) []byte {
  7270      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  7271      dst = dst[8:]
  7272      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  7273      dst = dst[8:]
  7274      for idx := 0; idx < UVM_MAX_GPUS; idx++ {
  7275          dst = u.PerGPUAttributes[idx].MarshalUnsafe(dst)
  7276      }
  7277      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.GPUAttributesCount))
  7278      dst = dst[8:]
  7279      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7280      dst = dst[4:]
  7281      for idx := 0; idx < 4; idx++ {
  7282          dst[0] = byte(u.Pad0[idx])
  7283          dst = dst[1:]
  7284      }
  7285      return dst
  7286  }
  7287  
  7288  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7289  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) UnmarshalBytes(src []byte) []byte {
  7290      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7291      src = src[8:]
  7292      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7293      src = src[8:]
  7294      for idx := 0; idx < UVM_MAX_GPUS; idx++ {
  7295          src = u.PerGPUAttributes[idx].UnmarshalUnsafe(src)
  7296      }
  7297      u.GPUAttributesCount = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7298      src = src[8:]
  7299      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7300      src = src[4:]
  7301      for idx := 0; idx < 4; idx++ {
  7302          u.Pad0[idx] = src[0]
  7303          src = src[1:]
  7304      }
  7305      return src
  7306  }
  7307  
  7308  // Packed implements marshal.Marshallable.Packed.
  7309  //go:nosplit
  7310  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) Packed() bool {
  7311      return u.PerGPUAttributes[0].Packed()
  7312  }
  7313  
  7314  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7315  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7316      if u.PerGPUAttributes[0].Packed() {
  7317          size := u.SizeBytes()
  7318          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7319          return dst[size:]
  7320      }
  7321      // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  7322      return u.MarshalBytes(dst)
  7323  }
  7324  
  7325  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7326  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7327      if u.PerGPUAttributes[0].Packed() {
  7328          size := u.SizeBytes()
  7329          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7330          return src[size:]
  7331      }
  7332      // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  7333      return u.UnmarshalBytes(src)
  7334  }
  7335  
  7336  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7337  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7338      if !u.PerGPUAttributes[0].Packed() {
  7339          // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  7340          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  7341          u.MarshalBytes(buf) // escapes: fallback.
  7342          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7343      }
  7344  
  7345      // Construct a slice backed by dst's underlying memory.
  7346      var buf []byte
  7347      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7348      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7349      hdr.Len = u.SizeBytes()
  7350      hdr.Cap = u.SizeBytes()
  7351  
  7352      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7353      // Since we bypassed the compiler's escape analysis, indicate that u
  7354      // must live until the use above.
  7355      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7356      return length, err
  7357  }
  7358  
  7359  // CopyOut implements marshal.Marshallable.CopyOut.
  7360  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7361      return u.CopyOutN(cc, addr, u.SizeBytes())
  7362  }
  7363  
  7364  // CopyInN implements marshal.Marshallable.CopyInN.
  7365  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7366      if !u.PerGPUAttributes[0].Packed() {
  7367          // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  7368          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  7369          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7370          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  7371          // partially unmarshalled struct.
  7372          u.UnmarshalBytes(buf) // escapes: fallback.
  7373          return length, err
  7374      }
  7375  
  7376      // Construct a slice backed by dst's underlying memory.
  7377      var buf []byte
  7378      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7379      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7380      hdr.Len = u.SizeBytes()
  7381      hdr.Cap = u.SizeBytes()
  7382  
  7383      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7384      // Since we bypassed the compiler's escape analysis, indicate that u
  7385      // must live until the use above.
  7386      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7387      return length, err
  7388  }
  7389  
  7390  // CopyIn implements marshal.Marshallable.CopyIn.
  7391  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7392      return u.CopyInN(cc, addr, u.SizeBytes())
  7393  }
  7394  
  7395  // WriteTo implements io.WriterTo.WriteTo.
  7396  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7397      if !u.PerGPUAttributes[0].Packed() {
  7398          // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  7399          buf := make([]byte, u.SizeBytes())
  7400          u.MarshalBytes(buf)
  7401          length, err := writer.Write(buf)
  7402          return int64(length), err
  7403      }
  7404  
  7405      // Construct a slice backed by dst's underlying memory.
  7406      var buf []byte
  7407      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7408      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7409      hdr.Len = u.SizeBytes()
  7410      hdr.Cap = u.SizeBytes()
  7411  
  7412      length, err := writer.Write(buf)
  7413      // Since we bypassed the compiler's escape analysis, indicate that u
  7414      // must live until the use above.
  7415      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7416      return int64(length), err
  7417  }
  7418  
  7419  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7420  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) SizeBytes() int {
  7421      return 28 +
  7422          (*UvmGpuMappingAttributes)(nil).SizeBytes()*UVM_MAX_GPUS_V2 +
  7423          1*4
  7424  }
  7425  
  7426  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7427  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) MarshalBytes(dst []byte) []byte {
  7428      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  7429      dst = dst[8:]
  7430      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  7431      dst = dst[8:]
  7432      for idx := 0; idx < UVM_MAX_GPUS_V2; idx++ {
  7433          dst = u.PerGPUAttributes[idx].MarshalUnsafe(dst)
  7434      }
  7435      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.GPUAttributesCount))
  7436      dst = dst[8:]
  7437      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7438      dst = dst[4:]
  7439      for idx := 0; idx < 4; idx++ {
  7440          dst[0] = byte(u.Pad0[idx])
  7441          dst = dst[1:]
  7442      }
  7443      return dst
  7444  }
  7445  
  7446  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7447  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) UnmarshalBytes(src []byte) []byte {
  7448      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7449      src = src[8:]
  7450      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7451      src = src[8:]
  7452      for idx := 0; idx < UVM_MAX_GPUS_V2; idx++ {
  7453          src = u.PerGPUAttributes[idx].UnmarshalUnsafe(src)
  7454      }
  7455      u.GPUAttributesCount = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7456      src = src[8:]
  7457      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7458      src = src[4:]
  7459      for idx := 0; idx < 4; idx++ {
  7460          u.Pad0[idx] = src[0]
  7461          src = src[1:]
  7462      }
  7463      return src
  7464  }
  7465  
  7466  // Packed implements marshal.Marshallable.Packed.
  7467  //go:nosplit
  7468  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) Packed() bool {
  7469      return u.PerGPUAttributes[0].Packed()
  7470  }
  7471  
  7472  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7473  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) MarshalUnsafe(dst []byte) []byte {
  7474      if u.PerGPUAttributes[0].Packed() {
  7475          size := u.SizeBytes()
  7476          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7477          return dst[size:]
  7478      }
  7479      // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550 doesn't have a packed layout in memory, fallback to MarshalBytes.
  7480      return u.MarshalBytes(dst)
  7481  }
  7482  
  7483  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7484  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) UnmarshalUnsafe(src []byte) []byte {
  7485      if u.PerGPUAttributes[0].Packed() {
  7486          size := u.SizeBytes()
  7487          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7488          return src[size:]
  7489      }
  7490      // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  7491      return u.UnmarshalBytes(src)
  7492  }
  7493  
  7494  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7495  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7496      if !u.PerGPUAttributes[0].Packed() {
  7497          // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550 doesn't have a packed layout in memory, fall back to MarshalBytes.
  7498          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  7499          u.MarshalBytes(buf) // escapes: fallback.
  7500          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7501      }
  7502  
  7503      // Construct a slice backed by dst's underlying memory.
  7504      var buf []byte
  7505      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7506      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7507      hdr.Len = u.SizeBytes()
  7508      hdr.Cap = u.SizeBytes()
  7509  
  7510      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7511      // Since we bypassed the compiler's escape analysis, indicate that u
  7512      // must live until the use above.
  7513      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7514      return length, err
  7515  }
  7516  
  7517  // CopyOut implements marshal.Marshallable.CopyOut.
  7518  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7519      return u.CopyOutN(cc, addr, u.SizeBytes())
  7520  }
  7521  
  7522  // CopyInN implements marshal.Marshallable.CopyInN.
  7523  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7524      if !u.PerGPUAttributes[0].Packed() {
  7525          // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550 doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  7526          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  7527          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7528          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  7529          // partially unmarshalled struct.
  7530          u.UnmarshalBytes(buf) // escapes: fallback.
  7531          return length, err
  7532      }
  7533  
  7534      // Construct a slice backed by dst's underlying memory.
  7535      var buf []byte
  7536      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7537      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7538      hdr.Len = u.SizeBytes()
  7539      hdr.Cap = u.SizeBytes()
  7540  
  7541      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7542      // Since we bypassed the compiler's escape analysis, indicate that u
  7543      // must live until the use above.
  7544      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7545      return length, err
  7546  }
  7547  
  7548  // CopyIn implements marshal.Marshallable.CopyIn.
  7549  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7550      return u.CopyInN(cc, addr, u.SizeBytes())
  7551  }
  7552  
  7553  // WriteTo implements io.WriterTo.WriteTo.
  7554  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550) WriteTo(writer io.Writer) (int64, error) {
  7555      if !u.PerGPUAttributes[0].Packed() {
  7556          // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS_V550 doesn't have a packed layout in memory, fall back to MarshalBytes.
  7557          buf := make([]byte, u.SizeBytes())
  7558          u.MarshalBytes(buf)
  7559          length, err := writer.Write(buf)
  7560          return int64(length), err
  7561      }
  7562  
  7563      // Construct a slice backed by dst's underlying memory.
  7564      var buf []byte
  7565      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7566      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7567      hdr.Len = u.SizeBytes()
  7568      hdr.Cap = u.SizeBytes()
  7569  
  7570      length, err := writer.Write(buf)
  7571      // Since we bypassed the compiler's escape analysis, indicate that u
  7572      // must live until the use above.
  7573      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7574      return int64(length), err
  7575  }
  7576  
  7577  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7578  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) SizeBytes() int {
  7579      return 20 +
  7580          1*4
  7581  }
  7582  
  7583  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7584  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) MarshalBytes(dst []byte) []byte {
  7585      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  7586      dst = dst[8:]
  7587      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  7588      dst = dst[8:]
  7589      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7590      dst = dst[4:]
  7591      for idx := 0; idx < 4; idx++ {
  7592          dst[0] = byte(u.Pad0[idx])
  7593          dst = dst[1:]
  7594      }
  7595      return dst
  7596  }
  7597  
  7598  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7599  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) UnmarshalBytes(src []byte) []byte {
  7600      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7601      src = src[8:]
  7602      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7603      src = src[8:]
  7604      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7605      src = src[4:]
  7606      for idx := 0; idx < 4; idx++ {
  7607          u.Pad0[idx] = src[0]
  7608          src = src[1:]
  7609      }
  7610      return src
  7611  }
  7612  
  7613  // Packed implements marshal.Marshallable.Packed.
  7614  //go:nosplit
  7615  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) Packed() bool {
  7616      return true
  7617  }
  7618  
  7619  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7620  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7621      size := u.SizeBytes()
  7622      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7623      return dst[size:]
  7624  }
  7625  
  7626  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7627  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7628      size := u.SizeBytes()
  7629      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7630      return src[size:]
  7631  }
  7632  
  7633  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7634  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7635      // Construct a slice backed by dst's underlying memory.
  7636      var buf []byte
  7637      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7638      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7639      hdr.Len = u.SizeBytes()
  7640      hdr.Cap = u.SizeBytes()
  7641  
  7642      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7643      // Since we bypassed the compiler's escape analysis, indicate that u
  7644      // must live until the use above.
  7645      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7646      return length, err
  7647  }
  7648  
  7649  // CopyOut implements marshal.Marshallable.CopyOut.
  7650  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7651      return u.CopyOutN(cc, addr, u.SizeBytes())
  7652  }
  7653  
  7654  // CopyInN implements marshal.Marshallable.CopyInN.
  7655  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7656      // Construct a slice backed by dst's underlying memory.
  7657      var buf []byte
  7658      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7659      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7660      hdr.Len = u.SizeBytes()
  7661      hdr.Cap = u.SizeBytes()
  7662  
  7663      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7664      // Since we bypassed the compiler's escape analysis, indicate that u
  7665      // must live until the use above.
  7666      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7667      return length, err
  7668  }
  7669  
  7670  // CopyIn implements marshal.Marshallable.CopyIn.
  7671  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7672      return u.CopyInN(cc, addr, u.SizeBytes())
  7673  }
  7674  
  7675  // WriteTo implements io.WriterTo.WriteTo.
  7676  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7677      // Construct a slice backed by dst's underlying memory.
  7678      var buf []byte
  7679      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7680      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7681      hdr.Len = u.SizeBytes()
  7682      hdr.Cap = u.SizeBytes()
  7683  
  7684      length, err := writer.Write(buf)
  7685      // Since we bypassed the compiler's escape analysis, indicate that u
  7686      // must live until the use above.
  7687      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7688      return int64(length), err
  7689  }
  7690  
  7691  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7692  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) SizeBytes() int {
  7693      return 12 +
  7694          1*4
  7695  }
  7696  
  7697  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7698  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) MarshalBytes(dst []byte) []byte {
  7699      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RangeGroupID))
  7700      dst = dst[8:]
  7701      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7702      dst = dst[4:]
  7703      for idx := 0; idx < 4; idx++ {
  7704          dst[0] = byte(u.Pad0[idx])
  7705          dst = dst[1:]
  7706      }
  7707      return dst
  7708  }
  7709  
  7710  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7711  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) UnmarshalBytes(src []byte) []byte {
  7712      u.RangeGroupID = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7713      src = src[8:]
  7714      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7715      src = src[4:]
  7716      for idx := 0; idx < 4; idx++ {
  7717          u.Pad0[idx] = src[0]
  7718          src = src[1:]
  7719      }
  7720      return src
  7721  }
  7722  
  7723  // Packed implements marshal.Marshallable.Packed.
  7724  //go:nosplit
  7725  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) Packed() bool {
  7726      return true
  7727  }
  7728  
  7729  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7730  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7731      size := u.SizeBytes()
  7732      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7733      return dst[size:]
  7734  }
  7735  
  7736  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7737  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7738      size := u.SizeBytes()
  7739      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7740      return src[size:]
  7741  }
  7742  
  7743  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7744  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7745      // Construct a slice backed by dst's underlying memory.
  7746      var buf []byte
  7747      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7748      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7749      hdr.Len = u.SizeBytes()
  7750      hdr.Cap = u.SizeBytes()
  7751  
  7752      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7753      // Since we bypassed the compiler's escape analysis, indicate that u
  7754      // must live until the use above.
  7755      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7756      return length, err
  7757  }
  7758  
  7759  // CopyOut implements marshal.Marshallable.CopyOut.
  7760  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7761      return u.CopyOutN(cc, addr, u.SizeBytes())
  7762  }
  7763  
  7764  // CopyInN implements marshal.Marshallable.CopyInN.
  7765  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7766      // Construct a slice backed by dst's underlying memory.
  7767      var buf []byte
  7768      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7769      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7770      hdr.Len = u.SizeBytes()
  7771      hdr.Cap = u.SizeBytes()
  7772  
  7773      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7774      // Since we bypassed the compiler's escape analysis, indicate that u
  7775      // must live until the use above.
  7776      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7777      return length, err
  7778  }
  7779  
  7780  // CopyIn implements marshal.Marshallable.CopyIn.
  7781  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7782      return u.CopyInN(cc, addr, u.SizeBytes())
  7783  }
  7784  
  7785  // WriteTo implements io.WriterTo.WriteTo.
  7786  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7787      // Construct a slice backed by dst's underlying memory.
  7788      var buf []byte
  7789      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7790      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7791      hdr.Len = u.SizeBytes()
  7792      hdr.Cap = u.SizeBytes()
  7793  
  7794      length, err := writer.Write(buf)
  7795      // Since we bypassed the compiler's escape analysis, indicate that u
  7796      // must live until the use above.
  7797      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7798      return int64(length), err
  7799  }
  7800  
  7801  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7802  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) SizeBytes() int {
  7803      return 12 +
  7804          1*4
  7805  }
  7806  
  7807  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7808  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) MarshalBytes(dst []byte) []byte {
  7809      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RangeGroupID))
  7810      dst = dst[8:]
  7811      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7812      dst = dst[4:]
  7813      for idx := 0; idx < 4; idx++ {
  7814          dst[0] = byte(u.Pad0[idx])
  7815          dst = dst[1:]
  7816      }
  7817      return dst
  7818  }
  7819  
  7820  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7821  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) UnmarshalBytes(src []byte) []byte {
  7822      u.RangeGroupID = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7823      src = src[8:]
  7824      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7825      src = src[4:]
  7826      for idx := 0; idx < 4; idx++ {
  7827          u.Pad0[idx] = src[0]
  7828          src = src[1:]
  7829      }
  7830      return src
  7831  }
  7832  
  7833  // Packed implements marshal.Marshallable.Packed.
  7834  //go:nosplit
  7835  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) Packed() bool {
  7836      return true
  7837  }
  7838  
  7839  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7840  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7841      size := u.SizeBytes()
  7842      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7843      return dst[size:]
  7844  }
  7845  
  7846  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7847  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7848      size := u.SizeBytes()
  7849      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7850      return src[size:]
  7851  }
  7852  
  7853  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7854  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7855      // Construct a slice backed by dst's underlying memory.
  7856      var buf []byte
  7857      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7858      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7859      hdr.Len = u.SizeBytes()
  7860      hdr.Cap = u.SizeBytes()
  7861  
  7862      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7863      // Since we bypassed the compiler's escape analysis, indicate that u
  7864      // must live until the use above.
  7865      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7866      return length, err
  7867  }
  7868  
  7869  // CopyOut implements marshal.Marshallable.CopyOut.
  7870  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7871      return u.CopyOutN(cc, addr, u.SizeBytes())
  7872  }
  7873  
  7874  // CopyInN implements marshal.Marshallable.CopyInN.
  7875  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7876      // Construct a slice backed by dst's underlying memory.
  7877      var buf []byte
  7878      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7879      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7880      hdr.Len = u.SizeBytes()
  7881      hdr.Cap = u.SizeBytes()
  7882  
  7883      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7884      // Since we bypassed the compiler's escape analysis, indicate that u
  7885      // must live until the use above.
  7886      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7887      return length, err
  7888  }
  7889  
  7890  // CopyIn implements marshal.Marshallable.CopyIn.
  7891  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7892      return u.CopyInN(cc, addr, u.SizeBytes())
  7893  }
  7894  
  7895  // WriteTo implements io.WriterTo.WriteTo.
  7896  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7897      // Construct a slice backed by dst's underlying memory.
  7898      var buf []byte
  7899      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7900      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7901      hdr.Len = u.SizeBytes()
  7902      hdr.Cap = u.SizeBytes()
  7903  
  7904      length, err := writer.Write(buf)
  7905      // Since we bypassed the compiler's escape analysis, indicate that u
  7906      // must live until the use above.
  7907      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7908      return int64(length), err
  7909  }
  7910  
  7911  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7912  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) SizeBytes() int {
  7913      return 20 +
  7914          1*4
  7915  }
  7916  
  7917  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7918  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) MarshalBytes(dst []byte) []byte {
  7919      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RequestedBase))
  7920      dst = dst[8:]
  7921      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  7922      dst = dst[8:]
  7923      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7924      dst = dst[4:]
  7925      for idx := 0; idx < 4; idx++ {
  7926          dst[0] = byte(u.Pad0[idx])
  7927          dst = dst[1:]
  7928      }
  7929      return dst
  7930  }
  7931  
  7932  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7933  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) UnmarshalBytes(src []byte) []byte {
  7934      u.RequestedBase = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7935      src = src[8:]
  7936      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7937      src = src[8:]
  7938      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7939      src = src[4:]
  7940      for idx := 0; idx < 4; idx++ {
  7941          u.Pad0[idx] = src[0]
  7942          src = src[1:]
  7943      }
  7944      return src
  7945  }
  7946  
  7947  // Packed implements marshal.Marshallable.Packed.
  7948  //go:nosplit
  7949  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) Packed() bool {
  7950      return true
  7951  }
  7952  
  7953  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7954  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7955      size := u.SizeBytes()
  7956      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7957      return dst[size:]
  7958  }
  7959  
  7960  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7961  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7962      size := u.SizeBytes()
  7963      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7964      return src[size:]
  7965  }
  7966  
  7967  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7968  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7969      // Construct a slice backed by dst's underlying memory.
  7970      var buf []byte
  7971      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7972      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7973      hdr.Len = u.SizeBytes()
  7974      hdr.Cap = u.SizeBytes()
  7975  
  7976      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7977      // Since we bypassed the compiler's escape analysis, indicate that u
  7978      // must live until the use above.
  7979      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7980      return length, err
  7981  }
  7982  
  7983  // CopyOut implements marshal.Marshallable.CopyOut.
  7984  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7985      return u.CopyOutN(cc, addr, u.SizeBytes())
  7986  }
  7987  
  7988  // CopyInN implements marshal.Marshallable.CopyInN.
  7989  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7990      // Construct a slice backed by dst's underlying memory.
  7991      var buf []byte
  7992      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7993      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7994      hdr.Len = u.SizeBytes()
  7995      hdr.Cap = u.SizeBytes()
  7996  
  7997      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7998      // Since we bypassed the compiler's escape analysis, indicate that u
  7999      // must live until the use above.
  8000      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8001      return length, err
  8002  }
  8003  
  8004  // CopyIn implements marshal.Marshallable.CopyIn.
  8005  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8006      return u.CopyInN(cc, addr, u.SizeBytes())
  8007  }
  8008  
  8009  // WriteTo implements io.WriterTo.WriteTo.
  8010  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8011      // Construct a slice backed by dst's underlying memory.
  8012      var buf []byte
  8013      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8014      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8015      hdr.Len = u.SizeBytes()
  8016      hdr.Cap = u.SizeBytes()
  8017  
  8018      length, err := writer.Write(buf)
  8019      // Since we bypassed the compiler's escape analysis, indicate that u
  8020      // must live until the use above.
  8021      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8022      return int64(length), err
  8023  }
  8024  
  8025  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8026  func (u *UVM_FREE_PARAMS) SizeBytes() int {
  8027      return 20 +
  8028          1*4
  8029  }
  8030  
  8031  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8032  func (u *UVM_FREE_PARAMS) MarshalBytes(dst []byte) []byte {
  8033      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  8034      dst = dst[8:]
  8035      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  8036      dst = dst[8:]
  8037      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  8038      dst = dst[4:]
  8039      for idx := 0; idx < 4; idx++ {
  8040          dst[0] = byte(u.Pad0[idx])
  8041          dst = dst[1:]
  8042      }
  8043      return dst
  8044  }
  8045  
  8046  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8047  func (u *UVM_FREE_PARAMS) UnmarshalBytes(src []byte) []byte {
  8048      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8049      src = src[8:]
  8050      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8051      src = src[8:]
  8052      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8053      src = src[4:]
  8054      for idx := 0; idx < 4; idx++ {
  8055          u.Pad0[idx] = src[0]
  8056          src = src[1:]
  8057      }
  8058      return src
  8059  }
  8060  
  8061  // Packed implements marshal.Marshallable.Packed.
  8062  //go:nosplit
  8063  func (u *UVM_FREE_PARAMS) Packed() bool {
  8064      return true
  8065  }
  8066  
  8067  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8068  func (u *UVM_FREE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8069      size := u.SizeBytes()
  8070      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  8071      return dst[size:]
  8072  }
  8073  
  8074  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8075  func (u *UVM_FREE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8076      size := u.SizeBytes()
  8077      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  8078      return src[size:]
  8079  }
  8080  
  8081  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8082  func (u *UVM_FREE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8083      // Construct a slice backed by dst's underlying memory.
  8084      var buf []byte
  8085      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8086      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8087      hdr.Len = u.SizeBytes()
  8088      hdr.Cap = u.SizeBytes()
  8089  
  8090      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8091      // Since we bypassed the compiler's escape analysis, indicate that u
  8092      // must live until the use above.
  8093      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8094      return length, err
  8095  }
  8096  
  8097  // CopyOut implements marshal.Marshallable.CopyOut.
  8098  func (u *UVM_FREE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8099      return u.CopyOutN(cc, addr, u.SizeBytes())
  8100  }
  8101  
  8102  // CopyInN implements marshal.Marshallable.CopyInN.
  8103  func (u *UVM_FREE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8104      // Construct a slice backed by dst's underlying memory.
  8105      var buf []byte
  8106      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8107      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8108      hdr.Len = u.SizeBytes()
  8109      hdr.Cap = u.SizeBytes()
  8110  
  8111      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8112      // Since we bypassed the compiler's escape analysis, indicate that u
  8113      // must live until the use above.
  8114      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8115      return length, err
  8116  }
  8117  
  8118  // CopyIn implements marshal.Marshallable.CopyIn.
  8119  func (u *UVM_FREE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8120      return u.CopyInN(cc, addr, u.SizeBytes())
  8121  }
  8122  
  8123  // WriteTo implements io.WriterTo.WriteTo.
  8124  func (u *UVM_FREE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8125      // Construct a slice backed by dst's underlying memory.
  8126      var buf []byte
  8127      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8128      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8129      hdr.Len = u.SizeBytes()
  8130      hdr.Cap = u.SizeBytes()
  8131  
  8132      length, err := writer.Write(buf)
  8133      // Since we bypassed the compiler's escape analysis, indicate that u
  8134      // must live until the use above.
  8135      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8136      return int64(length), err
  8137  }
  8138  
  8139  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8140  func (u *UVM_INITIALIZE_PARAMS) SizeBytes() int {
  8141      return 12 +
  8142          1*4
  8143  }
  8144  
  8145  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8146  func (u *UVM_INITIALIZE_PARAMS) MarshalBytes(dst []byte) []byte {
  8147      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Flags))
  8148      dst = dst[8:]
  8149      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  8150      dst = dst[4:]
  8151      for idx := 0; idx < 4; idx++ {
  8152          dst[0] = byte(u.Pad0[idx])
  8153          dst = dst[1:]
  8154      }
  8155      return dst
  8156  }
  8157  
  8158  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8159  func (u *UVM_INITIALIZE_PARAMS) UnmarshalBytes(src []byte) []byte {
  8160      u.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8161      src = src[8:]
  8162      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8163      src = src[4:]
  8164      for idx := 0; idx < 4; idx++ {
  8165          u.Pad0[idx] = src[0]
  8166          src = src[1:]
  8167      }
  8168      return src
  8169  }
  8170  
  8171  // Packed implements marshal.Marshallable.Packed.
  8172  //go:nosplit
  8173  func (u *UVM_INITIALIZE_PARAMS) Packed() bool {
  8174      return true
  8175  }
  8176  
  8177  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8178  func (u *UVM_INITIALIZE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8179      size := u.SizeBytes()
  8180      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  8181      return dst[size:]
  8182  }
  8183  
  8184  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8185  func (u *UVM_INITIALIZE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8186      size := u.SizeBytes()
  8187      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  8188      return src[size:]
  8189  }
  8190  
  8191  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8192  func (u *UVM_INITIALIZE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8193      // Construct a slice backed by dst's underlying memory.
  8194      var buf []byte
  8195      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8196      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8197      hdr.Len = u.SizeBytes()
  8198      hdr.Cap = u.SizeBytes()
  8199  
  8200      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8201      // Since we bypassed the compiler's escape analysis, indicate that u
  8202      // must live until the use above.
  8203      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8204      return length, err
  8205  }
  8206  
  8207  // CopyOut implements marshal.Marshallable.CopyOut.
  8208  func (u *UVM_INITIALIZE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8209      return u.CopyOutN(cc, addr, u.SizeBytes())
  8210  }
  8211  
  8212  // CopyInN implements marshal.Marshallable.CopyInN.
  8213  func (u *UVM_INITIALIZE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8214      // Construct a slice backed by dst's underlying memory.
  8215      var buf []byte
  8216      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8217      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8218      hdr.Len = u.SizeBytes()
  8219      hdr.Cap = u.SizeBytes()
  8220  
  8221      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8222      // Since we bypassed the compiler's escape analysis, indicate that u
  8223      // must live until the use above.
  8224      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8225      return length, err
  8226  }
  8227  
  8228  // CopyIn implements marshal.Marshallable.CopyIn.
  8229  func (u *UVM_INITIALIZE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8230      return u.CopyInN(cc, addr, u.SizeBytes())
  8231  }
  8232  
  8233  // WriteTo implements io.WriterTo.WriteTo.
  8234  func (u *UVM_INITIALIZE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8235      // Construct a slice backed by dst's underlying memory.
  8236      var buf []byte
  8237      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8238      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8239      hdr.Len = u.SizeBytes()
  8240      hdr.Cap = u.SizeBytes()
  8241  
  8242      length, err := writer.Write(buf)
  8243      // Since we bypassed the compiler's escape analysis, indicate that u
  8244      // must live until the use above.
  8245      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8246      return int64(length), err
  8247  }
  8248  
  8249  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8250  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) SizeBytes() int {
  8251      return 20 +
  8252          (*NvUUID)(nil).SizeBytes() +
  8253          1*4
  8254  }
  8255  
  8256  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8257  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) MarshalBytes(dst []byte) []byte {
  8258      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  8259      dst = dst[8:]
  8260      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  8261      dst = dst[8:]
  8262      dst = u.GPUUUID.MarshalUnsafe(dst)
  8263      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  8264      dst = dst[4:]
  8265      for idx := 0; idx < 4; idx++ {
  8266          dst[0] = byte(u.Pad0[idx])
  8267          dst = dst[1:]
  8268      }
  8269      return dst
  8270  }
  8271  
  8272  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8273  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) UnmarshalBytes(src []byte) []byte {
  8274      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8275      src = src[8:]
  8276      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8277      src = src[8:]
  8278      src = u.GPUUUID.UnmarshalUnsafe(src)
  8279      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8280      src = src[4:]
  8281      for idx := 0; idx < 4; idx++ {
  8282          u.Pad0[idx] = src[0]
  8283          src = src[1:]
  8284      }
  8285      return src
  8286  }
  8287  
  8288  // Packed implements marshal.Marshallable.Packed.
  8289  //go:nosplit
  8290  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) Packed() bool {
  8291      return u.GPUUUID.Packed()
  8292  }
  8293  
  8294  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8295  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8296      if u.GPUUUID.Packed() {
  8297          size := u.SizeBytes()
  8298          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  8299          return dst[size:]
  8300      }
  8301      // Type UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  8302      return u.MarshalBytes(dst)
  8303  }
  8304  
  8305  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8306  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8307      if u.GPUUUID.Packed() {
  8308          size := u.SizeBytes()
  8309          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  8310          return src[size:]
  8311      }
  8312      // Type UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  8313      return u.UnmarshalBytes(src)
  8314  }
  8315  
  8316  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8317  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8318      if !u.GPUUUID.Packed() {
  8319          // Type UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8320          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  8321          u.MarshalBytes(buf) // escapes: fallback.
  8322          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8323      }
  8324  
  8325      // Construct a slice backed by dst's underlying memory.
  8326      var buf []byte
  8327      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8328      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8329      hdr.Len = u.SizeBytes()
  8330      hdr.Cap = u.SizeBytes()
  8331  
  8332      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8333      // Since we bypassed the compiler's escape analysis, indicate that u
  8334      // must live until the use above.
  8335      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8336      return length, err
  8337  }
  8338  
  8339  // CopyOut implements marshal.Marshallable.CopyOut.
  8340  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8341      return u.CopyOutN(cc, addr, u.SizeBytes())
  8342  }
  8343  
  8344  // CopyInN implements marshal.Marshallable.CopyInN.
  8345  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8346      if !u.GPUUUID.Packed() {
  8347          // Type UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  8348          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  8349          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8350          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  8351          // partially unmarshalled struct.
  8352          u.UnmarshalBytes(buf) // escapes: fallback.
  8353          return length, err
  8354      }
  8355  
  8356      // Construct a slice backed by dst's underlying memory.
  8357      var buf []byte
  8358      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8359      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8360      hdr.Len = u.SizeBytes()
  8361      hdr.Cap = u.SizeBytes()
  8362  
  8363      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8364      // Since we bypassed the compiler's escape analysis, indicate that u
  8365      // must live until the use above.
  8366      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8367      return length, err
  8368  }
  8369  
  8370  // CopyIn implements marshal.Marshallable.CopyIn.
  8371  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8372      return u.CopyInN(cc, addr, u.SizeBytes())
  8373  }
  8374  
  8375  // WriteTo implements io.WriterTo.WriteTo.
  8376  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8377      if !u.GPUUUID.Packed() {
  8378          // Type UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8379          buf := make([]byte, u.SizeBytes())
  8380          u.MarshalBytes(buf)
  8381          length, err := writer.Write(buf)
  8382          return int64(length), err
  8383      }
  8384  
  8385      // Construct a slice backed by dst's underlying memory.
  8386      var buf []byte
  8387      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8388      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8389      hdr.Len = u.SizeBytes()
  8390      hdr.Cap = u.SizeBytes()
  8391  
  8392      length, err := writer.Write(buf)
  8393      // Since we bypassed the compiler's escape analysis, indicate that u
  8394      // must live until the use above.
  8395      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8396      return int64(length), err
  8397  }
  8398  
  8399  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8400  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) SizeBytes() int {
  8401      return 40 +
  8402          (*UvmGpuMappingAttributes)(nil).SizeBytes()*UVM_MAX_GPUS +
  8403          (*Handle)(nil).SizeBytes() +
  8404          (*Handle)(nil).SizeBytes()
  8405  }
  8406  
  8407  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8408  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) MarshalBytes(dst []byte) []byte {
  8409      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Base))
  8410      dst = dst[8:]
  8411      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Length))
  8412      dst = dst[8:]
  8413      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Offset))
  8414      dst = dst[8:]
  8415      for idx := 0; idx < UVM_MAX_GPUS; idx++ {
  8416          dst = p.PerGPUAttributes[idx].MarshalUnsafe(dst)
  8417      }
  8418      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.GPUAttributesCount))
  8419      dst = dst[8:]
  8420      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD))
  8421      dst = dst[4:]
  8422      dst = p.HClient.MarshalUnsafe(dst)
  8423      dst = p.HMemory.MarshalUnsafe(dst)
  8424      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus))
  8425      dst = dst[4:]
  8426      return dst
  8427  }
  8428  
  8429  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8430  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) UnmarshalBytes(src []byte) []byte {
  8431      p.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8432      src = src[8:]
  8433      p.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8434      src = src[8:]
  8435      p.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8436      src = src[8:]
  8437      for idx := 0; idx < UVM_MAX_GPUS; idx++ {
  8438          src = p.PerGPUAttributes[idx].UnmarshalUnsafe(src)
  8439      }
  8440      p.GPUAttributesCount = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8441      src = src[8:]
  8442      p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  8443      src = src[4:]
  8444      src = p.HClient.UnmarshalUnsafe(src)
  8445      src = p.HMemory.UnmarshalUnsafe(src)
  8446      p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8447      src = src[4:]
  8448      return src
  8449  }
  8450  
  8451  // Packed implements marshal.Marshallable.Packed.
  8452  //go:nosplit
  8453  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) Packed() bool {
  8454      return p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed()
  8455  }
  8456  
  8457  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8458  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8459      if p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8460          size := p.SizeBytes()
  8461          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  8462          return dst[size:]
  8463      }
  8464      // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  8465      return p.MarshalBytes(dst)
  8466  }
  8467  
  8468  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8469  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8470      if p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8471          size := p.SizeBytes()
  8472          gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  8473          return src[size:]
  8474      }
  8475      // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  8476      return p.UnmarshalBytes(src)
  8477  }
  8478  
  8479  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8480  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8481      if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8482          // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8483          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8484          p.MarshalBytes(buf) // escapes: fallback.
  8485          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8486      }
  8487  
  8488      // Construct a slice backed by dst's underlying memory.
  8489      var buf []byte
  8490      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8491      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8492      hdr.Len = p.SizeBytes()
  8493      hdr.Cap = p.SizeBytes()
  8494  
  8495      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8496      // Since we bypassed the compiler's escape analysis, indicate that p
  8497      // must live until the use above.
  8498      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8499      return length, err
  8500  }
  8501  
  8502  // CopyOut implements marshal.Marshallable.CopyOut.
  8503  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8504      return p.CopyOutN(cc, addr, p.SizeBytes())
  8505  }
  8506  
  8507  // CopyInN implements marshal.Marshallable.CopyInN.
  8508  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8509      if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8510          // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  8511          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8512          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8513          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  8514          // partially unmarshalled struct.
  8515          p.UnmarshalBytes(buf) // escapes: fallback.
  8516          return length, err
  8517      }
  8518  
  8519      // Construct a slice backed by dst's underlying memory.
  8520      var buf []byte
  8521      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8522      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8523      hdr.Len = p.SizeBytes()
  8524      hdr.Cap = p.SizeBytes()
  8525  
  8526      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8527      // Since we bypassed the compiler's escape analysis, indicate that p
  8528      // must live until the use above.
  8529      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8530      return length, err
  8531  }
  8532  
  8533  // CopyIn implements marshal.Marshallable.CopyIn.
  8534  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8535      return p.CopyInN(cc, addr, p.SizeBytes())
  8536  }
  8537  
  8538  // WriteTo implements io.WriterTo.WriteTo.
  8539  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8540      if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8541          // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8542          buf := make([]byte, p.SizeBytes())
  8543          p.MarshalBytes(buf)
  8544          length, err := writer.Write(buf)
  8545          return int64(length), err
  8546      }
  8547  
  8548      // Construct a slice backed by dst's underlying memory.
  8549      var buf []byte
  8550      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8551      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8552      hdr.Len = p.SizeBytes()
  8553      hdr.Cap = p.SizeBytes()
  8554  
  8555      length, err := writer.Write(buf)
  8556      // Since we bypassed the compiler's escape analysis, indicate that p
  8557      // must live until the use above.
  8558      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8559      return int64(length), err
  8560  }
  8561  
  8562  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8563  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) SizeBytes() int {
  8564      return 40 +
  8565          (*UvmGpuMappingAttributes)(nil).SizeBytes()*UVM_MAX_GPUS_V2 +
  8566          (*Handle)(nil).SizeBytes() +
  8567          (*Handle)(nil).SizeBytes()
  8568  }
  8569  
  8570  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8571  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) MarshalBytes(dst []byte) []byte {
  8572      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Base))
  8573      dst = dst[8:]
  8574      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Length))
  8575      dst = dst[8:]
  8576      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Offset))
  8577      dst = dst[8:]
  8578      for idx := 0; idx < UVM_MAX_GPUS_V2; idx++ {
  8579          dst = p.PerGPUAttributes[idx].MarshalUnsafe(dst)
  8580      }
  8581      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.GPUAttributesCount))
  8582      dst = dst[8:]
  8583      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD))
  8584      dst = dst[4:]
  8585      dst = p.HClient.MarshalUnsafe(dst)
  8586      dst = p.HMemory.MarshalUnsafe(dst)
  8587      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus))
  8588      dst = dst[4:]
  8589      return dst
  8590  }
  8591  
  8592  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8593  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) UnmarshalBytes(src []byte) []byte {
  8594      p.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8595      src = src[8:]
  8596      p.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8597      src = src[8:]
  8598      p.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8599      src = src[8:]
  8600      for idx := 0; idx < UVM_MAX_GPUS_V2; idx++ {
  8601          src = p.PerGPUAttributes[idx].UnmarshalUnsafe(src)
  8602      }
  8603      p.GPUAttributesCount = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8604      src = src[8:]
  8605      p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  8606      src = src[4:]
  8607      src = p.HClient.UnmarshalUnsafe(src)
  8608      src = p.HMemory.UnmarshalUnsafe(src)
  8609      p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8610      src = src[4:]
  8611      return src
  8612  }
  8613  
  8614  // Packed implements marshal.Marshallable.Packed.
  8615  //go:nosplit
  8616  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) Packed() bool {
  8617      return p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed()
  8618  }
  8619  
  8620  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8621  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) MarshalUnsafe(dst []byte) []byte {
  8622      if p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8623          size := p.SizeBytes()
  8624          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  8625          return dst[size:]
  8626      }
  8627      // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550 doesn't have a packed layout in memory, fallback to MarshalBytes.
  8628      return p.MarshalBytes(dst)
  8629  }
  8630  
  8631  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8632  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) UnmarshalUnsafe(src []byte) []byte {
  8633      if p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8634          size := p.SizeBytes()
  8635          gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  8636          return src[size:]
  8637      }
  8638      // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  8639      return p.UnmarshalBytes(src)
  8640  }
  8641  
  8642  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8643  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8644      if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8645          // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550 doesn't have a packed layout in memory, fall back to MarshalBytes.
  8646          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8647          p.MarshalBytes(buf) // escapes: fallback.
  8648          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8649      }
  8650  
  8651      // Construct a slice backed by dst's underlying memory.
  8652      var buf []byte
  8653      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8654      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8655      hdr.Len = p.SizeBytes()
  8656      hdr.Cap = p.SizeBytes()
  8657  
  8658      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8659      // Since we bypassed the compiler's escape analysis, indicate that p
  8660      // must live until the use above.
  8661      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8662      return length, err
  8663  }
  8664  
  8665  // CopyOut implements marshal.Marshallable.CopyOut.
  8666  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8667      return p.CopyOutN(cc, addr, p.SizeBytes())
  8668  }
  8669  
  8670  // CopyInN implements marshal.Marshallable.CopyInN.
  8671  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8672      if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8673          // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550 doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  8674          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8675          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8676          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  8677          // partially unmarshalled struct.
  8678          p.UnmarshalBytes(buf) // escapes: fallback.
  8679          return length, err
  8680      }
  8681  
  8682      // Construct a slice backed by dst's underlying memory.
  8683      var buf []byte
  8684      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8685      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8686      hdr.Len = p.SizeBytes()
  8687      hdr.Cap = p.SizeBytes()
  8688  
  8689      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8690      // Since we bypassed the compiler's escape analysis, indicate that p
  8691      // must live until the use above.
  8692      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8693      return length, err
  8694  }
  8695  
  8696  // CopyIn implements marshal.Marshallable.CopyIn.
  8697  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8698      return p.CopyInN(cc, addr, p.SizeBytes())
  8699  }
  8700  
  8701  // WriteTo implements io.WriterTo.WriteTo.
  8702  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550) WriteTo(writer io.Writer) (int64, error) {
  8703      if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  8704          // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS_V550 doesn't have a packed layout in memory, fall back to MarshalBytes.
  8705          buf := make([]byte, p.SizeBytes())
  8706          p.MarshalBytes(buf)
  8707          length, err := writer.Write(buf)
  8708          return int64(length), err
  8709      }
  8710  
  8711      // Construct a slice backed by dst's underlying memory.
  8712      var buf []byte
  8713      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8714      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8715      hdr.Len = p.SizeBytes()
  8716      hdr.Cap = p.SizeBytes()
  8717  
  8718      length, err := writer.Write(buf)
  8719      // Since we bypassed the compiler's escape analysis, indicate that p
  8720      // must live until the use above.
  8721      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8722      return int64(length), err
  8723  }
  8724  
  8725  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8726  func (u *UVM_MM_INITIALIZE_PARAMS) SizeBytes() int {
  8727      return 8
  8728  }
  8729  
  8730  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8731  func (u *UVM_MM_INITIALIZE_PARAMS) MarshalBytes(dst []byte) []byte {
  8732      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.UvmFD))
  8733      dst = dst[4:]
  8734      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.Status))
  8735      dst = dst[4:]
  8736      return dst
  8737  }
  8738  
  8739  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8740  func (u *UVM_MM_INITIALIZE_PARAMS) UnmarshalBytes(src []byte) []byte {
  8741      u.UvmFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  8742      src = src[4:]
  8743      u.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8744      src = src[4:]
  8745      return src
  8746  }
  8747  
  8748  // Packed implements marshal.Marshallable.Packed.
  8749  //go:nosplit
  8750  func (u *UVM_MM_INITIALIZE_PARAMS) Packed() bool {
  8751      return true
  8752  }
  8753  
  8754  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8755  func (u *UVM_MM_INITIALIZE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8756      size := u.SizeBytes()
  8757      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  8758      return dst[size:]
  8759  }
  8760  
  8761  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8762  func (u *UVM_MM_INITIALIZE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8763      size := u.SizeBytes()
  8764      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  8765      return src[size:]
  8766  }
  8767  
  8768  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8769  func (u *UVM_MM_INITIALIZE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8770      // Construct a slice backed by dst's underlying memory.
  8771      var buf []byte
  8772      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8773      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8774      hdr.Len = u.SizeBytes()
  8775      hdr.Cap = u.SizeBytes()
  8776  
  8777      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8778      // Since we bypassed the compiler's escape analysis, indicate that u
  8779      // must live until the use above.
  8780      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8781      return length, err
  8782  }
  8783  
  8784  // CopyOut implements marshal.Marshallable.CopyOut.
  8785  func (u *UVM_MM_INITIALIZE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8786      return u.CopyOutN(cc, addr, u.SizeBytes())
  8787  }
  8788  
  8789  // CopyInN implements marshal.Marshallable.CopyInN.
  8790  func (u *UVM_MM_INITIALIZE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8791      // Construct a slice backed by dst's underlying memory.
  8792      var buf []byte
  8793      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8794      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8795      hdr.Len = u.SizeBytes()
  8796      hdr.Cap = u.SizeBytes()
  8797  
  8798      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8799      // Since we bypassed the compiler's escape analysis, indicate that u
  8800      // must live until the use above.
  8801      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8802      return length, err
  8803  }
  8804  
  8805  // CopyIn implements marshal.Marshallable.CopyIn.
  8806  func (u *UVM_MM_INITIALIZE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8807      return u.CopyInN(cc, addr, u.SizeBytes())
  8808  }
  8809  
  8810  // WriteTo implements io.WriterTo.WriteTo.
  8811  func (u *UVM_MM_INITIALIZE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8812      // Construct a slice backed by dst's underlying memory.
  8813      var buf []byte
  8814      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8815      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8816      hdr.Len = u.SizeBytes()
  8817      hdr.Cap = u.SizeBytes()
  8818  
  8819      length, err := writer.Write(buf)
  8820      // Since we bypassed the compiler's escape analysis, indicate that u
  8821      // must live until the use above.
  8822      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8823      return int64(length), err
  8824  }
  8825  
  8826  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8827  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) SizeBytes() int {
  8828      return 5 +
  8829          1*3
  8830  }
  8831  
  8832  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8833  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) MarshalBytes(dst []byte) []byte {
  8834      dst[0] = byte(u.PageableMemAccess)
  8835      dst = dst[1:]
  8836      for idx := 0; idx < 3; idx++ {
  8837          dst[0] = byte(u.Pad[idx])
  8838          dst = dst[1:]
  8839      }
  8840      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  8841      dst = dst[4:]
  8842      return dst
  8843  }
  8844  
  8845  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8846  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) UnmarshalBytes(src []byte) []byte {
  8847      u.PageableMemAccess = uint8(src[0])
  8848      src = src[1:]
  8849      for idx := 0; idx < 3; idx++ {
  8850          u.Pad[idx] = src[0]
  8851          src = src[1:]
  8852      }
  8853      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8854      src = src[4:]
  8855      return src
  8856  }
  8857  
  8858  // Packed implements marshal.Marshallable.Packed.
  8859  //go:nosplit
  8860  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) Packed() bool {
  8861      return true
  8862  }
  8863  
  8864  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8865  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8866      size := u.SizeBytes()
  8867      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  8868      return dst[size:]
  8869  }
  8870  
  8871  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8872  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8873      size := u.SizeBytes()
  8874      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  8875      return src[size:]
  8876  }
  8877  
  8878  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8879  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8880      // Construct a slice backed by dst's underlying memory.
  8881      var buf []byte
  8882      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8883      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8884      hdr.Len = u.SizeBytes()
  8885      hdr.Cap = u.SizeBytes()
  8886  
  8887      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8888      // Since we bypassed the compiler's escape analysis, indicate that u
  8889      // must live until the use above.
  8890      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8891      return length, err
  8892  }
  8893  
  8894  // CopyOut implements marshal.Marshallable.CopyOut.
  8895  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8896      return u.CopyOutN(cc, addr, u.SizeBytes())
  8897  }
  8898  
  8899  // CopyInN implements marshal.Marshallable.CopyInN.
  8900  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8901      // Construct a slice backed by dst's underlying memory.
  8902      var buf []byte
  8903      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8904      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8905      hdr.Len = u.SizeBytes()
  8906      hdr.Cap = u.SizeBytes()
  8907  
  8908      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8909      // Since we bypassed the compiler's escape analysis, indicate that u
  8910      // must live until the use above.
  8911      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8912      return length, err
  8913  }
  8914  
  8915  // CopyIn implements marshal.Marshallable.CopyIn.
  8916  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8917      return u.CopyInN(cc, addr, u.SizeBytes())
  8918  }
  8919  
  8920  // WriteTo implements io.WriterTo.WriteTo.
  8921  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8922      // Construct a slice backed by dst's underlying memory.
  8923      var buf []byte
  8924      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8925      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8926      hdr.Len = u.SizeBytes()
  8927      hdr.Cap = u.SizeBytes()
  8928  
  8929      length, err := writer.Write(buf)
  8930      // Since we bypassed the compiler's escape analysis, indicate that u
  8931      // must live until the use above.
  8932      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8933      return int64(length), err
  8934  }
  8935  
  8936  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8937  func (p *UVM_REGISTER_CHANNEL_PARAMS) SizeBytes() int {
  8938      return 24 +
  8939          (*NvUUID)(nil).SizeBytes() +
  8940          (*Handle)(nil).SizeBytes() +
  8941          (*Handle)(nil).SizeBytes() +
  8942          1*4 +
  8943          1*4
  8944  }
  8945  
  8946  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8947  func (p *UVM_REGISTER_CHANNEL_PARAMS) MarshalBytes(dst []byte) []byte {
  8948      dst = p.GPUUUID.MarshalUnsafe(dst)
  8949      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD))
  8950      dst = dst[4:]
  8951      dst = p.HClient.MarshalUnsafe(dst)
  8952      dst = p.HChannel.MarshalUnsafe(dst)
  8953      for idx := 0; idx < 4; idx++ {
  8954          dst[0] = byte(p.Pad[idx])
  8955          dst = dst[1:]
  8956      }
  8957      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Base))
  8958      dst = dst[8:]
  8959      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Length))
  8960      dst = dst[8:]
  8961      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus))
  8962      dst = dst[4:]
  8963      for idx := 0; idx < 4; idx++ {
  8964          dst[0] = byte(p.Pad0[idx])
  8965          dst = dst[1:]
  8966      }
  8967      return dst
  8968  }
  8969  
  8970  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8971  func (p *UVM_REGISTER_CHANNEL_PARAMS) UnmarshalBytes(src []byte) []byte {
  8972      src = p.GPUUUID.UnmarshalUnsafe(src)
  8973      p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  8974      src = src[4:]
  8975      src = p.HClient.UnmarshalUnsafe(src)
  8976      src = p.HChannel.UnmarshalUnsafe(src)
  8977      for idx := 0; idx < 4; idx++ {
  8978          p.Pad[idx] = src[0]
  8979          src = src[1:]
  8980      }
  8981      p.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8982      src = src[8:]
  8983      p.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8984      src = src[8:]
  8985      p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8986      src = src[4:]
  8987      for idx := 0; idx < 4; idx++ {
  8988          p.Pad0[idx] = src[0]
  8989          src = src[1:]
  8990      }
  8991      return src
  8992  }
  8993  
  8994  // Packed implements marshal.Marshallable.Packed.
  8995  //go:nosplit
  8996  func (p *UVM_REGISTER_CHANNEL_PARAMS) Packed() bool {
  8997      return p.GPUUUID.Packed() && p.HChannel.Packed() && p.HClient.Packed()
  8998  }
  8999  
  9000  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  9001  func (p *UVM_REGISTER_CHANNEL_PARAMS) MarshalUnsafe(dst []byte) []byte {
  9002      if p.GPUUUID.Packed() && p.HChannel.Packed() && p.HClient.Packed() {
  9003          size := p.SizeBytes()
  9004          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  9005          return dst[size:]
  9006      }
  9007      // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  9008      return p.MarshalBytes(dst)
  9009  }
  9010  
  9011  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  9012  func (p *UVM_REGISTER_CHANNEL_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  9013      if p.GPUUUID.Packed() && p.HChannel.Packed() && p.HClient.Packed() {
  9014          size := p.SizeBytes()
  9015          gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  9016          return src[size:]
  9017      }
  9018      // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  9019      return p.UnmarshalBytes(src)
  9020  }
  9021  
  9022  // CopyOutN implements marshal.Marshallable.CopyOutN.
  9023  func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9024      if !p.GPUUUID.Packed() && p.HChannel.Packed() && p.HClient.Packed() {
  9025          // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9026          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  9027          p.MarshalBytes(buf) // escapes: fallback.
  9028          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9029      }
  9030  
  9031      // Construct a slice backed by dst's underlying memory.
  9032      var buf []byte
  9033      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9034      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  9035      hdr.Len = p.SizeBytes()
  9036      hdr.Cap = p.SizeBytes()
  9037  
  9038      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9039      // Since we bypassed the compiler's escape analysis, indicate that p
  9040      // must live until the use above.
  9041      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  9042      return length, err
  9043  }
  9044  
  9045  // CopyOut implements marshal.Marshallable.CopyOut.
  9046  func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9047      return p.CopyOutN(cc, addr, p.SizeBytes())
  9048  }
  9049  
  9050  // CopyInN implements marshal.Marshallable.CopyInN.
  9051  func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9052      if !p.GPUUUID.Packed() && p.HChannel.Packed() && p.HClient.Packed() {
  9053          // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  9054          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  9055          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9056          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  9057          // partially unmarshalled struct.
  9058          p.UnmarshalBytes(buf) // escapes: fallback.
  9059          return length, err
  9060      }
  9061  
  9062      // Construct a slice backed by dst's underlying memory.
  9063      var buf []byte
  9064      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9065      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  9066      hdr.Len = p.SizeBytes()
  9067      hdr.Cap = p.SizeBytes()
  9068  
  9069      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9070      // Since we bypassed the compiler's escape analysis, indicate that p
  9071      // must live until the use above.
  9072      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  9073      return length, err
  9074  }
  9075  
  9076  // CopyIn implements marshal.Marshallable.CopyIn.
  9077  func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9078      return p.CopyInN(cc, addr, p.SizeBytes())
  9079  }
  9080  
  9081  // WriteTo implements io.WriterTo.WriteTo.
  9082  func (p *UVM_REGISTER_CHANNEL_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  9083      if !p.GPUUUID.Packed() && p.HChannel.Packed() && p.HClient.Packed() {
  9084          // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9085          buf := make([]byte, p.SizeBytes())
  9086          p.MarshalBytes(buf)
  9087          length, err := writer.Write(buf)
  9088          return int64(length), err
  9089      }
  9090  
  9091      // Construct a slice backed by dst's underlying memory.
  9092      var buf []byte
  9093      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9094      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  9095      hdr.Len = p.SizeBytes()
  9096      hdr.Cap = p.SizeBytes()
  9097  
  9098      length, err := writer.Write(buf)
  9099      // Since we bypassed the compiler's escape analysis, indicate that p
  9100      // must live until the use above.
  9101      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  9102      return int64(length), err
  9103  }
  9104  
  9105  // SizeBytes implements marshal.Marshallable.SizeBytes.
  9106  func (p *UVM_REGISTER_GPU_PARAMS) SizeBytes() int {
  9107      return 13 +
  9108          (*NvUUID)(nil).SizeBytes() +
  9109          1*3 +
  9110          (*Handle)(nil).SizeBytes() +
  9111          (*Handle)(nil).SizeBytes()
  9112  }
  9113  
  9114  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  9115  func (p *UVM_REGISTER_GPU_PARAMS) MarshalBytes(dst []byte) []byte {
  9116      dst = p.GPUUUID.MarshalUnsafe(dst)
  9117      dst[0] = byte(p.NumaEnabled)
  9118      dst = dst[1:]
  9119      for idx := 0; idx < 3; idx++ {
  9120          dst[0] = byte(p.Pad[idx])
  9121          dst = dst[1:]
  9122      }
  9123      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.NumaNodeID))
  9124      dst = dst[4:]
  9125      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD))
  9126      dst = dst[4:]
  9127      dst = p.HClient.MarshalUnsafe(dst)
  9128      dst = p.HSMCPartRef.MarshalUnsafe(dst)
  9129      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus))
  9130      dst = dst[4:]
  9131      return dst
  9132  }
  9133  
  9134  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  9135  func (p *UVM_REGISTER_GPU_PARAMS) UnmarshalBytes(src []byte) []byte {
  9136      src = p.GPUUUID.UnmarshalUnsafe(src)
  9137      p.NumaEnabled = uint8(src[0])
  9138      src = src[1:]
  9139      for idx := 0; idx < 3; idx++ {
  9140          p.Pad[idx] = src[0]
  9141          src = src[1:]
  9142      }
  9143      p.NumaNodeID = int32(hostarch.ByteOrder.Uint32(src[:4]))
  9144      src = src[4:]
  9145      p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  9146      src = src[4:]
  9147      src = p.HClient.UnmarshalUnsafe(src)
  9148      src = p.HSMCPartRef.UnmarshalUnsafe(src)
  9149      p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9150      src = src[4:]
  9151      return src
  9152  }
  9153  
  9154  // Packed implements marshal.Marshallable.Packed.
  9155  //go:nosplit
  9156  func (p *UVM_REGISTER_GPU_PARAMS) Packed() bool {
  9157      return p.GPUUUID.Packed() && p.HClient.Packed() && p.HSMCPartRef.Packed()
  9158  }
  9159  
  9160  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  9161  func (p *UVM_REGISTER_GPU_PARAMS) MarshalUnsafe(dst []byte) []byte {
  9162      if p.GPUUUID.Packed() && p.HClient.Packed() && p.HSMCPartRef.Packed() {
  9163          size := p.SizeBytes()
  9164          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  9165          return dst[size:]
  9166      }
  9167      // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  9168      return p.MarshalBytes(dst)
  9169  }
  9170  
  9171  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  9172  func (p *UVM_REGISTER_GPU_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  9173      if p.GPUUUID.Packed() && p.HClient.Packed() && p.HSMCPartRef.Packed() {
  9174          size := p.SizeBytes()
  9175          gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  9176          return src[size:]
  9177      }
  9178      // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  9179      return p.UnmarshalBytes(src)
  9180  }
  9181  
  9182  // CopyOutN implements marshal.Marshallable.CopyOutN.
  9183  func (p *UVM_REGISTER_GPU_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9184      if !p.GPUUUID.Packed() && p.HClient.Packed() && p.HSMCPartRef.Packed() {
  9185          // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9186          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  9187          p.MarshalBytes(buf) // escapes: fallback.
  9188          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9189      }
  9190  
  9191      // Construct a slice backed by dst's underlying memory.
  9192      var buf []byte
  9193      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9194      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  9195      hdr.Len = p.SizeBytes()
  9196      hdr.Cap = p.SizeBytes()
  9197  
  9198      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9199      // Since we bypassed the compiler's escape analysis, indicate that p
  9200      // must live until the use above.
  9201      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  9202      return length, err
  9203  }
  9204  
  9205  // CopyOut implements marshal.Marshallable.CopyOut.
  9206  func (p *UVM_REGISTER_GPU_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9207      return p.CopyOutN(cc, addr, p.SizeBytes())
  9208  }
  9209  
  9210  // CopyInN implements marshal.Marshallable.CopyInN.
  9211  func (p *UVM_REGISTER_GPU_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9212      if !p.GPUUUID.Packed() && p.HClient.Packed() && p.HSMCPartRef.Packed() {
  9213          // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  9214          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  9215          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9216          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  9217          // partially unmarshalled struct.
  9218          p.UnmarshalBytes(buf) // escapes: fallback.
  9219          return length, err
  9220      }
  9221  
  9222      // Construct a slice backed by dst's underlying memory.
  9223      var buf []byte
  9224      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9225      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  9226      hdr.Len = p.SizeBytes()
  9227      hdr.Cap = p.SizeBytes()
  9228  
  9229      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9230      // Since we bypassed the compiler's escape analysis, indicate that p
  9231      // must live until the use above.
  9232      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  9233      return length, err
  9234  }
  9235  
  9236  // CopyIn implements marshal.Marshallable.CopyIn.
  9237  func (p *UVM_REGISTER_GPU_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9238      return p.CopyInN(cc, addr, p.SizeBytes())
  9239  }
  9240  
  9241  // WriteTo implements io.WriterTo.WriteTo.
  9242  func (p *UVM_REGISTER_GPU_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  9243      if !p.GPUUUID.Packed() && p.HClient.Packed() && p.HSMCPartRef.Packed() {
  9244          // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9245          buf := make([]byte, p.SizeBytes())
  9246          p.MarshalBytes(buf)
  9247          length, err := writer.Write(buf)
  9248          return int64(length), err
  9249      }
  9250  
  9251      // Construct a slice backed by dst's underlying memory.
  9252      var buf []byte
  9253      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9254      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  9255      hdr.Len = p.SizeBytes()
  9256      hdr.Cap = p.SizeBytes()
  9257  
  9258      length, err := writer.Write(buf)
  9259      // Since we bypassed the compiler's escape analysis, indicate that p
  9260      // must live until the use above.
  9261      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  9262      return int64(length), err
  9263  }
  9264  
  9265  // SizeBytes implements marshal.Marshallable.SizeBytes.
  9266  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) SizeBytes() int {
  9267      return 8 +
  9268          (*NvUUID)(nil).SizeBytes() +
  9269          (*Handle)(nil).SizeBytes() +
  9270          (*Handle)(nil).SizeBytes()
  9271  }
  9272  
  9273  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  9274  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) MarshalBytes(dst []byte) []byte {
  9275      dst = p.GPUUUID.MarshalUnsafe(dst)
  9276      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD))
  9277      dst = dst[4:]
  9278      dst = p.HClient.MarshalUnsafe(dst)
  9279      dst = p.HVASpace.MarshalUnsafe(dst)
  9280      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus))
  9281      dst = dst[4:]
  9282      return dst
  9283  }
  9284  
  9285  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  9286  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) UnmarshalBytes(src []byte) []byte {
  9287      src = p.GPUUUID.UnmarshalUnsafe(src)
  9288      p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  9289      src = src[4:]
  9290      src = p.HClient.UnmarshalUnsafe(src)
  9291      src = p.HVASpace.UnmarshalUnsafe(src)
  9292      p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9293      src = src[4:]
  9294      return src
  9295  }
  9296  
  9297  // Packed implements marshal.Marshallable.Packed.
  9298  //go:nosplit
  9299  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) Packed() bool {
  9300      return p.GPUUUID.Packed() && p.HClient.Packed() && p.HVASpace.Packed()
  9301  }
  9302  
  9303  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  9304  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  9305      if p.GPUUUID.Packed() && p.HClient.Packed() && p.HVASpace.Packed() {
  9306          size := p.SizeBytes()
  9307          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  9308          return dst[size:]
  9309      }
  9310      // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  9311      return p.MarshalBytes(dst)
  9312  }
  9313  
  9314  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  9315  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  9316      if p.GPUUUID.Packed() && p.HClient.Packed() && p.HVASpace.Packed() {
  9317          size := p.SizeBytes()
  9318          gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  9319          return src[size:]
  9320      }
  9321      // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  9322      return p.UnmarshalBytes(src)
  9323  }
  9324  
  9325  // CopyOutN implements marshal.Marshallable.CopyOutN.
  9326  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9327      if !p.GPUUUID.Packed() && p.HClient.Packed() && p.HVASpace.Packed() {
  9328          // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9329          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  9330          p.MarshalBytes(buf) // escapes: fallback.
  9331          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9332      }
  9333  
  9334      // Construct a slice backed by dst's underlying memory.
  9335      var buf []byte
  9336      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9337      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  9338      hdr.Len = p.SizeBytes()
  9339      hdr.Cap = p.SizeBytes()
  9340  
  9341      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9342      // Since we bypassed the compiler's escape analysis, indicate that p
  9343      // must live until the use above.
  9344      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  9345      return length, err
  9346  }
  9347  
  9348  // CopyOut implements marshal.Marshallable.CopyOut.
  9349  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9350      return p.CopyOutN(cc, addr, p.SizeBytes())
  9351  }
  9352  
  9353  // CopyInN implements marshal.Marshallable.CopyInN.
  9354  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9355      if !p.GPUUUID.Packed() && p.HClient.Packed() && p.HVASpace.Packed() {
  9356          // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  9357          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  9358          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9359          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  9360          // partially unmarshalled struct.
  9361          p.UnmarshalBytes(buf) // escapes: fallback.
  9362          return length, err
  9363      }
  9364  
  9365      // Construct a slice backed by dst's underlying memory.
  9366      var buf []byte
  9367      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9368      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  9369      hdr.Len = p.SizeBytes()
  9370      hdr.Cap = p.SizeBytes()
  9371  
  9372      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9373      // Since we bypassed the compiler's escape analysis, indicate that p
  9374      // must live until the use above.
  9375      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  9376      return length, err
  9377  }
  9378  
  9379  // CopyIn implements marshal.Marshallable.CopyIn.
  9380  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9381      return p.CopyInN(cc, addr, p.SizeBytes())
  9382  }
  9383  
  9384  // WriteTo implements io.WriterTo.WriteTo.
  9385  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  9386      if !p.GPUUUID.Packed() && p.HClient.Packed() && p.HVASpace.Packed() {
  9387          // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9388          buf := make([]byte, p.SizeBytes())
  9389          p.MarshalBytes(buf)
  9390          length, err := writer.Write(buf)
  9391          return int64(length), err
  9392      }
  9393  
  9394      // Construct a slice backed by dst's underlying memory.
  9395      var buf []byte
  9396      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9397      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  9398      hdr.Len = p.SizeBytes()
  9399      hdr.Cap = p.SizeBytes()
  9400  
  9401      length, err := writer.Write(buf)
  9402      // Since we bypassed the compiler's escape analysis, indicate that p
  9403      // must live until the use above.
  9404      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  9405      return int64(length), err
  9406  }
  9407  
  9408  // SizeBytes implements marshal.Marshallable.SizeBytes.
  9409  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) SizeBytes() int {
  9410      return 20 +
  9411          (*NvUUID)(nil).SizeBytes() +
  9412          1*4
  9413  }
  9414  
  9415  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  9416  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) MarshalBytes(dst []byte) []byte {
  9417      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RequestedBase))
  9418      dst = dst[8:]
  9419      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  9420      dst = dst[8:]
  9421      dst = u.PreferredLocation.MarshalUnsafe(dst)
  9422      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  9423      dst = dst[4:]
  9424      for idx := 0; idx < 4; idx++ {
  9425          dst[0] = byte(u.Pad0[idx])
  9426          dst = dst[1:]
  9427      }
  9428      return dst
  9429  }
  9430  
  9431  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  9432  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) UnmarshalBytes(src []byte) []byte {
  9433      u.RequestedBase = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  9434      src = src[8:]
  9435      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  9436      src = src[8:]
  9437      src = u.PreferredLocation.UnmarshalUnsafe(src)
  9438      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9439      src = src[4:]
  9440      for idx := 0; idx < 4; idx++ {
  9441          u.Pad0[idx] = src[0]
  9442          src = src[1:]
  9443      }
  9444      return src
  9445  }
  9446  
  9447  // Packed implements marshal.Marshallable.Packed.
  9448  //go:nosplit
  9449  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) Packed() bool {
  9450      return u.PreferredLocation.Packed()
  9451  }
  9452  
  9453  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  9454  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  9455      if u.PreferredLocation.Packed() {
  9456          size := u.SizeBytes()
  9457          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  9458          return dst[size:]
  9459      }
  9460      // Type UVM_SET_PREFERRED_LOCATION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  9461      return u.MarshalBytes(dst)
  9462  }
  9463  
  9464  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  9465  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  9466      if u.PreferredLocation.Packed() {
  9467          size := u.SizeBytes()
  9468          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  9469          return src[size:]
  9470      }
  9471      // Type UVM_SET_PREFERRED_LOCATION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  9472      return u.UnmarshalBytes(src)
  9473  }
  9474  
  9475  // CopyOutN implements marshal.Marshallable.CopyOutN.
  9476  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9477      if !u.PreferredLocation.Packed() {
  9478          // Type UVM_SET_PREFERRED_LOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9479          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  9480          u.MarshalBytes(buf) // escapes: fallback.
  9481          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9482      }
  9483  
  9484      // Construct a slice backed by dst's underlying memory.
  9485      var buf []byte
  9486      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9487      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9488      hdr.Len = u.SizeBytes()
  9489      hdr.Cap = u.SizeBytes()
  9490  
  9491      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9492      // Since we bypassed the compiler's escape analysis, indicate that u
  9493      // must live until the use above.
  9494      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9495      return length, err
  9496  }
  9497  
  9498  // CopyOut implements marshal.Marshallable.CopyOut.
  9499  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9500      return u.CopyOutN(cc, addr, u.SizeBytes())
  9501  }
  9502  
  9503  // CopyInN implements marshal.Marshallable.CopyInN.
  9504  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9505      if !u.PreferredLocation.Packed() {
  9506          // Type UVM_SET_PREFERRED_LOCATION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  9507          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  9508          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9509          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  9510          // partially unmarshalled struct.
  9511          u.UnmarshalBytes(buf) // escapes: fallback.
  9512          return length, err
  9513      }
  9514  
  9515      // Construct a slice backed by dst's underlying memory.
  9516      var buf []byte
  9517      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9518      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9519      hdr.Len = u.SizeBytes()
  9520      hdr.Cap = u.SizeBytes()
  9521  
  9522      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9523      // Since we bypassed the compiler's escape analysis, indicate that u
  9524      // must live until the use above.
  9525      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9526      return length, err
  9527  }
  9528  
  9529  // CopyIn implements marshal.Marshallable.CopyIn.
  9530  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9531      return u.CopyInN(cc, addr, u.SizeBytes())
  9532  }
  9533  
  9534  // WriteTo implements io.WriterTo.WriteTo.
  9535  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  9536      if !u.PreferredLocation.Packed() {
  9537          // Type UVM_SET_PREFERRED_LOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9538          buf := make([]byte, u.SizeBytes())
  9539          u.MarshalBytes(buf)
  9540          length, err := writer.Write(buf)
  9541          return int64(length), err
  9542      }
  9543  
  9544      // Construct a slice backed by dst's underlying memory.
  9545      var buf []byte
  9546      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9547      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9548      hdr.Len = u.SizeBytes()
  9549      hdr.Cap = u.SizeBytes()
  9550  
  9551      length, err := writer.Write(buf)
  9552      // Since we bypassed the compiler's escape analysis, indicate that u
  9553      // must live until the use above.
  9554      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9555      return int64(length), err
  9556  }
  9557  
  9558  // SizeBytes implements marshal.Marshallable.SizeBytes.
  9559  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) SizeBytes() int {
  9560      return 24 +
  9561          (*NvUUID)(nil).SizeBytes()
  9562  }
  9563  
  9564  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  9565  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) MarshalBytes(dst []byte) []byte {
  9566      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RequestedBase))
  9567      dst = dst[8:]
  9568      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  9569      dst = dst[8:]
  9570      dst = u.PreferredLocation.MarshalUnsafe(dst)
  9571      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.PreferredCPUNumaNode))
  9572      dst = dst[4:]
  9573      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  9574      dst = dst[4:]
  9575      return dst
  9576  }
  9577  
  9578  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  9579  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) UnmarshalBytes(src []byte) []byte {
  9580      u.RequestedBase = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  9581      src = src[8:]
  9582      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  9583      src = src[8:]
  9584      src = u.PreferredLocation.UnmarshalUnsafe(src)
  9585      u.PreferredCPUNumaNode = int32(hostarch.ByteOrder.Uint32(src[:4]))
  9586      src = src[4:]
  9587      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9588      src = src[4:]
  9589      return src
  9590  }
  9591  
  9592  // Packed implements marshal.Marshallable.Packed.
  9593  //go:nosplit
  9594  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) Packed() bool {
  9595      return u.PreferredLocation.Packed()
  9596  }
  9597  
  9598  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  9599  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) MarshalUnsafe(dst []byte) []byte {
  9600      if u.PreferredLocation.Packed() {
  9601          size := u.SizeBytes()
  9602          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  9603          return dst[size:]
  9604      }
  9605      // Type UVM_SET_PREFERRED_LOCATION_PARAMS_V550 doesn't have a packed layout in memory, fallback to MarshalBytes.
  9606      return u.MarshalBytes(dst)
  9607  }
  9608  
  9609  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  9610  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) UnmarshalUnsafe(src []byte) []byte {
  9611      if u.PreferredLocation.Packed() {
  9612          size := u.SizeBytes()
  9613          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  9614          return src[size:]
  9615      }
  9616      // Type UVM_SET_PREFERRED_LOCATION_PARAMS_V550 doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  9617      return u.UnmarshalBytes(src)
  9618  }
  9619  
  9620  // CopyOutN implements marshal.Marshallable.CopyOutN.
  9621  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9622      if !u.PreferredLocation.Packed() {
  9623          // Type UVM_SET_PREFERRED_LOCATION_PARAMS_V550 doesn't have a packed layout in memory, fall back to MarshalBytes.
  9624          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  9625          u.MarshalBytes(buf) // escapes: fallback.
  9626          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9627      }
  9628  
  9629      // Construct a slice backed by dst's underlying memory.
  9630      var buf []byte
  9631      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9632      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9633      hdr.Len = u.SizeBytes()
  9634      hdr.Cap = u.SizeBytes()
  9635  
  9636      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9637      // Since we bypassed the compiler's escape analysis, indicate that u
  9638      // must live until the use above.
  9639      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9640      return length, err
  9641  }
  9642  
  9643  // CopyOut implements marshal.Marshallable.CopyOut.
  9644  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9645      return u.CopyOutN(cc, addr, u.SizeBytes())
  9646  }
  9647  
  9648  // CopyInN implements marshal.Marshallable.CopyInN.
  9649  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9650      if !u.PreferredLocation.Packed() {
  9651          // Type UVM_SET_PREFERRED_LOCATION_PARAMS_V550 doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  9652          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  9653          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9654          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  9655          // partially unmarshalled struct.
  9656          u.UnmarshalBytes(buf) // escapes: fallback.
  9657          return length, err
  9658      }
  9659  
  9660      // Construct a slice backed by dst's underlying memory.
  9661      var buf []byte
  9662      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9663      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9664      hdr.Len = u.SizeBytes()
  9665      hdr.Cap = u.SizeBytes()
  9666  
  9667      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9668      // Since we bypassed the compiler's escape analysis, indicate that u
  9669      // must live until the use above.
  9670      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9671      return length, err
  9672  }
  9673  
  9674  // CopyIn implements marshal.Marshallable.CopyIn.
  9675  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9676      return u.CopyInN(cc, addr, u.SizeBytes())
  9677  }
  9678  
  9679  // WriteTo implements io.WriterTo.WriteTo.
  9680  func (u *UVM_SET_PREFERRED_LOCATION_PARAMS_V550) WriteTo(writer io.Writer) (int64, error) {
  9681      if !u.PreferredLocation.Packed() {
  9682          // Type UVM_SET_PREFERRED_LOCATION_PARAMS_V550 doesn't have a packed layout in memory, fall back to MarshalBytes.
  9683          buf := make([]byte, u.SizeBytes())
  9684          u.MarshalBytes(buf)
  9685          length, err := writer.Write(buf)
  9686          return int64(length), err
  9687      }
  9688  
  9689      // Construct a slice backed by dst's underlying memory.
  9690      var buf []byte
  9691      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9692      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9693      hdr.Len = u.SizeBytes()
  9694      hdr.Cap = u.SizeBytes()
  9695  
  9696      length, err := writer.Write(buf)
  9697      // Since we bypassed the compiler's escape analysis, indicate that u
  9698      // must live until the use above.
  9699      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9700      return int64(length), err
  9701  }
  9702  
  9703  // SizeBytes implements marshal.Marshallable.SizeBytes.
  9704  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) SizeBytes() int {
  9705      return 4 +
  9706          (*NvUUID)(nil).SizeBytes() +
  9707          (*Handle)(nil).SizeBytes() +
  9708          (*Handle)(nil).SizeBytes()
  9709  }
  9710  
  9711  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  9712  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) MarshalBytes(dst []byte) []byte {
  9713      dst = u.GPUUUID.MarshalUnsafe(dst)
  9714      dst = u.HClient.MarshalUnsafe(dst)
  9715      dst = u.HChannel.MarshalUnsafe(dst)
  9716      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  9717      dst = dst[4:]
  9718      return dst
  9719  }
  9720  
  9721  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  9722  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) UnmarshalBytes(src []byte) []byte {
  9723      src = u.GPUUUID.UnmarshalUnsafe(src)
  9724      src = u.HClient.UnmarshalUnsafe(src)
  9725      src = u.HChannel.UnmarshalUnsafe(src)
  9726      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9727      src = src[4:]
  9728      return src
  9729  }
  9730  
  9731  // Packed implements marshal.Marshallable.Packed.
  9732  //go:nosplit
  9733  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) Packed() bool {
  9734      return u.GPUUUID.Packed() && u.HChannel.Packed() && u.HClient.Packed()
  9735  }
  9736  
  9737  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  9738  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) MarshalUnsafe(dst []byte) []byte {
  9739      if u.GPUUUID.Packed() && u.HChannel.Packed() && u.HClient.Packed() {
  9740          size := u.SizeBytes()
  9741          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  9742          return dst[size:]
  9743      }
  9744      // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  9745      return u.MarshalBytes(dst)
  9746  }
  9747  
  9748  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  9749  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  9750      if u.GPUUUID.Packed() && u.HChannel.Packed() && u.HClient.Packed() {
  9751          size := u.SizeBytes()
  9752          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  9753          return src[size:]
  9754      }
  9755      // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  9756      return u.UnmarshalBytes(src)
  9757  }
  9758  
  9759  // CopyOutN implements marshal.Marshallable.CopyOutN.
  9760  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9761      if !u.GPUUUID.Packed() && u.HChannel.Packed() && u.HClient.Packed() {
  9762          // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9763          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  9764          u.MarshalBytes(buf) // escapes: fallback.
  9765          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9766      }
  9767  
  9768      // Construct a slice backed by dst's underlying memory.
  9769      var buf []byte
  9770      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9771      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9772      hdr.Len = u.SizeBytes()
  9773      hdr.Cap = u.SizeBytes()
  9774  
  9775      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9776      // Since we bypassed the compiler's escape analysis, indicate that u
  9777      // must live until the use above.
  9778      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9779      return length, err
  9780  }
  9781  
  9782  // CopyOut implements marshal.Marshallable.CopyOut.
  9783  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9784      return u.CopyOutN(cc, addr, u.SizeBytes())
  9785  }
  9786  
  9787  // CopyInN implements marshal.Marshallable.CopyInN.
  9788  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9789      if !u.GPUUUID.Packed() && u.HChannel.Packed() && u.HClient.Packed() {
  9790          // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  9791          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  9792          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9793          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  9794          // partially unmarshalled struct.
  9795          u.UnmarshalBytes(buf) // escapes: fallback.
  9796          return length, err
  9797      }
  9798  
  9799      // Construct a slice backed by dst's underlying memory.
  9800      var buf []byte
  9801      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9802      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9803      hdr.Len = u.SizeBytes()
  9804      hdr.Cap = u.SizeBytes()
  9805  
  9806      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9807      // Since we bypassed the compiler's escape analysis, indicate that u
  9808      // must live until the use above.
  9809      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9810      return length, err
  9811  }
  9812  
  9813  // CopyIn implements marshal.Marshallable.CopyIn.
  9814  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9815      return u.CopyInN(cc, addr, u.SizeBytes())
  9816  }
  9817  
  9818  // WriteTo implements io.WriterTo.WriteTo.
  9819  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  9820      if !u.GPUUUID.Packed() && u.HChannel.Packed() && u.HClient.Packed() {
  9821          // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9822          buf := make([]byte, u.SizeBytes())
  9823          u.MarshalBytes(buf)
  9824          length, err := writer.Write(buf)
  9825          return int64(length), err
  9826      }
  9827  
  9828      // Construct a slice backed by dst's underlying memory.
  9829      var buf []byte
  9830      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9831      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9832      hdr.Len = u.SizeBytes()
  9833      hdr.Cap = u.SizeBytes()
  9834  
  9835      length, err := writer.Write(buf)
  9836      // Since we bypassed the compiler's escape analysis, indicate that u
  9837      // must live until the use above.
  9838      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9839      return int64(length), err
  9840  }
  9841  
  9842  // SizeBytes implements marshal.Marshallable.SizeBytes.
  9843  func (u *UVM_UNREGISTER_GPU_PARAMS) SizeBytes() int {
  9844      return 4 +
  9845          (*NvUUID)(nil).SizeBytes()
  9846  }
  9847  
  9848  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  9849  func (u *UVM_UNREGISTER_GPU_PARAMS) MarshalBytes(dst []byte) []byte {
  9850      dst = u.GPUUUID.MarshalUnsafe(dst)
  9851      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  9852      dst = dst[4:]
  9853      return dst
  9854  }
  9855  
  9856  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  9857  func (u *UVM_UNREGISTER_GPU_PARAMS) UnmarshalBytes(src []byte) []byte {
  9858      src = u.GPUUUID.UnmarshalUnsafe(src)
  9859      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9860      src = src[4:]
  9861      return src
  9862  }
  9863  
  9864  // Packed implements marshal.Marshallable.Packed.
  9865  //go:nosplit
  9866  func (u *UVM_UNREGISTER_GPU_PARAMS) Packed() bool {
  9867      return u.GPUUUID.Packed()
  9868  }
  9869  
  9870  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  9871  func (u *UVM_UNREGISTER_GPU_PARAMS) MarshalUnsafe(dst []byte) []byte {
  9872      if u.GPUUUID.Packed() {
  9873          size := u.SizeBytes()
  9874          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  9875          return dst[size:]
  9876      }
  9877      // Type UVM_UNREGISTER_GPU_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  9878      return u.MarshalBytes(dst)
  9879  }
  9880  
  9881  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  9882  func (u *UVM_UNREGISTER_GPU_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  9883      if u.GPUUUID.Packed() {
  9884          size := u.SizeBytes()
  9885          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  9886          return src[size:]
  9887      }
  9888      // Type UVM_UNREGISTER_GPU_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  9889      return u.UnmarshalBytes(src)
  9890  }
  9891  
  9892  // CopyOutN implements marshal.Marshallable.CopyOutN.
  9893  func (u *UVM_UNREGISTER_GPU_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9894      if !u.GPUUUID.Packed() {
  9895          // Type UVM_UNREGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9896          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  9897          u.MarshalBytes(buf) // escapes: fallback.
  9898          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9899      }
  9900  
  9901      // Construct a slice backed by dst's underlying memory.
  9902      var buf []byte
  9903      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9904      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9905      hdr.Len = u.SizeBytes()
  9906      hdr.Cap = u.SizeBytes()
  9907  
  9908      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9909      // Since we bypassed the compiler's escape analysis, indicate that u
  9910      // must live until the use above.
  9911      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9912      return length, err
  9913  }
  9914  
  9915  // CopyOut implements marshal.Marshallable.CopyOut.
  9916  func (u *UVM_UNREGISTER_GPU_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9917      return u.CopyOutN(cc, addr, u.SizeBytes())
  9918  }
  9919  
  9920  // CopyInN implements marshal.Marshallable.CopyInN.
  9921  func (u *UVM_UNREGISTER_GPU_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9922      if !u.GPUUUID.Packed() {
  9923          // Type UVM_UNREGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  9924          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  9925          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9926          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  9927          // partially unmarshalled struct.
  9928          u.UnmarshalBytes(buf) // escapes: fallback.
  9929          return length, err
  9930      }
  9931  
  9932      // Construct a slice backed by dst's underlying memory.
  9933      var buf []byte
  9934      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9935      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9936      hdr.Len = u.SizeBytes()
  9937      hdr.Cap = u.SizeBytes()
  9938  
  9939      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9940      // Since we bypassed the compiler's escape analysis, indicate that u
  9941      // must live until the use above.
  9942      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9943      return length, err
  9944  }
  9945  
  9946  // CopyIn implements marshal.Marshallable.CopyIn.
  9947  func (u *UVM_UNREGISTER_GPU_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9948      return u.CopyInN(cc, addr, u.SizeBytes())
  9949  }
  9950  
  9951  // WriteTo implements io.WriterTo.WriteTo.
  9952  func (u *UVM_UNREGISTER_GPU_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  9953      if !u.GPUUUID.Packed() {
  9954          // Type UVM_UNREGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  9955          buf := make([]byte, u.SizeBytes())
  9956          u.MarshalBytes(buf)
  9957          length, err := writer.Write(buf)
  9958          return int64(length), err
  9959      }
  9960  
  9961      // Construct a slice backed by dst's underlying memory.
  9962      var buf []byte
  9963      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9964      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9965      hdr.Len = u.SizeBytes()
  9966      hdr.Cap = u.SizeBytes()
  9967  
  9968      length, err := writer.Write(buf)
  9969      // Since we bypassed the compiler's escape analysis, indicate that u
  9970      // must live until the use above.
  9971      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9972      return int64(length), err
  9973  }
  9974  
  9975  // SizeBytes implements marshal.Marshallable.SizeBytes.
  9976  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) SizeBytes() int {
  9977      return 4 +
  9978          (*NvUUID)(nil).SizeBytes()
  9979  }
  9980  
  9981  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  9982  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) MarshalBytes(dst []byte) []byte {
  9983      dst = u.GPUUUID.MarshalUnsafe(dst)
  9984      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  9985      dst = dst[4:]
  9986      return dst
  9987  }
  9988  
  9989  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  9990  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) UnmarshalBytes(src []byte) []byte {
  9991      src = u.GPUUUID.UnmarshalUnsafe(src)
  9992      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9993      src = src[4:]
  9994      return src
  9995  }
  9996  
  9997  // Packed implements marshal.Marshallable.Packed.
  9998  //go:nosplit
  9999  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) Packed() bool {
 10000      return u.GPUUUID.Packed()
 10001  }
 10002  
 10003  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
 10004  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) MarshalUnsafe(dst []byte) []byte {
 10005      if u.GPUUUID.Packed() {
 10006          size := u.SizeBytes()
 10007          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
 10008          return dst[size:]
 10009      }
 10010      // Type UVM_UNREGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
 10011      return u.MarshalBytes(dst)
 10012  }
 10013  
 10014  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
 10015  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
 10016      if u.GPUUUID.Packed() {
 10017          size := u.SizeBytes()
 10018          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
 10019          return src[size:]
 10020      }
 10021      // Type UVM_UNREGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
 10022      return u.UnmarshalBytes(src)
 10023  }
 10024  
 10025  // CopyOutN implements marshal.Marshallable.CopyOutN.
 10026  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
 10027      if !u.GPUUUID.Packed() {
 10028          // Type UVM_UNREGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
 10029          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
 10030          u.MarshalBytes(buf) // escapes: fallback.
 10031          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
 10032      }
 10033  
 10034      // Construct a slice backed by dst's underlying memory.
 10035      var buf []byte
 10036      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
 10037      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
 10038      hdr.Len = u.SizeBytes()
 10039      hdr.Cap = u.SizeBytes()
 10040  
 10041      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
 10042      // Since we bypassed the compiler's escape analysis, indicate that u
 10043      // must live until the use above.
 10044      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
 10045      return length, err
 10046  }
 10047  
 10048  // CopyOut implements marshal.Marshallable.CopyOut.
 10049  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
 10050      return u.CopyOutN(cc, addr, u.SizeBytes())
 10051  }
 10052  
 10053  // CopyInN implements marshal.Marshallable.CopyInN.
 10054  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
 10055      if !u.GPUUUID.Packed() {
 10056          // Type UVM_UNREGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
 10057          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
 10058          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
 10059          // Unmarshal unconditionally. If we had a short copy-in, this results in a
 10060          // partially unmarshalled struct.
 10061          u.UnmarshalBytes(buf) // escapes: fallback.
 10062          return length, err
 10063      }
 10064  
 10065      // Construct a slice backed by dst's underlying memory.
 10066      var buf []byte
 10067      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
 10068      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
 10069      hdr.Len = u.SizeBytes()
 10070      hdr.Cap = u.SizeBytes()
 10071  
 10072      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
 10073      // Since we bypassed the compiler's escape analysis, indicate that u
 10074      // must live until the use above.
 10075      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
 10076      return length, err
 10077  }
 10078  
 10079  // CopyIn implements marshal.Marshallable.CopyIn.
 10080  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
 10081      return u.CopyInN(cc, addr, u.SizeBytes())
 10082  }
 10083  
 10084  // WriteTo implements io.WriterTo.WriteTo.
 10085  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
 10086      if !u.GPUUUID.Packed() {
 10087          // Type UVM_UNREGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
 10088          buf := make([]byte, u.SizeBytes())
 10089          u.MarshalBytes(buf)
 10090          length, err := writer.Write(buf)
 10091          return int64(length), err
 10092      }
 10093  
 10094      // Construct a slice backed by dst's underlying memory.
 10095      var buf []byte
 10096      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
 10097      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
 10098      hdr.Len = u.SizeBytes()
 10099      hdr.Cap = u.SizeBytes()
 10100  
 10101      length, err := writer.Write(buf)
 10102      // Since we bypassed the compiler's escape analysis, indicate that u
 10103      // must live until the use above.
 10104      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
 10105      return int64(length), err
 10106  }
 10107  
 10108  // SizeBytes implements marshal.Marshallable.SizeBytes.
 10109  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) SizeBytes() int {
 10110      return 20 +
 10111          1*4
 10112  }
 10113  
 10114  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
 10115  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) MarshalBytes(dst []byte) []byte {
 10116      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
 10117      dst = dst[8:]
 10118      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
 10119      dst = dst[8:]
 10120      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
 10121      dst = dst[4:]
 10122      for idx := 0; idx < 4; idx++ {
 10123          dst[0] = byte(u.Pad0[idx])
 10124          dst = dst[1:]
 10125      }
 10126      return dst
 10127  }
 10128  
 10129  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
 10130  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) UnmarshalBytes(src []byte) []byte {
 10131      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
 10132      src = src[8:]
 10133      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
 10134      src = src[8:]
 10135      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
 10136      src = src[4:]
 10137      for idx := 0; idx < 4; idx++ {
 10138          u.Pad0[idx] = src[0]
 10139          src = src[1:]
 10140      }
 10141      return src
 10142  }
 10143  
 10144  // Packed implements marshal.Marshallable.Packed.
 10145  //go:nosplit
 10146  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) Packed() bool {
 10147      return true
 10148  }
 10149  
 10150  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
 10151  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) MarshalUnsafe(dst []byte) []byte {
 10152      size := u.SizeBytes()
 10153      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
 10154      return dst[size:]
 10155  }
 10156  
 10157  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
 10158  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
 10159      size := u.SizeBytes()
 10160      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
 10161      return src[size:]
 10162  }
 10163  
 10164  // CopyOutN implements marshal.Marshallable.CopyOutN.
 10165  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
 10166      // Construct a slice backed by dst's underlying memory.
 10167      var buf []byte
 10168      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
 10169      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
 10170      hdr.Len = u.SizeBytes()
 10171      hdr.Cap = u.SizeBytes()
 10172  
 10173      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
 10174      // Since we bypassed the compiler's escape analysis, indicate that u
 10175      // must live until the use above.
 10176      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
 10177      return length, err
 10178  }
 10179  
 10180  // CopyOut implements marshal.Marshallable.CopyOut.
 10181  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
 10182      return u.CopyOutN(cc, addr, u.SizeBytes())
 10183  }
 10184  
 10185  // CopyInN implements marshal.Marshallable.CopyInN.
 10186  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
 10187      // Construct a slice backed by dst's underlying memory.
 10188      var buf []byte
 10189      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
 10190      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
 10191      hdr.Len = u.SizeBytes()
 10192      hdr.Cap = u.SizeBytes()
 10193  
 10194      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
 10195      // Since we bypassed the compiler's escape analysis, indicate that u
 10196      // must live until the use above.
 10197      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
 10198      return length, err
 10199  }
 10200  
 10201  // CopyIn implements marshal.Marshallable.CopyIn.
 10202  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
 10203      return u.CopyInN(cc, addr, u.SizeBytes())
 10204  }
 10205  
 10206  // WriteTo implements io.WriterTo.WriteTo.
 10207  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
 10208      // Construct a slice backed by dst's underlying memory.
 10209      var buf []byte
 10210      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
 10211      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
 10212      hdr.Len = u.SizeBytes()
 10213      hdr.Cap = u.SizeBytes()
 10214  
 10215      length, err := writer.Write(buf)
 10216      // Since we bypassed the compiler's escape analysis, indicate that u
 10217      // must live until the use above.
 10218      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
 10219      return int64(length), err
 10220  }
 10221  
 10222  // SizeBytes implements marshal.Marshallable.SizeBytes.
 10223  func (u *UvmGpuMappingAttributes) SizeBytes() int {
 10224      return 20 +
 10225          (*NvUUID)(nil).SizeBytes()
 10226  }
 10227  
 10228  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
 10229  func (u *UvmGpuMappingAttributes) MarshalBytes(dst []byte) []byte {
 10230      dst = u.GPUUUID.MarshalUnsafe(dst)
 10231      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUMappingType))
 10232      dst = dst[4:]
 10233      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUCachingType))
 10234      dst = dst[4:]
 10235      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUFormatType))
 10236      dst = dst[4:]
 10237      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUElementBits))
 10238      dst = dst[4:]
 10239      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUCompressionType))
 10240      dst = dst[4:]
 10241      return dst
 10242  }
 10243  
 10244  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
 10245  func (u *UvmGpuMappingAttributes) UnmarshalBytes(src []byte) []byte {
 10246      src = u.GPUUUID.UnmarshalUnsafe(src)
 10247      u.GPUMappingType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
 10248      src = src[4:]
 10249      u.GPUCachingType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
 10250      src = src[4:]
 10251      u.GPUFormatType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
 10252      src = src[4:]
 10253      u.GPUElementBits = uint32(hostarch.ByteOrder.Uint32(src[:4]))
 10254      src = src[4:]
 10255      u.GPUCompressionType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
 10256      src = src[4:]
 10257      return src
 10258  }
 10259  
 10260  // Packed implements marshal.Marshallable.Packed.
 10261  //go:nosplit
 10262  func (u *UvmGpuMappingAttributes) Packed() bool {
 10263      return u.GPUUUID.Packed()
 10264  }
 10265  
 10266  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
 10267  func (u *UvmGpuMappingAttributes) MarshalUnsafe(dst []byte) []byte {
 10268      if u.GPUUUID.Packed() {
 10269          size := u.SizeBytes()
 10270          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
 10271          return dst[size:]
 10272      }
 10273      // Type UvmGpuMappingAttributes doesn't have a packed layout in memory, fallback to MarshalBytes.
 10274      return u.MarshalBytes(dst)
 10275  }
 10276  
 10277  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
 10278  func (u *UvmGpuMappingAttributes) UnmarshalUnsafe(src []byte) []byte {
 10279      if u.GPUUUID.Packed() {
 10280          size := u.SizeBytes()
 10281          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
 10282          return src[size:]
 10283      }
 10284      // Type UvmGpuMappingAttributes doesn't have a packed layout in memory, fallback to UnmarshalBytes.
 10285      return u.UnmarshalBytes(src)
 10286  }
 10287  
 10288  // CopyOutN implements marshal.Marshallable.CopyOutN.
 10289  func (u *UvmGpuMappingAttributes) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
 10290      if !u.GPUUUID.Packed() {
 10291          // Type UvmGpuMappingAttributes doesn't have a packed layout in memory, fall back to MarshalBytes.
 10292          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
 10293          u.MarshalBytes(buf) // escapes: fallback.
 10294          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
 10295      }
 10296  
 10297      // Construct a slice backed by dst's underlying memory.
 10298      var buf []byte
 10299      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
 10300      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
 10301      hdr.Len = u.SizeBytes()
 10302      hdr.Cap = u.SizeBytes()
 10303  
 10304      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
 10305      // Since we bypassed the compiler's escape analysis, indicate that u
 10306      // must live until the use above.
 10307      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
 10308      return length, err
 10309  }
 10310  
 10311  // CopyOut implements marshal.Marshallable.CopyOut.
 10312  func (u *UvmGpuMappingAttributes) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
 10313      return u.CopyOutN(cc, addr, u.SizeBytes())
 10314  }
 10315  
 10316  // CopyInN implements marshal.Marshallable.CopyInN.
 10317  func (u *UvmGpuMappingAttributes) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
 10318      if !u.GPUUUID.Packed() {
 10319          // Type UvmGpuMappingAttributes doesn't have a packed layout in memory, fall back to UnmarshalBytes.
 10320          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
 10321          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
 10322          // Unmarshal unconditionally. If we had a short copy-in, this results in a
 10323          // partially unmarshalled struct.
 10324          u.UnmarshalBytes(buf) // escapes: fallback.
 10325          return length, err
 10326      }
 10327  
 10328      // Construct a slice backed by dst's underlying memory.
 10329      var buf []byte
 10330      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
 10331      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
 10332      hdr.Len = u.SizeBytes()
 10333      hdr.Cap = u.SizeBytes()
 10334  
 10335      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
 10336      // Since we bypassed the compiler's escape analysis, indicate that u
 10337      // must live until the use above.
 10338      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
 10339      return length, err
 10340  }
 10341  
 10342  // CopyIn implements marshal.Marshallable.CopyIn.
 10343  func (u *UvmGpuMappingAttributes) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
 10344      return u.CopyInN(cc, addr, u.SizeBytes())
 10345  }
 10346  
 10347  // WriteTo implements io.WriterTo.WriteTo.
 10348  func (u *UvmGpuMappingAttributes) WriteTo(writer io.Writer) (int64, error) {
 10349      if !u.GPUUUID.Packed() {
 10350          // Type UvmGpuMappingAttributes doesn't have a packed layout in memory, fall back to MarshalBytes.
 10351          buf := make([]byte, u.SizeBytes())
 10352          u.MarshalBytes(buf)
 10353          length, err := writer.Write(buf)
 10354          return int64(length), err
 10355      }
 10356  
 10357      // Construct a slice backed by dst's underlying memory.
 10358      var buf []byte
 10359      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
 10360      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
 10361      hdr.Len = u.SizeBytes()
 10362      hdr.Cap = u.SizeBytes()
 10363  
 10364      length, err := writer.Write(buf)
 10365      // Since we bypassed the compiler's escape analysis, indicate that u
 10366      // must live until the use above.
 10367      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
 10368      return int64(length), err
 10369  }
 10370