github.com/metacubex/gvisor@v0.0.0-20240320004321-933faba989ec/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/metacubex/gvisor/pkg/gohacks"
     7      "github.com/metacubex/gvisor/pkg/hostarch"
     8      "github.com/metacubex/gvisor/pkg/marshal"
     9      "io"
    10      "reflect"
    11      "runtime"
    12      "unsafe"
    13  )
    14  
    15  // Marshallable types used by this file.
    16  var _ marshal.Marshallable = (*Handle)(nil)
    17  var _ marshal.Marshallable = (*IoctlAllocOSEvent)(nil)
    18  var _ marshal.Marshallable = (*IoctlFreeOSEvent)(nil)
    19  var _ marshal.Marshallable = (*IoctlNVOS02ParametersWithFD)(nil)
    20  var _ marshal.Marshallable = (*IoctlNVOS33ParametersWithFD)(nil)
    21  var _ marshal.Marshallable = (*IoctlRegisterFD)(nil)
    22  var _ marshal.Marshallable = (*IoctlSysParams)(nil)
    23  var _ marshal.Marshallable = (*NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS)(nil)
    24  var _ marshal.Marshallable = (*NV0005_ALLOC_PARAMETERS)(nil)
    25  var _ marshal.Marshallable = (*NV0080_ALLOC_PARAMETERS)(nil)
    26  var _ marshal.Marshallable = (*NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS)(nil)
    27  var _ marshal.Marshallable = (*NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS)(nil)
    28  var _ marshal.Marshallable = (*NV0080_CTRL_GR_ROUTE_INFO)(nil)
    29  var _ marshal.Marshallable = (*NV00F8_ALLOCATION_PARAMETERS)(nil)
    30  var _ marshal.Marshallable = (*NV2080_ALLOC_PARAMETERS)(nil)
    31  var _ marshal.Marshallable = (*NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS)(nil)
    32  var _ marshal.Marshallable = (*NV2080_CTRL_GR_GET_INFO_PARAMS)(nil)
    33  var _ marshal.Marshallable = (*NV503B_ALLOC_PARAMETERS)(nil)
    34  var _ marshal.Marshallable = (*NV503B_BAR1_P2P_DMA_INFO)(nil)
    35  var _ marshal.Marshallable = (*NV503C_ALLOC_PARAMETERS)(nil)
    36  var _ marshal.Marshallable = (*NV83DE_ALLOC_PARAMETERS)(nil)
    37  var _ marshal.Marshallable = (*NVB0B5_ALLOCATION_PARAMETERS)(nil)
    38  var _ marshal.Marshallable = (*NVOS00Parameters)(nil)
    39  var _ marshal.Marshallable = (*NVOS02Parameters)(nil)
    40  var _ marshal.Marshallable = (*NVOS21Parameters)(nil)
    41  var _ marshal.Marshallable = (*NVOS32Parameters)(nil)
    42  var _ marshal.Marshallable = (*NVOS33Parameters)(nil)
    43  var _ marshal.Marshallable = (*NVOS34Parameters)(nil)
    44  var _ marshal.Marshallable = (*NVOS54Parameters)(nil)
    45  var _ marshal.Marshallable = (*NVOS55Parameters)(nil)
    46  var _ marshal.Marshallable = (*NVOS56Parameters)(nil)
    47  var _ marshal.Marshallable = (*NVOS57Parameters)(nil)
    48  var _ marshal.Marshallable = (*NVOS64Parameters)(nil)
    49  var _ marshal.Marshallable = (*NVXXXX_CTRL_XXX_INFO)(nil)
    50  var _ marshal.Marshallable = (*NV_CHANNEL_ALLOC_PARAMS)(nil)
    51  var _ marshal.Marshallable = (*NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS)(nil)
    52  var _ marshal.Marshallable = (*NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS)(nil)
    53  var _ marshal.Marshallable = (*NV_CTXSHARE_ALLOCATION_PARAMETERS)(nil)
    54  var _ marshal.Marshallable = (*NV_GR_ALLOCATION_PARAMETERS)(nil)
    55  var _ marshal.Marshallable = (*NV_HOPPER_USERMODE_A_PARAMS)(nil)
    56  var _ marshal.Marshallable = (*NV_MEMORY_ALLOCATION_PARAMS)(nil)
    57  var _ marshal.Marshallable = (*NV_MEMORY_DESC_PARAMS)(nil)
    58  var _ marshal.Marshallable = (*NV_VASPACE_ALLOCATION_PARAMETERS)(nil)
    59  var _ marshal.Marshallable = (*P64)(nil)
    60  var _ marshal.Marshallable = (*RMAPIVersion)(nil)
    61  var _ marshal.Marshallable = (*RS_ACCESS_MASK)(nil)
    62  var _ marshal.Marshallable = (*RS_SHARE_POLICY)(nil)
    63  var _ marshal.Marshallable = (*UVM_ALLOC_SEMAPHORE_POOL_PARAMS)(nil)
    64  var _ marshal.Marshallable = (*UVM_CREATE_EXTERNAL_RANGE_PARAMS)(nil)
    65  var _ marshal.Marshallable = (*UVM_CREATE_RANGE_GROUP_PARAMS)(nil)
    66  var _ marshal.Marshallable = (*UVM_DESTROY_RANGE_GROUP_PARAMS)(nil)
    67  var _ marshal.Marshallable = (*UVM_DISABLE_READ_DUPLICATION_PARAMS)(nil)
    68  var _ marshal.Marshallable = (*UVM_FREE_PARAMS)(nil)
    69  var _ marshal.Marshallable = (*UVM_INITIALIZE_PARAMS)(nil)
    70  var _ marshal.Marshallable = (*UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS)(nil)
    71  var _ marshal.Marshallable = (*UVM_MAP_EXTERNAL_ALLOCATION_PARAMS)(nil)
    72  var _ marshal.Marshallable = (*UVM_MM_INITIALIZE_PARAMS)(nil)
    73  var _ marshal.Marshallable = (*UVM_PAGEABLE_MEM_ACCESS_PARAMS)(nil)
    74  var _ marshal.Marshallable = (*UVM_REGISTER_CHANNEL_PARAMS)(nil)
    75  var _ marshal.Marshallable = (*UVM_REGISTER_GPU_PARAMS)(nil)
    76  var _ marshal.Marshallable = (*UVM_REGISTER_GPU_VASPACE_PARAMS)(nil)
    77  var _ marshal.Marshallable = (*UVM_UNREGISTER_CHANNEL_PARAMS)(nil)
    78  var _ marshal.Marshallable = (*UVM_UNREGISTER_GPU_PARAMS)(nil)
    79  var _ marshal.Marshallable = (*UVM_UNREGISTER_GPU_VASPACE_PARAMS)(nil)
    80  var _ marshal.Marshallable = (*UVM_VALIDATE_VA_RANGE_PARAMS)(nil)
    81  var _ marshal.Marshallable = (*UvmGpuMappingAttributes)(nil)
    82  var _ marshal.Marshallable = (*nv00f8Map)(nil)
    83  
    84  // SizeBytes implements marshal.Marshallable.SizeBytes.
    85  func (n *NV0005_ALLOC_PARAMETERS) SizeBytes() int {
    86      return 8 +
    87          (*Handle)(nil).SizeBytes() +
    88          (*Handle)(nil).SizeBytes() +
    89          (*P64)(nil).SizeBytes()
    90  }
    91  
    92  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
    93  func (n *NV0005_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
    94      dst = n.HParentClient.MarshalUnsafe(dst)
    95      dst = n.HSrcResource.MarshalUnsafe(dst)
    96      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HClass))
    97      dst = dst[4:]
    98      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NotifyIndex))
    99      dst = dst[4:]
   100      dst = n.Data.MarshalUnsafe(dst)
   101      return dst
   102  }
   103  
   104  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   105  func (n *NV0005_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   106      src = n.HParentClient.UnmarshalUnsafe(src)
   107      src = n.HSrcResource.UnmarshalUnsafe(src)
   108      n.HClass = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   109      src = src[4:]
   110      n.NotifyIndex = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   111      src = src[4:]
   112      src = n.Data.UnmarshalUnsafe(src)
   113      return src
   114  }
   115  
   116  // Packed implements marshal.Marshallable.Packed.
   117  //go:nosplit
   118  func (n *NV0005_ALLOC_PARAMETERS) Packed() bool {
   119      return n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed()
   120  }
   121  
   122  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   123  func (n *NV0005_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   124      if n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   125          size := n.SizeBytes()
   126          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   127          return dst[size:]
   128      }
   129      // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
   130      return n.MarshalBytes(dst)
   131  }
   132  
   133  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   134  func (n *NV0005_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   135      if n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   136          size := n.SizeBytes()
   137          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   138          return src[size:]
   139      }
   140      // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
   141      return n.UnmarshalBytes(src)
   142  }
   143  
   144  // CopyOutN implements marshal.Marshallable.CopyOutN.
   145  func (n *NV0005_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   146      if !n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   147          // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   148          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   149          n.MarshalBytes(buf) // escapes: fallback.
   150          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   151      }
   152  
   153      // Construct a slice backed by dst's underlying memory.
   154      var buf []byte
   155      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   156      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   157      hdr.Len = n.SizeBytes()
   158      hdr.Cap = n.SizeBytes()
   159  
   160      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   161      // Since we bypassed the compiler's escape analysis, indicate that n
   162      // must live until the use above.
   163      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   164      return length, err
   165  }
   166  
   167  // CopyOut implements marshal.Marshallable.CopyOut.
   168  func (n *NV0005_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   169      return n.CopyOutN(cc, addr, n.SizeBytes())
   170  }
   171  
   172  // CopyInN implements marshal.Marshallable.CopyInN.
   173  func (n *NV0005_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   174      if !n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   175          // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
   176          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   177          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   178          // Unmarshal unconditionally. If we had a short copy-in, this results in a
   179          // partially unmarshalled struct.
   180          n.UnmarshalBytes(buf) // escapes: fallback.
   181          return length, err
   182      }
   183  
   184      // Construct a slice backed by dst's underlying memory.
   185      var buf []byte
   186      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   187      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   188      hdr.Len = n.SizeBytes()
   189      hdr.Cap = n.SizeBytes()
   190  
   191      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   192      // Since we bypassed the compiler's escape analysis, indicate that n
   193      // must live until the use above.
   194      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   195      return length, err
   196  }
   197  
   198  // CopyIn implements marshal.Marshallable.CopyIn.
   199  func (n *NV0005_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   200      return n.CopyInN(cc, addr, n.SizeBytes())
   201  }
   202  
   203  // WriteTo implements io.WriterTo.WriteTo.
   204  func (n *NV0005_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   205      if !n.Data.Packed() && n.HParentClient.Packed() && n.HSrcResource.Packed() {
   206          // Type NV0005_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   207          buf := make([]byte, n.SizeBytes())
   208          n.MarshalBytes(buf)
   209          length, err := writer.Write(buf)
   210          return int64(length), err
   211      }
   212  
   213      // Construct a slice backed by dst's underlying memory.
   214      var buf []byte
   215      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   216      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   217      hdr.Len = n.SizeBytes()
   218      hdr.Cap = n.SizeBytes()
   219  
   220      length, err := writer.Write(buf)
   221      // Since we bypassed the compiler's escape analysis, indicate that n
   222      // must live until the use above.
   223      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   224      return int64(length), err
   225  }
   226  
   227  // SizeBytes implements marshal.Marshallable.SizeBytes.
   228  func (n *NV0080_ALLOC_PARAMETERS) SizeBytes() int {
   229      return 36 +
   230          (*Handle)(nil).SizeBytes() +
   231          (*Handle)(nil).SizeBytes() +
   232          (*Handle)(nil).SizeBytes() +
   233          1*4 +
   234          1*4
   235  }
   236  
   237  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   238  func (n *NV0080_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
   239      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.DeviceID))
   240      dst = dst[4:]
   241      dst = n.HClientShare.MarshalUnsafe(dst)
   242      dst = n.HTargetClient.MarshalUnsafe(dst)
   243      dst = n.HTargetDevice.MarshalUnsafe(dst)
   244      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
   245      dst = dst[4:]
   246      for idx := 0; idx < 4; idx++ {
   247          dst[0] = byte(n.Pad0[idx])
   248          dst = dst[1:]
   249      }
   250      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VASpaceSize))
   251      dst = dst[8:]
   252      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VAStartInternal))
   253      dst = dst[8:]
   254      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VALimitInternal))
   255      dst = dst[8:]
   256      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.VAMode))
   257      dst = dst[4:]
   258      for idx := 0; idx < 4; idx++ {
   259          dst[0] = byte(n.Pad1[idx])
   260          dst = dst[1:]
   261      }
   262      return dst
   263  }
   264  
   265  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   266  func (n *NV0080_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   267      n.DeviceID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   268      src = src[4:]
   269      src = n.HClientShare.UnmarshalUnsafe(src)
   270      src = n.HTargetClient.UnmarshalUnsafe(src)
   271      src = n.HTargetDevice.UnmarshalUnsafe(src)
   272      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   273      src = src[4:]
   274      for idx := 0; idx < 4; idx++ {
   275          n.Pad0[idx] = src[0]
   276          src = src[1:]
   277      }
   278      n.VASpaceSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   279      src = src[8:]
   280      n.VAStartInternal = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   281      src = src[8:]
   282      n.VALimitInternal = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   283      src = src[8:]
   284      n.VAMode = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   285      src = src[4:]
   286      for idx := 0; idx < 4; idx++ {
   287          n.Pad1[idx] = src[0]
   288          src = src[1:]
   289      }
   290      return src
   291  }
   292  
   293  // Packed implements marshal.Marshallable.Packed.
   294  //go:nosplit
   295  func (n *NV0080_ALLOC_PARAMETERS) Packed() bool {
   296      return n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed()
   297  }
   298  
   299  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   300  func (n *NV0080_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   301      if n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   302          size := n.SizeBytes()
   303          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   304          return dst[size:]
   305      }
   306      // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
   307      return n.MarshalBytes(dst)
   308  }
   309  
   310  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   311  func (n *NV0080_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   312      if n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   313          size := n.SizeBytes()
   314          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   315          return src[size:]
   316      }
   317      // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
   318      return n.UnmarshalBytes(src)
   319  }
   320  
   321  // CopyOutN implements marshal.Marshallable.CopyOutN.
   322  func (n *NV0080_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   323      if !n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   324          // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   325          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   326          n.MarshalBytes(buf) // escapes: fallback.
   327          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   328      }
   329  
   330      // Construct a slice backed by dst's underlying memory.
   331      var buf []byte
   332      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   333      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   334      hdr.Len = n.SizeBytes()
   335      hdr.Cap = n.SizeBytes()
   336  
   337      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   338      // Since we bypassed the compiler's escape analysis, indicate that n
   339      // must live until the use above.
   340      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   341      return length, err
   342  }
   343  
   344  // CopyOut implements marshal.Marshallable.CopyOut.
   345  func (n *NV0080_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   346      return n.CopyOutN(cc, addr, n.SizeBytes())
   347  }
   348  
   349  // CopyInN implements marshal.Marshallable.CopyInN.
   350  func (n *NV0080_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   351      if !n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   352          // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
   353          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   354          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   355          // Unmarshal unconditionally. If we had a short copy-in, this results in a
   356          // partially unmarshalled struct.
   357          n.UnmarshalBytes(buf) // escapes: fallback.
   358          return length, err
   359      }
   360  
   361      // Construct a slice backed by dst's underlying memory.
   362      var buf []byte
   363      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   364      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   365      hdr.Len = n.SizeBytes()
   366      hdr.Cap = n.SizeBytes()
   367  
   368      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   369      // Since we bypassed the compiler's escape analysis, indicate that n
   370      // must live until the use above.
   371      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   372      return length, err
   373  }
   374  
   375  // CopyIn implements marshal.Marshallable.CopyIn.
   376  func (n *NV0080_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   377      return n.CopyInN(cc, addr, n.SizeBytes())
   378  }
   379  
   380  // WriteTo implements io.WriterTo.WriteTo.
   381  func (n *NV0080_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   382      if !n.HClientShare.Packed() && n.HTargetClient.Packed() && n.HTargetDevice.Packed() {
   383          // Type NV0080_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   384          buf := make([]byte, n.SizeBytes())
   385          n.MarshalBytes(buf)
   386          length, err := writer.Write(buf)
   387          return int64(length), err
   388      }
   389  
   390      // Construct a slice backed by dst's underlying memory.
   391      var buf []byte
   392      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   393      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   394      hdr.Len = n.SizeBytes()
   395      hdr.Cap = n.SizeBytes()
   396  
   397      length, err := writer.Write(buf)
   398      // Since we bypassed the compiler's escape analysis, indicate that n
   399      // must live until the use above.
   400      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   401      return int64(length), err
   402  }
   403  
   404  // SizeBytes implements marshal.Marshallable.SizeBytes.
   405  func (n *NV00F8_ALLOCATION_PARAMETERS) SizeBytes() int {
   406      return 32 +
   407          (*nv00f8Map)(nil).SizeBytes()
   408  }
   409  
   410  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   411  func (n *NV00F8_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
   412      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Alignment))
   413      dst = dst[8:]
   414      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.AllocSize))
   415      dst = dst[8:]
   416      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.PageSize))
   417      dst = dst[8:]
   418      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.AllocFlags))
   419      dst = dst[4:]
   420      // Padding: dst[:sizeof(uint32)] ~= uint32(0)
   421      dst = dst[4:]
   422      dst = n.Map.MarshalUnsafe(dst)
   423      return dst
   424  }
   425  
   426  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   427  func (n *NV00F8_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   428      n.Alignment = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   429      src = src[8:]
   430      n.AllocSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   431      src = src[8:]
   432      n.PageSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   433      src = src[8:]
   434      n.AllocFlags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   435      src = src[4:]
   436      // Padding: var _ uint32 ~= src[:sizeof(uint32)]
   437      src = src[4:]
   438      src = n.Map.UnmarshalUnsafe(src)
   439      return src
   440  }
   441  
   442  // Packed implements marshal.Marshallable.Packed.
   443  //go:nosplit
   444  func (n *NV00F8_ALLOCATION_PARAMETERS) Packed() bool {
   445      return n.Map.Packed()
   446  }
   447  
   448  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   449  func (n *NV00F8_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   450      if n.Map.Packed() {
   451          size := n.SizeBytes()
   452          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   453          return dst[size:]
   454      }
   455      // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
   456      return n.MarshalBytes(dst)
   457  }
   458  
   459  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   460  func (n *NV00F8_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   461      if n.Map.Packed() {
   462          size := n.SizeBytes()
   463          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   464          return src[size:]
   465      }
   466      // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
   467      return n.UnmarshalBytes(src)
   468  }
   469  
   470  // CopyOutN implements marshal.Marshallable.CopyOutN.
   471  func (n *NV00F8_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   472      if !n.Map.Packed() {
   473          // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   474          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   475          n.MarshalBytes(buf) // escapes: fallback.
   476          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   477      }
   478  
   479      // Construct a slice backed by dst's underlying memory.
   480      var buf []byte
   481      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   482      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   483      hdr.Len = n.SizeBytes()
   484      hdr.Cap = n.SizeBytes()
   485  
   486      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   487      // Since we bypassed the compiler's escape analysis, indicate that n
   488      // must live until the use above.
   489      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   490      return length, err
   491  }
   492  
   493  // CopyOut implements marshal.Marshallable.CopyOut.
   494  func (n *NV00F8_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   495      return n.CopyOutN(cc, addr, n.SizeBytes())
   496  }
   497  
   498  // CopyInN implements marshal.Marshallable.CopyInN.
   499  func (n *NV00F8_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   500      if !n.Map.Packed() {
   501          // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
   502          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   503          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   504          // Unmarshal unconditionally. If we had a short copy-in, this results in a
   505          // partially unmarshalled struct.
   506          n.UnmarshalBytes(buf) // escapes: fallback.
   507          return length, err
   508      }
   509  
   510      // Construct a slice backed by dst's underlying memory.
   511      var buf []byte
   512      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   513      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   514      hdr.Len = n.SizeBytes()
   515      hdr.Cap = n.SizeBytes()
   516  
   517      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   518      // Since we bypassed the compiler's escape analysis, indicate that n
   519      // must live until the use above.
   520      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   521      return length, err
   522  }
   523  
   524  // CopyIn implements marshal.Marshallable.CopyIn.
   525  func (n *NV00F8_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   526      return n.CopyInN(cc, addr, n.SizeBytes())
   527  }
   528  
   529  // WriteTo implements io.WriterTo.WriteTo.
   530  func (n *NV00F8_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   531      if !n.Map.Packed() {
   532          // Type NV00F8_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   533          buf := make([]byte, n.SizeBytes())
   534          n.MarshalBytes(buf)
   535          length, err := writer.Write(buf)
   536          return int64(length), err
   537      }
   538  
   539      // Construct a slice backed by dst's underlying memory.
   540      var buf []byte
   541      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   542      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   543      hdr.Len = n.SizeBytes()
   544      hdr.Cap = n.SizeBytes()
   545  
   546      length, err := writer.Write(buf)
   547      // Since we bypassed the compiler's escape analysis, indicate that n
   548      // must live until the use above.
   549      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   550      return int64(length), err
   551  }
   552  
   553  // SizeBytes implements marshal.Marshallable.SizeBytes.
   554  func (n *NV2080_ALLOC_PARAMETERS) SizeBytes() int {
   555      return 4
   556  }
   557  
   558  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   559  func (n *NV2080_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
   560      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDeviceID))
   561      dst = dst[4:]
   562      return dst
   563  }
   564  
   565  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   566  func (n *NV2080_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   567      n.SubDeviceID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   568      src = src[4:]
   569      return src
   570  }
   571  
   572  // Packed implements marshal.Marshallable.Packed.
   573  //go:nosplit
   574  func (n *NV2080_ALLOC_PARAMETERS) Packed() bool {
   575      return true
   576  }
   577  
   578  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   579  func (n *NV2080_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   580      size := n.SizeBytes()
   581      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   582      return dst[size:]
   583  }
   584  
   585  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   586  func (n *NV2080_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   587      size := n.SizeBytes()
   588      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   589      return src[size:]
   590  }
   591  
   592  // CopyOutN implements marshal.Marshallable.CopyOutN.
   593  func (n *NV2080_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   594      // Construct a slice backed by dst's underlying memory.
   595      var buf []byte
   596      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   597      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   598      hdr.Len = n.SizeBytes()
   599      hdr.Cap = n.SizeBytes()
   600  
   601      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   602      // Since we bypassed the compiler's escape analysis, indicate that n
   603      // must live until the use above.
   604      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   605      return length, err
   606  }
   607  
   608  // CopyOut implements marshal.Marshallable.CopyOut.
   609  func (n *NV2080_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   610      return n.CopyOutN(cc, addr, n.SizeBytes())
   611  }
   612  
   613  // CopyInN implements marshal.Marshallable.CopyInN.
   614  func (n *NV2080_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   615      // Construct a slice backed by dst's underlying memory.
   616      var buf []byte
   617      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   618      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   619      hdr.Len = n.SizeBytes()
   620      hdr.Cap = n.SizeBytes()
   621  
   622      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   623      // Since we bypassed the compiler's escape analysis, indicate that n
   624      // must live until the use above.
   625      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   626      return length, err
   627  }
   628  
   629  // CopyIn implements marshal.Marshallable.CopyIn.
   630  func (n *NV2080_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   631      return n.CopyInN(cc, addr, n.SizeBytes())
   632  }
   633  
   634  // WriteTo implements io.WriterTo.WriteTo.
   635  func (n *NV2080_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   636      // Construct a slice backed by dst's underlying memory.
   637      var buf []byte
   638      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   639      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   640      hdr.Len = n.SizeBytes()
   641      hdr.Cap = n.SizeBytes()
   642  
   643      length, err := writer.Write(buf)
   644      // Since we bypassed the compiler's escape analysis, indicate that n
   645      // must live until the use above.
   646      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   647      return int64(length), err
   648  }
   649  
   650  // SizeBytes implements marshal.Marshallable.SizeBytes.
   651  func (n *NV503B_ALLOC_PARAMETERS) SizeBytes() int {
   652      return 32 +
   653          (*Handle)(nil).SizeBytes() +
   654          (*Handle)(nil).SizeBytes() +
   655          (*NV503B_BAR1_P2P_DMA_INFO)(nil).SizeBytes() +
   656          (*NV503B_BAR1_P2P_DMA_INFO)(nil).SizeBytes()
   657  }
   658  
   659  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   660  func (n *NV503B_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
   661      dst = n.HSubDevice.MarshalUnsafe(dst)
   662      dst = n.HPeerSubDevice.MarshalUnsafe(dst)
   663      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDevicePeerIDMask))
   664      dst = dst[4:]
   665      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.PeerSubDevicePeerIDMask))
   666      dst = dst[4:]
   667      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.MailboxBar1Addr))
   668      dst = dst[8:]
   669      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.MailboxTotalSize))
   670      dst = dst[4:]
   671      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
   672      dst = dst[4:]
   673      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDeviceEgmPeerIDMask))
   674      dst = dst[4:]
   675      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.PeerSubDeviceEgmPeerIDMask))
   676      dst = dst[4:]
   677      dst = n.L2pBar1P2PDmaInfo.MarshalUnsafe(dst)
   678      dst = n.P2lBar1P2PDmaInfo.MarshalUnsafe(dst)
   679      return dst
   680  }
   681  
   682  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   683  func (n *NV503B_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   684      src = n.HSubDevice.UnmarshalUnsafe(src)
   685      src = n.HPeerSubDevice.UnmarshalUnsafe(src)
   686      n.SubDevicePeerIDMask = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   687      src = src[4:]
   688      n.PeerSubDevicePeerIDMask = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   689      src = src[4:]
   690      n.MailboxBar1Addr = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   691      src = src[8:]
   692      n.MailboxTotalSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   693      src = src[4:]
   694      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   695      src = src[4:]
   696      n.SubDeviceEgmPeerIDMask = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   697      src = src[4:]
   698      n.PeerSubDeviceEgmPeerIDMask = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   699      src = src[4:]
   700      src = n.L2pBar1P2PDmaInfo.UnmarshalUnsafe(src)
   701      src = n.P2lBar1P2PDmaInfo.UnmarshalUnsafe(src)
   702      return src
   703  }
   704  
   705  // Packed implements marshal.Marshallable.Packed.
   706  //go:nosplit
   707  func (n *NV503B_ALLOC_PARAMETERS) Packed() bool {
   708      return n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed()
   709  }
   710  
   711  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   712  func (n *NV503B_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   713      if n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   714          size := n.SizeBytes()
   715          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   716          return dst[size:]
   717      }
   718      // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
   719      return n.MarshalBytes(dst)
   720  }
   721  
   722  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   723  func (n *NV503B_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   724      if n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   725          size := n.SizeBytes()
   726          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   727          return src[size:]
   728      }
   729      // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
   730      return n.UnmarshalBytes(src)
   731  }
   732  
   733  // CopyOutN implements marshal.Marshallable.CopyOutN.
   734  func (n *NV503B_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   735      if !n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   736          // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   737          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   738          n.MarshalBytes(buf) // escapes: fallback.
   739          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   740      }
   741  
   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 := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   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 length, err
   754  }
   755  
   756  // CopyOut implements marshal.Marshallable.CopyOut.
   757  func (n *NV503B_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   758      return n.CopyOutN(cc, addr, n.SizeBytes())
   759  }
   760  
   761  // CopyInN implements marshal.Marshallable.CopyInN.
   762  func (n *NV503B_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   763      if !n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   764          // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
   765          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
   766          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   767          // Unmarshal unconditionally. If we had a short copy-in, this results in a
   768          // partially unmarshalled struct.
   769          n.UnmarshalBytes(buf) // escapes: fallback.
   770          return length, err
   771      }
   772  
   773      // Construct a slice backed by dst's underlying memory.
   774      var buf []byte
   775      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   776      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   777      hdr.Len = n.SizeBytes()
   778      hdr.Cap = n.SizeBytes()
   779  
   780      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   781      // Since we bypassed the compiler's escape analysis, indicate that n
   782      // must live until the use above.
   783      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   784      return length, err
   785  }
   786  
   787  // CopyIn implements marshal.Marshallable.CopyIn.
   788  func (n *NV503B_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   789      return n.CopyInN(cc, addr, n.SizeBytes())
   790  }
   791  
   792  // WriteTo implements io.WriterTo.WriteTo.
   793  func (n *NV503B_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
   794      if !n.HPeerSubDevice.Packed() && n.HSubDevice.Packed() && n.L2pBar1P2PDmaInfo.Packed() && n.P2lBar1P2PDmaInfo.Packed() {
   795          // Type NV503B_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
   796          buf := make([]byte, n.SizeBytes())
   797          n.MarshalBytes(buf)
   798          length, err := writer.Write(buf)
   799          return int64(length), err
   800      }
   801  
   802      // Construct a slice backed by dst's underlying memory.
   803      var buf []byte
   804      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   805      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   806      hdr.Len = n.SizeBytes()
   807      hdr.Cap = n.SizeBytes()
   808  
   809      length, err := writer.Write(buf)
   810      // Since we bypassed the compiler's escape analysis, indicate that n
   811      // must live until the use above.
   812      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   813      return int64(length), err
   814  }
   815  
   816  // SizeBytes implements marshal.Marshallable.SizeBytes.
   817  func (n *NV503B_BAR1_P2P_DMA_INFO) SizeBytes() int {
   818      return 16
   819  }
   820  
   821  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   822  func (n *NV503B_BAR1_P2P_DMA_INFO) MarshalBytes(dst []byte) []byte {
   823      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.DmaAddress))
   824      dst = dst[8:]
   825      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.DmaSize))
   826      dst = dst[8:]
   827      return dst
   828  }
   829  
   830  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   831  func (n *NV503B_BAR1_P2P_DMA_INFO) UnmarshalBytes(src []byte) []byte {
   832      n.DmaAddress = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   833      src = src[8:]
   834      n.DmaSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
   835      src = src[8:]
   836      return src
   837  }
   838  
   839  // Packed implements marshal.Marshallable.Packed.
   840  //go:nosplit
   841  func (n *NV503B_BAR1_P2P_DMA_INFO) Packed() bool {
   842      return true
   843  }
   844  
   845  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   846  func (n *NV503B_BAR1_P2P_DMA_INFO) MarshalUnsafe(dst []byte) []byte {
   847      size := n.SizeBytes()
   848      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   849      return dst[size:]
   850  }
   851  
   852  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   853  func (n *NV503B_BAR1_P2P_DMA_INFO) UnmarshalUnsafe(src []byte) []byte {
   854      size := n.SizeBytes()
   855      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   856      return src[size:]
   857  }
   858  
   859  // CopyOutN implements marshal.Marshallable.CopyOutN.
   860  func (n *NV503B_BAR1_P2P_DMA_INFO) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   861      // Construct a slice backed by dst's underlying memory.
   862      var buf []byte
   863      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   864      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   865      hdr.Len = n.SizeBytes()
   866      hdr.Cap = n.SizeBytes()
   867  
   868      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   869      // Since we bypassed the compiler's escape analysis, indicate that n
   870      // must live until the use above.
   871      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   872      return length, err
   873  }
   874  
   875  // CopyOut implements marshal.Marshallable.CopyOut.
   876  func (n *NV503B_BAR1_P2P_DMA_INFO) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   877      return n.CopyOutN(cc, addr, n.SizeBytes())
   878  }
   879  
   880  // CopyInN implements marshal.Marshallable.CopyInN.
   881  func (n *NV503B_BAR1_P2P_DMA_INFO) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   882      // Construct a slice backed by dst's underlying memory.
   883      var buf []byte
   884      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   885      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   886      hdr.Len = n.SizeBytes()
   887      hdr.Cap = n.SizeBytes()
   888  
   889      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   890      // Since we bypassed the compiler's escape analysis, indicate that n
   891      // must live until the use above.
   892      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   893      return length, err
   894  }
   895  
   896  // CopyIn implements marshal.Marshallable.CopyIn.
   897  func (n *NV503B_BAR1_P2P_DMA_INFO) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   898      return n.CopyInN(cc, addr, n.SizeBytes())
   899  }
   900  
   901  // WriteTo implements io.WriterTo.WriteTo.
   902  func (n *NV503B_BAR1_P2P_DMA_INFO) WriteTo(writer io.Writer) (int64, error) {
   903      // Construct a slice backed by dst's underlying memory.
   904      var buf []byte
   905      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   906      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   907      hdr.Len = n.SizeBytes()
   908      hdr.Cap = n.SizeBytes()
   909  
   910      length, err := writer.Write(buf)
   911      // Since we bypassed the compiler's escape analysis, indicate that n
   912      // must live until the use above.
   913      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   914      return int64(length), err
   915  }
   916  
   917  // SizeBytes implements marshal.Marshallable.SizeBytes.
   918  func (n *NV503C_ALLOC_PARAMETERS) SizeBytes() int {
   919      return 4
   920  }
   921  
   922  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
   923  func (n *NV503C_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
   924      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
   925      dst = dst[4:]
   926      return dst
   927  }
   928  
   929  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
   930  func (n *NV503C_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
   931      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
   932      src = src[4:]
   933      return src
   934  }
   935  
   936  // Packed implements marshal.Marshallable.Packed.
   937  //go:nosplit
   938  func (n *NV503C_ALLOC_PARAMETERS) Packed() bool {
   939      return true
   940  }
   941  
   942  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
   943  func (n *NV503C_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
   944      size := n.SizeBytes()
   945      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
   946      return dst[size:]
   947  }
   948  
   949  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
   950  func (n *NV503C_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
   951      size := n.SizeBytes()
   952      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
   953      return src[size:]
   954  }
   955  
   956  // CopyOutN implements marshal.Marshallable.CopyOutN.
   957  func (n *NV503C_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   958      // Construct a slice backed by dst's underlying memory.
   959      var buf []byte
   960      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   961      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   962      hdr.Len = n.SizeBytes()
   963      hdr.Cap = n.SizeBytes()
   964  
   965      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
   966      // Since we bypassed the compiler's escape analysis, indicate that n
   967      // must live until the use above.
   968      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   969      return length, err
   970  }
   971  
   972  // CopyOut implements marshal.Marshallable.CopyOut.
   973  func (n *NV503C_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   974      return n.CopyOutN(cc, addr, n.SizeBytes())
   975  }
   976  
   977  // CopyInN implements marshal.Marshallable.CopyInN.
   978  func (n *NV503C_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
   979      // Construct a slice backed by dst's underlying memory.
   980      var buf []byte
   981      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
   982      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
   983      hdr.Len = n.SizeBytes()
   984      hdr.Cap = n.SizeBytes()
   985  
   986      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
   987      // Since we bypassed the compiler's escape analysis, indicate that n
   988      // must live until the use above.
   989      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
   990      return length, err
   991  }
   992  
   993  // CopyIn implements marshal.Marshallable.CopyIn.
   994  func (n *NV503C_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
   995      return n.CopyInN(cc, addr, n.SizeBytes())
   996  }
   997  
   998  // WriteTo implements io.WriterTo.WriteTo.
   999  func (n *NV503C_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  1000      // Construct a slice backed by dst's underlying memory.
  1001      var buf []byte
  1002      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1003      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1004      hdr.Len = n.SizeBytes()
  1005      hdr.Cap = n.SizeBytes()
  1006  
  1007      length, err := writer.Write(buf)
  1008      // Since we bypassed the compiler's escape analysis, indicate that n
  1009      // must live until the use above.
  1010      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1011      return int64(length), err
  1012  }
  1013  
  1014  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1015  func (n *NV83DE_ALLOC_PARAMETERS) SizeBytes() int {
  1016      return 0 +
  1017          (*Handle)(nil).SizeBytes() +
  1018          (*Handle)(nil).SizeBytes() +
  1019          (*Handle)(nil).SizeBytes()
  1020  }
  1021  
  1022  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1023  func (n *NV83DE_ALLOC_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1024      dst = n.HDebuggerClient_Obsolete.MarshalUnsafe(dst)
  1025      dst = n.HAppClient.MarshalUnsafe(dst)
  1026      dst = n.HClass3DObject.MarshalUnsafe(dst)
  1027      return dst
  1028  }
  1029  
  1030  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1031  func (n *NV83DE_ALLOC_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1032      src = n.HDebuggerClient_Obsolete.UnmarshalUnsafe(src)
  1033      src = n.HAppClient.UnmarshalUnsafe(src)
  1034      src = n.HClass3DObject.UnmarshalUnsafe(src)
  1035      return src
  1036  }
  1037  
  1038  // Packed implements marshal.Marshallable.Packed.
  1039  //go:nosplit
  1040  func (n *NV83DE_ALLOC_PARAMETERS) Packed() bool {
  1041      return n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed()
  1042  }
  1043  
  1044  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1045  func (n *NV83DE_ALLOC_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  1046      if n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1047          size := n.SizeBytes()
  1048          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1049          return dst[size:]
  1050      }
  1051      // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
  1052      return n.MarshalBytes(dst)
  1053  }
  1054  
  1055  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1056  func (n *NV83DE_ALLOC_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  1057      if n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1058          size := n.SizeBytes()
  1059          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1060          return src[size:]
  1061      }
  1062      // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  1063      return n.UnmarshalBytes(src)
  1064  }
  1065  
  1066  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1067  func (n *NV83DE_ALLOC_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1068      if !n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1069          // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1070          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1071          n.MarshalBytes(buf) // escapes: fallback.
  1072          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1073      }
  1074  
  1075      // Construct a slice backed by dst's underlying memory.
  1076      var buf []byte
  1077      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1078      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1079      hdr.Len = n.SizeBytes()
  1080      hdr.Cap = n.SizeBytes()
  1081  
  1082      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1083      // Since we bypassed the compiler's escape analysis, indicate that n
  1084      // must live until the use above.
  1085      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1086      return length, err
  1087  }
  1088  
  1089  // CopyOut implements marshal.Marshallable.CopyOut.
  1090  func (n *NV83DE_ALLOC_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1091      return n.CopyOutN(cc, addr, n.SizeBytes())
  1092  }
  1093  
  1094  // CopyInN implements marshal.Marshallable.CopyInN.
  1095  func (n *NV83DE_ALLOC_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1096      if !n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1097          // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  1098          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1099          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1100          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  1101          // partially unmarshalled struct.
  1102          n.UnmarshalBytes(buf) // escapes: fallback.
  1103          return length, err
  1104      }
  1105  
  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 := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  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 length, err
  1118  }
  1119  
  1120  // CopyIn implements marshal.Marshallable.CopyIn.
  1121  func (n *NV83DE_ALLOC_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1122      return n.CopyInN(cc, addr, n.SizeBytes())
  1123  }
  1124  
  1125  // WriteTo implements io.WriterTo.WriteTo.
  1126  func (n *NV83DE_ALLOC_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  1127      if !n.HAppClient.Packed() && n.HClass3DObject.Packed() && n.HDebuggerClient_Obsolete.Packed() {
  1128          // Type NV83DE_ALLOC_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1129          buf := make([]byte, n.SizeBytes())
  1130          n.MarshalBytes(buf)
  1131          length, err := writer.Write(buf)
  1132          return int64(length), err
  1133      }
  1134  
  1135      // Construct a slice backed by dst's underlying memory.
  1136      var buf []byte
  1137      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1138      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1139      hdr.Len = n.SizeBytes()
  1140      hdr.Cap = n.SizeBytes()
  1141  
  1142      length, err := writer.Write(buf)
  1143      // Since we bypassed the compiler's escape analysis, indicate that n
  1144      // must live until the use above.
  1145      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1146      return int64(length), err
  1147  }
  1148  
  1149  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1150  func (n *NVB0B5_ALLOCATION_PARAMETERS) SizeBytes() int {
  1151      return 8
  1152  }
  1153  
  1154  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1155  func (n *NVB0B5_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1156      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Version))
  1157      dst = dst[4:]
  1158      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EngineType))
  1159      dst = dst[4:]
  1160      return dst
  1161  }
  1162  
  1163  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1164  func (n *NVB0B5_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1165      n.Version = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1166      src = src[4:]
  1167      n.EngineType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1168      src = src[4:]
  1169      return src
  1170  }
  1171  
  1172  // Packed implements marshal.Marshallable.Packed.
  1173  //go:nosplit
  1174  func (n *NVB0B5_ALLOCATION_PARAMETERS) Packed() bool {
  1175      return true
  1176  }
  1177  
  1178  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1179  func (n *NVB0B5_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  1180      size := n.SizeBytes()
  1181      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1182      return dst[size:]
  1183  }
  1184  
  1185  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1186  func (n *NVB0B5_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  1187      size := n.SizeBytes()
  1188      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1189      return src[size:]
  1190  }
  1191  
  1192  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1193  func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1194      // Construct a slice backed by dst's underlying memory.
  1195      var buf []byte
  1196      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1197      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1198      hdr.Len = n.SizeBytes()
  1199      hdr.Cap = n.SizeBytes()
  1200  
  1201      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1202      // Since we bypassed the compiler's escape analysis, indicate that n
  1203      // must live until the use above.
  1204      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1205      return length, err
  1206  }
  1207  
  1208  // CopyOut implements marshal.Marshallable.CopyOut.
  1209  func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1210      return n.CopyOutN(cc, addr, n.SizeBytes())
  1211  }
  1212  
  1213  // CopyInN implements marshal.Marshallable.CopyInN.
  1214  func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1215      // Construct a slice backed by dst's underlying memory.
  1216      var buf []byte
  1217      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1218      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1219      hdr.Len = n.SizeBytes()
  1220      hdr.Cap = n.SizeBytes()
  1221  
  1222      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1223      // Since we bypassed the compiler's escape analysis, indicate that n
  1224      // must live until the use above.
  1225      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1226      return length, err
  1227  }
  1228  
  1229  // CopyIn implements marshal.Marshallable.CopyIn.
  1230  func (n *NVB0B5_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1231      return n.CopyInN(cc, addr, n.SizeBytes())
  1232  }
  1233  
  1234  // WriteTo implements io.WriterTo.WriteTo.
  1235  func (n *NVB0B5_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  1236      // Construct a slice backed by dst's underlying memory.
  1237      var buf []byte
  1238      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1239      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1240      hdr.Len = n.SizeBytes()
  1241      hdr.Cap = n.SizeBytes()
  1242  
  1243      length, err := writer.Write(buf)
  1244      // Since we bypassed the compiler's escape analysis, indicate that n
  1245      // must live until the use above.
  1246      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1247      return int64(length), err
  1248  }
  1249  
  1250  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1251  func (n *NV_CHANNEL_ALLOC_PARAMS) SizeBytes() int {
  1252      return 40 +
  1253          (*Handle)(nil).SizeBytes() +
  1254          (*Handle)(nil).SizeBytes() +
  1255          (*Handle)(nil).SizeBytes() +
  1256          (*Handle)(nil).SizeBytes() +
  1257          (*Handle)(nil).SizeBytes()*NV_MAX_SUBDEVICES +
  1258          8*NV_MAX_SUBDEVICES +
  1259          (*Handle)(nil).SizeBytes() +
  1260          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1261          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1262          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1263          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1264          (*Handle)(nil).SizeBytes() +
  1265          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1266          (*NV_MEMORY_DESC_PARAMS)(nil).SizeBytes() +
  1267          4*CC_CHAN_ALLOC_IV_SIZE_DWORD +
  1268          4*CC_CHAN_ALLOC_IV_SIZE_DWORD +
  1269          4*CC_CHAN_ALLOC_NONCE_SIZE_DWORD
  1270  }
  1271  
  1272  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1273  func (n *NV_CHANNEL_ALLOC_PARAMS) MarshalBytes(dst []byte) []byte {
  1274      dst = n.HObjectError.MarshalUnsafe(dst)
  1275      dst = n.HObjectBuffer.MarshalUnsafe(dst)
  1276      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.GPFIFOOffset))
  1277      dst = dst[8:]
  1278      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.GPFIFOEntries))
  1279      dst = dst[4:]
  1280      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  1281      dst = dst[4:]
  1282      dst = n.HContextShare.MarshalUnsafe(dst)
  1283      dst = n.HVASpace.MarshalUnsafe(dst)
  1284      for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ {
  1285          dst = n.HUserdMemory[idx].MarshalUnsafe(dst)
  1286      }
  1287      for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ {
  1288          hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.UserdOffset[idx]))
  1289          dst = dst[8:]
  1290      }
  1291      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EngineType))
  1292      dst = dst[4:]
  1293      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.CID))
  1294      dst = dst[4:]
  1295      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubDeviceID))
  1296      dst = dst[4:]
  1297      dst = n.HObjectECCError.MarshalUnsafe(dst)
  1298      dst = n.InstanceMem.MarshalUnsafe(dst)
  1299      dst = n.UserdMem.MarshalUnsafe(dst)
  1300      dst = n.RamfcMem.MarshalUnsafe(dst)
  1301      dst = n.MthdbufMem.MarshalUnsafe(dst)
  1302      dst = n.HPhysChannelGroup.MarshalUnsafe(dst)
  1303      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.InternalFlags))
  1304      dst = dst[4:]
  1305      dst = n.ErrorNotifierMem.MarshalUnsafe(dst)
  1306      dst = n.ECCErrorNotifierMem.MarshalUnsafe(dst)
  1307      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ProcessID))
  1308      dst = dst[4:]
  1309      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubProcessID))
  1310      dst = dst[4:]
  1311      for idx := 0; idx < CC_CHAN_ALLOC_IV_SIZE_DWORD; idx++ {
  1312          hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EncryptIv[idx]))
  1313          dst = dst[4:]
  1314      }
  1315      for idx := 0; idx < CC_CHAN_ALLOC_IV_SIZE_DWORD; idx++ {
  1316          hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.DecryptIv[idx]))
  1317          dst = dst[4:]
  1318      }
  1319      for idx := 0; idx < CC_CHAN_ALLOC_NONCE_SIZE_DWORD; idx++ {
  1320          hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HmacNonce[idx]))
  1321          dst = dst[4:]
  1322      }
  1323      return dst
  1324  }
  1325  
  1326  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1327  func (n *NV_CHANNEL_ALLOC_PARAMS) UnmarshalBytes(src []byte) []byte {
  1328      src = n.HObjectError.UnmarshalUnsafe(src)
  1329      src = n.HObjectBuffer.UnmarshalUnsafe(src)
  1330      n.GPFIFOOffset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  1331      src = src[8:]
  1332      n.GPFIFOEntries = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1333      src = src[4:]
  1334      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1335      src = src[4:]
  1336      src = n.HContextShare.UnmarshalUnsafe(src)
  1337      src = n.HVASpace.UnmarshalUnsafe(src)
  1338      for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ {
  1339          src = n.HUserdMemory[idx].UnmarshalUnsafe(src)
  1340      }
  1341      for idx := 0; idx < NV_MAX_SUBDEVICES; idx++ {
  1342          n.UserdOffset[idx] = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  1343          src = src[8:]
  1344      }
  1345      n.EngineType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1346      src = src[4:]
  1347      n.CID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1348      src = src[4:]
  1349      n.SubDeviceID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1350      src = src[4:]
  1351      src = n.HObjectECCError.UnmarshalUnsafe(src)
  1352      src = n.InstanceMem.UnmarshalUnsafe(src)
  1353      src = n.UserdMem.UnmarshalUnsafe(src)
  1354      src = n.RamfcMem.UnmarshalUnsafe(src)
  1355      src = n.MthdbufMem.UnmarshalUnsafe(src)
  1356      src = n.HPhysChannelGroup.UnmarshalUnsafe(src)
  1357      n.InternalFlags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1358      src = src[4:]
  1359      src = n.ErrorNotifierMem.UnmarshalUnsafe(src)
  1360      src = n.ECCErrorNotifierMem.UnmarshalUnsafe(src)
  1361      n.ProcessID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1362      src = src[4:]
  1363      n.SubProcessID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1364      src = src[4:]
  1365      for idx := 0; idx < CC_CHAN_ALLOC_IV_SIZE_DWORD; idx++ {
  1366          n.EncryptIv[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1367          src = src[4:]
  1368      }
  1369      for idx := 0; idx < CC_CHAN_ALLOC_IV_SIZE_DWORD; idx++ {
  1370          n.DecryptIv[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1371          src = src[4:]
  1372      }
  1373      for idx := 0; idx < CC_CHAN_ALLOC_NONCE_SIZE_DWORD; idx++ {
  1374          n.HmacNonce[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1375          src = src[4:]
  1376      }
  1377      return src
  1378  }
  1379  
  1380  // Packed implements marshal.Marshallable.Packed.
  1381  //go:nosplit
  1382  func (n *NV_CHANNEL_ALLOC_PARAMS) Packed() bool {
  1383      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()
  1384  }
  1385  
  1386  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1387  func (n *NV_CHANNEL_ALLOC_PARAMS) MarshalUnsafe(dst []byte) []byte {
  1388      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() {
  1389          size := n.SizeBytes()
  1390          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1391          return dst[size:]
  1392      }
  1393      // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  1394      return n.MarshalBytes(dst)
  1395  }
  1396  
  1397  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1398  func (n *NV_CHANNEL_ALLOC_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  1399      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() {
  1400          size := n.SizeBytes()
  1401          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1402          return src[size:]
  1403      }
  1404      // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  1405      return n.UnmarshalBytes(src)
  1406  }
  1407  
  1408  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1409  func (n *NV_CHANNEL_ALLOC_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1410      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() {
  1411          // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1412          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1413          n.MarshalBytes(buf) // escapes: fallback.
  1414          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1415      }
  1416  
  1417      // Construct a slice backed by dst's underlying memory.
  1418      var buf []byte
  1419      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1420      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1421      hdr.Len = n.SizeBytes()
  1422      hdr.Cap = n.SizeBytes()
  1423  
  1424      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1425      // Since we bypassed the compiler's escape analysis, indicate that n
  1426      // must live until the use above.
  1427      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1428      return length, err
  1429  }
  1430  
  1431  // CopyOut implements marshal.Marshallable.CopyOut.
  1432  func (n *NV_CHANNEL_ALLOC_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1433      return n.CopyOutN(cc, addr, n.SizeBytes())
  1434  }
  1435  
  1436  // CopyInN implements marshal.Marshallable.CopyInN.
  1437  func (n *NV_CHANNEL_ALLOC_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1438      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() {
  1439          // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  1440          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1441          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1442          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  1443          // partially unmarshalled struct.
  1444          n.UnmarshalBytes(buf) // escapes: fallback.
  1445          return length, err
  1446      }
  1447  
  1448      // Construct a slice backed by dst's underlying memory.
  1449      var buf []byte
  1450      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1451      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1452      hdr.Len = n.SizeBytes()
  1453      hdr.Cap = n.SizeBytes()
  1454  
  1455      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1456      // Since we bypassed the compiler's escape analysis, indicate that n
  1457      // must live until the use above.
  1458      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1459      return length, err
  1460  }
  1461  
  1462  // CopyIn implements marshal.Marshallable.CopyIn.
  1463  func (n *NV_CHANNEL_ALLOC_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1464      return n.CopyInN(cc, addr, n.SizeBytes())
  1465  }
  1466  
  1467  // WriteTo implements io.WriterTo.WriteTo.
  1468  func (n *NV_CHANNEL_ALLOC_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  1469      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() {
  1470          // Type NV_CHANNEL_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1471          buf := make([]byte, n.SizeBytes())
  1472          n.MarshalBytes(buf)
  1473          length, err := writer.Write(buf)
  1474          return int64(length), err
  1475      }
  1476  
  1477      // Construct a slice backed by dst's underlying memory.
  1478      var buf []byte
  1479      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1480      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1481      hdr.Len = n.SizeBytes()
  1482      hdr.Cap = n.SizeBytes()
  1483  
  1484      length, err := writer.Write(buf)
  1485      // Since we bypassed the compiler's escape analysis, indicate that n
  1486      // must live until the use above.
  1487      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1488      return int64(length), err
  1489  }
  1490  
  1491  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1492  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) SizeBytes() int {
  1493      return 5 +
  1494          (*Handle)(nil).SizeBytes() +
  1495          (*Handle)(nil).SizeBytes() +
  1496          (*Handle)(nil).SizeBytes() +
  1497          1*3
  1498  }
  1499  
  1500  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1501  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1502      dst = n.HObjectError.MarshalUnsafe(dst)
  1503      dst = n.HObjectECCError.MarshalUnsafe(dst)
  1504      dst = n.HVASpace.MarshalUnsafe(dst)
  1505      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.EngineType))
  1506      dst = dst[4:]
  1507      dst[0] = byte(n.BIsCallingContextVgpuPlugin)
  1508      dst = dst[1:]
  1509      for idx := 0; idx < 3; idx++ {
  1510          dst[0] = byte(n.Pad0[idx])
  1511          dst = dst[1:]
  1512      }
  1513      return dst
  1514  }
  1515  
  1516  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1517  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1518      src = n.HObjectError.UnmarshalUnsafe(src)
  1519      src = n.HObjectECCError.UnmarshalUnsafe(src)
  1520      src = n.HVASpace.UnmarshalUnsafe(src)
  1521      n.EngineType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1522      src = src[4:]
  1523      n.BIsCallingContextVgpuPlugin = uint8(src[0])
  1524      src = src[1:]
  1525      for idx := 0; idx < 3; idx++ {
  1526          n.Pad0[idx] = src[0]
  1527          src = src[1:]
  1528      }
  1529      return src
  1530  }
  1531  
  1532  // Packed implements marshal.Marshallable.Packed.
  1533  //go:nosplit
  1534  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) Packed() bool {
  1535      return n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed()
  1536  }
  1537  
  1538  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1539  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  1540      if n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1541          size := n.SizeBytes()
  1542          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1543          return dst[size:]
  1544      }
  1545      // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
  1546      return n.MarshalBytes(dst)
  1547  }
  1548  
  1549  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1550  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  1551      if n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1552          size := n.SizeBytes()
  1553          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1554          return src[size:]
  1555      }
  1556      // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  1557      return n.UnmarshalBytes(src)
  1558  }
  1559  
  1560  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1561  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1562      if !n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1563          // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1564          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1565          n.MarshalBytes(buf) // escapes: fallback.
  1566          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1567      }
  1568  
  1569      // Construct a slice backed by dst's underlying memory.
  1570      var buf []byte
  1571      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1572      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1573      hdr.Len = n.SizeBytes()
  1574      hdr.Cap = n.SizeBytes()
  1575  
  1576      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1577      // Since we bypassed the compiler's escape analysis, indicate that n
  1578      // must live until the use above.
  1579      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1580      return length, err
  1581  }
  1582  
  1583  // CopyOut implements marshal.Marshallable.CopyOut.
  1584  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1585      return n.CopyOutN(cc, addr, n.SizeBytes())
  1586  }
  1587  
  1588  // CopyInN implements marshal.Marshallable.CopyInN.
  1589  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1590      if !n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1591          // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  1592          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1593          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1594          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  1595          // partially unmarshalled struct.
  1596          n.UnmarshalBytes(buf) // escapes: fallback.
  1597          return length, err
  1598      }
  1599  
  1600      // Construct a slice backed by dst's underlying memory.
  1601      var buf []byte
  1602      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1603      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1604      hdr.Len = n.SizeBytes()
  1605      hdr.Cap = n.SizeBytes()
  1606  
  1607      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1608      // Since we bypassed the compiler's escape analysis, indicate that n
  1609      // must live until the use above.
  1610      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1611      return length, err
  1612  }
  1613  
  1614  // CopyIn implements marshal.Marshallable.CopyIn.
  1615  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1616      return n.CopyInN(cc, addr, n.SizeBytes())
  1617  }
  1618  
  1619  // WriteTo implements io.WriterTo.WriteTo.
  1620  func (n *NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  1621      if !n.HObjectECCError.Packed() && n.HObjectError.Packed() && n.HVASpace.Packed() {
  1622          // Type NV_CHANNEL_GROUP_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1623          buf := make([]byte, n.SizeBytes())
  1624          n.MarshalBytes(buf)
  1625          length, err := writer.Write(buf)
  1626          return int64(length), err
  1627      }
  1628  
  1629      // Construct a slice backed by dst's underlying memory.
  1630      var buf []byte
  1631      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1632      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1633      hdr.Len = n.SizeBytes()
  1634      hdr.Cap = n.SizeBytes()
  1635  
  1636      length, err := writer.Write(buf)
  1637      // Since we bypassed the compiler's escape analysis, indicate that n
  1638      // must live until the use above.
  1639      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1640      return int64(length), err
  1641  }
  1642  
  1643  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1644  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) SizeBytes() int {
  1645      return 4 +
  1646          (*Handle)(nil).SizeBytes()
  1647  }
  1648  
  1649  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1650  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) MarshalBytes(dst []byte) []byte {
  1651      dst = n.Handle.MarshalUnsafe(dst)
  1652      // Padding: dst[:sizeof(uint32)] ~= uint32(0)
  1653      dst = dst[4:]
  1654      return dst
  1655  }
  1656  
  1657  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1658  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) UnmarshalBytes(src []byte) []byte {
  1659      src = n.Handle.UnmarshalUnsafe(src)
  1660      // Padding: var _ uint32 ~= src[:sizeof(uint32)]
  1661      src = src[4:]
  1662      return src
  1663  }
  1664  
  1665  // Packed implements marshal.Marshallable.Packed.
  1666  //go:nosplit
  1667  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) Packed() bool {
  1668      return n.Handle.Packed()
  1669  }
  1670  
  1671  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1672  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) MarshalUnsafe(dst []byte) []byte {
  1673      if n.Handle.Packed() {
  1674          size := n.SizeBytes()
  1675          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1676          return dst[size:]
  1677      }
  1678      // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  1679      return n.MarshalBytes(dst)
  1680  }
  1681  
  1682  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1683  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  1684      if n.Handle.Packed() {
  1685          size := n.SizeBytes()
  1686          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1687          return src[size:]
  1688      }
  1689      // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  1690      return n.UnmarshalBytes(src)
  1691  }
  1692  
  1693  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1694  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1695      if !n.Handle.Packed() {
  1696          // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1697          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1698          n.MarshalBytes(buf) // escapes: fallback.
  1699          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1700      }
  1701  
  1702      // Construct a slice backed by dst's underlying memory.
  1703      var buf []byte
  1704      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1705      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1706      hdr.Len = n.SizeBytes()
  1707      hdr.Cap = n.SizeBytes()
  1708  
  1709      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1710      // Since we bypassed the compiler's escape analysis, indicate that n
  1711      // must live until the use above.
  1712      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1713      return length, err
  1714  }
  1715  
  1716  // CopyOut implements marshal.Marshallable.CopyOut.
  1717  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1718      return n.CopyOutN(cc, addr, n.SizeBytes())
  1719  }
  1720  
  1721  // CopyInN implements marshal.Marshallable.CopyInN.
  1722  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1723      if !n.Handle.Packed() {
  1724          // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  1725          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1726          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1727          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  1728          // partially unmarshalled struct.
  1729          n.UnmarshalBytes(buf) // escapes: fallback.
  1730          return length, err
  1731      }
  1732  
  1733      // Construct a slice backed by dst's underlying memory.
  1734      var buf []byte
  1735      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1736      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1737      hdr.Len = n.SizeBytes()
  1738      hdr.Cap = n.SizeBytes()
  1739  
  1740      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1741      // Since we bypassed the compiler's escape analysis, indicate that n
  1742      // must live until the use above.
  1743      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1744      return length, err
  1745  }
  1746  
  1747  // CopyIn implements marshal.Marshallable.CopyIn.
  1748  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1749      return n.CopyInN(cc, addr, n.SizeBytes())
  1750  }
  1751  
  1752  // WriteTo implements io.WriterTo.WriteTo.
  1753  func (n *NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  1754      if !n.Handle.Packed() {
  1755          // Type NV_CONFIDENTIAL_COMPUTE_ALLOC_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1756          buf := make([]byte, n.SizeBytes())
  1757          n.MarshalBytes(buf)
  1758          length, err := writer.Write(buf)
  1759          return int64(length), err
  1760      }
  1761  
  1762      // Construct a slice backed by dst's underlying memory.
  1763      var buf []byte
  1764      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1765      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1766      hdr.Len = n.SizeBytes()
  1767      hdr.Cap = n.SizeBytes()
  1768  
  1769      length, err := writer.Write(buf)
  1770      // Since we bypassed the compiler's escape analysis, indicate that n
  1771      // must live until the use above.
  1772      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1773      return int64(length), err
  1774  }
  1775  
  1776  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1777  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) SizeBytes() int {
  1778      return 8 +
  1779          (*Handle)(nil).SizeBytes()
  1780  }
  1781  
  1782  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1783  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1784      dst = n.HVASpace.MarshalUnsafe(dst)
  1785      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  1786      dst = dst[4:]
  1787      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SubctxID))
  1788      dst = dst[4:]
  1789      return dst
  1790  }
  1791  
  1792  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1793  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1794      src = n.HVASpace.UnmarshalUnsafe(src)
  1795      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1796      src = src[4:]
  1797      n.SubctxID = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1798      src = src[4:]
  1799      return src
  1800  }
  1801  
  1802  // Packed implements marshal.Marshallable.Packed.
  1803  //go:nosplit
  1804  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) Packed() bool {
  1805      return n.HVASpace.Packed()
  1806  }
  1807  
  1808  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1809  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  1810      if n.HVASpace.Packed() {
  1811          size := n.SizeBytes()
  1812          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1813          return dst[size:]
  1814      }
  1815      // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to MarshalBytes.
  1816      return n.MarshalBytes(dst)
  1817  }
  1818  
  1819  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1820  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  1821      if n.HVASpace.Packed() {
  1822          size := n.SizeBytes()
  1823          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1824          return src[size:]
  1825      }
  1826      // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  1827      return n.UnmarshalBytes(src)
  1828  }
  1829  
  1830  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1831  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1832      if !n.HVASpace.Packed() {
  1833          // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1834          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1835          n.MarshalBytes(buf) // escapes: fallback.
  1836          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1837      }
  1838  
  1839      // Construct a slice backed by dst's underlying memory.
  1840      var buf []byte
  1841      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1842      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1843      hdr.Len = n.SizeBytes()
  1844      hdr.Cap = n.SizeBytes()
  1845  
  1846      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1847      // Since we bypassed the compiler's escape analysis, indicate that n
  1848      // must live until the use above.
  1849      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1850      return length, err
  1851  }
  1852  
  1853  // CopyOut implements marshal.Marshallable.CopyOut.
  1854  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1855      return n.CopyOutN(cc, addr, n.SizeBytes())
  1856  }
  1857  
  1858  // CopyInN implements marshal.Marshallable.CopyInN.
  1859  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1860      if !n.HVASpace.Packed() {
  1861          // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  1862          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  1863          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1864          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  1865          // partially unmarshalled struct.
  1866          n.UnmarshalBytes(buf) // escapes: fallback.
  1867          return length, err
  1868      }
  1869  
  1870      // Construct a slice backed by dst's underlying memory.
  1871      var buf []byte
  1872      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1873      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1874      hdr.Len = n.SizeBytes()
  1875      hdr.Cap = n.SizeBytes()
  1876  
  1877      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1878      // Since we bypassed the compiler's escape analysis, indicate that n
  1879      // must live until the use above.
  1880      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1881      return length, err
  1882  }
  1883  
  1884  // CopyIn implements marshal.Marshallable.CopyIn.
  1885  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1886      return n.CopyInN(cc, addr, n.SizeBytes())
  1887  }
  1888  
  1889  // WriteTo implements io.WriterTo.WriteTo.
  1890  func (n *NV_CTXSHARE_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  1891      if !n.HVASpace.Packed() {
  1892          // Type NV_CTXSHARE_ALLOCATION_PARAMETERS doesn't have a packed layout in memory, fall back to MarshalBytes.
  1893          buf := make([]byte, n.SizeBytes())
  1894          n.MarshalBytes(buf)
  1895          length, err := writer.Write(buf)
  1896          return int64(length), err
  1897      }
  1898  
  1899      // Construct a slice backed by dst's underlying memory.
  1900      var buf []byte
  1901      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1902      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1903      hdr.Len = n.SizeBytes()
  1904      hdr.Cap = n.SizeBytes()
  1905  
  1906      length, err := writer.Write(buf)
  1907      // Since we bypassed the compiler's escape analysis, indicate that n
  1908      // must live until the use above.
  1909      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1910      return int64(length), err
  1911  }
  1912  
  1913  // SizeBytes implements marshal.Marshallable.SizeBytes.
  1914  func (n *NV_GR_ALLOCATION_PARAMETERS) SizeBytes() int {
  1915      return 16
  1916  }
  1917  
  1918  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  1919  func (n *NV_GR_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  1920      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Version))
  1921      dst = dst[4:]
  1922      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  1923      dst = dst[4:]
  1924      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Size))
  1925      dst = dst[4:]
  1926      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Caps))
  1927      dst = dst[4:]
  1928      return dst
  1929  }
  1930  
  1931  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  1932  func (n *NV_GR_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  1933      n.Version = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1934      src = src[4:]
  1935      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1936      src = src[4:]
  1937      n.Size = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1938      src = src[4:]
  1939      n.Caps = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  1940      src = src[4:]
  1941      return src
  1942  }
  1943  
  1944  // Packed implements marshal.Marshallable.Packed.
  1945  //go:nosplit
  1946  func (n *NV_GR_ALLOCATION_PARAMETERS) Packed() bool {
  1947      return true
  1948  }
  1949  
  1950  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  1951  func (n *NV_GR_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  1952      size := n.SizeBytes()
  1953      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  1954      return dst[size:]
  1955  }
  1956  
  1957  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  1958  func (n *NV_GR_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  1959      size := n.SizeBytes()
  1960      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  1961      return src[size:]
  1962  }
  1963  
  1964  // CopyOutN implements marshal.Marshallable.CopyOutN.
  1965  func (n *NV_GR_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1966      // Construct a slice backed by dst's underlying memory.
  1967      var buf []byte
  1968      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1969      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1970      hdr.Len = n.SizeBytes()
  1971      hdr.Cap = n.SizeBytes()
  1972  
  1973      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  1974      // Since we bypassed the compiler's escape analysis, indicate that n
  1975      // must live until the use above.
  1976      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1977      return length, err
  1978  }
  1979  
  1980  // CopyOut implements marshal.Marshallable.CopyOut.
  1981  func (n *NV_GR_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  1982      return n.CopyOutN(cc, addr, n.SizeBytes())
  1983  }
  1984  
  1985  // CopyInN implements marshal.Marshallable.CopyInN.
  1986  func (n *NV_GR_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  1987      // Construct a slice backed by dst's underlying memory.
  1988      var buf []byte
  1989      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  1990      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  1991      hdr.Len = n.SizeBytes()
  1992      hdr.Cap = n.SizeBytes()
  1993  
  1994      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  1995      // Since we bypassed the compiler's escape analysis, indicate that n
  1996      // must live until the use above.
  1997      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  1998      return length, err
  1999  }
  2000  
  2001  // CopyIn implements marshal.Marshallable.CopyIn.
  2002  func (n *NV_GR_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2003      return n.CopyInN(cc, addr, n.SizeBytes())
  2004  }
  2005  
  2006  // WriteTo implements io.WriterTo.WriteTo.
  2007  func (n *NV_GR_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  2008      // Construct a slice backed by dst's underlying memory.
  2009      var buf []byte
  2010      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2011      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2012      hdr.Len = n.SizeBytes()
  2013      hdr.Cap = n.SizeBytes()
  2014  
  2015      length, err := writer.Write(buf)
  2016      // Since we bypassed the compiler's escape analysis, indicate that n
  2017      // must live until the use above.
  2018      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2019      return int64(length), err
  2020  }
  2021  
  2022  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2023  func (n *NV_HOPPER_USERMODE_A_PARAMS) SizeBytes() int {
  2024      return 2
  2025  }
  2026  
  2027  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2028  func (n *NV_HOPPER_USERMODE_A_PARAMS) MarshalBytes(dst []byte) []byte {
  2029      dst[0] = byte(n.Bar1Mapping)
  2030      dst = dst[1:]
  2031      dst[0] = byte(n.Priv)
  2032      dst = dst[1:]
  2033      return dst
  2034  }
  2035  
  2036  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2037  func (n *NV_HOPPER_USERMODE_A_PARAMS) UnmarshalBytes(src []byte) []byte {
  2038      n.Bar1Mapping = uint8(src[0])
  2039      src = src[1:]
  2040      n.Priv = uint8(src[0])
  2041      src = src[1:]
  2042      return src
  2043  }
  2044  
  2045  // Packed implements marshal.Marshallable.Packed.
  2046  //go:nosplit
  2047  func (n *NV_HOPPER_USERMODE_A_PARAMS) Packed() bool {
  2048      return true
  2049  }
  2050  
  2051  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2052  func (n *NV_HOPPER_USERMODE_A_PARAMS) MarshalUnsafe(dst []byte) []byte {
  2053      size := n.SizeBytes()
  2054      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2055      return dst[size:]
  2056  }
  2057  
  2058  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2059  func (n *NV_HOPPER_USERMODE_A_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  2060      size := n.SizeBytes()
  2061      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2062      return src[size:]
  2063  }
  2064  
  2065  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2066  func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2067      // Construct a slice backed by dst's underlying memory.
  2068      var buf []byte
  2069      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2070      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2071      hdr.Len = n.SizeBytes()
  2072      hdr.Cap = n.SizeBytes()
  2073  
  2074      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2075      // Since we bypassed the compiler's escape analysis, indicate that n
  2076      // must live until the use above.
  2077      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2078      return length, err
  2079  }
  2080  
  2081  // CopyOut implements marshal.Marshallable.CopyOut.
  2082  func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2083      return n.CopyOutN(cc, addr, n.SizeBytes())
  2084  }
  2085  
  2086  // CopyInN implements marshal.Marshallable.CopyInN.
  2087  func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2088      // Construct a slice backed by dst's underlying memory.
  2089      var buf []byte
  2090      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2091      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2092      hdr.Len = n.SizeBytes()
  2093      hdr.Cap = n.SizeBytes()
  2094  
  2095      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2096      // Since we bypassed the compiler's escape analysis, indicate that n
  2097      // must live until the use above.
  2098      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2099      return length, err
  2100  }
  2101  
  2102  // CopyIn implements marshal.Marshallable.CopyIn.
  2103  func (n *NV_HOPPER_USERMODE_A_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2104      return n.CopyInN(cc, addr, n.SizeBytes())
  2105  }
  2106  
  2107  // WriteTo implements io.WriterTo.WriteTo.
  2108  func (n *NV_HOPPER_USERMODE_A_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  2109      // Construct a slice backed by dst's underlying memory.
  2110      var buf []byte
  2111      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2112      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2113      hdr.Len = n.SizeBytes()
  2114      hdr.Cap = n.SizeBytes()
  2115  
  2116      length, err := writer.Write(buf)
  2117      // Since we bypassed the compiler's escape analysis, indicate that n
  2118      // must live until the use above.
  2119      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2120      return int64(length), err
  2121  }
  2122  
  2123  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2124  func (n *NV_MEMORY_ALLOCATION_PARAMS) SizeBytes() int {
  2125      return 108 +
  2126          (*P64)(nil).SizeBytes() +
  2127          (*Handle)(nil).SizeBytes()
  2128  }
  2129  
  2130  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2131  func (n *NV_MEMORY_ALLOCATION_PARAMS) MarshalBytes(dst []byte) []byte {
  2132      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Owner))
  2133      dst = dst[4:]
  2134      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Type))
  2135      dst = dst[4:]
  2136      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  2137      dst = dst[4:]
  2138      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Width))
  2139      dst = dst[4:]
  2140      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Height))
  2141      dst = dst[4:]
  2142      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Pitch))
  2143      dst = dst[4:]
  2144      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Attr))
  2145      dst = dst[4:]
  2146      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Attr2))
  2147      dst = dst[4:]
  2148      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Format))
  2149      dst = dst[4:]
  2150      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ComprCovg))
  2151      dst = dst[4:]
  2152      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ZcullCovg))
  2153      dst = dst[4:]
  2154      // Padding: dst[:sizeof(uint32)] ~= uint32(0)
  2155      dst = dst[4:]
  2156      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.RangeLo))
  2157      dst = dst[8:]
  2158      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.RangeHi))
  2159      dst = dst[8:]
  2160      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Size))
  2161      dst = dst[8:]
  2162      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Alignment))
  2163      dst = dst[8:]
  2164      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Offset))
  2165      dst = dst[8:]
  2166      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Limit))
  2167      dst = dst[8:]
  2168      dst = n.Address.MarshalUnsafe(dst)
  2169      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.CtagOffset))
  2170      dst = dst[4:]
  2171      dst = n.HVASpace.MarshalUnsafe(dst)
  2172      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.InternalFlags))
  2173      dst = dst[4:]
  2174      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Tag))
  2175      dst = dst[4:]
  2176      return dst
  2177  }
  2178  
  2179  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2180  func (n *NV_MEMORY_ALLOCATION_PARAMS) UnmarshalBytes(src []byte) []byte {
  2181      n.Owner = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2182      src = src[4:]
  2183      n.Type = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2184      src = src[4:]
  2185      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2186      src = src[4:]
  2187      n.Width = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2188      src = src[4:]
  2189      n.Height = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2190      src = src[4:]
  2191      n.Pitch = int32(hostarch.ByteOrder.Uint32(src[:4]))
  2192      src = src[4:]
  2193      n.Attr = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2194      src = src[4:]
  2195      n.Attr2 = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2196      src = src[4:]
  2197      n.Format = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2198      src = src[4:]
  2199      n.ComprCovg = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2200      src = src[4:]
  2201      n.ZcullCovg = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2202      src = src[4:]
  2203      // Padding: var _ uint32 ~= src[:sizeof(uint32)]
  2204      src = src[4:]
  2205      n.RangeLo = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2206      src = src[8:]
  2207      n.RangeHi = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2208      src = src[8:]
  2209      n.Size = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2210      src = src[8:]
  2211      n.Alignment = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2212      src = src[8:]
  2213      n.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2214      src = src[8:]
  2215      n.Limit = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2216      src = src[8:]
  2217      src = n.Address.UnmarshalUnsafe(src)
  2218      n.CtagOffset = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2219      src = src[4:]
  2220      src = n.HVASpace.UnmarshalUnsafe(src)
  2221      n.InternalFlags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2222      src = src[4:]
  2223      n.Tag = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2224      src = src[4:]
  2225      return src
  2226  }
  2227  
  2228  // Packed implements marshal.Marshallable.Packed.
  2229  //go:nosplit
  2230  func (n *NV_MEMORY_ALLOCATION_PARAMS) Packed() bool {
  2231      return n.Address.Packed() && n.HVASpace.Packed()
  2232  }
  2233  
  2234  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2235  func (n *NV_MEMORY_ALLOCATION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  2236      if n.Address.Packed() && n.HVASpace.Packed() {
  2237          size := n.SizeBytes()
  2238          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2239          return dst[size:]
  2240      }
  2241      // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  2242      return n.MarshalBytes(dst)
  2243  }
  2244  
  2245  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2246  func (n *NV_MEMORY_ALLOCATION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  2247      if n.Address.Packed() && n.HVASpace.Packed() {
  2248          size := n.SizeBytes()
  2249          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2250          return src[size:]
  2251      }
  2252      // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  2253      return n.UnmarshalBytes(src)
  2254  }
  2255  
  2256  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2257  func (n *NV_MEMORY_ALLOCATION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2258      if !n.Address.Packed() && n.HVASpace.Packed() {
  2259          // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2260          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2261          n.MarshalBytes(buf) // escapes: fallback.
  2262          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2263      }
  2264  
  2265      // Construct a slice backed by dst's underlying memory.
  2266      var buf []byte
  2267      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2268      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2269      hdr.Len = n.SizeBytes()
  2270      hdr.Cap = n.SizeBytes()
  2271  
  2272      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2273      // Since we bypassed the compiler's escape analysis, indicate that n
  2274      // must live until the use above.
  2275      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2276      return length, err
  2277  }
  2278  
  2279  // CopyOut implements marshal.Marshallable.CopyOut.
  2280  func (n *NV_MEMORY_ALLOCATION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2281      return n.CopyOutN(cc, addr, n.SizeBytes())
  2282  }
  2283  
  2284  // CopyInN implements marshal.Marshallable.CopyInN.
  2285  func (n *NV_MEMORY_ALLOCATION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2286      if !n.Address.Packed() && n.HVASpace.Packed() {
  2287          // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  2288          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2289          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2290          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  2291          // partially unmarshalled struct.
  2292          n.UnmarshalBytes(buf) // escapes: fallback.
  2293          return length, err
  2294      }
  2295  
  2296      // Construct a slice backed by dst's underlying memory.
  2297      var buf []byte
  2298      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2299      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2300      hdr.Len = n.SizeBytes()
  2301      hdr.Cap = n.SizeBytes()
  2302  
  2303      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2304      // Since we bypassed the compiler's escape analysis, indicate that n
  2305      // must live until the use above.
  2306      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2307      return length, err
  2308  }
  2309  
  2310  // CopyIn implements marshal.Marshallable.CopyIn.
  2311  func (n *NV_MEMORY_ALLOCATION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2312      return n.CopyInN(cc, addr, n.SizeBytes())
  2313  }
  2314  
  2315  // WriteTo implements io.WriterTo.WriteTo.
  2316  func (n *NV_MEMORY_ALLOCATION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  2317      if !n.Address.Packed() && n.HVASpace.Packed() {
  2318          // Type NV_MEMORY_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2319          buf := make([]byte, n.SizeBytes())
  2320          n.MarshalBytes(buf)
  2321          length, err := writer.Write(buf)
  2322          return int64(length), err
  2323      }
  2324  
  2325      // Construct a slice backed by dst's underlying memory.
  2326      var buf []byte
  2327      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2328      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2329      hdr.Len = n.SizeBytes()
  2330      hdr.Cap = n.SizeBytes()
  2331  
  2332      length, err := writer.Write(buf)
  2333      // Since we bypassed the compiler's escape analysis, indicate that n
  2334      // must live until the use above.
  2335      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2336      return int64(length), err
  2337  }
  2338  
  2339  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2340  func (n *NV_MEMORY_DESC_PARAMS) SizeBytes() int {
  2341      return 24
  2342  }
  2343  
  2344  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2345  func (n *NV_MEMORY_DESC_PARAMS) MarshalBytes(dst []byte) []byte {
  2346      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Base))
  2347      dst = dst[8:]
  2348      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Size))
  2349      dst = dst[8:]
  2350      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.AddressSpace))
  2351      dst = dst[4:]
  2352      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.CacheAttrib))
  2353      dst = dst[4:]
  2354      return dst
  2355  }
  2356  
  2357  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2358  func (n *NV_MEMORY_DESC_PARAMS) UnmarshalBytes(src []byte) []byte {
  2359      n.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2360      src = src[8:]
  2361      n.Size = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2362      src = src[8:]
  2363      n.AddressSpace = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2364      src = src[4:]
  2365      n.CacheAttrib = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2366      src = src[4:]
  2367      return src
  2368  }
  2369  
  2370  // Packed implements marshal.Marshallable.Packed.
  2371  //go:nosplit
  2372  func (n *NV_MEMORY_DESC_PARAMS) Packed() bool {
  2373      return true
  2374  }
  2375  
  2376  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2377  func (n *NV_MEMORY_DESC_PARAMS) MarshalUnsafe(dst []byte) []byte {
  2378      size := n.SizeBytes()
  2379      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2380      return dst[size:]
  2381  }
  2382  
  2383  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2384  func (n *NV_MEMORY_DESC_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  2385      size := n.SizeBytes()
  2386      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2387      return src[size:]
  2388  }
  2389  
  2390  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2391  func (n *NV_MEMORY_DESC_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2392      // Construct a slice backed by dst's underlying memory.
  2393      var buf []byte
  2394      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2395      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2396      hdr.Len = n.SizeBytes()
  2397      hdr.Cap = n.SizeBytes()
  2398  
  2399      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2400      // Since we bypassed the compiler's escape analysis, indicate that n
  2401      // must live until the use above.
  2402      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2403      return length, err
  2404  }
  2405  
  2406  // CopyOut implements marshal.Marshallable.CopyOut.
  2407  func (n *NV_MEMORY_DESC_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2408      return n.CopyOutN(cc, addr, n.SizeBytes())
  2409  }
  2410  
  2411  // CopyInN implements marshal.Marshallable.CopyInN.
  2412  func (n *NV_MEMORY_DESC_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2413      // Construct a slice backed by dst's underlying memory.
  2414      var buf []byte
  2415      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2416      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2417      hdr.Len = n.SizeBytes()
  2418      hdr.Cap = n.SizeBytes()
  2419  
  2420      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2421      // Since we bypassed the compiler's escape analysis, indicate that n
  2422      // must live until the use above.
  2423      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2424      return length, err
  2425  }
  2426  
  2427  // CopyIn implements marshal.Marshallable.CopyIn.
  2428  func (n *NV_MEMORY_DESC_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2429      return n.CopyInN(cc, addr, n.SizeBytes())
  2430  }
  2431  
  2432  // WriteTo implements io.WriterTo.WriteTo.
  2433  func (n *NV_MEMORY_DESC_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  2434      // Construct a slice backed by dst's underlying memory.
  2435      var buf []byte
  2436      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2437      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2438      hdr.Len = n.SizeBytes()
  2439      hdr.Cap = n.SizeBytes()
  2440  
  2441      length, err := writer.Write(buf)
  2442      // Since we bypassed the compiler's escape analysis, indicate that n
  2443      // must live until the use above.
  2444      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2445      return int64(length), err
  2446  }
  2447  
  2448  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2449  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) SizeBytes() int {
  2450      return 44 +
  2451          1*4
  2452  }
  2453  
  2454  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2455  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) MarshalBytes(dst []byte) []byte {
  2456      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Index))
  2457      dst = dst[4:]
  2458      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  2459      dst = dst[4:]
  2460      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VASize))
  2461      dst = dst[8:]
  2462      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VAStartInternal))
  2463      dst = dst[8:]
  2464      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VALimitInternal))
  2465      dst = dst[8:]
  2466      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.BigPageSize))
  2467      dst = dst[4:]
  2468      for idx := 0; idx < 4; idx++ {
  2469          dst[0] = byte(n.Pad0[idx])
  2470          dst = dst[1:]
  2471      }
  2472      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.VABase))
  2473      dst = dst[8:]
  2474      return dst
  2475  }
  2476  
  2477  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2478  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) UnmarshalBytes(src []byte) []byte {
  2479      n.Index = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2480      src = src[4:]
  2481      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2482      src = src[4:]
  2483      n.VASize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2484      src = src[8:]
  2485      n.VAStartInternal = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2486      src = src[8:]
  2487      n.VALimitInternal = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2488      src = src[8:]
  2489      n.BigPageSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2490      src = src[4:]
  2491      for idx := 0; idx < 4; idx++ {
  2492          n.Pad0[idx] = src[0]
  2493          src = src[1:]
  2494      }
  2495      n.VABase = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2496      src = src[8:]
  2497      return src
  2498  }
  2499  
  2500  // Packed implements marshal.Marshallable.Packed.
  2501  //go:nosplit
  2502  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) Packed() bool {
  2503      return true
  2504  }
  2505  
  2506  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2507  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) MarshalUnsafe(dst []byte) []byte {
  2508      size := n.SizeBytes()
  2509      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2510      return dst[size:]
  2511  }
  2512  
  2513  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2514  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) UnmarshalUnsafe(src []byte) []byte {
  2515      size := n.SizeBytes()
  2516      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2517      return src[size:]
  2518  }
  2519  
  2520  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2521  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2522      // Construct a slice backed by dst's underlying memory.
  2523      var buf []byte
  2524      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2525      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2526      hdr.Len = n.SizeBytes()
  2527      hdr.Cap = n.SizeBytes()
  2528  
  2529      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2530      // Since we bypassed the compiler's escape analysis, indicate that n
  2531      // must live until the use above.
  2532      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2533      return length, err
  2534  }
  2535  
  2536  // CopyOut implements marshal.Marshallable.CopyOut.
  2537  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2538      return n.CopyOutN(cc, addr, n.SizeBytes())
  2539  }
  2540  
  2541  // CopyInN implements marshal.Marshallable.CopyInN.
  2542  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2543      // Construct a slice backed by dst's underlying memory.
  2544      var buf []byte
  2545      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2546      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2547      hdr.Len = n.SizeBytes()
  2548      hdr.Cap = n.SizeBytes()
  2549  
  2550      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2551      // Since we bypassed the compiler's escape analysis, indicate that n
  2552      // must live until the use above.
  2553      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2554      return length, err
  2555  }
  2556  
  2557  // CopyIn implements marshal.Marshallable.CopyIn.
  2558  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2559      return n.CopyInN(cc, addr, n.SizeBytes())
  2560  }
  2561  
  2562  // WriteTo implements io.WriterTo.WriteTo.
  2563  func (n *NV_VASPACE_ALLOCATION_PARAMETERS) WriteTo(writer io.Writer) (int64, error) {
  2564      // Construct a slice backed by dst's underlying memory.
  2565      var buf []byte
  2566      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2567      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2568      hdr.Len = n.SizeBytes()
  2569      hdr.Cap = n.SizeBytes()
  2570  
  2571      length, err := writer.Write(buf)
  2572      // Since we bypassed the compiler's escape analysis, indicate that n
  2573      // must live until the use above.
  2574      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2575      return int64(length), err
  2576  }
  2577  
  2578  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2579  func (n *nv00f8Map) SizeBytes() int {
  2580      return 12 +
  2581          (*Handle)(nil).SizeBytes()
  2582  }
  2583  
  2584  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2585  func (n *nv00f8Map) MarshalBytes(dst []byte) []byte {
  2586      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.offset))
  2587      dst = dst[8:]
  2588      dst = n.hVidMem.MarshalUnsafe(dst)
  2589      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.flags))
  2590      dst = dst[4:]
  2591      return dst
  2592  }
  2593  
  2594  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2595  func (n *nv00f8Map) UnmarshalBytes(src []byte) []byte {
  2596      n.offset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  2597      src = src[8:]
  2598      src = n.hVidMem.UnmarshalUnsafe(src)
  2599      n.flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2600      src = src[4:]
  2601      return src
  2602  }
  2603  
  2604  // Packed implements marshal.Marshallable.Packed.
  2605  //go:nosplit
  2606  func (n *nv00f8Map) Packed() bool {
  2607      return n.hVidMem.Packed()
  2608  }
  2609  
  2610  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2611  func (n *nv00f8Map) MarshalUnsafe(dst []byte) []byte {
  2612      if n.hVidMem.Packed() {
  2613          size := n.SizeBytes()
  2614          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2615          return dst[size:]
  2616      }
  2617      // Type nv00f8Map doesn't have a packed layout in memory, fallback to MarshalBytes.
  2618      return n.MarshalBytes(dst)
  2619  }
  2620  
  2621  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2622  func (n *nv00f8Map) UnmarshalUnsafe(src []byte) []byte {
  2623      if n.hVidMem.Packed() {
  2624          size := n.SizeBytes()
  2625          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2626          return src[size:]
  2627      }
  2628      // Type nv00f8Map doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  2629      return n.UnmarshalBytes(src)
  2630  }
  2631  
  2632  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2633  func (n *nv00f8Map) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2634      if !n.hVidMem.Packed() {
  2635          // Type nv00f8Map doesn't have a packed layout in memory, fall back to MarshalBytes.
  2636          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2637          n.MarshalBytes(buf) // escapes: fallback.
  2638          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2639      }
  2640  
  2641      // Construct a slice backed by dst's underlying memory.
  2642      var buf []byte
  2643      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2644      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2645      hdr.Len = n.SizeBytes()
  2646      hdr.Cap = n.SizeBytes()
  2647  
  2648      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2649      // Since we bypassed the compiler's escape analysis, indicate that n
  2650      // must live until the use above.
  2651      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2652      return length, err
  2653  }
  2654  
  2655  // CopyOut implements marshal.Marshallable.CopyOut.
  2656  func (n *nv00f8Map) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2657      return n.CopyOutN(cc, addr, n.SizeBytes())
  2658  }
  2659  
  2660  // CopyInN implements marshal.Marshallable.CopyInN.
  2661  func (n *nv00f8Map) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2662      if !n.hVidMem.Packed() {
  2663          // Type nv00f8Map doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  2664          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2665          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2666          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  2667          // partially unmarshalled struct.
  2668          n.UnmarshalBytes(buf) // escapes: fallback.
  2669          return length, err
  2670      }
  2671  
  2672      // Construct a slice backed by dst's underlying memory.
  2673      var buf []byte
  2674      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2675      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2676      hdr.Len = n.SizeBytes()
  2677      hdr.Cap = n.SizeBytes()
  2678  
  2679      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2680      // Since we bypassed the compiler's escape analysis, indicate that n
  2681      // must live until the use above.
  2682      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2683      return length, err
  2684  }
  2685  
  2686  // CopyIn implements marshal.Marshallable.CopyIn.
  2687  func (n *nv00f8Map) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2688      return n.CopyInN(cc, addr, n.SizeBytes())
  2689  }
  2690  
  2691  // WriteTo implements io.WriterTo.WriteTo.
  2692  func (n *nv00f8Map) WriteTo(writer io.Writer) (int64, error) {
  2693      if !n.hVidMem.Packed() {
  2694          // Type nv00f8Map doesn't have a packed layout in memory, fall back to MarshalBytes.
  2695          buf := make([]byte, n.SizeBytes())
  2696          n.MarshalBytes(buf)
  2697          length, err := writer.Write(buf)
  2698          return int64(length), err
  2699      }
  2700  
  2701      // Construct a slice backed by dst's underlying memory.
  2702      var buf []byte
  2703      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2704      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2705      hdr.Len = n.SizeBytes()
  2706      hdr.Cap = n.SizeBytes()
  2707  
  2708      length, err := writer.Write(buf)
  2709      // Since we bypassed the compiler's escape analysis, indicate that n
  2710      // must live until the use above.
  2711      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2712      return int64(length), err
  2713  }
  2714  
  2715  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2716  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) SizeBytes() int {
  2717      return 12 +
  2718          1*4 +
  2719          (*P64)(nil).SizeBytes() +
  2720          (*P64)(nil).SizeBytes() +
  2721          (*P64)(nil).SizeBytes()
  2722  }
  2723  
  2724  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2725  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) MarshalBytes(dst []byte) []byte {
  2726      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.SizeOfStrings))
  2727      dst = dst[4:]
  2728      for idx := 0; idx < 4; idx++ {
  2729          dst[0] = byte(n.Pad[idx])
  2730          dst = dst[1:]
  2731      }
  2732      dst = n.PDriverVersionBuffer.MarshalUnsafe(dst)
  2733      dst = n.PVersionBuffer.MarshalUnsafe(dst)
  2734      dst = n.PTitleBuffer.MarshalUnsafe(dst)
  2735      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ChangelistNumber))
  2736      dst = dst[4:]
  2737      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.OfficialChangelistNumber))
  2738      dst = dst[4:]
  2739      return dst
  2740  }
  2741  
  2742  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2743  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) UnmarshalBytes(src []byte) []byte {
  2744      n.SizeOfStrings = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2745      src = src[4:]
  2746      for idx := 0; idx < 4; idx++ {
  2747          n.Pad[idx] = src[0]
  2748          src = src[1:]
  2749      }
  2750      src = n.PDriverVersionBuffer.UnmarshalUnsafe(src)
  2751      src = n.PVersionBuffer.UnmarshalUnsafe(src)
  2752      src = n.PTitleBuffer.UnmarshalUnsafe(src)
  2753      n.ChangelistNumber = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2754      src = src[4:]
  2755      n.OfficialChangelistNumber = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2756      src = src[4:]
  2757      return src
  2758  }
  2759  
  2760  // Packed implements marshal.Marshallable.Packed.
  2761  //go:nosplit
  2762  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) Packed() bool {
  2763      return n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed()
  2764  }
  2765  
  2766  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2767  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  2768      if n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  2769          size := n.SizeBytes()
  2770          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2771          return dst[size:]
  2772      }
  2773      // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  2774      return n.MarshalBytes(dst)
  2775  }
  2776  
  2777  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2778  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  2779      if n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  2780          size := n.SizeBytes()
  2781          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2782          return src[size:]
  2783      }
  2784      // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  2785      return n.UnmarshalBytes(src)
  2786  }
  2787  
  2788  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2789  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2790      if !n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  2791          // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2792          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2793          n.MarshalBytes(buf) // escapes: fallback.
  2794          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2795      }
  2796  
  2797      // Construct a slice backed by dst's underlying memory.
  2798      var buf []byte
  2799      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2800      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2801      hdr.Len = n.SizeBytes()
  2802      hdr.Cap = n.SizeBytes()
  2803  
  2804      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2805      // Since we bypassed the compiler's escape analysis, indicate that n
  2806      // must live until the use above.
  2807      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2808      return length, err
  2809  }
  2810  
  2811  // CopyOut implements marshal.Marshallable.CopyOut.
  2812  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2813      return n.CopyOutN(cc, addr, n.SizeBytes())
  2814  }
  2815  
  2816  // CopyInN implements marshal.Marshallable.CopyInN.
  2817  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2818      if !n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  2819          // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  2820          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2821          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2822          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  2823          // partially unmarshalled struct.
  2824          n.UnmarshalBytes(buf) // escapes: fallback.
  2825          return length, err
  2826      }
  2827  
  2828      // Construct a slice backed by dst's underlying memory.
  2829      var buf []byte
  2830      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2831      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2832      hdr.Len = n.SizeBytes()
  2833      hdr.Cap = n.SizeBytes()
  2834  
  2835      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2836      // Since we bypassed the compiler's escape analysis, indicate that n
  2837      // must live until the use above.
  2838      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2839      return length, err
  2840  }
  2841  
  2842  // CopyIn implements marshal.Marshallable.CopyIn.
  2843  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2844      return n.CopyInN(cc, addr, n.SizeBytes())
  2845  }
  2846  
  2847  // WriteTo implements io.WriterTo.WriteTo.
  2848  func (n *NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  2849      if !n.PDriverVersionBuffer.Packed() && n.PTitleBuffer.Packed() && n.PVersionBuffer.Packed() {
  2850          // Type NV0000_CTRL_SYSTEM_GET_BUILD_VERSION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2851          buf := make([]byte, n.SizeBytes())
  2852          n.MarshalBytes(buf)
  2853          length, err := writer.Write(buf)
  2854          return int64(length), err
  2855      }
  2856  
  2857      // Construct a slice backed by dst's underlying memory.
  2858      var buf []byte
  2859      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2860      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2861      hdr.Len = n.SizeBytes()
  2862      hdr.Cap = n.SizeBytes()
  2863  
  2864      length, err := writer.Write(buf)
  2865      // Since we bypassed the compiler's escape analysis, indicate that n
  2866      // must live until the use above.
  2867      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2868      return int64(length), err
  2869  }
  2870  
  2871  // SizeBytes implements marshal.Marshallable.SizeBytes.
  2872  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) SizeBytes() int {
  2873      return 4 +
  2874          1*4 +
  2875          (*P64)(nil).SizeBytes() +
  2876          (*P64)(nil).SizeBytes()
  2877  }
  2878  
  2879  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  2880  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) MarshalBytes(dst []byte) []byte {
  2881      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NumChannels))
  2882      dst = dst[4:]
  2883      for idx := 0; idx < 4; idx++ {
  2884          dst[0] = byte(n.Pad[idx])
  2885          dst = dst[1:]
  2886      }
  2887      dst = n.PChannelHandleList.MarshalUnsafe(dst)
  2888      dst = n.PChannelList.MarshalUnsafe(dst)
  2889      return dst
  2890  }
  2891  
  2892  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  2893  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) UnmarshalBytes(src []byte) []byte {
  2894      n.NumChannels = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  2895      src = src[4:]
  2896      for idx := 0; idx < 4; idx++ {
  2897          n.Pad[idx] = src[0]
  2898          src = src[1:]
  2899      }
  2900      src = n.PChannelHandleList.UnmarshalUnsafe(src)
  2901      src = n.PChannelList.UnmarshalUnsafe(src)
  2902      return src
  2903  }
  2904  
  2905  // Packed implements marshal.Marshallable.Packed.
  2906  //go:nosplit
  2907  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) Packed() bool {
  2908      return n.PChannelHandleList.Packed() && n.PChannelList.Packed()
  2909  }
  2910  
  2911  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  2912  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) MarshalUnsafe(dst []byte) []byte {
  2913      if n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  2914          size := n.SizeBytes()
  2915          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  2916          return dst[size:]
  2917      }
  2918      // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  2919      return n.MarshalBytes(dst)
  2920  }
  2921  
  2922  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  2923  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  2924      if n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  2925          size := n.SizeBytes()
  2926          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  2927          return src[size:]
  2928      }
  2929      // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  2930      return n.UnmarshalBytes(src)
  2931  }
  2932  
  2933  // CopyOutN implements marshal.Marshallable.CopyOutN.
  2934  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2935      if !n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  2936          // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2937          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2938          n.MarshalBytes(buf) // escapes: fallback.
  2939          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2940      }
  2941  
  2942      // Construct a slice backed by dst's underlying memory.
  2943      var buf []byte
  2944      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2945      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2946      hdr.Len = n.SizeBytes()
  2947      hdr.Cap = n.SizeBytes()
  2948  
  2949      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  2950      // Since we bypassed the compiler's escape analysis, indicate that n
  2951      // must live until the use above.
  2952      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2953      return length, err
  2954  }
  2955  
  2956  // CopyOut implements marshal.Marshallable.CopyOut.
  2957  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2958      return n.CopyOutN(cc, addr, n.SizeBytes())
  2959  }
  2960  
  2961  // CopyInN implements marshal.Marshallable.CopyInN.
  2962  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  2963      if !n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  2964          // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  2965          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  2966          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2967          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  2968          // partially unmarshalled struct.
  2969          n.UnmarshalBytes(buf) // escapes: fallback.
  2970          return length, err
  2971      }
  2972  
  2973      // Construct a slice backed by dst's underlying memory.
  2974      var buf []byte
  2975      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  2976      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  2977      hdr.Len = n.SizeBytes()
  2978      hdr.Cap = n.SizeBytes()
  2979  
  2980      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  2981      // Since we bypassed the compiler's escape analysis, indicate that n
  2982      // must live until the use above.
  2983      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  2984      return length, err
  2985  }
  2986  
  2987  // CopyIn implements marshal.Marshallable.CopyIn.
  2988  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  2989      return n.CopyInN(cc, addr, n.SizeBytes())
  2990  }
  2991  
  2992  // WriteTo implements io.WriterTo.WriteTo.
  2993  func (n *NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  2994      if !n.PChannelHandleList.Packed() && n.PChannelList.Packed() {
  2995          // Type NV0080_CTRL_FIFO_GET_CHANNELLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  2996          buf := make([]byte, n.SizeBytes())
  2997          n.MarshalBytes(buf)
  2998          length, err := writer.Write(buf)
  2999          return int64(length), err
  3000      }
  3001  
  3002      // Construct a slice backed by dst's underlying memory.
  3003      var buf []byte
  3004      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3005      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3006      hdr.Len = n.SizeBytes()
  3007      hdr.Cap = n.SizeBytes()
  3008  
  3009      length, err := writer.Write(buf)
  3010      // Since we bypassed the compiler's escape analysis, indicate that n
  3011      // must live until the use above.
  3012      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3013      return int64(length), err
  3014  }
  3015  
  3016  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3017  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) SizeBytes() int {
  3018      return 4 +
  3019          1*4 +
  3020          (*P64)(nil).SizeBytes()
  3021  }
  3022  
  3023  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3024  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) MarshalBytes(dst []byte) []byte {
  3025      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NumClasses))
  3026      dst = dst[4:]
  3027      for idx := 0; idx < 4; idx++ {
  3028          dst[0] = byte(n.Pad[idx])
  3029          dst = dst[1:]
  3030      }
  3031      dst = n.ClassList.MarshalUnsafe(dst)
  3032      return dst
  3033  }
  3034  
  3035  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3036  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) UnmarshalBytes(src []byte) []byte {
  3037      n.NumClasses = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3038      src = src[4:]
  3039      for idx := 0; idx < 4; idx++ {
  3040          n.Pad[idx] = src[0]
  3041          src = src[1:]
  3042      }
  3043      src = n.ClassList.UnmarshalUnsafe(src)
  3044      return src
  3045  }
  3046  
  3047  // Packed implements marshal.Marshallable.Packed.
  3048  //go:nosplit
  3049  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) Packed() bool {
  3050      return n.ClassList.Packed()
  3051  }
  3052  
  3053  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3054  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) MarshalUnsafe(dst []byte) []byte {
  3055      if n.ClassList.Packed() {
  3056          size := n.SizeBytes()
  3057          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3058          return dst[size:]
  3059      }
  3060      // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  3061      return n.MarshalBytes(dst)
  3062  }
  3063  
  3064  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3065  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  3066      if n.ClassList.Packed() {
  3067          size := n.SizeBytes()
  3068          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3069          return src[size:]
  3070      }
  3071      // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3072      return n.UnmarshalBytes(src)
  3073  }
  3074  
  3075  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3076  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3077      if !n.ClassList.Packed() {
  3078          // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3079          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3080          n.MarshalBytes(buf) // escapes: fallback.
  3081          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3082      }
  3083  
  3084      // Construct a slice backed by dst's underlying memory.
  3085      var buf []byte
  3086      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3087      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3088      hdr.Len = n.SizeBytes()
  3089      hdr.Cap = n.SizeBytes()
  3090  
  3091      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3092      // Since we bypassed the compiler's escape analysis, indicate that n
  3093      // must live until the use above.
  3094      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3095      return length, err
  3096  }
  3097  
  3098  // CopyOut implements marshal.Marshallable.CopyOut.
  3099  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3100      return n.CopyOutN(cc, addr, n.SizeBytes())
  3101  }
  3102  
  3103  // CopyInN implements marshal.Marshallable.CopyInN.
  3104  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3105      if !n.ClassList.Packed() {
  3106          // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3107          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3108          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3109          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3110          // partially unmarshalled struct.
  3111          n.UnmarshalBytes(buf) // escapes: fallback.
  3112          return length, err
  3113      }
  3114  
  3115      // Construct a slice backed by dst's underlying memory.
  3116      var buf []byte
  3117      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3118      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3119      hdr.Len = n.SizeBytes()
  3120      hdr.Cap = n.SizeBytes()
  3121  
  3122      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3123      // Since we bypassed the compiler's escape analysis, indicate that n
  3124      // must live until the use above.
  3125      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3126      return length, err
  3127  }
  3128  
  3129  // CopyIn implements marshal.Marshallable.CopyIn.
  3130  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3131      return n.CopyInN(cc, addr, n.SizeBytes())
  3132  }
  3133  
  3134  // WriteTo implements io.WriterTo.WriteTo.
  3135  func (n *NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  3136      if !n.ClassList.Packed() {
  3137          // Type NV0080_CTRL_GPU_GET_CLASSLIST_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3138          buf := make([]byte, n.SizeBytes())
  3139          n.MarshalBytes(buf)
  3140          length, err := writer.Write(buf)
  3141          return int64(length), err
  3142      }
  3143  
  3144      // Construct a slice backed by dst's underlying memory.
  3145      var buf []byte
  3146      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3147      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3148      hdr.Len = n.SizeBytes()
  3149      hdr.Cap = n.SizeBytes()
  3150  
  3151      length, err := writer.Write(buf)
  3152      // Since we bypassed the compiler's escape analysis, indicate that n
  3153      // must live until the use above.
  3154      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3155      return int64(length), err
  3156  }
  3157  
  3158  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3159  func (n *NV0080_CTRL_GR_ROUTE_INFO) SizeBytes() int {
  3160      return 12 +
  3161          1*4
  3162  }
  3163  
  3164  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3165  func (n *NV0080_CTRL_GR_ROUTE_INFO) MarshalBytes(dst []byte) []byte {
  3166      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  3167      dst = dst[4:]
  3168      for idx := 0; idx < 4; idx++ {
  3169          dst[0] = byte(n.Pad[idx])
  3170          dst = dst[1:]
  3171      }
  3172      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Route))
  3173      dst = dst[8:]
  3174      return dst
  3175  }
  3176  
  3177  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3178  func (n *NV0080_CTRL_GR_ROUTE_INFO) UnmarshalBytes(src []byte) []byte {
  3179      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3180      src = src[4:]
  3181      for idx := 0; idx < 4; idx++ {
  3182          n.Pad[idx] = src[0]
  3183          src = src[1:]
  3184      }
  3185      n.Route = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  3186      src = src[8:]
  3187      return src
  3188  }
  3189  
  3190  // Packed implements marshal.Marshallable.Packed.
  3191  //go:nosplit
  3192  func (n *NV0080_CTRL_GR_ROUTE_INFO) Packed() bool {
  3193      return true
  3194  }
  3195  
  3196  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3197  func (n *NV0080_CTRL_GR_ROUTE_INFO) MarshalUnsafe(dst []byte) []byte {
  3198      size := n.SizeBytes()
  3199      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3200      return dst[size:]
  3201  }
  3202  
  3203  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3204  func (n *NV0080_CTRL_GR_ROUTE_INFO) UnmarshalUnsafe(src []byte) []byte {
  3205      size := n.SizeBytes()
  3206      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3207      return src[size:]
  3208  }
  3209  
  3210  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3211  func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3212      // Construct a slice backed by dst's underlying memory.
  3213      var buf []byte
  3214      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3215      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3216      hdr.Len = n.SizeBytes()
  3217      hdr.Cap = n.SizeBytes()
  3218  
  3219      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3220      // Since we bypassed the compiler's escape analysis, indicate that n
  3221      // must live until the use above.
  3222      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3223      return length, err
  3224  }
  3225  
  3226  // CopyOut implements marshal.Marshallable.CopyOut.
  3227  func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3228      return n.CopyOutN(cc, addr, n.SizeBytes())
  3229  }
  3230  
  3231  // CopyInN implements marshal.Marshallable.CopyInN.
  3232  func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3233      // Construct a slice backed by dst's underlying memory.
  3234      var buf []byte
  3235      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3236      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3237      hdr.Len = n.SizeBytes()
  3238      hdr.Cap = n.SizeBytes()
  3239  
  3240      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3241      // Since we bypassed the compiler's escape analysis, indicate that n
  3242      // must live until the use above.
  3243      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3244      return length, err
  3245  }
  3246  
  3247  // CopyIn implements marshal.Marshallable.CopyIn.
  3248  func (n *NV0080_CTRL_GR_ROUTE_INFO) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3249      return n.CopyInN(cc, addr, n.SizeBytes())
  3250  }
  3251  
  3252  // WriteTo implements io.WriterTo.WriteTo.
  3253  func (n *NV0080_CTRL_GR_ROUTE_INFO) WriteTo(writer io.Writer) (int64, error) {
  3254      // Construct a slice backed by dst's underlying memory.
  3255      var buf []byte
  3256      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3257      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3258      hdr.Len = n.SizeBytes()
  3259      hdr.Cap = n.SizeBytes()
  3260  
  3261      length, err := writer.Write(buf)
  3262      // Since we bypassed the compiler's escape analysis, indicate that n
  3263      // must live until the use above.
  3264      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3265      return int64(length), err
  3266  }
  3267  
  3268  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3269  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) SizeBytes() int {
  3270      return 7 +
  3271          1*3 +
  3272          1*6 +
  3273          (*P64)(nil).SizeBytes() +
  3274          (*Handle)(nil).SizeBytes()*NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES +
  3275          (*Handle)(nil).SizeBytes()*NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES
  3276  }
  3277  
  3278  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3279  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) MarshalBytes(dst []byte) []byte {
  3280      dst[0] = byte(n.BDisable)
  3281      dst = dst[1:]
  3282      for idx := 0; idx < 3; idx++ {
  3283          dst[0] = byte(n.Pad1[idx])
  3284          dst = dst[1:]
  3285      }
  3286      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.NumChannels))
  3287      dst = dst[4:]
  3288      dst[0] = byte(n.BOnlyDisableScheduling)
  3289      dst = dst[1:]
  3290      dst[0] = byte(n.BRewindGpPut)
  3291      dst = dst[1:]
  3292      for idx := 0; idx < 6; idx++ {
  3293          dst[0] = byte(n.Pad2[idx])
  3294          dst = dst[1:]
  3295      }
  3296      dst = n.PRunlistPreemptEvent.MarshalUnsafe(dst)
  3297      for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ {
  3298          dst = n.HClientList[idx].MarshalUnsafe(dst)
  3299      }
  3300      for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ {
  3301          dst = n.HChannelList[idx].MarshalUnsafe(dst)
  3302      }
  3303      return dst
  3304  }
  3305  
  3306  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3307  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) UnmarshalBytes(src []byte) []byte {
  3308      n.BDisable = uint8(src[0])
  3309      src = src[1:]
  3310      for idx := 0; idx < 3; idx++ {
  3311          n.Pad1[idx] = src[0]
  3312          src = src[1:]
  3313      }
  3314      n.NumChannels = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3315      src = src[4:]
  3316      n.BOnlyDisableScheduling = uint8(src[0])
  3317      src = src[1:]
  3318      n.BRewindGpPut = uint8(src[0])
  3319      src = src[1:]
  3320      for idx := 0; idx < 6; idx++ {
  3321          n.Pad2[idx] = src[0]
  3322          src = src[1:]
  3323      }
  3324      src = n.PRunlistPreemptEvent.UnmarshalUnsafe(src)
  3325      for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ {
  3326          src = n.HClientList[idx].UnmarshalUnsafe(src)
  3327      }
  3328      for idx := 0; idx < NV2080_CTRL_FIFO_DISABLE_CHANNELS_MAX_ENTRIES; idx++ {
  3329          src = n.HChannelList[idx].UnmarshalUnsafe(src)
  3330      }
  3331      return src
  3332  }
  3333  
  3334  // Packed implements marshal.Marshallable.Packed.
  3335  //go:nosplit
  3336  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) Packed() bool {
  3337      return n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed()
  3338  }
  3339  
  3340  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3341  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) MarshalUnsafe(dst []byte) []byte {
  3342      if n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3343          size := n.SizeBytes()
  3344          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3345          return dst[size:]
  3346      }
  3347      // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  3348      return n.MarshalBytes(dst)
  3349  }
  3350  
  3351  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3352  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  3353      if n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3354          size := n.SizeBytes()
  3355          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3356          return src[size:]
  3357      }
  3358      // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3359      return n.UnmarshalBytes(src)
  3360  }
  3361  
  3362  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3363  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3364      if !n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3365          // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3366          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3367          n.MarshalBytes(buf) // escapes: fallback.
  3368          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3369      }
  3370  
  3371      // Construct a slice backed by dst's underlying memory.
  3372      var buf []byte
  3373      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3374      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3375      hdr.Len = n.SizeBytes()
  3376      hdr.Cap = n.SizeBytes()
  3377  
  3378      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3379      // Since we bypassed the compiler's escape analysis, indicate that n
  3380      // must live until the use above.
  3381      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3382      return length, err
  3383  }
  3384  
  3385  // CopyOut implements marshal.Marshallable.CopyOut.
  3386  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3387      return n.CopyOutN(cc, addr, n.SizeBytes())
  3388  }
  3389  
  3390  // CopyInN implements marshal.Marshallable.CopyInN.
  3391  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3392      if !n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3393          // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3394          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3395          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3396          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3397          // partially unmarshalled struct.
  3398          n.UnmarshalBytes(buf) // escapes: fallback.
  3399          return length, err
  3400      }
  3401  
  3402      // Construct a slice backed by dst's underlying memory.
  3403      var buf []byte
  3404      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3405      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3406      hdr.Len = n.SizeBytes()
  3407      hdr.Cap = n.SizeBytes()
  3408  
  3409      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3410      // Since we bypassed the compiler's escape analysis, indicate that n
  3411      // must live until the use above.
  3412      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3413      return length, err
  3414  }
  3415  
  3416  // CopyIn implements marshal.Marshallable.CopyIn.
  3417  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3418      return n.CopyInN(cc, addr, n.SizeBytes())
  3419  }
  3420  
  3421  // WriteTo implements io.WriterTo.WriteTo.
  3422  func (n *NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  3423      if !n.HChannelList[0].Packed() && n.HClientList[0].Packed() && n.PRunlistPreemptEvent.Packed() {
  3424          // Type NV2080_CTRL_FIFO_DISABLE_CHANNELS_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3425          buf := make([]byte, n.SizeBytes())
  3426          n.MarshalBytes(buf)
  3427          length, err := writer.Write(buf)
  3428          return int64(length), err
  3429      }
  3430  
  3431      // Construct a slice backed by dst's underlying memory.
  3432      var buf []byte
  3433      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3434      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3435      hdr.Len = n.SizeBytes()
  3436      hdr.Cap = n.SizeBytes()
  3437  
  3438      length, err := writer.Write(buf)
  3439      // Since we bypassed the compiler's escape analysis, indicate that n
  3440      // must live until the use above.
  3441      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3442      return int64(length), err
  3443  }
  3444  
  3445  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3446  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) SizeBytes() int {
  3447      return 4 +
  3448          1*4 +
  3449          (*P64)(nil).SizeBytes() +
  3450          (*NV0080_CTRL_GR_ROUTE_INFO)(nil).SizeBytes()
  3451  }
  3452  
  3453  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3454  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) MarshalBytes(dst []byte) []byte {
  3455      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.GRInfoListSize))
  3456      dst = dst[4:]
  3457      for idx := 0; idx < 4; idx++ {
  3458          dst[0] = byte(n.Pad[idx])
  3459          dst = dst[1:]
  3460      }
  3461      dst = n.GRInfoList.MarshalUnsafe(dst)
  3462      dst = n.GRRouteInfo.MarshalUnsafe(dst)
  3463      return dst
  3464  }
  3465  
  3466  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3467  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) UnmarshalBytes(src []byte) []byte {
  3468      n.GRInfoListSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3469      src = src[4:]
  3470      for idx := 0; idx < 4; idx++ {
  3471          n.Pad[idx] = src[0]
  3472          src = src[1:]
  3473      }
  3474      src = n.GRInfoList.UnmarshalUnsafe(src)
  3475      src = n.GRRouteInfo.UnmarshalUnsafe(src)
  3476      return src
  3477  }
  3478  
  3479  // Packed implements marshal.Marshallable.Packed.
  3480  //go:nosplit
  3481  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) Packed() bool {
  3482      return n.GRInfoList.Packed() && n.GRRouteInfo.Packed()
  3483  }
  3484  
  3485  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3486  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) MarshalUnsafe(dst []byte) []byte {
  3487      if n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3488          size := n.SizeBytes()
  3489          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3490          return dst[size:]
  3491      }
  3492      // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  3493      return n.MarshalBytes(dst)
  3494  }
  3495  
  3496  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3497  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  3498      if n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3499          size := n.SizeBytes()
  3500          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3501          return src[size:]
  3502      }
  3503      // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3504      return n.UnmarshalBytes(src)
  3505  }
  3506  
  3507  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3508  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3509      if !n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3510          // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3511          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3512          n.MarshalBytes(buf) // escapes: fallback.
  3513          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3514      }
  3515  
  3516      // Construct a slice backed by dst's underlying memory.
  3517      var buf []byte
  3518      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3519      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3520      hdr.Len = n.SizeBytes()
  3521      hdr.Cap = n.SizeBytes()
  3522  
  3523      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3524      // Since we bypassed the compiler's escape analysis, indicate that n
  3525      // must live until the use above.
  3526      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3527      return length, err
  3528  }
  3529  
  3530  // CopyOut implements marshal.Marshallable.CopyOut.
  3531  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3532      return n.CopyOutN(cc, addr, n.SizeBytes())
  3533  }
  3534  
  3535  // CopyInN implements marshal.Marshallable.CopyInN.
  3536  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3537      if !n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3538          // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3539          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  3540          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3541          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3542          // partially unmarshalled struct.
  3543          n.UnmarshalBytes(buf) // escapes: fallback.
  3544          return length, err
  3545      }
  3546  
  3547      // Construct a slice backed by dst's underlying memory.
  3548      var buf []byte
  3549      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3550      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3551      hdr.Len = n.SizeBytes()
  3552      hdr.Cap = n.SizeBytes()
  3553  
  3554      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3555      // Since we bypassed the compiler's escape analysis, indicate that n
  3556      // must live until the use above.
  3557      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3558      return length, err
  3559  }
  3560  
  3561  // CopyIn implements marshal.Marshallable.CopyIn.
  3562  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3563      return n.CopyInN(cc, addr, n.SizeBytes())
  3564  }
  3565  
  3566  // WriteTo implements io.WriterTo.WriteTo.
  3567  func (n *NV2080_CTRL_GR_GET_INFO_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  3568      if !n.GRInfoList.Packed() && n.GRRouteInfo.Packed() {
  3569          // Type NV2080_CTRL_GR_GET_INFO_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  3570          buf := make([]byte, n.SizeBytes())
  3571          n.MarshalBytes(buf)
  3572          length, err := writer.Write(buf)
  3573          return int64(length), err
  3574      }
  3575  
  3576      // Construct a slice backed by dst's underlying memory.
  3577      var buf []byte
  3578      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3579      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3580      hdr.Len = n.SizeBytes()
  3581      hdr.Cap = n.SizeBytes()
  3582  
  3583      length, err := writer.Write(buf)
  3584      // Since we bypassed the compiler's escape analysis, indicate that n
  3585      // must live until the use above.
  3586      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3587      return int64(length), err
  3588  }
  3589  
  3590  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3591  func (n *NVXXXX_CTRL_XXX_INFO) SizeBytes() int {
  3592      return 8
  3593  }
  3594  
  3595  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3596  func (n *NVXXXX_CTRL_XXX_INFO) MarshalBytes(dst []byte) []byte {
  3597      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Index))
  3598      dst = dst[4:]
  3599      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Data))
  3600      dst = dst[4:]
  3601      return dst
  3602  }
  3603  
  3604  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3605  func (n *NVXXXX_CTRL_XXX_INFO) UnmarshalBytes(src []byte) []byte {
  3606      n.Index = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3607      src = src[4:]
  3608      n.Data = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3609      src = src[4:]
  3610      return src
  3611  }
  3612  
  3613  // Packed implements marshal.Marshallable.Packed.
  3614  //go:nosplit
  3615  func (n *NVXXXX_CTRL_XXX_INFO) Packed() bool {
  3616      return true
  3617  }
  3618  
  3619  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3620  func (n *NVXXXX_CTRL_XXX_INFO) MarshalUnsafe(dst []byte) []byte {
  3621      size := n.SizeBytes()
  3622      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  3623      return dst[size:]
  3624  }
  3625  
  3626  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3627  func (n *NVXXXX_CTRL_XXX_INFO) UnmarshalUnsafe(src []byte) []byte {
  3628      size := n.SizeBytes()
  3629      gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  3630      return src[size:]
  3631  }
  3632  
  3633  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3634  func (n *NVXXXX_CTRL_XXX_INFO) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3635      // Construct a slice backed by dst's underlying memory.
  3636      var buf []byte
  3637      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3638      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3639      hdr.Len = n.SizeBytes()
  3640      hdr.Cap = n.SizeBytes()
  3641  
  3642      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3643      // Since we bypassed the compiler's escape analysis, indicate that n
  3644      // must live until the use above.
  3645      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3646      return length, err
  3647  }
  3648  
  3649  // CopyOut implements marshal.Marshallable.CopyOut.
  3650  func (n *NVXXXX_CTRL_XXX_INFO) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3651      return n.CopyOutN(cc, addr, n.SizeBytes())
  3652  }
  3653  
  3654  // CopyInN implements marshal.Marshallable.CopyInN.
  3655  func (n *NVXXXX_CTRL_XXX_INFO) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3656      // Construct a slice backed by dst's underlying memory.
  3657      var buf []byte
  3658      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3659      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3660      hdr.Len = n.SizeBytes()
  3661      hdr.Cap = n.SizeBytes()
  3662  
  3663      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3664      // Since we bypassed the compiler's escape analysis, indicate that n
  3665      // must live until the use above.
  3666      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3667      return length, err
  3668  }
  3669  
  3670  // CopyIn implements marshal.Marshallable.CopyIn.
  3671  func (n *NVXXXX_CTRL_XXX_INFO) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3672      return n.CopyInN(cc, addr, n.SizeBytes())
  3673  }
  3674  
  3675  // WriteTo implements io.WriterTo.WriteTo.
  3676  func (n *NVXXXX_CTRL_XXX_INFO) WriteTo(writer io.Writer) (int64, error) {
  3677      // Construct a slice backed by dst's underlying memory.
  3678      var buf []byte
  3679      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3680      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  3681      hdr.Len = n.SizeBytes()
  3682      hdr.Cap = n.SizeBytes()
  3683  
  3684      length, err := writer.Write(buf)
  3685      // Since we bypassed the compiler's escape analysis, indicate that n
  3686      // must live until the use above.
  3687      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  3688      return int64(length), err
  3689  }
  3690  
  3691  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3692  func (i *IoctlAllocOSEvent) SizeBytes() int {
  3693      return 8 +
  3694          (*Handle)(nil).SizeBytes() +
  3695          (*Handle)(nil).SizeBytes()
  3696  }
  3697  
  3698  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3699  func (i *IoctlAllocOSEvent) MarshalBytes(dst []byte) []byte {
  3700      dst = i.HClient.MarshalUnsafe(dst)
  3701      dst = i.HDevice.MarshalUnsafe(dst)
  3702      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD))
  3703      dst = dst[4:]
  3704      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Status))
  3705      dst = dst[4:]
  3706      return dst
  3707  }
  3708  
  3709  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3710  func (i *IoctlAllocOSEvent) UnmarshalBytes(src []byte) []byte {
  3711      src = i.HClient.UnmarshalUnsafe(src)
  3712      src = i.HDevice.UnmarshalUnsafe(src)
  3713      i.FD = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3714      src = src[4:]
  3715      i.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3716      src = src[4:]
  3717      return src
  3718  }
  3719  
  3720  // Packed implements marshal.Marshallable.Packed.
  3721  //go:nosplit
  3722  func (i *IoctlAllocOSEvent) Packed() bool {
  3723      return i.HClient.Packed() && i.HDevice.Packed()
  3724  }
  3725  
  3726  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3727  func (i *IoctlAllocOSEvent) MarshalUnsafe(dst []byte) []byte {
  3728      if i.HClient.Packed() && i.HDevice.Packed() {
  3729          size := i.SizeBytes()
  3730          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  3731          return dst[size:]
  3732      }
  3733      // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fallback to MarshalBytes.
  3734      return i.MarshalBytes(dst)
  3735  }
  3736  
  3737  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3738  func (i *IoctlAllocOSEvent) UnmarshalUnsafe(src []byte) []byte {
  3739      if i.HClient.Packed() && i.HDevice.Packed() {
  3740          size := i.SizeBytes()
  3741          gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  3742          return src[size:]
  3743      }
  3744      // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3745      return i.UnmarshalBytes(src)
  3746  }
  3747  
  3748  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3749  func (i *IoctlAllocOSEvent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3750      if !i.HClient.Packed() && i.HDevice.Packed() {
  3751          // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes.
  3752          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  3753          i.MarshalBytes(buf) // escapes: fallback.
  3754          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3755      }
  3756  
  3757      // Construct a slice backed by dst's underlying memory.
  3758      var buf []byte
  3759      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3760      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  3761      hdr.Len = i.SizeBytes()
  3762      hdr.Cap = i.SizeBytes()
  3763  
  3764      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3765      // Since we bypassed the compiler's escape analysis, indicate that i
  3766      // must live until the use above.
  3767      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  3768      return length, err
  3769  }
  3770  
  3771  // CopyOut implements marshal.Marshallable.CopyOut.
  3772  func (i *IoctlAllocOSEvent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3773      return i.CopyOutN(cc, addr, i.SizeBytes())
  3774  }
  3775  
  3776  // CopyInN implements marshal.Marshallable.CopyInN.
  3777  func (i *IoctlAllocOSEvent) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3778      if !i.HClient.Packed() && i.HDevice.Packed() {
  3779          // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3780          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  3781          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3782          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3783          // partially unmarshalled struct.
  3784          i.UnmarshalBytes(buf) // escapes: fallback.
  3785          return length, err
  3786      }
  3787  
  3788      // Construct a slice backed by dst's underlying memory.
  3789      var buf []byte
  3790      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3791      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  3792      hdr.Len = i.SizeBytes()
  3793      hdr.Cap = i.SizeBytes()
  3794  
  3795      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3796      // Since we bypassed the compiler's escape analysis, indicate that i
  3797      // must live until the use above.
  3798      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  3799      return length, err
  3800  }
  3801  
  3802  // CopyIn implements marshal.Marshallable.CopyIn.
  3803  func (i *IoctlAllocOSEvent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3804      return i.CopyInN(cc, addr, i.SizeBytes())
  3805  }
  3806  
  3807  // WriteTo implements io.WriterTo.WriteTo.
  3808  func (i *IoctlAllocOSEvent) WriteTo(writer io.Writer) (int64, error) {
  3809      if !i.HClient.Packed() && i.HDevice.Packed() {
  3810          // Type IoctlAllocOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes.
  3811          buf := make([]byte, i.SizeBytes())
  3812          i.MarshalBytes(buf)
  3813          length, err := writer.Write(buf)
  3814          return int64(length), err
  3815      }
  3816  
  3817      // Construct a slice backed by dst's underlying memory.
  3818      var buf []byte
  3819      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3820      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  3821      hdr.Len = i.SizeBytes()
  3822      hdr.Cap = i.SizeBytes()
  3823  
  3824      length, err := writer.Write(buf)
  3825      // Since we bypassed the compiler's escape analysis, indicate that i
  3826      // must live until the use above.
  3827      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  3828      return int64(length), err
  3829  }
  3830  
  3831  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3832  func (i *IoctlFreeOSEvent) SizeBytes() int {
  3833      return 8 +
  3834          (*Handle)(nil).SizeBytes() +
  3835          (*Handle)(nil).SizeBytes()
  3836  }
  3837  
  3838  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3839  func (i *IoctlFreeOSEvent) MarshalBytes(dst []byte) []byte {
  3840      dst = i.HClient.MarshalUnsafe(dst)
  3841      dst = i.HDevice.MarshalUnsafe(dst)
  3842      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD))
  3843      dst = dst[4:]
  3844      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Status))
  3845      dst = dst[4:]
  3846      return dst
  3847  }
  3848  
  3849  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3850  func (i *IoctlFreeOSEvent) UnmarshalBytes(src []byte) []byte {
  3851      src = i.HClient.UnmarshalUnsafe(src)
  3852      src = i.HDevice.UnmarshalUnsafe(src)
  3853      i.FD = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3854      src = src[4:]
  3855      i.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  3856      src = src[4:]
  3857      return src
  3858  }
  3859  
  3860  // Packed implements marshal.Marshallable.Packed.
  3861  //go:nosplit
  3862  func (i *IoctlFreeOSEvent) Packed() bool {
  3863      return i.HClient.Packed() && i.HDevice.Packed()
  3864  }
  3865  
  3866  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  3867  func (i *IoctlFreeOSEvent) MarshalUnsafe(dst []byte) []byte {
  3868      if i.HClient.Packed() && i.HDevice.Packed() {
  3869          size := i.SizeBytes()
  3870          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  3871          return dst[size:]
  3872      }
  3873      // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fallback to MarshalBytes.
  3874      return i.MarshalBytes(dst)
  3875  }
  3876  
  3877  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  3878  func (i *IoctlFreeOSEvent) UnmarshalUnsafe(src []byte) []byte {
  3879      if i.HClient.Packed() && i.HDevice.Packed() {
  3880          size := i.SizeBytes()
  3881          gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  3882          return src[size:]
  3883      }
  3884      // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  3885      return i.UnmarshalBytes(src)
  3886  }
  3887  
  3888  // CopyOutN implements marshal.Marshallable.CopyOutN.
  3889  func (i *IoctlFreeOSEvent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3890      if !i.HClient.Packed() && i.HDevice.Packed() {
  3891          // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes.
  3892          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  3893          i.MarshalBytes(buf) // escapes: fallback.
  3894          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3895      }
  3896  
  3897      // Construct a slice backed by dst's underlying memory.
  3898      var buf []byte
  3899      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3900      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  3901      hdr.Len = i.SizeBytes()
  3902      hdr.Cap = i.SizeBytes()
  3903  
  3904      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  3905      // Since we bypassed the compiler's escape analysis, indicate that i
  3906      // must live until the use above.
  3907      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  3908      return length, err
  3909  }
  3910  
  3911  // CopyOut implements marshal.Marshallable.CopyOut.
  3912  func (i *IoctlFreeOSEvent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3913      return i.CopyOutN(cc, addr, i.SizeBytes())
  3914  }
  3915  
  3916  // CopyInN implements marshal.Marshallable.CopyInN.
  3917  func (i *IoctlFreeOSEvent) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  3918      if !i.HClient.Packed() && i.HDevice.Packed() {
  3919          // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  3920          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  3921          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3922          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  3923          // partially unmarshalled struct.
  3924          i.UnmarshalBytes(buf) // escapes: fallback.
  3925          return length, err
  3926      }
  3927  
  3928      // Construct a slice backed by dst's underlying memory.
  3929      var buf []byte
  3930      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3931      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  3932      hdr.Len = i.SizeBytes()
  3933      hdr.Cap = i.SizeBytes()
  3934  
  3935      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  3936      // Since we bypassed the compiler's escape analysis, indicate that i
  3937      // must live until the use above.
  3938      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  3939      return length, err
  3940  }
  3941  
  3942  // CopyIn implements marshal.Marshallable.CopyIn.
  3943  func (i *IoctlFreeOSEvent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  3944      return i.CopyInN(cc, addr, i.SizeBytes())
  3945  }
  3946  
  3947  // WriteTo implements io.WriterTo.WriteTo.
  3948  func (i *IoctlFreeOSEvent) WriteTo(writer io.Writer) (int64, error) {
  3949      if !i.HClient.Packed() && i.HDevice.Packed() {
  3950          // Type IoctlFreeOSEvent doesn't have a packed layout in memory, fall back to MarshalBytes.
  3951          buf := make([]byte, i.SizeBytes())
  3952          i.MarshalBytes(buf)
  3953          length, err := writer.Write(buf)
  3954          return int64(length), err
  3955      }
  3956  
  3957      // Construct a slice backed by dst's underlying memory.
  3958      var buf []byte
  3959      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  3960      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  3961      hdr.Len = i.SizeBytes()
  3962      hdr.Cap = i.SizeBytes()
  3963  
  3964      length, err := writer.Write(buf)
  3965      // Since we bypassed the compiler's escape analysis, indicate that i
  3966      // must live until the use above.
  3967      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  3968      return int64(length), err
  3969  }
  3970  
  3971  // SizeBytes implements marshal.Marshallable.SizeBytes.
  3972  func (i *IoctlNVOS02ParametersWithFD) SizeBytes() int {
  3973      return 4 +
  3974          (*NVOS02Parameters)(nil).SizeBytes() +
  3975          1*4
  3976  }
  3977  
  3978  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  3979  func (i *IoctlNVOS02ParametersWithFD) MarshalBytes(dst []byte) []byte {
  3980      dst = i.Params.MarshalUnsafe(dst)
  3981      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD))
  3982      dst = dst[4:]
  3983      for idx := 0; idx < 4; idx++ {
  3984          dst[0] = byte(i.Pad0[idx])
  3985          dst = dst[1:]
  3986      }
  3987      return dst
  3988  }
  3989  
  3990  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  3991  func (i *IoctlNVOS02ParametersWithFD) UnmarshalBytes(src []byte) []byte {
  3992      src = i.Params.UnmarshalUnsafe(src)
  3993      i.FD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  3994      src = src[4:]
  3995      for idx := 0; idx < 4; idx++ {
  3996          i.Pad0[idx] = src[0]
  3997          src = src[1:]
  3998      }
  3999      return src
  4000  }
  4001  
  4002  // Packed implements marshal.Marshallable.Packed.
  4003  //go:nosplit
  4004  func (i *IoctlNVOS02ParametersWithFD) Packed() bool {
  4005      return i.Params.Packed()
  4006  }
  4007  
  4008  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4009  func (i *IoctlNVOS02ParametersWithFD) MarshalUnsafe(dst []byte) []byte {
  4010      if i.Params.Packed() {
  4011          size := i.SizeBytes()
  4012          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4013          return dst[size:]
  4014      }
  4015      // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fallback to MarshalBytes.
  4016      return i.MarshalBytes(dst)
  4017  }
  4018  
  4019  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4020  func (i *IoctlNVOS02ParametersWithFD) UnmarshalUnsafe(src []byte) []byte {
  4021      if i.Params.Packed() {
  4022          size := i.SizeBytes()
  4023          gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4024          return src[size:]
  4025      }
  4026      // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4027      return i.UnmarshalBytes(src)
  4028  }
  4029  
  4030  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4031  func (i *IoctlNVOS02ParametersWithFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4032      if !i.Params.Packed() {
  4033          // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes.
  4034          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4035          i.MarshalBytes(buf) // escapes: fallback.
  4036          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4037      }
  4038  
  4039      // Construct a slice backed by dst's underlying memory.
  4040      var buf []byte
  4041      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4042      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4043      hdr.Len = i.SizeBytes()
  4044      hdr.Cap = i.SizeBytes()
  4045  
  4046      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4047      // Since we bypassed the compiler's escape analysis, indicate that i
  4048      // must live until the use above.
  4049      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4050      return length, err
  4051  }
  4052  
  4053  // CopyOut implements marshal.Marshallable.CopyOut.
  4054  func (i *IoctlNVOS02ParametersWithFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4055      return i.CopyOutN(cc, addr, i.SizeBytes())
  4056  }
  4057  
  4058  // CopyInN implements marshal.Marshallable.CopyInN.
  4059  func (i *IoctlNVOS02ParametersWithFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4060      if !i.Params.Packed() {
  4061          // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4062          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4063          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4064          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4065          // partially unmarshalled struct.
  4066          i.UnmarshalBytes(buf) // escapes: fallback.
  4067          return length, err
  4068      }
  4069  
  4070      // Construct a slice backed by dst's underlying memory.
  4071      var buf []byte
  4072      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4073      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4074      hdr.Len = i.SizeBytes()
  4075      hdr.Cap = i.SizeBytes()
  4076  
  4077      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4078      // Since we bypassed the compiler's escape analysis, indicate that i
  4079      // must live until the use above.
  4080      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4081      return length, err
  4082  }
  4083  
  4084  // CopyIn implements marshal.Marshallable.CopyIn.
  4085  func (i *IoctlNVOS02ParametersWithFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4086      return i.CopyInN(cc, addr, i.SizeBytes())
  4087  }
  4088  
  4089  // WriteTo implements io.WriterTo.WriteTo.
  4090  func (i *IoctlNVOS02ParametersWithFD) WriteTo(writer io.Writer) (int64, error) {
  4091      if !i.Params.Packed() {
  4092          // Type IoctlNVOS02ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes.
  4093          buf := make([]byte, i.SizeBytes())
  4094          i.MarshalBytes(buf)
  4095          length, err := writer.Write(buf)
  4096          return int64(length), err
  4097      }
  4098  
  4099      // Construct a slice backed by dst's underlying memory.
  4100      var buf []byte
  4101      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4102      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4103      hdr.Len = i.SizeBytes()
  4104      hdr.Cap = i.SizeBytes()
  4105  
  4106      length, err := writer.Write(buf)
  4107      // Since we bypassed the compiler's escape analysis, indicate that i
  4108      // must live until the use above.
  4109      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4110      return int64(length), err
  4111  }
  4112  
  4113  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4114  func (i *IoctlNVOS33ParametersWithFD) SizeBytes() int {
  4115      return 4 +
  4116          (*NVOS33Parameters)(nil).SizeBytes() +
  4117          1*4
  4118  }
  4119  
  4120  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4121  func (i *IoctlNVOS33ParametersWithFD) MarshalBytes(dst []byte) []byte {
  4122      dst = i.Params.MarshalUnsafe(dst)
  4123      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD))
  4124      dst = dst[4:]
  4125      for idx := 0; idx < 4; idx++ {
  4126          dst[0] = byte(i.Pad0[idx])
  4127          dst = dst[1:]
  4128      }
  4129      return dst
  4130  }
  4131  
  4132  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4133  func (i *IoctlNVOS33ParametersWithFD) UnmarshalBytes(src []byte) []byte {
  4134      src = i.Params.UnmarshalUnsafe(src)
  4135      i.FD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  4136      src = src[4:]
  4137      for idx := 0; idx < 4; idx++ {
  4138          i.Pad0[idx] = src[0]
  4139          src = src[1:]
  4140      }
  4141      return src
  4142  }
  4143  
  4144  // Packed implements marshal.Marshallable.Packed.
  4145  //go:nosplit
  4146  func (i *IoctlNVOS33ParametersWithFD) Packed() bool {
  4147      return i.Params.Packed()
  4148  }
  4149  
  4150  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4151  func (i *IoctlNVOS33ParametersWithFD) MarshalUnsafe(dst []byte) []byte {
  4152      if i.Params.Packed() {
  4153          size := i.SizeBytes()
  4154          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4155          return dst[size:]
  4156      }
  4157      // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fallback to MarshalBytes.
  4158      return i.MarshalBytes(dst)
  4159  }
  4160  
  4161  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4162  func (i *IoctlNVOS33ParametersWithFD) UnmarshalUnsafe(src []byte) []byte {
  4163      if i.Params.Packed() {
  4164          size := i.SizeBytes()
  4165          gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4166          return src[size:]
  4167      }
  4168      // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4169      return i.UnmarshalBytes(src)
  4170  }
  4171  
  4172  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4173  func (i *IoctlNVOS33ParametersWithFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4174      if !i.Params.Packed() {
  4175          // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes.
  4176          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4177          i.MarshalBytes(buf) // escapes: fallback.
  4178          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4179      }
  4180  
  4181      // Construct a slice backed by dst's underlying memory.
  4182      var buf []byte
  4183      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4184      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4185      hdr.Len = i.SizeBytes()
  4186      hdr.Cap = i.SizeBytes()
  4187  
  4188      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4189      // Since we bypassed the compiler's escape analysis, indicate that i
  4190      // must live until the use above.
  4191      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4192      return length, err
  4193  }
  4194  
  4195  // CopyOut implements marshal.Marshallable.CopyOut.
  4196  func (i *IoctlNVOS33ParametersWithFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4197      return i.CopyOutN(cc, addr, i.SizeBytes())
  4198  }
  4199  
  4200  // CopyInN implements marshal.Marshallable.CopyInN.
  4201  func (i *IoctlNVOS33ParametersWithFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4202      if !i.Params.Packed() {
  4203          // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4204          buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay.
  4205          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4206          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4207          // partially unmarshalled struct.
  4208          i.UnmarshalBytes(buf) // escapes: fallback.
  4209          return length, err
  4210      }
  4211  
  4212      // Construct a slice backed by dst's underlying memory.
  4213      var buf []byte
  4214      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4215      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4216      hdr.Len = i.SizeBytes()
  4217      hdr.Cap = i.SizeBytes()
  4218  
  4219      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4220      // Since we bypassed the compiler's escape analysis, indicate that i
  4221      // must live until the use above.
  4222      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4223      return length, err
  4224  }
  4225  
  4226  // CopyIn implements marshal.Marshallable.CopyIn.
  4227  func (i *IoctlNVOS33ParametersWithFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4228      return i.CopyInN(cc, addr, i.SizeBytes())
  4229  }
  4230  
  4231  // WriteTo implements io.WriterTo.WriteTo.
  4232  func (i *IoctlNVOS33ParametersWithFD) WriteTo(writer io.Writer) (int64, error) {
  4233      if !i.Params.Packed() {
  4234          // Type IoctlNVOS33ParametersWithFD doesn't have a packed layout in memory, fall back to MarshalBytes.
  4235          buf := make([]byte, i.SizeBytes())
  4236          i.MarshalBytes(buf)
  4237          length, err := writer.Write(buf)
  4238          return int64(length), err
  4239      }
  4240  
  4241      // Construct a slice backed by dst's underlying memory.
  4242      var buf []byte
  4243      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4244      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4245      hdr.Len = i.SizeBytes()
  4246      hdr.Cap = i.SizeBytes()
  4247  
  4248      length, err := writer.Write(buf)
  4249      // Since we bypassed the compiler's escape analysis, indicate that i
  4250      // must live until the use above.
  4251      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4252      return int64(length), err
  4253  }
  4254  
  4255  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4256  func (i *IoctlRegisterFD) SizeBytes() int {
  4257      return 4
  4258  }
  4259  
  4260  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4261  func (i *IoctlRegisterFD) MarshalBytes(dst []byte) []byte {
  4262      hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CtlFD))
  4263      dst = dst[4:]
  4264      return dst
  4265  }
  4266  
  4267  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4268  func (i *IoctlRegisterFD) UnmarshalBytes(src []byte) []byte {
  4269      i.CtlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  4270      src = src[4:]
  4271      return src
  4272  }
  4273  
  4274  // Packed implements marshal.Marshallable.Packed.
  4275  //go:nosplit
  4276  func (i *IoctlRegisterFD) Packed() bool {
  4277      return true
  4278  }
  4279  
  4280  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4281  func (i *IoctlRegisterFD) MarshalUnsafe(dst []byte) []byte {
  4282      size := i.SizeBytes()
  4283      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4284      return dst[size:]
  4285  }
  4286  
  4287  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4288  func (i *IoctlRegisterFD) UnmarshalUnsafe(src []byte) []byte {
  4289      size := i.SizeBytes()
  4290      gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4291      return src[size:]
  4292  }
  4293  
  4294  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4295  func (i *IoctlRegisterFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4296      // Construct a slice backed by dst's underlying memory.
  4297      var buf []byte
  4298      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4299      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4300      hdr.Len = i.SizeBytes()
  4301      hdr.Cap = i.SizeBytes()
  4302  
  4303      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4304      // Since we bypassed the compiler's escape analysis, indicate that i
  4305      // must live until the use above.
  4306      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4307      return length, err
  4308  }
  4309  
  4310  // CopyOut implements marshal.Marshallable.CopyOut.
  4311  func (i *IoctlRegisterFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4312      return i.CopyOutN(cc, addr, i.SizeBytes())
  4313  }
  4314  
  4315  // CopyInN implements marshal.Marshallable.CopyInN.
  4316  func (i *IoctlRegisterFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4317      // Construct a slice backed by dst's underlying memory.
  4318      var buf []byte
  4319      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4320      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4321      hdr.Len = i.SizeBytes()
  4322      hdr.Cap = i.SizeBytes()
  4323  
  4324      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4325      // Since we bypassed the compiler's escape analysis, indicate that i
  4326      // must live until the use above.
  4327      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4328      return length, err
  4329  }
  4330  
  4331  // CopyIn implements marshal.Marshallable.CopyIn.
  4332  func (i *IoctlRegisterFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4333      return i.CopyInN(cc, addr, i.SizeBytes())
  4334  }
  4335  
  4336  // WriteTo implements io.WriterTo.WriteTo.
  4337  func (i *IoctlRegisterFD) WriteTo(writer io.Writer) (int64, error) {
  4338      // Construct a slice backed by dst's underlying memory.
  4339      var buf []byte
  4340      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4341      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4342      hdr.Len = i.SizeBytes()
  4343      hdr.Cap = i.SizeBytes()
  4344  
  4345      length, err := writer.Write(buf)
  4346      // Since we bypassed the compiler's escape analysis, indicate that i
  4347      // must live until the use above.
  4348      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4349      return int64(length), err
  4350  }
  4351  
  4352  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4353  func (i *IoctlSysParams) SizeBytes() int {
  4354      return 8
  4355  }
  4356  
  4357  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4358  func (i *IoctlSysParams) MarshalBytes(dst []byte) []byte {
  4359      hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.MemblockSize))
  4360      dst = dst[8:]
  4361      return dst
  4362  }
  4363  
  4364  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4365  func (i *IoctlSysParams) UnmarshalBytes(src []byte) []byte {
  4366      i.MemblockSize = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  4367      src = src[8:]
  4368      return src
  4369  }
  4370  
  4371  // Packed implements marshal.Marshallable.Packed.
  4372  //go:nosplit
  4373  func (i *IoctlSysParams) Packed() bool {
  4374      return true
  4375  }
  4376  
  4377  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4378  func (i *IoctlSysParams) MarshalUnsafe(dst []byte) []byte {
  4379      size := i.SizeBytes()
  4380      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size))
  4381      return dst[size:]
  4382  }
  4383  
  4384  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4385  func (i *IoctlSysParams) UnmarshalUnsafe(src []byte) []byte {
  4386      size := i.SizeBytes()
  4387      gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size))
  4388      return src[size:]
  4389  }
  4390  
  4391  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4392  func (i *IoctlSysParams) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4393      // Construct a slice backed by dst's underlying memory.
  4394      var buf []byte
  4395      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4396      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4397      hdr.Len = i.SizeBytes()
  4398      hdr.Cap = i.SizeBytes()
  4399  
  4400      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4401      // Since we bypassed the compiler's escape analysis, indicate that i
  4402      // must live until the use above.
  4403      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4404      return length, err
  4405  }
  4406  
  4407  // CopyOut implements marshal.Marshallable.CopyOut.
  4408  func (i *IoctlSysParams) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4409      return i.CopyOutN(cc, addr, i.SizeBytes())
  4410  }
  4411  
  4412  // CopyInN implements marshal.Marshallable.CopyInN.
  4413  func (i *IoctlSysParams) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4414      // Construct a slice backed by dst's underlying memory.
  4415      var buf []byte
  4416      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4417      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4418      hdr.Len = i.SizeBytes()
  4419      hdr.Cap = i.SizeBytes()
  4420  
  4421      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4422      // Since we bypassed the compiler's escape analysis, indicate that i
  4423      // must live until the use above.
  4424      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4425      return length, err
  4426  }
  4427  
  4428  // CopyIn implements marshal.Marshallable.CopyIn.
  4429  func (i *IoctlSysParams) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4430      return i.CopyInN(cc, addr, i.SizeBytes())
  4431  }
  4432  
  4433  // WriteTo implements io.WriterTo.WriteTo.
  4434  func (i *IoctlSysParams) WriteTo(writer io.Writer) (int64, error) {
  4435      // Construct a slice backed by dst's underlying memory.
  4436      var buf []byte
  4437      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4438      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i)))
  4439      hdr.Len = i.SizeBytes()
  4440      hdr.Cap = i.SizeBytes()
  4441  
  4442      length, err := writer.Write(buf)
  4443      // Since we bypassed the compiler's escape analysis, indicate that i
  4444      // must live until the use above.
  4445      runtime.KeepAlive(i) // escapes: replaced by intrinsic.
  4446      return int64(length), err
  4447  }
  4448  
  4449  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4450  func (n *NVOS00Parameters) SizeBytes() int {
  4451      return 4 +
  4452          (*Handle)(nil).SizeBytes() +
  4453          (*Handle)(nil).SizeBytes() +
  4454          (*Handle)(nil).SizeBytes()
  4455  }
  4456  
  4457  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4458  func (n *NVOS00Parameters) MarshalBytes(dst []byte) []byte {
  4459      dst = n.HRoot.MarshalUnsafe(dst)
  4460      dst = n.HObjectParent.MarshalUnsafe(dst)
  4461      dst = n.HObjectOld.MarshalUnsafe(dst)
  4462      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  4463      dst = dst[4:]
  4464      return dst
  4465  }
  4466  
  4467  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4468  func (n *NVOS00Parameters) UnmarshalBytes(src []byte) []byte {
  4469      src = n.HRoot.UnmarshalUnsafe(src)
  4470      src = n.HObjectParent.UnmarshalUnsafe(src)
  4471      src = n.HObjectOld.UnmarshalUnsafe(src)
  4472      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4473      src = src[4:]
  4474      return src
  4475  }
  4476  
  4477  // Packed implements marshal.Marshallable.Packed.
  4478  //go:nosplit
  4479  func (n *NVOS00Parameters) Packed() bool {
  4480      return n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed()
  4481  }
  4482  
  4483  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4484  func (n *NVOS00Parameters) MarshalUnsafe(dst []byte) []byte {
  4485      if n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  4486          size := n.SizeBytes()
  4487          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  4488          return dst[size:]
  4489      }
  4490      // Type NVOS00Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  4491      return n.MarshalBytes(dst)
  4492  }
  4493  
  4494  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4495  func (n *NVOS00Parameters) UnmarshalUnsafe(src []byte) []byte {
  4496      if n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  4497          size := n.SizeBytes()
  4498          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  4499          return src[size:]
  4500      }
  4501      // Type NVOS00Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4502      return n.UnmarshalBytes(src)
  4503  }
  4504  
  4505  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4506  func (n *NVOS00Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4507      if !n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  4508          // Type NVOS00Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  4509          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  4510          n.MarshalBytes(buf) // escapes: fallback.
  4511          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4512      }
  4513  
  4514      // Construct a slice backed by dst's underlying memory.
  4515      var buf []byte
  4516      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4517      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4518      hdr.Len = n.SizeBytes()
  4519      hdr.Cap = n.SizeBytes()
  4520  
  4521      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4522      // Since we bypassed the compiler's escape analysis, indicate that n
  4523      // must live until the use above.
  4524      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4525      return length, err
  4526  }
  4527  
  4528  // CopyOut implements marshal.Marshallable.CopyOut.
  4529  func (n *NVOS00Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4530      return n.CopyOutN(cc, addr, n.SizeBytes())
  4531  }
  4532  
  4533  // CopyInN implements marshal.Marshallable.CopyInN.
  4534  func (n *NVOS00Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4535      if !n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  4536          // Type NVOS00Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4537          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  4538          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4539          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4540          // partially unmarshalled struct.
  4541          n.UnmarshalBytes(buf) // escapes: fallback.
  4542          return length, err
  4543      }
  4544  
  4545      // Construct a slice backed by dst's underlying memory.
  4546      var buf []byte
  4547      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4548      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4549      hdr.Len = n.SizeBytes()
  4550      hdr.Cap = n.SizeBytes()
  4551  
  4552      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4553      // Since we bypassed the compiler's escape analysis, indicate that n
  4554      // must live until the use above.
  4555      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4556      return length, err
  4557  }
  4558  
  4559  // CopyIn implements marshal.Marshallable.CopyIn.
  4560  func (n *NVOS00Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4561      return n.CopyInN(cc, addr, n.SizeBytes())
  4562  }
  4563  
  4564  // WriteTo implements io.WriterTo.WriteTo.
  4565  func (n *NVOS00Parameters) WriteTo(writer io.Writer) (int64, error) {
  4566      if !n.HObjectOld.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() {
  4567          // Type NVOS00Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  4568          buf := make([]byte, n.SizeBytes())
  4569          n.MarshalBytes(buf)
  4570          length, err := writer.Write(buf)
  4571          return int64(length), err
  4572      }
  4573  
  4574      // Construct a slice backed by dst's underlying memory.
  4575      var buf []byte
  4576      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4577      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4578      hdr.Len = n.SizeBytes()
  4579      hdr.Cap = n.SizeBytes()
  4580  
  4581      length, err := writer.Write(buf)
  4582      // Since we bypassed the compiler's escape analysis, indicate that n
  4583      // must live until the use above.
  4584      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4585      return int64(length), err
  4586  }
  4587  
  4588  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4589  func (n *NVOS02Parameters) SizeBytes() int {
  4590      return 20 +
  4591          (*Handle)(nil).SizeBytes() +
  4592          (*Handle)(nil).SizeBytes() +
  4593          (*Handle)(nil).SizeBytes() +
  4594          1*4 +
  4595          (*P64)(nil).SizeBytes() +
  4596          1*4
  4597  }
  4598  
  4599  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4600  func (n *NVOS02Parameters) MarshalBytes(dst []byte) []byte {
  4601      dst = n.HRoot.MarshalUnsafe(dst)
  4602      dst = n.HObjectParent.MarshalUnsafe(dst)
  4603      dst = n.HObjectNew.MarshalUnsafe(dst)
  4604      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HClass))
  4605      dst = dst[4:]
  4606      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  4607      dst = dst[4:]
  4608      for idx := 0; idx < 4; idx++ {
  4609          dst[0] = byte(n.Pad0[idx])
  4610          dst = dst[1:]
  4611      }
  4612      dst = n.PMemory.MarshalUnsafe(dst)
  4613      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Limit))
  4614      dst = dst[8:]
  4615      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  4616      dst = dst[4:]
  4617      for idx := 0; idx < 4; idx++ {
  4618          dst[0] = byte(n.Pad1[idx])
  4619          dst = dst[1:]
  4620      }
  4621      return dst
  4622  }
  4623  
  4624  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4625  func (n *NVOS02Parameters) UnmarshalBytes(src []byte) []byte {
  4626      src = n.HRoot.UnmarshalUnsafe(src)
  4627      src = n.HObjectParent.UnmarshalUnsafe(src)
  4628      src = n.HObjectNew.UnmarshalUnsafe(src)
  4629      n.HClass = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4630      src = src[4:]
  4631      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4632      src = src[4:]
  4633      for idx := 0; idx < 4; idx++ {
  4634          n.Pad0[idx] = src[0]
  4635          src = src[1:]
  4636      }
  4637      src = n.PMemory.UnmarshalUnsafe(src)
  4638      n.Limit = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  4639      src = src[8:]
  4640      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4641      src = src[4:]
  4642      for idx := 0; idx < 4; idx++ {
  4643          n.Pad1[idx] = src[0]
  4644          src = src[1:]
  4645      }
  4646      return src
  4647  }
  4648  
  4649  // Packed implements marshal.Marshallable.Packed.
  4650  //go:nosplit
  4651  func (n *NVOS02Parameters) Packed() bool {
  4652      return n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed()
  4653  }
  4654  
  4655  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4656  func (n *NVOS02Parameters) MarshalUnsafe(dst []byte) []byte {
  4657      if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  4658          size := n.SizeBytes()
  4659          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  4660          return dst[size:]
  4661      }
  4662      // Type NVOS02Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  4663      return n.MarshalBytes(dst)
  4664  }
  4665  
  4666  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4667  func (n *NVOS02Parameters) UnmarshalUnsafe(src []byte) []byte {
  4668      if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  4669          size := n.SizeBytes()
  4670          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  4671          return src[size:]
  4672      }
  4673      // Type NVOS02Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4674      return n.UnmarshalBytes(src)
  4675  }
  4676  
  4677  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4678  func (n *NVOS02Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4679      if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  4680          // Type NVOS02Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  4681          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  4682          n.MarshalBytes(buf) // escapes: fallback.
  4683          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4684      }
  4685  
  4686      // Construct a slice backed by dst's underlying memory.
  4687      var buf []byte
  4688      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4689      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4690      hdr.Len = n.SizeBytes()
  4691      hdr.Cap = n.SizeBytes()
  4692  
  4693      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4694      // Since we bypassed the compiler's escape analysis, indicate that n
  4695      // must live until the use above.
  4696      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4697      return length, err
  4698  }
  4699  
  4700  // CopyOut implements marshal.Marshallable.CopyOut.
  4701  func (n *NVOS02Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4702      return n.CopyOutN(cc, addr, n.SizeBytes())
  4703  }
  4704  
  4705  // CopyInN implements marshal.Marshallable.CopyInN.
  4706  func (n *NVOS02Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4707      if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  4708          // Type NVOS02Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4709          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  4710          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4711          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4712          // partially unmarshalled struct.
  4713          n.UnmarshalBytes(buf) // escapes: fallback.
  4714          return length, err
  4715      }
  4716  
  4717      // Construct a slice backed by dst's underlying memory.
  4718      var buf []byte
  4719      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4720      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4721      hdr.Len = n.SizeBytes()
  4722      hdr.Cap = n.SizeBytes()
  4723  
  4724      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4725      // Since we bypassed the compiler's escape analysis, indicate that n
  4726      // must live until the use above.
  4727      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4728      return length, err
  4729  }
  4730  
  4731  // CopyIn implements marshal.Marshallable.CopyIn.
  4732  func (n *NVOS02Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4733      return n.CopyInN(cc, addr, n.SizeBytes())
  4734  }
  4735  
  4736  // WriteTo implements io.WriterTo.WriteTo.
  4737  func (n *NVOS02Parameters) WriteTo(writer io.Writer) (int64, error) {
  4738      if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PMemory.Packed() {
  4739          // Type NVOS02Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  4740          buf := make([]byte, n.SizeBytes())
  4741          n.MarshalBytes(buf)
  4742          length, err := writer.Write(buf)
  4743          return int64(length), err
  4744      }
  4745  
  4746      // Construct a slice backed by dst's underlying memory.
  4747      var buf []byte
  4748      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4749      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4750      hdr.Len = n.SizeBytes()
  4751      hdr.Cap = n.SizeBytes()
  4752  
  4753      length, err := writer.Write(buf)
  4754      // Since we bypassed the compiler's escape analysis, indicate that n
  4755      // must live until the use above.
  4756      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4757      return int64(length), err
  4758  }
  4759  
  4760  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4761  func (n *NVOS21Parameters) SizeBytes() int {
  4762      return 12 +
  4763          (*Handle)(nil).SizeBytes() +
  4764          (*Handle)(nil).SizeBytes() +
  4765          (*Handle)(nil).SizeBytes() +
  4766          (*P64)(nil).SizeBytes()
  4767  }
  4768  
  4769  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4770  func (n *NVOS21Parameters) MarshalBytes(dst []byte) []byte {
  4771      dst = n.HRoot.MarshalUnsafe(dst)
  4772      dst = n.HObjectParent.MarshalUnsafe(dst)
  4773      dst = n.HObjectNew.MarshalUnsafe(dst)
  4774      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HClass))
  4775      dst = dst[4:]
  4776      dst = n.PAllocParms.MarshalUnsafe(dst)
  4777      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ParamsSize))
  4778      dst = dst[4:]
  4779      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  4780      dst = dst[4:]
  4781      return dst
  4782  }
  4783  
  4784  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4785  func (n *NVOS21Parameters) UnmarshalBytes(src []byte) []byte {
  4786      src = n.HRoot.UnmarshalUnsafe(src)
  4787      src = n.HObjectParent.UnmarshalUnsafe(src)
  4788      src = n.HObjectNew.UnmarshalUnsafe(src)
  4789      n.HClass = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4790      src = src[4:]
  4791      src = n.PAllocParms.UnmarshalUnsafe(src)
  4792      n.ParamsSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4793      src = src[4:]
  4794      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4795      src = src[4:]
  4796      return src
  4797  }
  4798  
  4799  // Packed implements marshal.Marshallable.Packed.
  4800  //go:nosplit
  4801  func (n *NVOS21Parameters) Packed() bool {
  4802      return n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed()
  4803  }
  4804  
  4805  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4806  func (n *NVOS21Parameters) MarshalUnsafe(dst []byte) []byte {
  4807      if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  4808          size := n.SizeBytes()
  4809          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  4810          return dst[size:]
  4811      }
  4812      // Type NVOS21Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  4813      return n.MarshalBytes(dst)
  4814  }
  4815  
  4816  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4817  func (n *NVOS21Parameters) UnmarshalUnsafe(src []byte) []byte {
  4818      if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  4819          size := n.SizeBytes()
  4820          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  4821          return src[size:]
  4822      }
  4823      // Type NVOS21Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4824      return n.UnmarshalBytes(src)
  4825  }
  4826  
  4827  // CopyOutN implements marshal.Marshallable.CopyOutN.
  4828  func (n *NVOS21Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4829      if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  4830          // Type NVOS21Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  4831          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  4832          n.MarshalBytes(buf) // escapes: fallback.
  4833          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4834      }
  4835  
  4836      // Construct a slice backed by dst's underlying memory.
  4837      var buf []byte
  4838      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4839      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4840      hdr.Len = n.SizeBytes()
  4841      hdr.Cap = n.SizeBytes()
  4842  
  4843      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  4844      // Since we bypassed the compiler's escape analysis, indicate that n
  4845      // must live until the use above.
  4846      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4847      return length, err
  4848  }
  4849  
  4850  // CopyOut implements marshal.Marshallable.CopyOut.
  4851  func (n *NVOS21Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4852      return n.CopyOutN(cc, addr, n.SizeBytes())
  4853  }
  4854  
  4855  // CopyInN implements marshal.Marshallable.CopyInN.
  4856  func (n *NVOS21Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  4857      if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  4858          // Type NVOS21Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  4859          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  4860          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4861          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  4862          // partially unmarshalled struct.
  4863          n.UnmarshalBytes(buf) // escapes: fallback.
  4864          return length, err
  4865      }
  4866  
  4867      // Construct a slice backed by dst's underlying memory.
  4868      var buf []byte
  4869      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4870      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4871      hdr.Len = n.SizeBytes()
  4872      hdr.Cap = n.SizeBytes()
  4873  
  4874      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  4875      // Since we bypassed the compiler's escape analysis, indicate that n
  4876      // must live until the use above.
  4877      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4878      return length, err
  4879  }
  4880  
  4881  // CopyIn implements marshal.Marshallable.CopyIn.
  4882  func (n *NVOS21Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  4883      return n.CopyInN(cc, addr, n.SizeBytes())
  4884  }
  4885  
  4886  // WriteTo implements io.WriterTo.WriteTo.
  4887  func (n *NVOS21Parameters) WriteTo(writer io.Writer) (int64, error) {
  4888      if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() {
  4889          // Type NVOS21Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  4890          buf := make([]byte, n.SizeBytes())
  4891          n.MarshalBytes(buf)
  4892          length, err := writer.Write(buf)
  4893          return int64(length), err
  4894      }
  4895  
  4896      // Construct a slice backed by dst's underlying memory.
  4897      var buf []byte
  4898      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  4899      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  4900      hdr.Len = n.SizeBytes()
  4901      hdr.Cap = n.SizeBytes()
  4902  
  4903      length, err := writer.Write(buf)
  4904      // Since we bypassed the compiler's escape analysis, indicate that n
  4905      // must live until the use above.
  4906      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  4907      return int64(length), err
  4908  }
  4909  
  4910  // SizeBytes implements marshal.Marshallable.SizeBytes.
  4911  func (n *NVOS32Parameters) SizeBytes() int {
  4912      return 26 +
  4913          (*Handle)(nil).SizeBytes() +
  4914          (*Handle)(nil).SizeBytes() +
  4915          (*Handle)(nil).SizeBytes() +
  4916          1*2 +
  4917          1*144
  4918  }
  4919  
  4920  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  4921  func (n *NVOS32Parameters) MarshalBytes(dst []byte) []byte {
  4922      dst = n.HRoot.MarshalUnsafe(dst)
  4923      dst = n.HObjectParent.MarshalUnsafe(dst)
  4924      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Function))
  4925      dst = dst[4:]
  4926      dst = n.HVASpace.MarshalUnsafe(dst)
  4927      hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.IVCHeapNumber))
  4928      dst = dst[2:]
  4929      for idx := 0; idx < 2; idx++ {
  4930          dst[0] = byte(n.Pad[idx])
  4931          dst = dst[1:]
  4932      }
  4933      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  4934      dst = dst[4:]
  4935      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Total))
  4936      dst = dst[8:]
  4937      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Free))
  4938      dst = dst[8:]
  4939      for idx := 0; idx < 144; idx++ {
  4940          dst[0] = byte(n.Data[idx])
  4941          dst = dst[1:]
  4942      }
  4943      return dst
  4944  }
  4945  
  4946  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  4947  func (n *NVOS32Parameters) UnmarshalBytes(src []byte) []byte {
  4948      src = n.HRoot.UnmarshalUnsafe(src)
  4949      src = n.HObjectParent.UnmarshalUnsafe(src)
  4950      n.Function = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4951      src = src[4:]
  4952      src = n.HVASpace.UnmarshalUnsafe(src)
  4953      n.IVCHeapNumber = int16(hostarch.ByteOrder.Uint16(src[:2]))
  4954      src = src[2:]
  4955      for idx := 0; idx < 2; idx++ {
  4956          n.Pad[idx] = src[0]
  4957          src = src[1:]
  4958      }
  4959      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  4960      src = src[4:]
  4961      n.Total = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  4962      src = src[8:]
  4963      n.Free = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  4964      src = src[8:]
  4965      for idx := 0; idx < 144; idx++ {
  4966          n.Data[idx] = src[0]
  4967          src = src[1:]
  4968      }
  4969      return src
  4970  }
  4971  
  4972  // Packed implements marshal.Marshallable.Packed.
  4973  //go:nosplit
  4974  func (n *NVOS32Parameters) Packed() bool {
  4975      return n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed()
  4976  }
  4977  
  4978  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  4979  func (n *NVOS32Parameters) MarshalUnsafe(dst []byte) []byte {
  4980      if n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  4981          size := n.SizeBytes()
  4982          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  4983          return dst[size:]
  4984      }
  4985      // Type NVOS32Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  4986      return n.MarshalBytes(dst)
  4987  }
  4988  
  4989  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  4990  func (n *NVOS32Parameters) UnmarshalUnsafe(src []byte) []byte {
  4991      if n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  4992          size := n.SizeBytes()
  4993          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  4994          return src[size:]
  4995      }
  4996      // Type NVOS32Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  4997      return n.UnmarshalBytes(src)
  4998  }
  4999  
  5000  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5001  func (n *NVOS32Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5002      if !n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  5003          // Type NVOS32Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5004          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5005          n.MarshalBytes(buf) // escapes: fallback.
  5006          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5007      }
  5008  
  5009      // Construct a slice backed by dst's underlying memory.
  5010      var buf []byte
  5011      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5012      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5013      hdr.Len = n.SizeBytes()
  5014      hdr.Cap = n.SizeBytes()
  5015  
  5016      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5017      // Since we bypassed the compiler's escape analysis, indicate that n
  5018      // must live until the use above.
  5019      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5020      return length, err
  5021  }
  5022  
  5023  // CopyOut implements marshal.Marshallable.CopyOut.
  5024  func (n *NVOS32Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5025      return n.CopyOutN(cc, addr, n.SizeBytes())
  5026  }
  5027  
  5028  // CopyInN implements marshal.Marshallable.CopyInN.
  5029  func (n *NVOS32Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5030      if !n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  5031          // Type NVOS32Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5032          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5033          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5034          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5035          // partially unmarshalled struct.
  5036          n.UnmarshalBytes(buf) // escapes: fallback.
  5037          return length, err
  5038      }
  5039  
  5040      // Construct a slice backed by dst's underlying memory.
  5041      var buf []byte
  5042      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5043      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5044      hdr.Len = n.SizeBytes()
  5045      hdr.Cap = n.SizeBytes()
  5046  
  5047      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5048      // Since we bypassed the compiler's escape analysis, indicate that n
  5049      // must live until the use above.
  5050      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5051      return length, err
  5052  }
  5053  
  5054  // CopyIn implements marshal.Marshallable.CopyIn.
  5055  func (n *NVOS32Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5056      return n.CopyInN(cc, addr, n.SizeBytes())
  5057  }
  5058  
  5059  // WriteTo implements io.WriterTo.WriteTo.
  5060  func (n *NVOS32Parameters) WriteTo(writer io.Writer) (int64, error) {
  5061      if !n.HObjectParent.Packed() && n.HRoot.Packed() && n.HVASpace.Packed() {
  5062          // Type NVOS32Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5063          buf := make([]byte, n.SizeBytes())
  5064          n.MarshalBytes(buf)
  5065          length, err := writer.Write(buf)
  5066          return int64(length), err
  5067      }
  5068  
  5069      // Construct a slice backed by dst's underlying memory.
  5070      var buf []byte
  5071      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5072      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5073      hdr.Len = n.SizeBytes()
  5074      hdr.Cap = n.SizeBytes()
  5075  
  5076      length, err := writer.Write(buf)
  5077      // Since we bypassed the compiler's escape analysis, indicate that n
  5078      // must live until the use above.
  5079      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5080      return int64(length), err
  5081  }
  5082  
  5083  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5084  func (n *NVOS33Parameters) SizeBytes() int {
  5085      return 24 +
  5086          (*Handle)(nil).SizeBytes() +
  5087          (*Handle)(nil).SizeBytes() +
  5088          (*Handle)(nil).SizeBytes() +
  5089          1*4 +
  5090          (*P64)(nil).SizeBytes()
  5091  }
  5092  
  5093  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5094  func (n *NVOS33Parameters) MarshalBytes(dst []byte) []byte {
  5095      dst = n.HClient.MarshalUnsafe(dst)
  5096      dst = n.HDevice.MarshalUnsafe(dst)
  5097      dst = n.HMemory.MarshalUnsafe(dst)
  5098      for idx := 0; idx < 4; idx++ {
  5099          dst[0] = byte(n.Pad0[idx])
  5100          dst = dst[1:]
  5101      }
  5102      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Offset))
  5103      dst = dst[8:]
  5104      hostarch.ByteOrder.PutUint64(dst[:8], uint64(n.Length))
  5105      dst = dst[8:]
  5106      dst = n.PLinearAddress.MarshalUnsafe(dst)
  5107      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5108      dst = dst[4:]
  5109      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  5110      dst = dst[4:]
  5111      return dst
  5112  }
  5113  
  5114  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5115  func (n *NVOS33Parameters) UnmarshalBytes(src []byte) []byte {
  5116      src = n.HClient.UnmarshalUnsafe(src)
  5117      src = n.HDevice.UnmarshalUnsafe(src)
  5118      src = n.HMemory.UnmarshalUnsafe(src)
  5119      for idx := 0; idx < 4; idx++ {
  5120          n.Pad0[idx] = src[0]
  5121          src = src[1:]
  5122      }
  5123      n.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  5124      src = src[8:]
  5125      n.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  5126      src = src[8:]
  5127      src = n.PLinearAddress.UnmarshalUnsafe(src)
  5128      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5129      src = src[4:]
  5130      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5131      src = src[4:]
  5132      return src
  5133  }
  5134  
  5135  // Packed implements marshal.Marshallable.Packed.
  5136  //go:nosplit
  5137  func (n *NVOS33Parameters) Packed() bool {
  5138      return n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed()
  5139  }
  5140  
  5141  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5142  func (n *NVOS33Parameters) MarshalUnsafe(dst []byte) []byte {
  5143      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5144          size := n.SizeBytes()
  5145          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5146          return dst[size:]
  5147      }
  5148      // Type NVOS33Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5149      return n.MarshalBytes(dst)
  5150  }
  5151  
  5152  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5153  func (n *NVOS33Parameters) UnmarshalUnsafe(src []byte) []byte {
  5154      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5155          size := n.SizeBytes()
  5156          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5157          return src[size:]
  5158      }
  5159      // Type NVOS33Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5160      return n.UnmarshalBytes(src)
  5161  }
  5162  
  5163  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5164  func (n *NVOS33Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5165      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5166          // Type NVOS33Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5167          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5168          n.MarshalBytes(buf) // escapes: fallback.
  5169          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5170      }
  5171  
  5172      // Construct a slice backed by dst's underlying memory.
  5173      var buf []byte
  5174      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5175      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5176      hdr.Len = n.SizeBytes()
  5177      hdr.Cap = n.SizeBytes()
  5178  
  5179      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5180      // Since we bypassed the compiler's escape analysis, indicate that n
  5181      // must live until the use above.
  5182      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5183      return length, err
  5184  }
  5185  
  5186  // CopyOut implements marshal.Marshallable.CopyOut.
  5187  func (n *NVOS33Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5188      return n.CopyOutN(cc, addr, n.SizeBytes())
  5189  }
  5190  
  5191  // CopyInN implements marshal.Marshallable.CopyInN.
  5192  func (n *NVOS33Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5193      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5194          // Type NVOS33Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5195          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5196          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5197          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5198          // partially unmarshalled struct.
  5199          n.UnmarshalBytes(buf) // escapes: fallback.
  5200          return length, err
  5201      }
  5202  
  5203      // Construct a slice backed by dst's underlying memory.
  5204      var buf []byte
  5205      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5206      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5207      hdr.Len = n.SizeBytes()
  5208      hdr.Cap = n.SizeBytes()
  5209  
  5210      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5211      // Since we bypassed the compiler's escape analysis, indicate that n
  5212      // must live until the use above.
  5213      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5214      return length, err
  5215  }
  5216  
  5217  // CopyIn implements marshal.Marshallable.CopyIn.
  5218  func (n *NVOS33Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5219      return n.CopyInN(cc, addr, n.SizeBytes())
  5220  }
  5221  
  5222  // WriteTo implements io.WriterTo.WriteTo.
  5223  func (n *NVOS33Parameters) WriteTo(writer io.Writer) (int64, error) {
  5224      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5225          // Type NVOS33Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5226          buf := make([]byte, n.SizeBytes())
  5227          n.MarshalBytes(buf)
  5228          length, err := writer.Write(buf)
  5229          return int64(length), err
  5230      }
  5231  
  5232      // Construct a slice backed by dst's underlying memory.
  5233      var buf []byte
  5234      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5235      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5236      hdr.Len = n.SizeBytes()
  5237      hdr.Cap = n.SizeBytes()
  5238  
  5239      length, err := writer.Write(buf)
  5240      // Since we bypassed the compiler's escape analysis, indicate that n
  5241      // must live until the use above.
  5242      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5243      return int64(length), err
  5244  }
  5245  
  5246  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5247  func (n *NVOS34Parameters) SizeBytes() int {
  5248      return 8 +
  5249          (*Handle)(nil).SizeBytes() +
  5250          (*Handle)(nil).SizeBytes() +
  5251          (*Handle)(nil).SizeBytes() +
  5252          1*4 +
  5253          (*P64)(nil).SizeBytes()
  5254  }
  5255  
  5256  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5257  func (n *NVOS34Parameters) MarshalBytes(dst []byte) []byte {
  5258      dst = n.HClient.MarshalUnsafe(dst)
  5259      dst = n.HDevice.MarshalUnsafe(dst)
  5260      dst = n.HMemory.MarshalUnsafe(dst)
  5261      for idx := 0; idx < 4; idx++ {
  5262          dst[0] = byte(n.Pad0[idx])
  5263          dst = dst[1:]
  5264      }
  5265      dst = n.PLinearAddress.MarshalUnsafe(dst)
  5266      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5267      dst = dst[4:]
  5268      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  5269      dst = dst[4:]
  5270      return dst
  5271  }
  5272  
  5273  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5274  func (n *NVOS34Parameters) UnmarshalBytes(src []byte) []byte {
  5275      src = n.HClient.UnmarshalUnsafe(src)
  5276      src = n.HDevice.UnmarshalUnsafe(src)
  5277      src = n.HMemory.UnmarshalUnsafe(src)
  5278      for idx := 0; idx < 4; idx++ {
  5279          n.Pad0[idx] = src[0]
  5280          src = src[1:]
  5281      }
  5282      src = n.PLinearAddress.UnmarshalUnsafe(src)
  5283      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5284      src = src[4:]
  5285      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5286      src = src[4:]
  5287      return src
  5288  }
  5289  
  5290  // Packed implements marshal.Marshallable.Packed.
  5291  //go:nosplit
  5292  func (n *NVOS34Parameters) Packed() bool {
  5293      return n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed()
  5294  }
  5295  
  5296  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5297  func (n *NVOS34Parameters) MarshalUnsafe(dst []byte) []byte {
  5298      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5299          size := n.SizeBytes()
  5300          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5301          return dst[size:]
  5302      }
  5303      // Type NVOS34Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5304      return n.MarshalBytes(dst)
  5305  }
  5306  
  5307  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5308  func (n *NVOS34Parameters) UnmarshalUnsafe(src []byte) []byte {
  5309      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5310          size := n.SizeBytes()
  5311          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5312          return src[size:]
  5313      }
  5314      // Type NVOS34Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5315      return n.UnmarshalBytes(src)
  5316  }
  5317  
  5318  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5319  func (n *NVOS34Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5320      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5321          // Type NVOS34Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5322          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5323          n.MarshalBytes(buf) // escapes: fallback.
  5324          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5325      }
  5326  
  5327      // Construct a slice backed by dst's underlying memory.
  5328      var buf []byte
  5329      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5330      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5331      hdr.Len = n.SizeBytes()
  5332      hdr.Cap = n.SizeBytes()
  5333  
  5334      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5335      // Since we bypassed the compiler's escape analysis, indicate that n
  5336      // must live until the use above.
  5337      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5338      return length, err
  5339  }
  5340  
  5341  // CopyOut implements marshal.Marshallable.CopyOut.
  5342  func (n *NVOS34Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5343      return n.CopyOutN(cc, addr, n.SizeBytes())
  5344  }
  5345  
  5346  // CopyInN implements marshal.Marshallable.CopyInN.
  5347  func (n *NVOS34Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5348      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5349          // Type NVOS34Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5350          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5351          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5352          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5353          // partially unmarshalled struct.
  5354          n.UnmarshalBytes(buf) // escapes: fallback.
  5355          return length, err
  5356      }
  5357  
  5358      // Construct a slice backed by dst's underlying memory.
  5359      var buf []byte
  5360      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5361      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5362      hdr.Len = n.SizeBytes()
  5363      hdr.Cap = n.SizeBytes()
  5364  
  5365      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5366      // Since we bypassed the compiler's escape analysis, indicate that n
  5367      // must live until the use above.
  5368      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5369      return length, err
  5370  }
  5371  
  5372  // CopyIn implements marshal.Marshallable.CopyIn.
  5373  func (n *NVOS34Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5374      return n.CopyInN(cc, addr, n.SizeBytes())
  5375  }
  5376  
  5377  // WriteTo implements io.WriterTo.WriteTo.
  5378  func (n *NVOS34Parameters) WriteTo(writer io.Writer) (int64, error) {
  5379      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PLinearAddress.Packed() {
  5380          // Type NVOS34Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5381          buf := make([]byte, n.SizeBytes())
  5382          n.MarshalBytes(buf)
  5383          length, err := writer.Write(buf)
  5384          return int64(length), err
  5385      }
  5386  
  5387      // Construct a slice backed by dst's underlying memory.
  5388      var buf []byte
  5389      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5390      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5391      hdr.Len = n.SizeBytes()
  5392      hdr.Cap = n.SizeBytes()
  5393  
  5394      length, err := writer.Write(buf)
  5395      // Since we bypassed the compiler's escape analysis, indicate that n
  5396      // must live until the use above.
  5397      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5398      return int64(length), err
  5399  }
  5400  
  5401  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5402  func (n *NVOS54Parameters) SizeBytes() int {
  5403      return 16 +
  5404          (*Handle)(nil).SizeBytes() +
  5405          (*Handle)(nil).SizeBytes() +
  5406          (*P64)(nil).SizeBytes()
  5407  }
  5408  
  5409  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5410  func (n *NVOS54Parameters) MarshalBytes(dst []byte) []byte {
  5411      dst = n.HClient.MarshalUnsafe(dst)
  5412      dst = n.HObject.MarshalUnsafe(dst)
  5413      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Cmd))
  5414      dst = dst[4:]
  5415      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  5416      dst = dst[4:]
  5417      dst = n.Params.MarshalUnsafe(dst)
  5418      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ParamsSize))
  5419      dst = dst[4:]
  5420      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5421      dst = dst[4:]
  5422      return dst
  5423  }
  5424  
  5425  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5426  func (n *NVOS54Parameters) UnmarshalBytes(src []byte) []byte {
  5427      src = n.HClient.UnmarshalUnsafe(src)
  5428      src = n.HObject.UnmarshalUnsafe(src)
  5429      n.Cmd = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5430      src = src[4:]
  5431      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5432      src = src[4:]
  5433      src = n.Params.UnmarshalUnsafe(src)
  5434      n.ParamsSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5435      src = src[4:]
  5436      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5437      src = src[4:]
  5438      return src
  5439  }
  5440  
  5441  // Packed implements marshal.Marshallable.Packed.
  5442  //go:nosplit
  5443  func (n *NVOS54Parameters) Packed() bool {
  5444      return n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed()
  5445  }
  5446  
  5447  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5448  func (n *NVOS54Parameters) MarshalUnsafe(dst []byte) []byte {
  5449      if n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5450          size := n.SizeBytes()
  5451          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5452          return dst[size:]
  5453      }
  5454      // Type NVOS54Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5455      return n.MarshalBytes(dst)
  5456  }
  5457  
  5458  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5459  func (n *NVOS54Parameters) UnmarshalUnsafe(src []byte) []byte {
  5460      if n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5461          size := n.SizeBytes()
  5462          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5463          return src[size:]
  5464      }
  5465      // Type NVOS54Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5466      return n.UnmarshalBytes(src)
  5467  }
  5468  
  5469  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5470  func (n *NVOS54Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5471      if !n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5472          // Type NVOS54Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5473          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5474          n.MarshalBytes(buf) // escapes: fallback.
  5475          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5476      }
  5477  
  5478      // Construct a slice backed by dst's underlying memory.
  5479      var buf []byte
  5480      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5481      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5482      hdr.Len = n.SizeBytes()
  5483      hdr.Cap = n.SizeBytes()
  5484  
  5485      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5486      // Since we bypassed the compiler's escape analysis, indicate that n
  5487      // must live until the use above.
  5488      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5489      return length, err
  5490  }
  5491  
  5492  // CopyOut implements marshal.Marshallable.CopyOut.
  5493  func (n *NVOS54Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5494      return n.CopyOutN(cc, addr, n.SizeBytes())
  5495  }
  5496  
  5497  // CopyInN implements marshal.Marshallable.CopyInN.
  5498  func (n *NVOS54Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5499      if !n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5500          // Type NVOS54Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5501          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5502          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5503          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5504          // partially unmarshalled struct.
  5505          n.UnmarshalBytes(buf) // escapes: fallback.
  5506          return length, err
  5507      }
  5508  
  5509      // Construct a slice backed by dst's underlying memory.
  5510      var buf []byte
  5511      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5512      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5513      hdr.Len = n.SizeBytes()
  5514      hdr.Cap = n.SizeBytes()
  5515  
  5516      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5517      // Since we bypassed the compiler's escape analysis, indicate that n
  5518      // must live until the use above.
  5519      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5520      return length, err
  5521  }
  5522  
  5523  // CopyIn implements marshal.Marshallable.CopyIn.
  5524  func (n *NVOS54Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5525      return n.CopyInN(cc, addr, n.SizeBytes())
  5526  }
  5527  
  5528  // WriteTo implements io.WriterTo.WriteTo.
  5529  func (n *NVOS54Parameters) WriteTo(writer io.Writer) (int64, error) {
  5530      if !n.HClient.Packed() && n.HObject.Packed() && n.Params.Packed() {
  5531          // Type NVOS54Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5532          buf := make([]byte, n.SizeBytes())
  5533          n.MarshalBytes(buf)
  5534          length, err := writer.Write(buf)
  5535          return int64(length), err
  5536      }
  5537  
  5538      // Construct a slice backed by dst's underlying memory.
  5539      var buf []byte
  5540      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5541      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5542      hdr.Len = n.SizeBytes()
  5543      hdr.Cap = n.SizeBytes()
  5544  
  5545      length, err := writer.Write(buf)
  5546      // Since we bypassed the compiler's escape analysis, indicate that n
  5547      // must live until the use above.
  5548      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5549      return int64(length), err
  5550  }
  5551  
  5552  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5553  func (n *NVOS55Parameters) SizeBytes() int {
  5554      return 8 +
  5555          (*Handle)(nil).SizeBytes() +
  5556          (*Handle)(nil).SizeBytes() +
  5557          (*Handle)(nil).SizeBytes() +
  5558          (*Handle)(nil).SizeBytes() +
  5559          (*Handle)(nil).SizeBytes()
  5560  }
  5561  
  5562  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5563  func (n *NVOS55Parameters) MarshalBytes(dst []byte) []byte {
  5564      dst = n.HClient.MarshalUnsafe(dst)
  5565      dst = n.HParent.MarshalUnsafe(dst)
  5566      dst = n.HObject.MarshalUnsafe(dst)
  5567      dst = n.HClientSrc.MarshalUnsafe(dst)
  5568      dst = n.HObjectSrc.MarshalUnsafe(dst)
  5569      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  5570      dst = dst[4:]
  5571      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5572      dst = dst[4:]
  5573      return dst
  5574  }
  5575  
  5576  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5577  func (n *NVOS55Parameters) UnmarshalBytes(src []byte) []byte {
  5578      src = n.HClient.UnmarshalUnsafe(src)
  5579      src = n.HParent.UnmarshalUnsafe(src)
  5580      src = n.HObject.UnmarshalUnsafe(src)
  5581      src = n.HClientSrc.UnmarshalUnsafe(src)
  5582      src = n.HObjectSrc.UnmarshalUnsafe(src)
  5583      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5584      src = src[4:]
  5585      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5586      src = src[4:]
  5587      return src
  5588  }
  5589  
  5590  // Packed implements marshal.Marshallable.Packed.
  5591  //go:nosplit
  5592  func (n *NVOS55Parameters) Packed() bool {
  5593      return n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed()
  5594  }
  5595  
  5596  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5597  func (n *NVOS55Parameters) MarshalUnsafe(dst []byte) []byte {
  5598      if n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  5599          size := n.SizeBytes()
  5600          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5601          return dst[size:]
  5602      }
  5603      // Type NVOS55Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5604      return n.MarshalBytes(dst)
  5605  }
  5606  
  5607  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5608  func (n *NVOS55Parameters) UnmarshalUnsafe(src []byte) []byte {
  5609      if n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  5610          size := n.SizeBytes()
  5611          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5612          return src[size:]
  5613      }
  5614      // Type NVOS55Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5615      return n.UnmarshalBytes(src)
  5616  }
  5617  
  5618  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5619  func (n *NVOS55Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5620      if !n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  5621          // Type NVOS55Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5622          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5623          n.MarshalBytes(buf) // escapes: fallback.
  5624          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5625      }
  5626  
  5627      // Construct a slice backed by dst's underlying memory.
  5628      var buf []byte
  5629      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5630      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5631      hdr.Len = n.SizeBytes()
  5632      hdr.Cap = n.SizeBytes()
  5633  
  5634      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5635      // Since we bypassed the compiler's escape analysis, indicate that n
  5636      // must live until the use above.
  5637      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5638      return length, err
  5639  }
  5640  
  5641  // CopyOut implements marshal.Marshallable.CopyOut.
  5642  func (n *NVOS55Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5643      return n.CopyOutN(cc, addr, n.SizeBytes())
  5644  }
  5645  
  5646  // CopyInN implements marshal.Marshallable.CopyInN.
  5647  func (n *NVOS55Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5648      if !n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  5649          // Type NVOS55Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5650          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5651          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5652          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5653          // partially unmarshalled struct.
  5654          n.UnmarshalBytes(buf) // escapes: fallback.
  5655          return length, err
  5656      }
  5657  
  5658      // Construct a slice backed by dst's underlying memory.
  5659      var buf []byte
  5660      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5661      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5662      hdr.Len = n.SizeBytes()
  5663      hdr.Cap = n.SizeBytes()
  5664  
  5665      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5666      // Since we bypassed the compiler's escape analysis, indicate that n
  5667      // must live until the use above.
  5668      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5669      return length, err
  5670  }
  5671  
  5672  // CopyIn implements marshal.Marshallable.CopyIn.
  5673  func (n *NVOS55Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5674      return n.CopyInN(cc, addr, n.SizeBytes())
  5675  }
  5676  
  5677  // WriteTo implements io.WriterTo.WriteTo.
  5678  func (n *NVOS55Parameters) WriteTo(writer io.Writer) (int64, error) {
  5679      if !n.HClient.Packed() && n.HClientSrc.Packed() && n.HObject.Packed() && n.HObjectSrc.Packed() && n.HParent.Packed() {
  5680          // Type NVOS55Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5681          buf := make([]byte, n.SizeBytes())
  5682          n.MarshalBytes(buf)
  5683          length, err := writer.Write(buf)
  5684          return int64(length), err
  5685      }
  5686  
  5687      // Construct a slice backed by dst's underlying memory.
  5688      var buf []byte
  5689      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5690      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5691      hdr.Len = n.SizeBytes()
  5692      hdr.Cap = n.SizeBytes()
  5693  
  5694      length, err := writer.Write(buf)
  5695      // Since we bypassed the compiler's escape analysis, indicate that n
  5696      // must live until the use above.
  5697      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5698      return int64(length), err
  5699  }
  5700  
  5701  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5702  func (n *NVOS56Parameters) SizeBytes() int {
  5703      return 4 +
  5704          (*Handle)(nil).SizeBytes() +
  5705          (*Handle)(nil).SizeBytes() +
  5706          (*Handle)(nil).SizeBytes() +
  5707          1*4 +
  5708          (*P64)(nil).SizeBytes() +
  5709          (*P64)(nil).SizeBytes() +
  5710          1*4
  5711  }
  5712  
  5713  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5714  func (n *NVOS56Parameters) MarshalBytes(dst []byte) []byte {
  5715      dst = n.HClient.MarshalUnsafe(dst)
  5716      dst = n.HDevice.MarshalUnsafe(dst)
  5717      dst = n.HMemory.MarshalUnsafe(dst)
  5718      for idx := 0; idx < 4; idx++ {
  5719          dst[0] = byte(n.Pad0[idx])
  5720          dst = dst[1:]
  5721      }
  5722      dst = n.POldCPUAddress.MarshalUnsafe(dst)
  5723      dst = n.PNewCPUAddress.MarshalUnsafe(dst)
  5724      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5725      dst = dst[4:]
  5726      for idx := 0; idx < 4; idx++ {
  5727          dst[0] = byte(n.Pad1[idx])
  5728          dst = dst[1:]
  5729      }
  5730      return dst
  5731  }
  5732  
  5733  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5734  func (n *NVOS56Parameters) UnmarshalBytes(src []byte) []byte {
  5735      src = n.HClient.UnmarshalUnsafe(src)
  5736      src = n.HDevice.UnmarshalUnsafe(src)
  5737      src = n.HMemory.UnmarshalUnsafe(src)
  5738      for idx := 0; idx < 4; idx++ {
  5739          n.Pad0[idx] = src[0]
  5740          src = src[1:]
  5741      }
  5742      src = n.POldCPUAddress.UnmarshalUnsafe(src)
  5743      src = n.PNewCPUAddress.UnmarshalUnsafe(src)
  5744      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5745      src = src[4:]
  5746      for idx := 0; idx < 4; idx++ {
  5747          n.Pad1[idx] = src[0]
  5748          src = src[1:]
  5749      }
  5750      return src
  5751  }
  5752  
  5753  // Packed implements marshal.Marshallable.Packed.
  5754  //go:nosplit
  5755  func (n *NVOS56Parameters) Packed() bool {
  5756      return n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed()
  5757  }
  5758  
  5759  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5760  func (n *NVOS56Parameters) MarshalUnsafe(dst []byte) []byte {
  5761      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  5762          size := n.SizeBytes()
  5763          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5764          return dst[size:]
  5765      }
  5766      // Type NVOS56Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5767      return n.MarshalBytes(dst)
  5768  }
  5769  
  5770  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5771  func (n *NVOS56Parameters) UnmarshalUnsafe(src []byte) []byte {
  5772      if n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  5773          size := n.SizeBytes()
  5774          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5775          return src[size:]
  5776      }
  5777      // Type NVOS56Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5778      return n.UnmarshalBytes(src)
  5779  }
  5780  
  5781  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5782  func (n *NVOS56Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5783      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  5784          // Type NVOS56Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5785          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5786          n.MarshalBytes(buf) // escapes: fallback.
  5787          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5788      }
  5789  
  5790      // Construct a slice backed by dst's underlying memory.
  5791      var buf []byte
  5792      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5793      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5794      hdr.Len = n.SizeBytes()
  5795      hdr.Cap = n.SizeBytes()
  5796  
  5797      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5798      // Since we bypassed the compiler's escape analysis, indicate that n
  5799      // must live until the use above.
  5800      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5801      return length, err
  5802  }
  5803  
  5804  // CopyOut implements marshal.Marshallable.CopyOut.
  5805  func (n *NVOS56Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5806      return n.CopyOutN(cc, addr, n.SizeBytes())
  5807  }
  5808  
  5809  // CopyInN implements marshal.Marshallable.CopyInN.
  5810  func (n *NVOS56Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5811      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  5812          // Type NVOS56Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5813          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5814          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5815          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5816          // partially unmarshalled struct.
  5817          n.UnmarshalBytes(buf) // escapes: fallback.
  5818          return length, err
  5819      }
  5820  
  5821      // Construct a slice backed by dst's underlying memory.
  5822      var buf []byte
  5823      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5824      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5825      hdr.Len = n.SizeBytes()
  5826      hdr.Cap = n.SizeBytes()
  5827  
  5828      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5829      // Since we bypassed the compiler's escape analysis, indicate that n
  5830      // must live until the use above.
  5831      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5832      return length, err
  5833  }
  5834  
  5835  // CopyIn implements marshal.Marshallable.CopyIn.
  5836  func (n *NVOS56Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5837      return n.CopyInN(cc, addr, n.SizeBytes())
  5838  }
  5839  
  5840  // WriteTo implements io.WriterTo.WriteTo.
  5841  func (n *NVOS56Parameters) WriteTo(writer io.Writer) (int64, error) {
  5842      if !n.HClient.Packed() && n.HDevice.Packed() && n.HMemory.Packed() && n.PNewCPUAddress.Packed() && n.POldCPUAddress.Packed() {
  5843          // Type NVOS56Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5844          buf := make([]byte, n.SizeBytes())
  5845          n.MarshalBytes(buf)
  5846          length, err := writer.Write(buf)
  5847          return int64(length), err
  5848      }
  5849  
  5850      // Construct a slice backed by dst's underlying memory.
  5851      var buf []byte
  5852      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5853      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5854      hdr.Len = n.SizeBytes()
  5855      hdr.Cap = n.SizeBytes()
  5856  
  5857      length, err := writer.Write(buf)
  5858      // Since we bypassed the compiler's escape analysis, indicate that n
  5859      // must live until the use above.
  5860      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5861      return int64(length), err
  5862  }
  5863  
  5864  // SizeBytes implements marshal.Marshallable.SizeBytes.
  5865  func (n *NVOS57Parameters) SizeBytes() int {
  5866      return 4 +
  5867          (*Handle)(nil).SizeBytes() +
  5868          (*Handle)(nil).SizeBytes() +
  5869          (*RS_SHARE_POLICY)(nil).SizeBytes()
  5870  }
  5871  
  5872  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  5873  func (n *NVOS57Parameters) MarshalBytes(dst []byte) []byte {
  5874      dst = n.HClient.MarshalUnsafe(dst)
  5875      dst = n.HObject.MarshalUnsafe(dst)
  5876      dst = n.SharePolicy.MarshalUnsafe(dst)
  5877      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  5878      dst = dst[4:]
  5879      return dst
  5880  }
  5881  
  5882  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  5883  func (n *NVOS57Parameters) UnmarshalBytes(src []byte) []byte {
  5884      src = n.HClient.UnmarshalUnsafe(src)
  5885      src = n.HObject.UnmarshalUnsafe(src)
  5886      src = n.SharePolicy.UnmarshalUnsafe(src)
  5887      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  5888      src = src[4:]
  5889      return src
  5890  }
  5891  
  5892  // Packed implements marshal.Marshallable.Packed.
  5893  //go:nosplit
  5894  func (n *NVOS57Parameters) Packed() bool {
  5895      return n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed()
  5896  }
  5897  
  5898  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  5899  func (n *NVOS57Parameters) MarshalUnsafe(dst []byte) []byte {
  5900      if n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  5901          size := n.SizeBytes()
  5902          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  5903          return dst[size:]
  5904      }
  5905      // Type NVOS57Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  5906      return n.MarshalBytes(dst)
  5907  }
  5908  
  5909  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  5910  func (n *NVOS57Parameters) UnmarshalUnsafe(src []byte) []byte {
  5911      if n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  5912          size := n.SizeBytes()
  5913          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  5914          return src[size:]
  5915      }
  5916      // Type NVOS57Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  5917      return n.UnmarshalBytes(src)
  5918  }
  5919  
  5920  // CopyOutN implements marshal.Marshallable.CopyOutN.
  5921  func (n *NVOS57Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5922      if !n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  5923          // Type NVOS57Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5924          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5925          n.MarshalBytes(buf) // escapes: fallback.
  5926          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5927      }
  5928  
  5929      // Construct a slice backed by dst's underlying memory.
  5930      var buf []byte
  5931      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5932      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5933      hdr.Len = n.SizeBytes()
  5934      hdr.Cap = n.SizeBytes()
  5935  
  5936      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  5937      // Since we bypassed the compiler's escape analysis, indicate that n
  5938      // must live until the use above.
  5939      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5940      return length, err
  5941  }
  5942  
  5943  // CopyOut implements marshal.Marshallable.CopyOut.
  5944  func (n *NVOS57Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5945      return n.CopyOutN(cc, addr, n.SizeBytes())
  5946  }
  5947  
  5948  // CopyInN implements marshal.Marshallable.CopyInN.
  5949  func (n *NVOS57Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  5950      if !n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  5951          // Type NVOS57Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  5952          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  5953          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5954          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  5955          // partially unmarshalled struct.
  5956          n.UnmarshalBytes(buf) // escapes: fallback.
  5957          return length, err
  5958      }
  5959  
  5960      // Construct a slice backed by dst's underlying memory.
  5961      var buf []byte
  5962      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5963      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5964      hdr.Len = n.SizeBytes()
  5965      hdr.Cap = n.SizeBytes()
  5966  
  5967      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  5968      // Since we bypassed the compiler's escape analysis, indicate that n
  5969      // must live until the use above.
  5970      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  5971      return length, err
  5972  }
  5973  
  5974  // CopyIn implements marshal.Marshallable.CopyIn.
  5975  func (n *NVOS57Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  5976      return n.CopyInN(cc, addr, n.SizeBytes())
  5977  }
  5978  
  5979  // WriteTo implements io.WriterTo.WriteTo.
  5980  func (n *NVOS57Parameters) WriteTo(writer io.Writer) (int64, error) {
  5981      if !n.HClient.Packed() && n.HObject.Packed() && n.SharePolicy.Packed() {
  5982          // Type NVOS57Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  5983          buf := make([]byte, n.SizeBytes())
  5984          n.MarshalBytes(buf)
  5985          length, err := writer.Write(buf)
  5986          return int64(length), err
  5987      }
  5988  
  5989      // Construct a slice backed by dst's underlying memory.
  5990      var buf []byte
  5991      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  5992      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  5993      hdr.Len = n.SizeBytes()
  5994      hdr.Cap = n.SizeBytes()
  5995  
  5996      length, err := writer.Write(buf)
  5997      // Since we bypassed the compiler's escape analysis, indicate that n
  5998      // must live until the use above.
  5999      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6000      return int64(length), err
  6001  }
  6002  
  6003  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6004  func (n *NVOS64Parameters) SizeBytes() int {
  6005      return 20 +
  6006          (*Handle)(nil).SizeBytes() +
  6007          (*Handle)(nil).SizeBytes() +
  6008          (*Handle)(nil).SizeBytes() +
  6009          (*P64)(nil).SizeBytes() +
  6010          (*P64)(nil).SizeBytes()
  6011  }
  6012  
  6013  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6014  func (n *NVOS64Parameters) MarshalBytes(dst []byte) []byte {
  6015      dst = n.HRoot.MarshalUnsafe(dst)
  6016      dst = n.HObjectParent.MarshalUnsafe(dst)
  6017      dst = n.HObjectNew.MarshalUnsafe(dst)
  6018      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.HClass))
  6019      dst = dst[4:]
  6020      dst = n.PAllocParms.MarshalUnsafe(dst)
  6021      dst = n.PRightsRequested.MarshalUnsafe(dst)
  6022      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.ParamsSize))
  6023      dst = dst[4:]
  6024      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags))
  6025      dst = dst[4:]
  6026      hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Status))
  6027      dst = dst[4:]
  6028      // Padding: dst[:sizeof(uint32)] ~= uint32(0)
  6029      dst = dst[4:]
  6030      return dst
  6031  }
  6032  
  6033  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6034  func (n *NVOS64Parameters) UnmarshalBytes(src []byte) []byte {
  6035      src = n.HRoot.UnmarshalUnsafe(src)
  6036      src = n.HObjectParent.UnmarshalUnsafe(src)
  6037      src = n.HObjectNew.UnmarshalUnsafe(src)
  6038      n.HClass = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6039      src = src[4:]
  6040      src = n.PAllocParms.UnmarshalUnsafe(src)
  6041      src = n.PRightsRequested.UnmarshalUnsafe(src)
  6042      n.ParamsSize = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6043      src = src[4:]
  6044      n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6045      src = src[4:]
  6046      n.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6047      src = src[4:]
  6048      // Padding: var _ uint32 ~= src[:sizeof(uint32)]
  6049      src = src[4:]
  6050      return src
  6051  }
  6052  
  6053  // Packed implements marshal.Marshallable.Packed.
  6054  //go:nosplit
  6055  func (n *NVOS64Parameters) Packed() bool {
  6056      return n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed()
  6057  }
  6058  
  6059  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6060  func (n *NVOS64Parameters) MarshalUnsafe(dst []byte) []byte {
  6061      if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6062          size := n.SizeBytes()
  6063          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size))
  6064          return dst[size:]
  6065      }
  6066      // Type NVOS64Parameters doesn't have a packed layout in memory, fallback to MarshalBytes.
  6067      return n.MarshalBytes(dst)
  6068  }
  6069  
  6070  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6071  func (n *NVOS64Parameters) UnmarshalUnsafe(src []byte) []byte {
  6072      if n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6073          size := n.SizeBytes()
  6074          gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size))
  6075          return src[size:]
  6076      }
  6077      // Type NVOS64Parameters doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  6078      return n.UnmarshalBytes(src)
  6079  }
  6080  
  6081  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6082  func (n *NVOS64Parameters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6083      if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6084          // Type NVOS64Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6085          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6086          n.MarshalBytes(buf) // escapes: fallback.
  6087          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6088      }
  6089  
  6090      // Construct a slice backed by dst's underlying memory.
  6091      var buf []byte
  6092      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6093      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6094      hdr.Len = n.SizeBytes()
  6095      hdr.Cap = n.SizeBytes()
  6096  
  6097      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6098      // Since we bypassed the compiler's escape analysis, indicate that n
  6099      // must live until the use above.
  6100      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6101      return length, err
  6102  }
  6103  
  6104  // CopyOut implements marshal.Marshallable.CopyOut.
  6105  func (n *NVOS64Parameters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6106      return n.CopyOutN(cc, addr, n.SizeBytes())
  6107  }
  6108  
  6109  // CopyInN implements marshal.Marshallable.CopyInN.
  6110  func (n *NVOS64Parameters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6111      if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6112          // Type NVOS64Parameters doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  6113          buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay.
  6114          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6115          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  6116          // partially unmarshalled struct.
  6117          n.UnmarshalBytes(buf) // escapes: fallback.
  6118          return length, err
  6119      }
  6120  
  6121      // Construct a slice backed by dst's underlying memory.
  6122      var buf []byte
  6123      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6124      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6125      hdr.Len = n.SizeBytes()
  6126      hdr.Cap = n.SizeBytes()
  6127  
  6128      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6129      // Since we bypassed the compiler's escape analysis, indicate that n
  6130      // must live until the use above.
  6131      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6132      return length, err
  6133  }
  6134  
  6135  // CopyIn implements marshal.Marshallable.CopyIn.
  6136  func (n *NVOS64Parameters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6137      return n.CopyInN(cc, addr, n.SizeBytes())
  6138  }
  6139  
  6140  // WriteTo implements io.WriterTo.WriteTo.
  6141  func (n *NVOS64Parameters) WriteTo(writer io.Writer) (int64, error) {
  6142      if !n.HObjectNew.Packed() && n.HObjectParent.Packed() && n.HRoot.Packed() && n.PAllocParms.Packed() && n.PRightsRequested.Packed() {
  6143          // Type NVOS64Parameters doesn't have a packed layout in memory, fall back to MarshalBytes.
  6144          buf := make([]byte, n.SizeBytes())
  6145          n.MarshalBytes(buf)
  6146          length, err := writer.Write(buf)
  6147          return int64(length), err
  6148      }
  6149  
  6150      // Construct a slice backed by dst's underlying memory.
  6151      var buf []byte
  6152      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6153      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n)))
  6154      hdr.Len = n.SizeBytes()
  6155      hdr.Cap = n.SizeBytes()
  6156  
  6157      length, err := writer.Write(buf)
  6158      // Since we bypassed the compiler's escape analysis, indicate that n
  6159      // must live until the use above.
  6160      runtime.KeepAlive(n) // escapes: replaced by intrinsic.
  6161      return int64(length), err
  6162  }
  6163  
  6164  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6165  func (r *RMAPIVersion) SizeBytes() int {
  6166      return 8 +
  6167          1*64
  6168  }
  6169  
  6170  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6171  func (r *RMAPIVersion) MarshalBytes(dst []byte) []byte {
  6172      hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Cmd))
  6173      dst = dst[4:]
  6174      hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Reply))
  6175      dst = dst[4:]
  6176      for idx := 0; idx < 64; idx++ {
  6177          dst[0] = byte(r.VersionString[idx])
  6178          dst = dst[1:]
  6179      }
  6180      return dst
  6181  }
  6182  
  6183  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6184  func (r *RMAPIVersion) UnmarshalBytes(src []byte) []byte {
  6185      r.Cmd = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6186      src = src[4:]
  6187      r.Reply = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6188      src = src[4:]
  6189      for idx := 0; idx < 64; idx++ {
  6190          r.VersionString[idx] = src[0]
  6191          src = src[1:]
  6192      }
  6193      return src
  6194  }
  6195  
  6196  // Packed implements marshal.Marshallable.Packed.
  6197  //go:nosplit
  6198  func (r *RMAPIVersion) Packed() bool {
  6199      return true
  6200  }
  6201  
  6202  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6203  func (r *RMAPIVersion) MarshalUnsafe(dst []byte) []byte {
  6204      size := r.SizeBytes()
  6205      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size))
  6206      return dst[size:]
  6207  }
  6208  
  6209  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6210  func (r *RMAPIVersion) UnmarshalUnsafe(src []byte) []byte {
  6211      size := r.SizeBytes()
  6212      gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size))
  6213      return src[size:]
  6214  }
  6215  
  6216  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6217  func (r *RMAPIVersion) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6218      // Construct a slice backed by dst's underlying memory.
  6219      var buf []byte
  6220      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6221      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6222      hdr.Len = r.SizeBytes()
  6223      hdr.Cap = r.SizeBytes()
  6224  
  6225      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6226      // Since we bypassed the compiler's escape analysis, indicate that r
  6227      // must live until the use above.
  6228      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6229      return length, err
  6230  }
  6231  
  6232  // CopyOut implements marshal.Marshallable.CopyOut.
  6233  func (r *RMAPIVersion) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6234      return r.CopyOutN(cc, addr, r.SizeBytes())
  6235  }
  6236  
  6237  // CopyInN implements marshal.Marshallable.CopyInN.
  6238  func (r *RMAPIVersion) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6239      // Construct a slice backed by dst's underlying memory.
  6240      var buf []byte
  6241      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6242      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6243      hdr.Len = r.SizeBytes()
  6244      hdr.Cap = r.SizeBytes()
  6245  
  6246      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6247      // Since we bypassed the compiler's escape analysis, indicate that r
  6248      // must live until the use above.
  6249      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6250      return length, err
  6251  }
  6252  
  6253  // CopyIn implements marshal.Marshallable.CopyIn.
  6254  func (r *RMAPIVersion) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6255      return r.CopyInN(cc, addr, r.SizeBytes())
  6256  }
  6257  
  6258  // WriteTo implements io.WriterTo.WriteTo.
  6259  func (r *RMAPIVersion) WriteTo(writer io.Writer) (int64, error) {
  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(r)))
  6264      hdr.Len = r.SizeBytes()
  6265      hdr.Cap = r.SizeBytes()
  6266  
  6267      length, err := writer.Write(buf)
  6268      // Since we bypassed the compiler's escape analysis, indicate that r
  6269      // must live until the use above.
  6270      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6271      return int64(length), err
  6272  }
  6273  
  6274  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6275  func (h *Handle) SizeBytes() int {
  6276      return 4
  6277  }
  6278  
  6279  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6280  func (h *Handle) MarshalBytes(dst []byte) []byte {
  6281      hostarch.ByteOrder.PutUint32(dst[:4], uint32(h.Val))
  6282      dst = dst[4:]
  6283      return dst
  6284  }
  6285  
  6286  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6287  func (h *Handle) UnmarshalBytes(src []byte) []byte {
  6288      h.Val = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6289      src = src[4:]
  6290      return src
  6291  }
  6292  
  6293  // Packed implements marshal.Marshallable.Packed.
  6294  //go:nosplit
  6295  func (h *Handle) Packed() bool {
  6296      return true
  6297  }
  6298  
  6299  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6300  func (h *Handle) MarshalUnsafe(dst []byte) []byte {
  6301      size := h.SizeBytes()
  6302      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(h), uintptr(size))
  6303      return dst[size:]
  6304  }
  6305  
  6306  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6307  func (h *Handle) UnmarshalUnsafe(src []byte) []byte {
  6308      size := h.SizeBytes()
  6309      gohacks.Memmove(unsafe.Pointer(h), unsafe.Pointer(&src[0]), uintptr(size))
  6310      return src[size:]
  6311  }
  6312  
  6313  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6314  func (h *Handle) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6315      // Construct a slice backed by dst's underlying memory.
  6316      var buf []byte
  6317      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6318      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(h)))
  6319      hdr.Len = h.SizeBytes()
  6320      hdr.Cap = h.SizeBytes()
  6321  
  6322      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6323      // Since we bypassed the compiler's escape analysis, indicate that h
  6324      // must live until the use above.
  6325      runtime.KeepAlive(h) // escapes: replaced by intrinsic.
  6326      return length, err
  6327  }
  6328  
  6329  // CopyOut implements marshal.Marshallable.CopyOut.
  6330  func (h *Handle) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6331      return h.CopyOutN(cc, addr, h.SizeBytes())
  6332  }
  6333  
  6334  // CopyInN implements marshal.Marshallable.CopyInN.
  6335  func (h *Handle) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6336      // Construct a slice backed by dst's underlying memory.
  6337      var buf []byte
  6338      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6339      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(h)))
  6340      hdr.Len = h.SizeBytes()
  6341      hdr.Cap = h.SizeBytes()
  6342  
  6343      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6344      // Since we bypassed the compiler's escape analysis, indicate that h
  6345      // must live until the use above.
  6346      runtime.KeepAlive(h) // escapes: replaced by intrinsic.
  6347      return length, err
  6348  }
  6349  
  6350  // CopyIn implements marshal.Marshallable.CopyIn.
  6351  func (h *Handle) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6352      return h.CopyInN(cc, addr, h.SizeBytes())
  6353  }
  6354  
  6355  // WriteTo implements io.WriterTo.WriteTo.
  6356  func (h *Handle) WriteTo(writer io.Writer) (int64, error) {
  6357      // Construct a slice backed by dst's underlying memory.
  6358      var buf []byte
  6359      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6360      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(h)))
  6361      hdr.Len = h.SizeBytes()
  6362      hdr.Cap = h.SizeBytes()
  6363  
  6364      length, err := writer.Write(buf)
  6365      // Since we bypassed the compiler's escape analysis, indicate that h
  6366      // must live until the use above.
  6367      runtime.KeepAlive(h) // escapes: replaced by intrinsic.
  6368      return int64(length), err
  6369  }
  6370  
  6371  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6372  //go:nosplit
  6373  func (p *P64) SizeBytes() int {
  6374      return 8
  6375  }
  6376  
  6377  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6378  func (p *P64) MarshalBytes(dst []byte) []byte {
  6379      hostarch.ByteOrder.PutUint64(dst[:8], uint64(*p))
  6380      return dst[8:]
  6381  }
  6382  
  6383  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6384  func (p *P64) UnmarshalBytes(src []byte) []byte {
  6385      *p = P64(uint64(hostarch.ByteOrder.Uint64(src[:8])))
  6386      return src[8:]
  6387  }
  6388  
  6389  // Packed implements marshal.Marshallable.Packed.
  6390  //go:nosplit
  6391  func (p *P64) Packed() bool {
  6392      // Scalar newtypes are always packed.
  6393      return true
  6394  }
  6395  
  6396  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6397  func (p *P64) MarshalUnsafe(dst []byte) []byte {
  6398      size := p.SizeBytes()
  6399      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  6400      return dst[size:]
  6401  }
  6402  
  6403  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6404  func (p *P64) UnmarshalUnsafe(src []byte) []byte {
  6405      size := p.SizeBytes()
  6406      gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  6407      return src[size:]
  6408  }
  6409  
  6410  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6411  func (p *P64) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6412      // Construct a slice backed by dst's underlying memory.
  6413      var buf []byte
  6414      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6415      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  6416      hdr.Len = p.SizeBytes()
  6417      hdr.Cap = p.SizeBytes()
  6418  
  6419      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6420      // Since we bypassed the compiler's escape analysis, indicate that p
  6421      // must live until the use above.
  6422      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  6423      return length, err
  6424  }
  6425  
  6426  // CopyOut implements marshal.Marshallable.CopyOut.
  6427  func (p *P64) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6428      return p.CopyOutN(cc, addr, p.SizeBytes())
  6429  }
  6430  
  6431  // CopyInN implements marshal.Marshallable.CopyInN.
  6432  func (p *P64) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6433      // Construct a slice backed by dst's underlying memory.
  6434      var buf []byte
  6435      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6436      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  6437      hdr.Len = p.SizeBytes()
  6438      hdr.Cap = p.SizeBytes()
  6439  
  6440      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6441      // Since we bypassed the compiler's escape analysis, indicate that p
  6442      // must live until the use above.
  6443      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  6444      return length, err
  6445  }
  6446  
  6447  // CopyIn implements marshal.Marshallable.CopyIn.
  6448  func (p *P64) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6449      return p.CopyInN(cc, addr, p.SizeBytes())
  6450  }
  6451  
  6452  // WriteTo implements io.WriterTo.WriteTo.
  6453  func (p *P64) WriteTo(writer io.Writer) (int64, error) {
  6454      // Construct a slice backed by dst's underlying memory.
  6455      var buf []byte
  6456      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6457      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  6458      hdr.Len = p.SizeBytes()
  6459      hdr.Cap = p.SizeBytes()
  6460  
  6461      length, err := writer.Write(buf)
  6462      // Since we bypassed the compiler's escape analysis, indicate that p
  6463      // must live until the use above.
  6464      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  6465      return int64(length), err
  6466  }
  6467  
  6468  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6469  func (r *RS_ACCESS_MASK) SizeBytes() int {
  6470      return 0 +
  6471          4*SDK_RS_ACCESS_MAX_LIMBS
  6472  }
  6473  
  6474  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6475  func (r *RS_ACCESS_MASK) MarshalBytes(dst []byte) []byte {
  6476      for idx := 0; idx < SDK_RS_ACCESS_MAX_LIMBS; idx++ {
  6477          hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Limbs[idx]))
  6478          dst = dst[4:]
  6479      }
  6480      return dst
  6481  }
  6482  
  6483  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6484  func (r *RS_ACCESS_MASK) UnmarshalBytes(src []byte) []byte {
  6485      for idx := 0; idx < SDK_RS_ACCESS_MAX_LIMBS; idx++ {
  6486          r.Limbs[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6487          src = src[4:]
  6488      }
  6489      return src
  6490  }
  6491  
  6492  // Packed implements marshal.Marshallable.Packed.
  6493  //go:nosplit
  6494  func (r *RS_ACCESS_MASK) Packed() bool {
  6495      return true
  6496  }
  6497  
  6498  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6499  func (r *RS_ACCESS_MASK) MarshalUnsafe(dst []byte) []byte {
  6500      size := r.SizeBytes()
  6501      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size))
  6502      return dst[size:]
  6503  }
  6504  
  6505  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6506  func (r *RS_ACCESS_MASK) UnmarshalUnsafe(src []byte) []byte {
  6507      size := r.SizeBytes()
  6508      gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size))
  6509      return src[size:]
  6510  }
  6511  
  6512  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6513  func (r *RS_ACCESS_MASK) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6514      // Construct a slice backed by dst's underlying memory.
  6515      var buf []byte
  6516      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6517      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6518      hdr.Len = r.SizeBytes()
  6519      hdr.Cap = r.SizeBytes()
  6520  
  6521      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6522      // Since we bypassed the compiler's escape analysis, indicate that r
  6523      // must live until the use above.
  6524      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6525      return length, err
  6526  }
  6527  
  6528  // CopyOut implements marshal.Marshallable.CopyOut.
  6529  func (r *RS_ACCESS_MASK) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6530      return r.CopyOutN(cc, addr, r.SizeBytes())
  6531  }
  6532  
  6533  // CopyInN implements marshal.Marshallable.CopyInN.
  6534  func (r *RS_ACCESS_MASK) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6535      // Construct a slice backed by dst's underlying memory.
  6536      var buf []byte
  6537      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6538      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6539      hdr.Len = r.SizeBytes()
  6540      hdr.Cap = r.SizeBytes()
  6541  
  6542      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6543      // Since we bypassed the compiler's escape analysis, indicate that r
  6544      // must live until the use above.
  6545      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6546      return length, err
  6547  }
  6548  
  6549  // CopyIn implements marshal.Marshallable.CopyIn.
  6550  func (r *RS_ACCESS_MASK) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6551      return r.CopyInN(cc, addr, r.SizeBytes())
  6552  }
  6553  
  6554  // WriteTo implements io.WriterTo.WriteTo.
  6555  func (r *RS_ACCESS_MASK) WriteTo(writer io.Writer) (int64, error) {
  6556      // Construct a slice backed by dst's underlying memory.
  6557      var buf []byte
  6558      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6559      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6560      hdr.Len = r.SizeBytes()
  6561      hdr.Cap = r.SizeBytes()
  6562  
  6563      length, err := writer.Write(buf)
  6564      // Since we bypassed the compiler's escape analysis, indicate that r
  6565      // must live until the use above.
  6566      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6567      return int64(length), err
  6568  }
  6569  
  6570  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6571  func (r *RS_SHARE_POLICY) SizeBytes() int {
  6572      return 7 +
  6573          (*RS_ACCESS_MASK)(nil).SizeBytes() +
  6574          1*1
  6575  }
  6576  
  6577  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6578  func (r *RS_SHARE_POLICY) MarshalBytes(dst []byte) []byte {
  6579      hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Target))
  6580      dst = dst[4:]
  6581      dst = r.AccessMask.MarshalUnsafe(dst)
  6582      hostarch.ByteOrder.PutUint16(dst[:2], uint16(r.Type))
  6583      dst = dst[2:]
  6584      dst[0] = byte(r.Action)
  6585      dst = dst[1:]
  6586      for idx := 0; idx < 1; idx++ {
  6587          dst[0] = byte(r.Pad[idx])
  6588          dst = dst[1:]
  6589      }
  6590      return dst
  6591  }
  6592  
  6593  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6594  func (r *RS_SHARE_POLICY) UnmarshalBytes(src []byte) []byte {
  6595      r.Target = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6596      src = src[4:]
  6597      src = r.AccessMask.UnmarshalUnsafe(src)
  6598      r.Type = uint16(hostarch.ByteOrder.Uint16(src[:2]))
  6599      src = src[2:]
  6600      r.Action = uint8(src[0])
  6601      src = src[1:]
  6602      for idx := 0; idx < 1; idx++ {
  6603          r.Pad[idx] = src[0]
  6604          src = src[1:]
  6605      }
  6606      return src
  6607  }
  6608  
  6609  // Packed implements marshal.Marshallable.Packed.
  6610  //go:nosplit
  6611  func (r *RS_SHARE_POLICY) Packed() bool {
  6612      return r.AccessMask.Packed()
  6613  }
  6614  
  6615  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6616  func (r *RS_SHARE_POLICY) MarshalUnsafe(dst []byte) []byte {
  6617      if r.AccessMask.Packed() {
  6618          size := r.SizeBytes()
  6619          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size))
  6620          return dst[size:]
  6621      }
  6622      // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fallback to MarshalBytes.
  6623      return r.MarshalBytes(dst)
  6624  }
  6625  
  6626  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6627  func (r *RS_SHARE_POLICY) UnmarshalUnsafe(src []byte) []byte {
  6628      if r.AccessMask.Packed() {
  6629          size := r.SizeBytes()
  6630          gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size))
  6631          return src[size:]
  6632      }
  6633      // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  6634      return r.UnmarshalBytes(src)
  6635  }
  6636  
  6637  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6638  func (r *RS_SHARE_POLICY) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6639      if !r.AccessMask.Packed() {
  6640          // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fall back to MarshalBytes.
  6641          buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay.
  6642          r.MarshalBytes(buf) // escapes: fallback.
  6643          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6644      }
  6645  
  6646      // Construct a slice backed by dst's underlying memory.
  6647      var buf []byte
  6648      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6649      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6650      hdr.Len = r.SizeBytes()
  6651      hdr.Cap = r.SizeBytes()
  6652  
  6653      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6654      // Since we bypassed the compiler's escape analysis, indicate that r
  6655      // must live until the use above.
  6656      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6657      return length, err
  6658  }
  6659  
  6660  // CopyOut implements marshal.Marshallable.CopyOut.
  6661  func (r *RS_SHARE_POLICY) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6662      return r.CopyOutN(cc, addr, r.SizeBytes())
  6663  }
  6664  
  6665  // CopyInN implements marshal.Marshallable.CopyInN.
  6666  func (r *RS_SHARE_POLICY) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6667      if !r.AccessMask.Packed() {
  6668          // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  6669          buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay.
  6670          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6671          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  6672          // partially unmarshalled struct.
  6673          r.UnmarshalBytes(buf) // escapes: fallback.
  6674          return length, err
  6675      }
  6676  
  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 *RS_SHARE_POLICY) 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 *RS_SHARE_POLICY) WriteTo(writer io.Writer) (int64, error) {
  6698      if !r.AccessMask.Packed() {
  6699          // Type RS_SHARE_POLICY doesn't have a packed layout in memory, fall back to MarshalBytes.
  6700          buf := make([]byte, r.SizeBytes())
  6701          r.MarshalBytes(buf)
  6702          length, err := writer.Write(buf)
  6703          return int64(length), err
  6704      }
  6705  
  6706      // Construct a slice backed by dst's underlying memory.
  6707      var buf []byte
  6708      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6709      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r)))
  6710      hdr.Len = r.SizeBytes()
  6711      hdr.Cap = r.SizeBytes()
  6712  
  6713      length, err := writer.Write(buf)
  6714      // Since we bypassed the compiler's escape analysis, indicate that r
  6715      // must live until the use above.
  6716      runtime.KeepAlive(r) // escapes: replaced by intrinsic.
  6717      return int64(length), err
  6718  }
  6719  
  6720  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6721  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) SizeBytes() int {
  6722      return 28 +
  6723          (*UvmGpuMappingAttributes)(nil).SizeBytes()*UVM_MAX_GPUS +
  6724          1*4
  6725  }
  6726  
  6727  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6728  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) MarshalBytes(dst []byte) []byte {
  6729      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  6730      dst = dst[8:]
  6731      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  6732      dst = dst[8:]
  6733      for idx := 0; idx < UVM_MAX_GPUS; idx++ {
  6734          dst = u.PerGPUAttributes[idx].MarshalUnsafe(dst)
  6735      }
  6736      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.GPUAttributesCount))
  6737      dst = dst[8:]
  6738      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  6739      dst = dst[4:]
  6740      for idx := 0; idx < 4; idx++ {
  6741          dst[0] = byte(u.Pad0[idx])
  6742          dst = dst[1:]
  6743      }
  6744      return dst
  6745  }
  6746  
  6747  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6748  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) UnmarshalBytes(src []byte) []byte {
  6749      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  6750      src = src[8:]
  6751      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  6752      src = src[8:]
  6753      for idx := 0; idx < UVM_MAX_GPUS; idx++ {
  6754          src = u.PerGPUAttributes[idx].UnmarshalUnsafe(src)
  6755      }
  6756      u.GPUAttributesCount = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  6757      src = src[8:]
  6758      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6759      src = src[4:]
  6760      for idx := 0; idx < 4; idx++ {
  6761          u.Pad0[idx] = src[0]
  6762          src = src[1:]
  6763      }
  6764      return src
  6765  }
  6766  
  6767  // Packed implements marshal.Marshallable.Packed.
  6768  //go:nosplit
  6769  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) Packed() bool {
  6770      return u.PerGPUAttributes[0].Packed()
  6771  }
  6772  
  6773  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6774  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) MarshalUnsafe(dst []byte) []byte {
  6775      if u.PerGPUAttributes[0].Packed() {
  6776          size := u.SizeBytes()
  6777          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  6778          return dst[size:]
  6779      }
  6780      // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  6781      return u.MarshalBytes(dst)
  6782  }
  6783  
  6784  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6785  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  6786      if u.PerGPUAttributes[0].Packed() {
  6787          size := u.SizeBytes()
  6788          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  6789          return src[size:]
  6790      }
  6791      // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  6792      return u.UnmarshalBytes(src)
  6793  }
  6794  
  6795  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6796  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6797      if !u.PerGPUAttributes[0].Packed() {
  6798          // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  6799          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  6800          u.MarshalBytes(buf) // escapes: fallback.
  6801          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6802      }
  6803  
  6804      // Construct a slice backed by dst's underlying memory.
  6805      var buf []byte
  6806      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6807      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  6808      hdr.Len = u.SizeBytes()
  6809      hdr.Cap = u.SizeBytes()
  6810  
  6811      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6812      // Since we bypassed the compiler's escape analysis, indicate that u
  6813      // must live until the use above.
  6814      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  6815      return length, err
  6816  }
  6817  
  6818  // CopyOut implements marshal.Marshallable.CopyOut.
  6819  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6820      return u.CopyOutN(cc, addr, u.SizeBytes())
  6821  }
  6822  
  6823  // CopyInN implements marshal.Marshallable.CopyInN.
  6824  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6825      if !u.PerGPUAttributes[0].Packed() {
  6826          // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  6827          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  6828          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6829          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  6830          // partially unmarshalled struct.
  6831          u.UnmarshalBytes(buf) // escapes: fallback.
  6832          return length, err
  6833      }
  6834  
  6835      // Construct a slice backed by dst's underlying memory.
  6836      var buf []byte
  6837      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6838      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  6839      hdr.Len = u.SizeBytes()
  6840      hdr.Cap = u.SizeBytes()
  6841  
  6842      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6843      // Since we bypassed the compiler's escape analysis, indicate that u
  6844      // must live until the use above.
  6845      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  6846      return length, err
  6847  }
  6848  
  6849  // CopyIn implements marshal.Marshallable.CopyIn.
  6850  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6851      return u.CopyInN(cc, addr, u.SizeBytes())
  6852  }
  6853  
  6854  // WriteTo implements io.WriterTo.WriteTo.
  6855  func (u *UVM_ALLOC_SEMAPHORE_POOL_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  6856      if !u.PerGPUAttributes[0].Packed() {
  6857          // Type UVM_ALLOC_SEMAPHORE_POOL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  6858          buf := make([]byte, u.SizeBytes())
  6859          u.MarshalBytes(buf)
  6860          length, err := writer.Write(buf)
  6861          return int64(length), err
  6862      }
  6863  
  6864      // Construct a slice backed by dst's underlying memory.
  6865      var buf []byte
  6866      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6867      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  6868      hdr.Len = u.SizeBytes()
  6869      hdr.Cap = u.SizeBytes()
  6870  
  6871      length, err := writer.Write(buf)
  6872      // Since we bypassed the compiler's escape analysis, indicate that u
  6873      // must live until the use above.
  6874      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  6875      return int64(length), err
  6876  }
  6877  
  6878  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6879  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) SizeBytes() int {
  6880      return 20 +
  6881          1*4
  6882  }
  6883  
  6884  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6885  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) MarshalBytes(dst []byte) []byte {
  6886      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  6887      dst = dst[8:]
  6888      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  6889      dst = dst[8:]
  6890      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  6891      dst = dst[4:]
  6892      for idx := 0; idx < 4; idx++ {
  6893          dst[0] = byte(u.Pad0[idx])
  6894          dst = dst[1:]
  6895      }
  6896      return dst
  6897  }
  6898  
  6899  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  6900  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) UnmarshalBytes(src []byte) []byte {
  6901      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  6902      src = src[8:]
  6903      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  6904      src = src[8:]
  6905      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  6906      src = src[4:]
  6907      for idx := 0; idx < 4; idx++ {
  6908          u.Pad0[idx] = src[0]
  6909          src = src[1:]
  6910      }
  6911      return src
  6912  }
  6913  
  6914  // Packed implements marshal.Marshallable.Packed.
  6915  //go:nosplit
  6916  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) Packed() bool {
  6917      return true
  6918  }
  6919  
  6920  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  6921  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  6922      size := u.SizeBytes()
  6923      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  6924      return dst[size:]
  6925  }
  6926  
  6927  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  6928  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  6929      size := u.SizeBytes()
  6930      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  6931      return src[size:]
  6932  }
  6933  
  6934  // CopyOutN implements marshal.Marshallable.CopyOutN.
  6935  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6936      // Construct a slice backed by dst's underlying memory.
  6937      var buf []byte
  6938      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6939      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  6940      hdr.Len = u.SizeBytes()
  6941      hdr.Cap = u.SizeBytes()
  6942  
  6943      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  6944      // Since we bypassed the compiler's escape analysis, indicate that u
  6945      // must live until the use above.
  6946      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  6947      return length, err
  6948  }
  6949  
  6950  // CopyOut implements marshal.Marshallable.CopyOut.
  6951  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6952      return u.CopyOutN(cc, addr, u.SizeBytes())
  6953  }
  6954  
  6955  // CopyInN implements marshal.Marshallable.CopyInN.
  6956  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  6957      // Construct a slice backed by dst's underlying memory.
  6958      var buf []byte
  6959      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6960      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  6961      hdr.Len = u.SizeBytes()
  6962      hdr.Cap = u.SizeBytes()
  6963  
  6964      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  6965      // Since we bypassed the compiler's escape analysis, indicate that u
  6966      // must live until the use above.
  6967      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  6968      return length, err
  6969  }
  6970  
  6971  // CopyIn implements marshal.Marshallable.CopyIn.
  6972  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  6973      return u.CopyInN(cc, addr, u.SizeBytes())
  6974  }
  6975  
  6976  // WriteTo implements io.WriterTo.WriteTo.
  6977  func (u *UVM_CREATE_EXTERNAL_RANGE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  6978      // Construct a slice backed by dst's underlying memory.
  6979      var buf []byte
  6980      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  6981      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  6982      hdr.Len = u.SizeBytes()
  6983      hdr.Cap = u.SizeBytes()
  6984  
  6985      length, err := writer.Write(buf)
  6986      // Since we bypassed the compiler's escape analysis, indicate that u
  6987      // must live until the use above.
  6988      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  6989      return int64(length), err
  6990  }
  6991  
  6992  // SizeBytes implements marshal.Marshallable.SizeBytes.
  6993  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) SizeBytes() int {
  6994      return 12 +
  6995          1*4
  6996  }
  6997  
  6998  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  6999  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) MarshalBytes(dst []byte) []byte {
  7000      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RangeGroupID))
  7001      dst = dst[8:]
  7002      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7003      dst = dst[4:]
  7004      for idx := 0; idx < 4; idx++ {
  7005          dst[0] = byte(u.Pad0[idx])
  7006          dst = dst[1:]
  7007      }
  7008      return dst
  7009  }
  7010  
  7011  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7012  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) UnmarshalBytes(src []byte) []byte {
  7013      u.RangeGroupID = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7014      src = src[8:]
  7015      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7016      src = src[4:]
  7017      for idx := 0; idx < 4; idx++ {
  7018          u.Pad0[idx] = src[0]
  7019          src = src[1:]
  7020      }
  7021      return src
  7022  }
  7023  
  7024  // Packed implements marshal.Marshallable.Packed.
  7025  //go:nosplit
  7026  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) Packed() bool {
  7027      return true
  7028  }
  7029  
  7030  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7031  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7032      size := u.SizeBytes()
  7033      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7034      return dst[size:]
  7035  }
  7036  
  7037  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7038  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7039      size := u.SizeBytes()
  7040      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7041      return src[size:]
  7042  }
  7043  
  7044  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7045  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7046      // Construct a slice backed by dst's underlying memory.
  7047      var buf []byte
  7048      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7049      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7050      hdr.Len = u.SizeBytes()
  7051      hdr.Cap = u.SizeBytes()
  7052  
  7053      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7054      // Since we bypassed the compiler's escape analysis, indicate that u
  7055      // must live until the use above.
  7056      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7057      return length, err
  7058  }
  7059  
  7060  // CopyOut implements marshal.Marshallable.CopyOut.
  7061  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7062      return u.CopyOutN(cc, addr, u.SizeBytes())
  7063  }
  7064  
  7065  // CopyInN implements marshal.Marshallable.CopyInN.
  7066  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7067      // Construct a slice backed by dst's underlying memory.
  7068      var buf []byte
  7069      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7070      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7071      hdr.Len = u.SizeBytes()
  7072      hdr.Cap = u.SizeBytes()
  7073  
  7074      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7075      // Since we bypassed the compiler's escape analysis, indicate that u
  7076      // must live until the use above.
  7077      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7078      return length, err
  7079  }
  7080  
  7081  // CopyIn implements marshal.Marshallable.CopyIn.
  7082  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7083      return u.CopyInN(cc, addr, u.SizeBytes())
  7084  }
  7085  
  7086  // WriteTo implements io.WriterTo.WriteTo.
  7087  func (u *UVM_CREATE_RANGE_GROUP_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7088      // Construct a slice backed by dst's underlying memory.
  7089      var buf []byte
  7090      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7091      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7092      hdr.Len = u.SizeBytes()
  7093      hdr.Cap = u.SizeBytes()
  7094  
  7095      length, err := writer.Write(buf)
  7096      // Since we bypassed the compiler's escape analysis, indicate that u
  7097      // must live until the use above.
  7098      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7099      return int64(length), err
  7100  }
  7101  
  7102  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7103  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) SizeBytes() int {
  7104      return 12 +
  7105          1*4
  7106  }
  7107  
  7108  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7109  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) MarshalBytes(dst []byte) []byte {
  7110      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RangeGroupID))
  7111      dst = dst[8:]
  7112      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7113      dst = dst[4:]
  7114      for idx := 0; idx < 4; idx++ {
  7115          dst[0] = byte(u.Pad0[idx])
  7116          dst = dst[1:]
  7117      }
  7118      return dst
  7119  }
  7120  
  7121  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7122  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) UnmarshalBytes(src []byte) []byte {
  7123      u.RangeGroupID = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7124      src = src[8:]
  7125      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7126      src = src[4:]
  7127      for idx := 0; idx < 4; idx++ {
  7128          u.Pad0[idx] = src[0]
  7129          src = src[1:]
  7130      }
  7131      return src
  7132  }
  7133  
  7134  // Packed implements marshal.Marshallable.Packed.
  7135  //go:nosplit
  7136  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) Packed() bool {
  7137      return true
  7138  }
  7139  
  7140  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7141  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7142      size := u.SizeBytes()
  7143      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7144      return dst[size:]
  7145  }
  7146  
  7147  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7148  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7149      size := u.SizeBytes()
  7150      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7151      return src[size:]
  7152  }
  7153  
  7154  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7155  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7156      // Construct a slice backed by dst's underlying memory.
  7157      var buf []byte
  7158      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7159      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7160      hdr.Len = u.SizeBytes()
  7161      hdr.Cap = u.SizeBytes()
  7162  
  7163      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7164      // Since we bypassed the compiler's escape analysis, indicate that u
  7165      // must live until the use above.
  7166      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7167      return length, err
  7168  }
  7169  
  7170  // CopyOut implements marshal.Marshallable.CopyOut.
  7171  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7172      return u.CopyOutN(cc, addr, u.SizeBytes())
  7173  }
  7174  
  7175  // CopyInN implements marshal.Marshallable.CopyInN.
  7176  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7177      // Construct a slice backed by dst's underlying memory.
  7178      var buf []byte
  7179      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7180      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7181      hdr.Len = u.SizeBytes()
  7182      hdr.Cap = u.SizeBytes()
  7183  
  7184      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7185      // Since we bypassed the compiler's escape analysis, indicate that u
  7186      // must live until the use above.
  7187      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7188      return length, err
  7189  }
  7190  
  7191  // CopyIn implements marshal.Marshallable.CopyIn.
  7192  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7193      return u.CopyInN(cc, addr, u.SizeBytes())
  7194  }
  7195  
  7196  // WriteTo implements io.WriterTo.WriteTo.
  7197  func (u *UVM_DESTROY_RANGE_GROUP_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7198      // Construct a slice backed by dst's underlying memory.
  7199      var buf []byte
  7200      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7201      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7202      hdr.Len = u.SizeBytes()
  7203      hdr.Cap = u.SizeBytes()
  7204  
  7205      length, err := writer.Write(buf)
  7206      // Since we bypassed the compiler's escape analysis, indicate that u
  7207      // must live until the use above.
  7208      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7209      return int64(length), err
  7210  }
  7211  
  7212  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7213  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) SizeBytes() int {
  7214      return 20 +
  7215          1*4
  7216  }
  7217  
  7218  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7219  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) MarshalBytes(dst []byte) []byte {
  7220      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.RequestedBase))
  7221      dst = dst[8:]
  7222      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  7223      dst = dst[8:]
  7224      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7225      dst = dst[4:]
  7226      for idx := 0; idx < 4; idx++ {
  7227          dst[0] = byte(u.Pad0[idx])
  7228          dst = dst[1:]
  7229      }
  7230      return dst
  7231  }
  7232  
  7233  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7234  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) UnmarshalBytes(src []byte) []byte {
  7235      u.RequestedBase = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7236      src = src[8:]
  7237      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7238      src = src[8:]
  7239      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7240      src = src[4:]
  7241      for idx := 0; idx < 4; idx++ {
  7242          u.Pad0[idx] = src[0]
  7243          src = src[1:]
  7244      }
  7245      return src
  7246  }
  7247  
  7248  // Packed implements marshal.Marshallable.Packed.
  7249  //go:nosplit
  7250  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) Packed() bool {
  7251      return true
  7252  }
  7253  
  7254  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7255  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7256      size := u.SizeBytes()
  7257      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7258      return dst[size:]
  7259  }
  7260  
  7261  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7262  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7263      size := u.SizeBytes()
  7264      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7265      return src[size:]
  7266  }
  7267  
  7268  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7269  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7270      // Construct a slice backed by dst's underlying memory.
  7271      var buf []byte
  7272      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7273      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7274      hdr.Len = u.SizeBytes()
  7275      hdr.Cap = u.SizeBytes()
  7276  
  7277      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7278      // Since we bypassed the compiler's escape analysis, indicate that u
  7279      // must live until the use above.
  7280      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7281      return length, err
  7282  }
  7283  
  7284  // CopyOut implements marshal.Marshallable.CopyOut.
  7285  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7286      return u.CopyOutN(cc, addr, u.SizeBytes())
  7287  }
  7288  
  7289  // CopyInN implements marshal.Marshallable.CopyInN.
  7290  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7291      // Construct a slice backed by dst's underlying memory.
  7292      var buf []byte
  7293      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7294      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7295      hdr.Len = u.SizeBytes()
  7296      hdr.Cap = u.SizeBytes()
  7297  
  7298      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7299      // Since we bypassed the compiler's escape analysis, indicate that u
  7300      // must live until the use above.
  7301      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7302      return length, err
  7303  }
  7304  
  7305  // CopyIn implements marshal.Marshallable.CopyIn.
  7306  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7307      return u.CopyInN(cc, addr, u.SizeBytes())
  7308  }
  7309  
  7310  // WriteTo implements io.WriterTo.WriteTo.
  7311  func (u *UVM_DISABLE_READ_DUPLICATION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7312      // Construct a slice backed by dst's underlying memory.
  7313      var buf []byte
  7314      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7315      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7316      hdr.Len = u.SizeBytes()
  7317      hdr.Cap = u.SizeBytes()
  7318  
  7319      length, err := writer.Write(buf)
  7320      // Since we bypassed the compiler's escape analysis, indicate that u
  7321      // must live until the use above.
  7322      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7323      return int64(length), err
  7324  }
  7325  
  7326  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7327  func (u *UVM_FREE_PARAMS) SizeBytes() int {
  7328      return 20 +
  7329          1*4
  7330  }
  7331  
  7332  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7333  func (u *UVM_FREE_PARAMS) MarshalBytes(dst []byte) []byte {
  7334      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  7335      dst = dst[8:]
  7336      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  7337      dst = dst[8:]
  7338      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7339      dst = dst[4:]
  7340      for idx := 0; idx < 4; idx++ {
  7341          dst[0] = byte(u.Pad0[idx])
  7342          dst = dst[1:]
  7343      }
  7344      return dst
  7345  }
  7346  
  7347  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7348  func (u *UVM_FREE_PARAMS) UnmarshalBytes(src []byte) []byte {
  7349      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7350      src = src[8:]
  7351      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7352      src = src[8:]
  7353      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7354      src = src[4:]
  7355      for idx := 0; idx < 4; idx++ {
  7356          u.Pad0[idx] = src[0]
  7357          src = src[1:]
  7358      }
  7359      return src
  7360  }
  7361  
  7362  // Packed implements marshal.Marshallable.Packed.
  7363  //go:nosplit
  7364  func (u *UVM_FREE_PARAMS) Packed() bool {
  7365      return true
  7366  }
  7367  
  7368  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7369  func (u *UVM_FREE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7370      size := u.SizeBytes()
  7371      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7372      return dst[size:]
  7373  }
  7374  
  7375  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7376  func (u *UVM_FREE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7377      size := u.SizeBytes()
  7378      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7379      return src[size:]
  7380  }
  7381  
  7382  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7383  func (u *UVM_FREE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7384      // Construct a slice backed by dst's underlying memory.
  7385      var buf []byte
  7386      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7387      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7388      hdr.Len = u.SizeBytes()
  7389      hdr.Cap = u.SizeBytes()
  7390  
  7391      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7392      // Since we bypassed the compiler's escape analysis, indicate that u
  7393      // must live until the use above.
  7394      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7395      return length, err
  7396  }
  7397  
  7398  // CopyOut implements marshal.Marshallable.CopyOut.
  7399  func (u *UVM_FREE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7400      return u.CopyOutN(cc, addr, u.SizeBytes())
  7401  }
  7402  
  7403  // CopyInN implements marshal.Marshallable.CopyInN.
  7404  func (u *UVM_FREE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  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 := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  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 length, err
  7417  }
  7418  
  7419  // CopyIn implements marshal.Marshallable.CopyIn.
  7420  func (u *UVM_FREE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7421      return u.CopyInN(cc, addr, u.SizeBytes())
  7422  }
  7423  
  7424  // WriteTo implements io.WriterTo.WriteTo.
  7425  func (u *UVM_FREE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7426      // Construct a slice backed by dst's underlying memory.
  7427      var buf []byte
  7428      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7429      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7430      hdr.Len = u.SizeBytes()
  7431      hdr.Cap = u.SizeBytes()
  7432  
  7433      length, err := writer.Write(buf)
  7434      // Since we bypassed the compiler's escape analysis, indicate that u
  7435      // must live until the use above.
  7436      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7437      return int64(length), err
  7438  }
  7439  
  7440  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7441  func (u *UVM_INITIALIZE_PARAMS) SizeBytes() int {
  7442      return 12 +
  7443          1*4
  7444  }
  7445  
  7446  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7447  func (u *UVM_INITIALIZE_PARAMS) MarshalBytes(dst []byte) []byte {
  7448      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Flags))
  7449      dst = dst[8:]
  7450      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7451      dst = dst[4:]
  7452      for idx := 0; idx < 4; idx++ {
  7453          dst[0] = byte(u.Pad0[idx])
  7454          dst = dst[1:]
  7455      }
  7456      return dst
  7457  }
  7458  
  7459  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7460  func (u *UVM_INITIALIZE_PARAMS) UnmarshalBytes(src []byte) []byte {
  7461      u.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7462      src = src[8:]
  7463      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7464      src = src[4:]
  7465      for idx := 0; idx < 4; idx++ {
  7466          u.Pad0[idx] = src[0]
  7467          src = src[1:]
  7468      }
  7469      return src
  7470  }
  7471  
  7472  // Packed implements marshal.Marshallable.Packed.
  7473  //go:nosplit
  7474  func (u *UVM_INITIALIZE_PARAMS) Packed() bool {
  7475      return true
  7476  }
  7477  
  7478  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7479  func (u *UVM_INITIALIZE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7480      size := u.SizeBytes()
  7481      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7482      return dst[size:]
  7483  }
  7484  
  7485  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7486  func (u *UVM_INITIALIZE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7487      size := u.SizeBytes()
  7488      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7489      return src[size:]
  7490  }
  7491  
  7492  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7493  func (u *UVM_INITIALIZE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7494      // Construct a slice backed by dst's underlying memory.
  7495      var buf []byte
  7496      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7497      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7498      hdr.Len = u.SizeBytes()
  7499      hdr.Cap = u.SizeBytes()
  7500  
  7501      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7502      // Since we bypassed the compiler's escape analysis, indicate that u
  7503      // must live until the use above.
  7504      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7505      return length, err
  7506  }
  7507  
  7508  // CopyOut implements marshal.Marshallable.CopyOut.
  7509  func (u *UVM_INITIALIZE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7510      return u.CopyOutN(cc, addr, u.SizeBytes())
  7511  }
  7512  
  7513  // CopyInN implements marshal.Marshallable.CopyInN.
  7514  func (u *UVM_INITIALIZE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7515      // Construct a slice backed by dst's underlying memory.
  7516      var buf []byte
  7517      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7518      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7519      hdr.Len = u.SizeBytes()
  7520      hdr.Cap = u.SizeBytes()
  7521  
  7522      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7523      // Since we bypassed the compiler's escape analysis, indicate that u
  7524      // must live until the use above.
  7525      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7526      return length, err
  7527  }
  7528  
  7529  // CopyIn implements marshal.Marshallable.CopyIn.
  7530  func (u *UVM_INITIALIZE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7531      return u.CopyInN(cc, addr, u.SizeBytes())
  7532  }
  7533  
  7534  // WriteTo implements io.WriterTo.WriteTo.
  7535  func (u *UVM_INITIALIZE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7536      // Construct a slice backed by dst's underlying memory.
  7537      var buf []byte
  7538      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7539      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7540      hdr.Len = u.SizeBytes()
  7541      hdr.Cap = u.SizeBytes()
  7542  
  7543      length, err := writer.Write(buf)
  7544      // Since we bypassed the compiler's escape analysis, indicate that u
  7545      // must live until the use above.
  7546      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7547      return int64(length), err
  7548  }
  7549  
  7550  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7551  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) SizeBytes() int {
  7552      return 20 +
  7553          1*16 +
  7554          1*4
  7555  }
  7556  
  7557  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7558  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) MarshalBytes(dst []byte) []byte {
  7559      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  7560      dst = dst[8:]
  7561      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  7562      dst = dst[8:]
  7563      for idx := 0; idx < 16; idx++ {
  7564          dst[0] = byte(u.GPUUUID[idx])
  7565          dst = dst[1:]
  7566      }
  7567      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7568      dst = dst[4:]
  7569      for idx := 0; idx < 4; idx++ {
  7570          dst[0] = byte(u.Pad0[idx])
  7571          dst = dst[1:]
  7572      }
  7573      return dst
  7574  }
  7575  
  7576  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7577  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) UnmarshalBytes(src []byte) []byte {
  7578      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7579      src = src[8:]
  7580      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7581      src = src[8:]
  7582      for idx := 0; idx < 16; idx++ {
  7583          u.GPUUUID[idx] = uint8(src[0])
  7584          src = src[1:]
  7585      }
  7586      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7587      src = src[4:]
  7588      for idx := 0; idx < 4; idx++ {
  7589          u.Pad0[idx] = src[0]
  7590          src = src[1:]
  7591      }
  7592      return src
  7593  }
  7594  
  7595  // Packed implements marshal.Marshallable.Packed.
  7596  //go:nosplit
  7597  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) Packed() bool {
  7598      return true
  7599  }
  7600  
  7601  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7602  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7603      size := u.SizeBytes()
  7604      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7605      return dst[size:]
  7606  }
  7607  
  7608  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7609  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7610      size := u.SizeBytes()
  7611      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7612      return src[size:]
  7613  }
  7614  
  7615  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7616  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7617      // Construct a slice backed by dst's underlying memory.
  7618      var buf []byte
  7619      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7620      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7621      hdr.Len = u.SizeBytes()
  7622      hdr.Cap = u.SizeBytes()
  7623  
  7624      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7625      // Since we bypassed the compiler's escape analysis, indicate that u
  7626      // must live until the use above.
  7627      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7628      return length, err
  7629  }
  7630  
  7631  // CopyOut implements marshal.Marshallable.CopyOut.
  7632  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7633      return u.CopyOutN(cc, addr, u.SizeBytes())
  7634  }
  7635  
  7636  // CopyInN implements marshal.Marshallable.CopyInN.
  7637  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7638      // Construct a slice backed by dst's underlying memory.
  7639      var buf []byte
  7640      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7641      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7642      hdr.Len = u.SizeBytes()
  7643      hdr.Cap = u.SizeBytes()
  7644  
  7645      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7646      // Since we bypassed the compiler's escape analysis, indicate that u
  7647      // must live until the use above.
  7648      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7649      return length, err
  7650  }
  7651  
  7652  // CopyIn implements marshal.Marshallable.CopyIn.
  7653  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7654      return u.CopyInN(cc, addr, u.SizeBytes())
  7655  }
  7656  
  7657  // WriteTo implements io.WriterTo.WriteTo.
  7658  func (u *UVM_MAP_DYNAMIC_PARALLELISM_REGION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7659      // Construct a slice backed by dst's underlying memory.
  7660      var buf []byte
  7661      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7662      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7663      hdr.Len = u.SizeBytes()
  7664      hdr.Cap = u.SizeBytes()
  7665  
  7666      length, err := writer.Write(buf)
  7667      // Since we bypassed the compiler's escape analysis, indicate that u
  7668      // must live until the use above.
  7669      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7670      return int64(length), err
  7671  }
  7672  
  7673  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7674  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) SizeBytes() int {
  7675      return 40 +
  7676          (*UvmGpuMappingAttributes)(nil).SizeBytes()*UVM_MAX_GPUS +
  7677          (*Handle)(nil).SizeBytes() +
  7678          (*Handle)(nil).SizeBytes()
  7679  }
  7680  
  7681  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7682  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) MarshalBytes(dst []byte) []byte {
  7683      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Base))
  7684      dst = dst[8:]
  7685      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Length))
  7686      dst = dst[8:]
  7687      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Offset))
  7688      dst = dst[8:]
  7689      for idx := 0; idx < UVM_MAX_GPUS; idx++ {
  7690          dst = p.PerGPUAttributes[idx].MarshalUnsafe(dst)
  7691      }
  7692      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.GPUAttributesCount))
  7693      dst = dst[8:]
  7694      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD))
  7695      dst = dst[4:]
  7696      dst = p.HClient.MarshalUnsafe(dst)
  7697      dst = p.HMemory.MarshalUnsafe(dst)
  7698      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus))
  7699      dst = dst[4:]
  7700      return dst
  7701  }
  7702  
  7703  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7704  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) UnmarshalBytes(src []byte) []byte {
  7705      p.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7706      src = src[8:]
  7707      p.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7708      src = src[8:]
  7709      p.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7710      src = src[8:]
  7711      for idx := 0; idx < UVM_MAX_GPUS; idx++ {
  7712          src = p.PerGPUAttributes[idx].UnmarshalUnsafe(src)
  7713      }
  7714      p.GPUAttributesCount = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  7715      src = src[8:]
  7716      p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  7717      src = src[4:]
  7718      src = p.HClient.UnmarshalUnsafe(src)
  7719      src = p.HMemory.UnmarshalUnsafe(src)
  7720      p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7721      src = src[4:]
  7722      return src
  7723  }
  7724  
  7725  // Packed implements marshal.Marshallable.Packed.
  7726  //go:nosplit
  7727  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) Packed() bool {
  7728      return p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed()
  7729  }
  7730  
  7731  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7732  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7733      if p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  7734          size := p.SizeBytes()
  7735          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  7736          return dst[size:]
  7737      }
  7738      // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  7739      return p.MarshalBytes(dst)
  7740  }
  7741  
  7742  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7743  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7744      if p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  7745          size := p.SizeBytes()
  7746          gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  7747          return src[size:]
  7748      }
  7749      // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  7750      return p.UnmarshalBytes(src)
  7751  }
  7752  
  7753  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7754  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7755      if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  7756          // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  7757          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  7758          p.MarshalBytes(buf) // escapes: fallback.
  7759          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7760      }
  7761  
  7762      // Construct a slice backed by dst's underlying memory.
  7763      var buf []byte
  7764      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7765      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  7766      hdr.Len = p.SizeBytes()
  7767      hdr.Cap = p.SizeBytes()
  7768  
  7769      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7770      // Since we bypassed the compiler's escape analysis, indicate that p
  7771      // must live until the use above.
  7772      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  7773      return length, err
  7774  }
  7775  
  7776  // CopyOut implements marshal.Marshallable.CopyOut.
  7777  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7778      return p.CopyOutN(cc, addr, p.SizeBytes())
  7779  }
  7780  
  7781  // CopyInN implements marshal.Marshallable.CopyInN.
  7782  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7783      if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  7784          // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  7785          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  7786          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7787          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  7788          // partially unmarshalled struct.
  7789          p.UnmarshalBytes(buf) // escapes: fallback.
  7790          return length, err
  7791      }
  7792  
  7793      // Construct a slice backed by dst's underlying memory.
  7794      var buf []byte
  7795      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7796      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  7797      hdr.Len = p.SizeBytes()
  7798      hdr.Cap = p.SizeBytes()
  7799  
  7800      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7801      // Since we bypassed the compiler's escape analysis, indicate that p
  7802      // must live until the use above.
  7803      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  7804      return length, err
  7805  }
  7806  
  7807  // CopyIn implements marshal.Marshallable.CopyIn.
  7808  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7809      return p.CopyInN(cc, addr, p.SizeBytes())
  7810  }
  7811  
  7812  // WriteTo implements io.WriterTo.WriteTo.
  7813  func (p *UVM_MAP_EXTERNAL_ALLOCATION_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7814      if !p.HClient.Packed() && p.HMemory.Packed() && p.PerGPUAttributes[0].Packed() {
  7815          // Type UVM_MAP_EXTERNAL_ALLOCATION_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  7816          buf := make([]byte, p.SizeBytes())
  7817          p.MarshalBytes(buf)
  7818          length, err := writer.Write(buf)
  7819          return int64(length), err
  7820      }
  7821  
  7822      // Construct a slice backed by dst's underlying memory.
  7823      var buf []byte
  7824      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7825      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  7826      hdr.Len = p.SizeBytes()
  7827      hdr.Cap = p.SizeBytes()
  7828  
  7829      length, err := writer.Write(buf)
  7830      // Since we bypassed the compiler's escape analysis, indicate that p
  7831      // must live until the use above.
  7832      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  7833      return int64(length), err
  7834  }
  7835  
  7836  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7837  func (u *UVM_MM_INITIALIZE_PARAMS) SizeBytes() int {
  7838      return 8
  7839  }
  7840  
  7841  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7842  func (u *UVM_MM_INITIALIZE_PARAMS) MarshalBytes(dst []byte) []byte {
  7843      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.UvmFD))
  7844      dst = dst[4:]
  7845      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.Status))
  7846      dst = dst[4:]
  7847      return dst
  7848  }
  7849  
  7850  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7851  func (u *UVM_MM_INITIALIZE_PARAMS) UnmarshalBytes(src []byte) []byte {
  7852      u.UvmFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  7853      src = src[4:]
  7854      u.Status = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7855      src = src[4:]
  7856      return src
  7857  }
  7858  
  7859  // Packed implements marshal.Marshallable.Packed.
  7860  //go:nosplit
  7861  func (u *UVM_MM_INITIALIZE_PARAMS) Packed() bool {
  7862      return true
  7863  }
  7864  
  7865  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7866  func (u *UVM_MM_INITIALIZE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7867      size := u.SizeBytes()
  7868      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7869      return dst[size:]
  7870  }
  7871  
  7872  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7873  func (u *UVM_MM_INITIALIZE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7874      size := u.SizeBytes()
  7875      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7876      return src[size:]
  7877  }
  7878  
  7879  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7880  func (u *UVM_MM_INITIALIZE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7881      // Construct a slice backed by dst's underlying memory.
  7882      var buf []byte
  7883      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7884      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7885      hdr.Len = u.SizeBytes()
  7886      hdr.Cap = u.SizeBytes()
  7887  
  7888      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7889      // Since we bypassed the compiler's escape analysis, indicate that u
  7890      // must live until the use above.
  7891      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7892      return length, err
  7893  }
  7894  
  7895  // CopyOut implements marshal.Marshallable.CopyOut.
  7896  func (u *UVM_MM_INITIALIZE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7897      return u.CopyOutN(cc, addr, u.SizeBytes())
  7898  }
  7899  
  7900  // CopyInN implements marshal.Marshallable.CopyInN.
  7901  func (u *UVM_MM_INITIALIZE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7902      // Construct a slice backed by dst's underlying memory.
  7903      var buf []byte
  7904      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7905      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7906      hdr.Len = u.SizeBytes()
  7907      hdr.Cap = u.SizeBytes()
  7908  
  7909      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  7910      // Since we bypassed the compiler's escape analysis, indicate that u
  7911      // must live until the use above.
  7912      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7913      return length, err
  7914  }
  7915  
  7916  // CopyIn implements marshal.Marshallable.CopyIn.
  7917  func (u *UVM_MM_INITIALIZE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  7918      return u.CopyInN(cc, addr, u.SizeBytes())
  7919  }
  7920  
  7921  // WriteTo implements io.WriterTo.WriteTo.
  7922  func (u *UVM_MM_INITIALIZE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  7923      // Construct a slice backed by dst's underlying memory.
  7924      var buf []byte
  7925      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7926      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7927      hdr.Len = u.SizeBytes()
  7928      hdr.Cap = u.SizeBytes()
  7929  
  7930      length, err := writer.Write(buf)
  7931      // Since we bypassed the compiler's escape analysis, indicate that u
  7932      // must live until the use above.
  7933      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  7934      return int64(length), err
  7935  }
  7936  
  7937  // SizeBytes implements marshal.Marshallable.SizeBytes.
  7938  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) SizeBytes() int {
  7939      return 5 +
  7940          1*3
  7941  }
  7942  
  7943  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  7944  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) MarshalBytes(dst []byte) []byte {
  7945      dst[0] = byte(u.PageableMemAccess)
  7946      dst = dst[1:]
  7947      for idx := 0; idx < 3; idx++ {
  7948          dst[0] = byte(u.Pad[idx])
  7949          dst = dst[1:]
  7950      }
  7951      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  7952      dst = dst[4:]
  7953      return dst
  7954  }
  7955  
  7956  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  7957  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) UnmarshalBytes(src []byte) []byte {
  7958      u.PageableMemAccess = uint8(src[0])
  7959      src = src[1:]
  7960      for idx := 0; idx < 3; idx++ {
  7961          u.Pad[idx] = src[0]
  7962          src = src[1:]
  7963      }
  7964      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  7965      src = src[4:]
  7966      return src
  7967  }
  7968  
  7969  // Packed implements marshal.Marshallable.Packed.
  7970  //go:nosplit
  7971  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) Packed() bool {
  7972      return true
  7973  }
  7974  
  7975  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  7976  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) MarshalUnsafe(dst []byte) []byte {
  7977      size := u.SizeBytes()
  7978      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  7979      return dst[size:]
  7980  }
  7981  
  7982  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  7983  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  7984      size := u.SizeBytes()
  7985      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  7986      return src[size:]
  7987  }
  7988  
  7989  // CopyOutN implements marshal.Marshallable.CopyOutN.
  7990  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  7991      // Construct a slice backed by dst's underlying memory.
  7992      var buf []byte
  7993      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  7994      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  7995      hdr.Len = u.SizeBytes()
  7996      hdr.Cap = u.SizeBytes()
  7997  
  7998      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  7999      // Since we bypassed the compiler's escape analysis, indicate that u
  8000      // must live until the use above.
  8001      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8002      return length, err
  8003  }
  8004  
  8005  // CopyOut implements marshal.Marshallable.CopyOut.
  8006  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8007      return u.CopyOutN(cc, addr, u.SizeBytes())
  8008  }
  8009  
  8010  // CopyInN implements marshal.Marshallable.CopyInN.
  8011  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8012      // Construct a slice backed by dst's underlying memory.
  8013      var buf []byte
  8014      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8015      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8016      hdr.Len = u.SizeBytes()
  8017      hdr.Cap = u.SizeBytes()
  8018  
  8019      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8020      // Since we bypassed the compiler's escape analysis, indicate that u
  8021      // must live until the use above.
  8022      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8023      return length, err
  8024  }
  8025  
  8026  // CopyIn implements marshal.Marshallable.CopyIn.
  8027  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8028      return u.CopyInN(cc, addr, u.SizeBytes())
  8029  }
  8030  
  8031  // WriteTo implements io.WriterTo.WriteTo.
  8032  func (u *UVM_PAGEABLE_MEM_ACCESS_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8033      // Construct a slice backed by dst's underlying memory.
  8034      var buf []byte
  8035      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8036      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8037      hdr.Len = u.SizeBytes()
  8038      hdr.Cap = u.SizeBytes()
  8039  
  8040      length, err := writer.Write(buf)
  8041      // Since we bypassed the compiler's escape analysis, indicate that u
  8042      // must live until the use above.
  8043      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8044      return int64(length), err
  8045  }
  8046  
  8047  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8048  func (p *UVM_REGISTER_CHANNEL_PARAMS) SizeBytes() int {
  8049      return 24 +
  8050          1*16 +
  8051          (*Handle)(nil).SizeBytes() +
  8052          (*Handle)(nil).SizeBytes() +
  8053          1*4 +
  8054          1*4
  8055  }
  8056  
  8057  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8058  func (p *UVM_REGISTER_CHANNEL_PARAMS) MarshalBytes(dst []byte) []byte {
  8059      for idx := 0; idx < 16; idx++ {
  8060          dst[0] = byte(p.GPUUUID[idx])
  8061          dst = dst[1:]
  8062      }
  8063      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD))
  8064      dst = dst[4:]
  8065      dst = p.HClient.MarshalUnsafe(dst)
  8066      dst = p.HChannel.MarshalUnsafe(dst)
  8067      for idx := 0; idx < 4; idx++ {
  8068          dst[0] = byte(p.Pad[idx])
  8069          dst = dst[1:]
  8070      }
  8071      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Base))
  8072      dst = dst[8:]
  8073      hostarch.ByteOrder.PutUint64(dst[:8], uint64(p.Length))
  8074      dst = dst[8:]
  8075      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus))
  8076      dst = dst[4:]
  8077      for idx := 0; idx < 4; idx++ {
  8078          dst[0] = byte(p.Pad0[idx])
  8079          dst = dst[1:]
  8080      }
  8081      return dst
  8082  }
  8083  
  8084  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8085  func (p *UVM_REGISTER_CHANNEL_PARAMS) UnmarshalBytes(src []byte) []byte {
  8086      for idx := 0; idx < 16; idx++ {
  8087          p.GPUUUID[idx] = uint8(src[0])
  8088          src = src[1:]
  8089      }
  8090      p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  8091      src = src[4:]
  8092      src = p.HClient.UnmarshalUnsafe(src)
  8093      src = p.HChannel.UnmarshalUnsafe(src)
  8094      for idx := 0; idx < 4; idx++ {
  8095          p.Pad[idx] = src[0]
  8096          src = src[1:]
  8097      }
  8098      p.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8099      src = src[8:]
  8100      p.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8101      src = src[8:]
  8102      p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8103      src = src[4:]
  8104      for idx := 0; idx < 4; idx++ {
  8105          p.Pad0[idx] = src[0]
  8106          src = src[1:]
  8107      }
  8108      return src
  8109  }
  8110  
  8111  // Packed implements marshal.Marshallable.Packed.
  8112  //go:nosplit
  8113  func (p *UVM_REGISTER_CHANNEL_PARAMS) Packed() bool {
  8114      return p.HChannel.Packed() && p.HClient.Packed()
  8115  }
  8116  
  8117  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8118  func (p *UVM_REGISTER_CHANNEL_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8119      if p.HChannel.Packed() && p.HClient.Packed() {
  8120          size := p.SizeBytes()
  8121          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  8122          return dst[size:]
  8123      }
  8124      // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  8125      return p.MarshalBytes(dst)
  8126  }
  8127  
  8128  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8129  func (p *UVM_REGISTER_CHANNEL_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8130      if p.HChannel.Packed() && p.HClient.Packed() {
  8131          size := p.SizeBytes()
  8132          gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  8133          return src[size:]
  8134      }
  8135      // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  8136      return p.UnmarshalBytes(src)
  8137  }
  8138  
  8139  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8140  func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8141      if !p.HChannel.Packed() && p.HClient.Packed() {
  8142          // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8143          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8144          p.MarshalBytes(buf) // escapes: fallback.
  8145          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8146      }
  8147  
  8148      // Construct a slice backed by dst's underlying memory.
  8149      var buf []byte
  8150      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8151      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8152      hdr.Len = p.SizeBytes()
  8153      hdr.Cap = p.SizeBytes()
  8154  
  8155      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8156      // Since we bypassed the compiler's escape analysis, indicate that p
  8157      // must live until the use above.
  8158      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8159      return length, err
  8160  }
  8161  
  8162  // CopyOut implements marshal.Marshallable.CopyOut.
  8163  func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8164      return p.CopyOutN(cc, addr, p.SizeBytes())
  8165  }
  8166  
  8167  // CopyInN implements marshal.Marshallable.CopyInN.
  8168  func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8169      if !p.HChannel.Packed() && p.HClient.Packed() {
  8170          // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  8171          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8172          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8173          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  8174          // partially unmarshalled struct.
  8175          p.UnmarshalBytes(buf) // escapes: fallback.
  8176          return length, err
  8177      }
  8178  
  8179      // Construct a slice backed by dst's underlying memory.
  8180      var buf []byte
  8181      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8182      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8183      hdr.Len = p.SizeBytes()
  8184      hdr.Cap = p.SizeBytes()
  8185  
  8186      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8187      // Since we bypassed the compiler's escape analysis, indicate that p
  8188      // must live until the use above.
  8189      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8190      return length, err
  8191  }
  8192  
  8193  // CopyIn implements marshal.Marshallable.CopyIn.
  8194  func (p *UVM_REGISTER_CHANNEL_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8195      return p.CopyInN(cc, addr, p.SizeBytes())
  8196  }
  8197  
  8198  // WriteTo implements io.WriterTo.WriteTo.
  8199  func (p *UVM_REGISTER_CHANNEL_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8200      if !p.HChannel.Packed() && p.HClient.Packed() {
  8201          // Type UVM_REGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8202          buf := make([]byte, p.SizeBytes())
  8203          p.MarshalBytes(buf)
  8204          length, err := writer.Write(buf)
  8205          return int64(length), err
  8206      }
  8207  
  8208      // Construct a slice backed by dst's underlying memory.
  8209      var buf []byte
  8210      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8211      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8212      hdr.Len = p.SizeBytes()
  8213      hdr.Cap = p.SizeBytes()
  8214  
  8215      length, err := writer.Write(buf)
  8216      // Since we bypassed the compiler's escape analysis, indicate that p
  8217      // must live until the use above.
  8218      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8219      return int64(length), err
  8220  }
  8221  
  8222  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8223  func (p *UVM_REGISTER_GPU_PARAMS) SizeBytes() int {
  8224      return 13 +
  8225          1*16 +
  8226          1*3 +
  8227          (*Handle)(nil).SizeBytes() +
  8228          (*Handle)(nil).SizeBytes()
  8229  }
  8230  
  8231  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8232  func (p *UVM_REGISTER_GPU_PARAMS) MarshalBytes(dst []byte) []byte {
  8233      for idx := 0; idx < 16; idx++ {
  8234          dst[0] = byte(p.GPUUUID[idx])
  8235          dst = dst[1:]
  8236      }
  8237      dst[0] = byte(p.NumaEnabled)
  8238      dst = dst[1:]
  8239      for idx := 0; idx < 3; idx++ {
  8240          dst[0] = byte(p.Pad[idx])
  8241          dst = dst[1:]
  8242      }
  8243      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.NumaNodeID))
  8244      dst = dst[4:]
  8245      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD))
  8246      dst = dst[4:]
  8247      dst = p.HClient.MarshalUnsafe(dst)
  8248      dst = p.HSMCPartRef.MarshalUnsafe(dst)
  8249      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus))
  8250      dst = dst[4:]
  8251      return dst
  8252  }
  8253  
  8254  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8255  func (p *UVM_REGISTER_GPU_PARAMS) UnmarshalBytes(src []byte) []byte {
  8256      for idx := 0; idx < 16; idx++ {
  8257          p.GPUUUID[idx] = uint8(src[0])
  8258          src = src[1:]
  8259      }
  8260      p.NumaEnabled = uint8(src[0])
  8261      src = src[1:]
  8262      for idx := 0; idx < 3; idx++ {
  8263          p.Pad[idx] = src[0]
  8264          src = src[1:]
  8265      }
  8266      p.NumaNodeID = int32(hostarch.ByteOrder.Uint32(src[:4]))
  8267      src = src[4:]
  8268      p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  8269      src = src[4:]
  8270      src = p.HClient.UnmarshalUnsafe(src)
  8271      src = p.HSMCPartRef.UnmarshalUnsafe(src)
  8272      p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8273      src = src[4:]
  8274      return src
  8275  }
  8276  
  8277  // Packed implements marshal.Marshallable.Packed.
  8278  //go:nosplit
  8279  func (p *UVM_REGISTER_GPU_PARAMS) Packed() bool {
  8280      return p.HClient.Packed() && p.HSMCPartRef.Packed()
  8281  }
  8282  
  8283  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8284  func (p *UVM_REGISTER_GPU_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8285      if p.HClient.Packed() && p.HSMCPartRef.Packed() {
  8286          size := p.SizeBytes()
  8287          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  8288          return dst[size:]
  8289      }
  8290      // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  8291      return p.MarshalBytes(dst)
  8292  }
  8293  
  8294  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8295  func (p *UVM_REGISTER_GPU_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8296      if p.HClient.Packed() && p.HSMCPartRef.Packed() {
  8297          size := p.SizeBytes()
  8298          gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  8299          return src[size:]
  8300      }
  8301      // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  8302      return p.UnmarshalBytes(src)
  8303  }
  8304  
  8305  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8306  func (p *UVM_REGISTER_GPU_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8307      if !p.HClient.Packed() && p.HSMCPartRef.Packed() {
  8308          // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8309          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8310          p.MarshalBytes(buf) // escapes: fallback.
  8311          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8312      }
  8313  
  8314      // Construct a slice backed by dst's underlying memory.
  8315      var buf []byte
  8316      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8317      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8318      hdr.Len = p.SizeBytes()
  8319      hdr.Cap = p.SizeBytes()
  8320  
  8321      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8322      // Since we bypassed the compiler's escape analysis, indicate that p
  8323      // must live until the use above.
  8324      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8325      return length, err
  8326  }
  8327  
  8328  // CopyOut implements marshal.Marshallable.CopyOut.
  8329  func (p *UVM_REGISTER_GPU_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8330      return p.CopyOutN(cc, addr, p.SizeBytes())
  8331  }
  8332  
  8333  // CopyInN implements marshal.Marshallable.CopyInN.
  8334  func (p *UVM_REGISTER_GPU_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8335      if !p.HClient.Packed() && p.HSMCPartRef.Packed() {
  8336          // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  8337          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8338          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8339          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  8340          // partially unmarshalled struct.
  8341          p.UnmarshalBytes(buf) // escapes: fallback.
  8342          return length, err
  8343      }
  8344  
  8345      // Construct a slice backed by dst's underlying memory.
  8346      var buf []byte
  8347      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8348      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8349      hdr.Len = p.SizeBytes()
  8350      hdr.Cap = p.SizeBytes()
  8351  
  8352      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8353      // Since we bypassed the compiler's escape analysis, indicate that p
  8354      // must live until the use above.
  8355      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8356      return length, err
  8357  }
  8358  
  8359  // CopyIn implements marshal.Marshallable.CopyIn.
  8360  func (p *UVM_REGISTER_GPU_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8361      return p.CopyInN(cc, addr, p.SizeBytes())
  8362  }
  8363  
  8364  // WriteTo implements io.WriterTo.WriteTo.
  8365  func (p *UVM_REGISTER_GPU_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8366      if !p.HClient.Packed() && p.HSMCPartRef.Packed() {
  8367          // Type UVM_REGISTER_GPU_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8368          buf := make([]byte, p.SizeBytes())
  8369          p.MarshalBytes(buf)
  8370          length, err := writer.Write(buf)
  8371          return int64(length), err
  8372      }
  8373  
  8374      // Construct a slice backed by dst's underlying memory.
  8375      var buf []byte
  8376      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8377      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8378      hdr.Len = p.SizeBytes()
  8379      hdr.Cap = p.SizeBytes()
  8380  
  8381      length, err := writer.Write(buf)
  8382      // Since we bypassed the compiler's escape analysis, indicate that p
  8383      // must live until the use above.
  8384      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8385      return int64(length), err
  8386  }
  8387  
  8388  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8389  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) SizeBytes() int {
  8390      return 8 +
  8391          1*16 +
  8392          (*Handle)(nil).SizeBytes() +
  8393          (*Handle)(nil).SizeBytes()
  8394  }
  8395  
  8396  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8397  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) MarshalBytes(dst []byte) []byte {
  8398      for idx := 0; idx < 16; idx++ {
  8399          dst[0] = byte(p.GPUUUID[idx])
  8400          dst = dst[1:]
  8401      }
  8402      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMCtrlFD))
  8403      dst = dst[4:]
  8404      dst = p.HClient.MarshalUnsafe(dst)
  8405      dst = p.HVASpace.MarshalUnsafe(dst)
  8406      hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.RMStatus))
  8407      dst = dst[4:]
  8408      return dst
  8409  }
  8410  
  8411  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8412  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) UnmarshalBytes(src []byte) []byte {
  8413      for idx := 0; idx < 16; idx++ {
  8414          p.GPUUUID[idx] = uint8(src[0])
  8415          src = src[1:]
  8416      }
  8417      p.RMCtrlFD = int32(hostarch.ByteOrder.Uint32(src[:4]))
  8418      src = src[4:]
  8419      src = p.HClient.UnmarshalUnsafe(src)
  8420      src = p.HVASpace.UnmarshalUnsafe(src)
  8421      p.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8422      src = src[4:]
  8423      return src
  8424  }
  8425  
  8426  // Packed implements marshal.Marshallable.Packed.
  8427  //go:nosplit
  8428  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) Packed() bool {
  8429      return p.HClient.Packed() && p.HVASpace.Packed()
  8430  }
  8431  
  8432  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8433  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8434      if p.HClient.Packed() && p.HVASpace.Packed() {
  8435          size := p.SizeBytes()
  8436          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size))
  8437          return dst[size:]
  8438      }
  8439      // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  8440      return p.MarshalBytes(dst)
  8441  }
  8442  
  8443  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8444  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8445      if p.HClient.Packed() && p.HVASpace.Packed() {
  8446          size := p.SizeBytes()
  8447          gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size))
  8448          return src[size:]
  8449      }
  8450      // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  8451      return p.UnmarshalBytes(src)
  8452  }
  8453  
  8454  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8455  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8456      if !p.HClient.Packed() && p.HVASpace.Packed() {
  8457          // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8458          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8459          p.MarshalBytes(buf) // escapes: fallback.
  8460          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8461      }
  8462  
  8463      // Construct a slice backed by dst's underlying memory.
  8464      var buf []byte
  8465      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8466      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8467      hdr.Len = p.SizeBytes()
  8468      hdr.Cap = p.SizeBytes()
  8469  
  8470      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8471      // Since we bypassed the compiler's escape analysis, indicate that p
  8472      // must live until the use above.
  8473      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8474      return length, err
  8475  }
  8476  
  8477  // CopyOut implements marshal.Marshallable.CopyOut.
  8478  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8479      return p.CopyOutN(cc, addr, p.SizeBytes())
  8480  }
  8481  
  8482  // CopyInN implements marshal.Marshallable.CopyInN.
  8483  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8484      if !p.HClient.Packed() && p.HVASpace.Packed() {
  8485          // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  8486          buf := cc.CopyScratchBuffer(p.SizeBytes()) // escapes: okay.
  8487          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8488          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  8489          // partially unmarshalled struct.
  8490          p.UnmarshalBytes(buf) // escapes: fallback.
  8491          return length, err
  8492      }
  8493  
  8494      // Construct a slice backed by dst's underlying memory.
  8495      var buf []byte
  8496      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8497      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8498      hdr.Len = p.SizeBytes()
  8499      hdr.Cap = p.SizeBytes()
  8500  
  8501      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8502      // Since we bypassed the compiler's escape analysis, indicate that p
  8503      // must live until the use above.
  8504      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8505      return length, err
  8506  }
  8507  
  8508  // CopyIn implements marshal.Marshallable.CopyIn.
  8509  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8510      return p.CopyInN(cc, addr, p.SizeBytes())
  8511  }
  8512  
  8513  // WriteTo implements io.WriterTo.WriteTo.
  8514  func (p *UVM_REGISTER_GPU_VASPACE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8515      if !p.HClient.Packed() && p.HVASpace.Packed() {
  8516          // Type UVM_REGISTER_GPU_VASPACE_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8517          buf := make([]byte, p.SizeBytes())
  8518          p.MarshalBytes(buf)
  8519          length, err := writer.Write(buf)
  8520          return int64(length), err
  8521      }
  8522  
  8523      // Construct a slice backed by dst's underlying memory.
  8524      var buf []byte
  8525      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8526      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p)))
  8527      hdr.Len = p.SizeBytes()
  8528      hdr.Cap = p.SizeBytes()
  8529  
  8530      length, err := writer.Write(buf)
  8531      // Since we bypassed the compiler's escape analysis, indicate that p
  8532      // must live until the use above.
  8533      runtime.KeepAlive(p) // escapes: replaced by intrinsic.
  8534      return int64(length), err
  8535  }
  8536  
  8537  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8538  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) SizeBytes() int {
  8539      return 4 +
  8540          1*16 +
  8541          (*Handle)(nil).SizeBytes() +
  8542          (*Handle)(nil).SizeBytes()
  8543  }
  8544  
  8545  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8546  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) MarshalBytes(dst []byte) []byte {
  8547      for idx := 0; idx < 16; idx++ {
  8548          dst[0] = byte(u.GPUUUID[idx])
  8549          dst = dst[1:]
  8550      }
  8551      dst = u.HClient.MarshalUnsafe(dst)
  8552      dst = u.HChannel.MarshalUnsafe(dst)
  8553      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  8554      dst = dst[4:]
  8555      return dst
  8556  }
  8557  
  8558  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8559  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) UnmarshalBytes(src []byte) []byte {
  8560      for idx := 0; idx < 16; idx++ {
  8561          u.GPUUUID[idx] = uint8(src[0])
  8562          src = src[1:]
  8563      }
  8564      src = u.HClient.UnmarshalUnsafe(src)
  8565      src = u.HChannel.UnmarshalUnsafe(src)
  8566      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8567      src = src[4:]
  8568      return src
  8569  }
  8570  
  8571  // Packed implements marshal.Marshallable.Packed.
  8572  //go:nosplit
  8573  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) Packed() bool {
  8574      return u.HChannel.Packed() && u.HClient.Packed()
  8575  }
  8576  
  8577  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8578  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8579      if u.HChannel.Packed() && u.HClient.Packed() {
  8580          size := u.SizeBytes()
  8581          gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  8582          return dst[size:]
  8583      }
  8584      // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to MarshalBytes.
  8585      return u.MarshalBytes(dst)
  8586  }
  8587  
  8588  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8589  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8590      if u.HChannel.Packed() && u.HClient.Packed() {
  8591          size := u.SizeBytes()
  8592          gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  8593          return src[size:]
  8594      }
  8595      // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fallback to UnmarshalBytes.
  8596      return u.UnmarshalBytes(src)
  8597  }
  8598  
  8599  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8600  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8601      if !u.HChannel.Packed() && u.HClient.Packed() {
  8602          // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8603          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  8604          u.MarshalBytes(buf) // escapes: fallback.
  8605          return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8606      }
  8607  
  8608      // Construct a slice backed by dst's underlying memory.
  8609      var buf []byte
  8610      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8611      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8612      hdr.Len = u.SizeBytes()
  8613      hdr.Cap = u.SizeBytes()
  8614  
  8615      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8616      // Since we bypassed the compiler's escape analysis, indicate that u
  8617      // must live until the use above.
  8618      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8619      return length, err
  8620  }
  8621  
  8622  // CopyOut implements marshal.Marshallable.CopyOut.
  8623  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8624      return u.CopyOutN(cc, addr, u.SizeBytes())
  8625  }
  8626  
  8627  // CopyInN implements marshal.Marshallable.CopyInN.
  8628  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8629      if !u.HChannel.Packed() && u.HClient.Packed() {
  8630          // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to UnmarshalBytes.
  8631          buf := cc.CopyScratchBuffer(u.SizeBytes()) // escapes: okay.
  8632          length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8633          // Unmarshal unconditionally. If we had a short copy-in, this results in a
  8634          // partially unmarshalled struct.
  8635          u.UnmarshalBytes(buf) // escapes: fallback.
  8636          return length, err
  8637      }
  8638  
  8639      // Construct a slice backed by dst's underlying memory.
  8640      var buf []byte
  8641      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8642      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8643      hdr.Len = u.SizeBytes()
  8644      hdr.Cap = u.SizeBytes()
  8645  
  8646      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8647      // Since we bypassed the compiler's escape analysis, indicate that u
  8648      // must live until the use above.
  8649      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8650      return length, err
  8651  }
  8652  
  8653  // CopyIn implements marshal.Marshallable.CopyIn.
  8654  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8655      return u.CopyInN(cc, addr, u.SizeBytes())
  8656  }
  8657  
  8658  // WriteTo implements io.WriterTo.WriteTo.
  8659  func (u *UVM_UNREGISTER_CHANNEL_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8660      if !u.HChannel.Packed() && u.HClient.Packed() {
  8661          // Type UVM_UNREGISTER_CHANNEL_PARAMS doesn't have a packed layout in memory, fall back to MarshalBytes.
  8662          buf := make([]byte, u.SizeBytes())
  8663          u.MarshalBytes(buf)
  8664          length, err := writer.Write(buf)
  8665          return int64(length), err
  8666      }
  8667  
  8668      // Construct a slice backed by dst's underlying memory.
  8669      var buf []byte
  8670      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8671      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8672      hdr.Len = u.SizeBytes()
  8673      hdr.Cap = u.SizeBytes()
  8674  
  8675      length, err := writer.Write(buf)
  8676      // Since we bypassed the compiler's escape analysis, indicate that u
  8677      // must live until the use above.
  8678      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8679      return int64(length), err
  8680  }
  8681  
  8682  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8683  func (u *UVM_UNREGISTER_GPU_PARAMS) SizeBytes() int {
  8684      return 4 +
  8685          1*16
  8686  }
  8687  
  8688  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8689  func (u *UVM_UNREGISTER_GPU_PARAMS) MarshalBytes(dst []byte) []byte {
  8690      for idx := 0; idx < 16; idx++ {
  8691          dst[0] = byte(u.GPUUUID[idx])
  8692          dst = dst[1:]
  8693      }
  8694      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  8695      dst = dst[4:]
  8696      return dst
  8697  }
  8698  
  8699  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8700  func (u *UVM_UNREGISTER_GPU_PARAMS) UnmarshalBytes(src []byte) []byte {
  8701      for idx := 0; idx < 16; idx++ {
  8702          u.GPUUUID[idx] = uint8(src[0])
  8703          src = src[1:]
  8704      }
  8705      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8706      src = src[4:]
  8707      return src
  8708  }
  8709  
  8710  // Packed implements marshal.Marshallable.Packed.
  8711  //go:nosplit
  8712  func (u *UVM_UNREGISTER_GPU_PARAMS) Packed() bool {
  8713      return true
  8714  }
  8715  
  8716  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8717  func (u *UVM_UNREGISTER_GPU_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8718      size := u.SizeBytes()
  8719      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  8720      return dst[size:]
  8721  }
  8722  
  8723  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8724  func (u *UVM_UNREGISTER_GPU_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8725      size := u.SizeBytes()
  8726      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  8727      return src[size:]
  8728  }
  8729  
  8730  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8731  func (u *UVM_UNREGISTER_GPU_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8732      // Construct a slice backed by dst's underlying memory.
  8733      var buf []byte
  8734      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8735      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8736      hdr.Len = u.SizeBytes()
  8737      hdr.Cap = u.SizeBytes()
  8738  
  8739      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8740      // Since we bypassed the compiler's escape analysis, indicate that u
  8741      // must live until the use above.
  8742      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8743      return length, err
  8744  }
  8745  
  8746  // CopyOut implements marshal.Marshallable.CopyOut.
  8747  func (u *UVM_UNREGISTER_GPU_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8748      return u.CopyOutN(cc, addr, u.SizeBytes())
  8749  }
  8750  
  8751  // CopyInN implements marshal.Marshallable.CopyInN.
  8752  func (u *UVM_UNREGISTER_GPU_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8753      // Construct a slice backed by dst's underlying memory.
  8754      var buf []byte
  8755      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8756      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8757      hdr.Len = u.SizeBytes()
  8758      hdr.Cap = u.SizeBytes()
  8759  
  8760      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8761      // Since we bypassed the compiler's escape analysis, indicate that u
  8762      // must live until the use above.
  8763      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8764      return length, err
  8765  }
  8766  
  8767  // CopyIn implements marshal.Marshallable.CopyIn.
  8768  func (u *UVM_UNREGISTER_GPU_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8769      return u.CopyInN(cc, addr, u.SizeBytes())
  8770  }
  8771  
  8772  // WriteTo implements io.WriterTo.WriteTo.
  8773  func (u *UVM_UNREGISTER_GPU_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8774      // Construct a slice backed by dst's underlying memory.
  8775      var buf []byte
  8776      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8777      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8778      hdr.Len = u.SizeBytes()
  8779      hdr.Cap = u.SizeBytes()
  8780  
  8781      length, err := writer.Write(buf)
  8782      // Since we bypassed the compiler's escape analysis, indicate that u
  8783      // must live until the use above.
  8784      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8785      return int64(length), err
  8786  }
  8787  
  8788  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8789  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) SizeBytes() int {
  8790      return 4 +
  8791          1*16
  8792  }
  8793  
  8794  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8795  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) MarshalBytes(dst []byte) []byte {
  8796      for idx := 0; idx < 16; idx++ {
  8797          dst[0] = byte(u.GPUUUID[idx])
  8798          dst = dst[1:]
  8799      }
  8800      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  8801      dst = dst[4:]
  8802      return dst
  8803  }
  8804  
  8805  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8806  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) UnmarshalBytes(src []byte) []byte {
  8807      for idx := 0; idx < 16; idx++ {
  8808          u.GPUUUID[idx] = uint8(src[0])
  8809          src = src[1:]
  8810      }
  8811      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8812      src = src[4:]
  8813      return src
  8814  }
  8815  
  8816  // Packed implements marshal.Marshallable.Packed.
  8817  //go:nosplit
  8818  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) Packed() bool {
  8819      return true
  8820  }
  8821  
  8822  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8823  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8824      size := u.SizeBytes()
  8825      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  8826      return dst[size:]
  8827  }
  8828  
  8829  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8830  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8831      size := u.SizeBytes()
  8832      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  8833      return src[size:]
  8834  }
  8835  
  8836  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8837  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8838      // Construct a slice backed by dst's underlying memory.
  8839      var buf []byte
  8840      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8841      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8842      hdr.Len = u.SizeBytes()
  8843      hdr.Cap = u.SizeBytes()
  8844  
  8845      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8846      // Since we bypassed the compiler's escape analysis, indicate that u
  8847      // must live until the use above.
  8848      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8849      return length, err
  8850  }
  8851  
  8852  // CopyOut implements marshal.Marshallable.CopyOut.
  8853  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8854      return u.CopyOutN(cc, addr, u.SizeBytes())
  8855  }
  8856  
  8857  // CopyInN implements marshal.Marshallable.CopyInN.
  8858  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8859      // Construct a slice backed by dst's underlying memory.
  8860      var buf []byte
  8861      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8862      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8863      hdr.Len = u.SizeBytes()
  8864      hdr.Cap = u.SizeBytes()
  8865  
  8866      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8867      // Since we bypassed the compiler's escape analysis, indicate that u
  8868      // must live until the use above.
  8869      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8870      return length, err
  8871  }
  8872  
  8873  // CopyIn implements marshal.Marshallable.CopyIn.
  8874  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8875      return u.CopyInN(cc, addr, u.SizeBytes())
  8876  }
  8877  
  8878  // WriteTo implements io.WriterTo.WriteTo.
  8879  func (u *UVM_UNREGISTER_GPU_VASPACE_PARAMS) WriteTo(writer io.Writer) (int64, 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 := writer.Write(buf)
  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 int64(length), err
  8892  }
  8893  
  8894  // SizeBytes implements marshal.Marshallable.SizeBytes.
  8895  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) SizeBytes() int {
  8896      return 20 +
  8897          1*4
  8898  }
  8899  
  8900  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  8901  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) MarshalBytes(dst []byte) []byte {
  8902      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Base))
  8903      dst = dst[8:]
  8904      hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Length))
  8905      dst = dst[8:]
  8906      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.RMStatus))
  8907      dst = dst[4:]
  8908      for idx := 0; idx < 4; idx++ {
  8909          dst[0] = byte(u.Pad0[idx])
  8910          dst = dst[1:]
  8911      }
  8912      return dst
  8913  }
  8914  
  8915  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  8916  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) UnmarshalBytes(src []byte) []byte {
  8917      u.Base = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8918      src = src[8:]
  8919      u.Length = uint64(hostarch.ByteOrder.Uint64(src[:8]))
  8920      src = src[8:]
  8921      u.RMStatus = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  8922      src = src[4:]
  8923      for idx := 0; idx < 4; idx++ {
  8924          u.Pad0[idx] = src[0]
  8925          src = src[1:]
  8926      }
  8927      return src
  8928  }
  8929  
  8930  // Packed implements marshal.Marshallable.Packed.
  8931  //go:nosplit
  8932  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) Packed() bool {
  8933      return true
  8934  }
  8935  
  8936  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  8937  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) MarshalUnsafe(dst []byte) []byte {
  8938      size := u.SizeBytes()
  8939      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  8940      return dst[size:]
  8941  }
  8942  
  8943  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  8944  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) UnmarshalUnsafe(src []byte) []byte {
  8945      size := u.SizeBytes()
  8946      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  8947      return src[size:]
  8948  }
  8949  
  8950  // CopyOutN implements marshal.Marshallable.CopyOutN.
  8951  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8952      // Construct a slice backed by dst's underlying memory.
  8953      var buf []byte
  8954      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8955      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8956      hdr.Len = u.SizeBytes()
  8957      hdr.Cap = u.SizeBytes()
  8958  
  8959      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  8960      // Since we bypassed the compiler's escape analysis, indicate that u
  8961      // must live until the use above.
  8962      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8963      return length, err
  8964  }
  8965  
  8966  // CopyOut implements marshal.Marshallable.CopyOut.
  8967  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8968      return u.CopyOutN(cc, addr, u.SizeBytes())
  8969  }
  8970  
  8971  // CopyInN implements marshal.Marshallable.CopyInN.
  8972  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  8973      // Construct a slice backed by dst's underlying memory.
  8974      var buf []byte
  8975      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8976      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8977      hdr.Len = u.SizeBytes()
  8978      hdr.Cap = u.SizeBytes()
  8979  
  8980      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  8981      // Since we bypassed the compiler's escape analysis, indicate that u
  8982      // must live until the use above.
  8983      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  8984      return length, err
  8985  }
  8986  
  8987  // CopyIn implements marshal.Marshallable.CopyIn.
  8988  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  8989      return u.CopyInN(cc, addr, u.SizeBytes())
  8990  }
  8991  
  8992  // WriteTo implements io.WriterTo.WriteTo.
  8993  func (u *UVM_VALIDATE_VA_RANGE_PARAMS) WriteTo(writer io.Writer) (int64, error) {
  8994      // Construct a slice backed by dst's underlying memory.
  8995      var buf []byte
  8996      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  8997      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  8998      hdr.Len = u.SizeBytes()
  8999      hdr.Cap = u.SizeBytes()
  9000  
  9001      length, err := writer.Write(buf)
  9002      // Since we bypassed the compiler's escape analysis, indicate that u
  9003      // must live until the use above.
  9004      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9005      return int64(length), err
  9006  }
  9007  
  9008  // SizeBytes implements marshal.Marshallable.SizeBytes.
  9009  func (u *UvmGpuMappingAttributes) SizeBytes() int {
  9010      return 20 +
  9011          1*16
  9012  }
  9013  
  9014  // MarshalBytes implements marshal.Marshallable.MarshalBytes.
  9015  func (u *UvmGpuMappingAttributes) MarshalBytes(dst []byte) []byte {
  9016      for idx := 0; idx < 16; idx++ {
  9017          dst[0] = byte(u.GPUUUID[idx])
  9018          dst = dst[1:]
  9019      }
  9020      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUMappingType))
  9021      dst = dst[4:]
  9022      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUCachingType))
  9023      dst = dst[4:]
  9024      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUFormatType))
  9025      dst = dst[4:]
  9026      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUElementBits))
  9027      dst = dst[4:]
  9028      hostarch.ByteOrder.PutUint32(dst[:4], uint32(u.GPUCompressionType))
  9029      dst = dst[4:]
  9030      return dst
  9031  }
  9032  
  9033  // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes.
  9034  func (u *UvmGpuMappingAttributes) UnmarshalBytes(src []byte) []byte {
  9035      for idx := 0; idx < 16; idx++ {
  9036          u.GPUUUID[idx] = src[0]
  9037          src = src[1:]
  9038      }
  9039      u.GPUMappingType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9040      src = src[4:]
  9041      u.GPUCachingType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9042      src = src[4:]
  9043      u.GPUFormatType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9044      src = src[4:]
  9045      u.GPUElementBits = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9046      src = src[4:]
  9047      u.GPUCompressionType = uint32(hostarch.ByteOrder.Uint32(src[:4]))
  9048      src = src[4:]
  9049      return src
  9050  }
  9051  
  9052  // Packed implements marshal.Marshallable.Packed.
  9053  //go:nosplit
  9054  func (u *UvmGpuMappingAttributes) Packed() bool {
  9055      return true
  9056  }
  9057  
  9058  // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe.
  9059  func (u *UvmGpuMappingAttributes) MarshalUnsafe(dst []byte) []byte {
  9060      size := u.SizeBytes()
  9061      gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size))
  9062      return dst[size:]
  9063  }
  9064  
  9065  // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe.
  9066  func (u *UvmGpuMappingAttributes) UnmarshalUnsafe(src []byte) []byte {
  9067      size := u.SizeBytes()
  9068      gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size))
  9069      return src[size:]
  9070  }
  9071  
  9072  // CopyOutN implements marshal.Marshallable.CopyOutN.
  9073  func (u *UvmGpuMappingAttributes) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9074      // Construct a slice backed by dst's underlying memory.
  9075      var buf []byte
  9076      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9077      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9078      hdr.Len = u.SizeBytes()
  9079      hdr.Cap = u.SizeBytes()
  9080  
  9081      length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay.
  9082      // Since we bypassed the compiler's escape analysis, indicate that u
  9083      // must live until the use above.
  9084      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9085      return length, err
  9086  }
  9087  
  9088  // CopyOut implements marshal.Marshallable.CopyOut.
  9089  func (u *UvmGpuMappingAttributes) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9090      return u.CopyOutN(cc, addr, u.SizeBytes())
  9091  }
  9092  
  9093  // CopyInN implements marshal.Marshallable.CopyInN.
  9094  func (u *UvmGpuMappingAttributes) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) {
  9095      // Construct a slice backed by dst's underlying memory.
  9096      var buf []byte
  9097      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9098      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9099      hdr.Len = u.SizeBytes()
  9100      hdr.Cap = u.SizeBytes()
  9101  
  9102      length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay.
  9103      // Since we bypassed the compiler's escape analysis, indicate that u
  9104      // must live until the use above.
  9105      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9106      return length, err
  9107  }
  9108  
  9109  // CopyIn implements marshal.Marshallable.CopyIn.
  9110  func (u *UvmGpuMappingAttributes) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) {
  9111      return u.CopyInN(cc, addr, u.SizeBytes())
  9112  }
  9113  
  9114  // WriteTo implements io.WriterTo.WriteTo.
  9115  func (u *UvmGpuMappingAttributes) WriteTo(writer io.Writer) (int64, error) {
  9116      // Construct a slice backed by dst's underlying memory.
  9117      var buf []byte
  9118      hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf))
  9119      hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u)))
  9120      hdr.Len = u.SizeBytes()
  9121      hdr.Cap = u.SizeBytes()
  9122  
  9123      length, err := writer.Write(buf)
  9124      // Since we bypassed the compiler's escape analysis, indicate that u
  9125      // must live until the use above.
  9126      runtime.KeepAlive(u) // escapes: replaced by intrinsic.
  9127      return int64(length), err
  9128  }
  9129