github.com/sagernet/gvisor@v0.0.0-20240428053021-e691de28565f/pkg/abi/linux/linux_abi_autogen_unsafe.go (about) 1 // Automatically generated marshal implementation. See tools/go_marshal. 2 3 package linux 4 5 import ( 6 "github.com/sagernet/gvisor/pkg/gohacks" 7 "github.com/sagernet/gvisor/pkg/hostarch" 8 "github.com/sagernet/gvisor/pkg/marshal" 9 "io" 10 "reflect" 11 "runtime" 12 "unsafe" 13 ) 14 15 // Marshallable types used by this file. 16 var _ marshal.Marshallable = (*BPFInstruction)(nil) 17 var _ marshal.Marshallable = (*CString)(nil) 18 var _ marshal.Marshallable = (*CapUserData)(nil) 19 var _ marshal.Marshallable = (*CapUserHeader)(nil) 20 var _ marshal.Marshallable = (*ClockT)(nil) 21 var _ marshal.Marshallable = (*CloneArgs)(nil) 22 var _ marshal.Marshallable = (*ControlMessageCredentials)(nil) 23 var _ marshal.Marshallable = (*ControlMessageHeader)(nil) 24 var _ marshal.Marshallable = (*ControlMessageIPPacketInfo)(nil) 25 var _ marshal.Marshallable = (*ControlMessageIPv6PacketInfo)(nil) 26 var _ marshal.Marshallable = (*ElfHeader64)(nil) 27 var _ marshal.Marshallable = (*ElfProg64)(nil) 28 var _ marshal.Marshallable = (*ElfSection64)(nil) 29 var _ marshal.Marshallable = (*ErrorName)(nil) 30 var _ marshal.Marshallable = (*EthtoolCmd)(nil) 31 var _ marshal.Marshallable = (*EthtoolGFeatures)(nil) 32 var _ marshal.Marshallable = (*EthtoolGetFeaturesBlock)(nil) 33 var _ marshal.Marshallable = (*ExtensionName)(nil) 34 var _ marshal.Marshallable = (*FOwnerEx)(nil) 35 var _ marshal.Marshallable = (*FUSEAccessIn)(nil) 36 var _ marshal.Marshallable = (*FUSEAttr)(nil) 37 var _ marshal.Marshallable = (*FUSEAttrOut)(nil) 38 var _ marshal.Marshallable = (*FUSECreateIn)(nil) 39 var _ marshal.Marshallable = (*FUSECreateMeta)(nil) 40 var _ marshal.Marshallable = (*FUSECreateOut)(nil) 41 var _ marshal.Marshallable = (*FUSEDirent)(nil) 42 var _ marshal.Marshallable = (*FUSEDirentMeta)(nil) 43 var _ marshal.Marshallable = (*FUSEDirents)(nil) 44 var _ marshal.Marshallable = (*FUSEEmptyIn)(nil) 45 var _ marshal.Marshallable = (*FUSEEntryOut)(nil) 46 var _ marshal.Marshallable = (*FUSEFallocateIn)(nil) 47 var _ marshal.Marshallable = (*FUSEFlushIn)(nil) 48 var _ marshal.Marshallable = (*FUSEFsyncIn)(nil) 49 var _ marshal.Marshallable = (*FUSEGetAttrIn)(nil) 50 var _ marshal.Marshallable = (*FUSEHeaderIn)(nil) 51 var _ marshal.Marshallable = (*FUSEHeaderOut)(nil) 52 var _ marshal.Marshallable = (*FUSEInitIn)(nil) 53 var _ marshal.Marshallable = (*FUSEInitOut)(nil) 54 var _ marshal.Marshallable = (*FUSELinkIn)(nil) 55 var _ marshal.Marshallable = (*FUSELookupIn)(nil) 56 var _ marshal.Marshallable = (*FUSEMkdirIn)(nil) 57 var _ marshal.Marshallable = (*FUSEMkdirMeta)(nil) 58 var _ marshal.Marshallable = (*FUSEMknodIn)(nil) 59 var _ marshal.Marshallable = (*FUSEMknodMeta)(nil) 60 var _ marshal.Marshallable = (*FUSEOpID)(nil) 61 var _ marshal.Marshallable = (*FUSEOpcode)(nil) 62 var _ marshal.Marshallable = (*FUSEOpenIn)(nil) 63 var _ marshal.Marshallable = (*FUSEOpenOut)(nil) 64 var _ marshal.Marshallable = (*FUSEReadIn)(nil) 65 var _ marshal.Marshallable = (*FUSEReleaseIn)(nil) 66 var _ marshal.Marshallable = (*FUSERenameIn)(nil) 67 var _ marshal.Marshallable = (*FUSERmDirIn)(nil) 68 var _ marshal.Marshallable = (*FUSESetAttrIn)(nil) 69 var _ marshal.Marshallable = (*FUSEStatfsOut)(nil) 70 var _ marshal.Marshallable = (*FUSESymlinkIn)(nil) 71 var _ marshal.Marshallable = (*FUSEUnlinkIn)(nil) 72 var _ marshal.Marshallable = (*FUSEWriteIn)(nil) 73 var _ marshal.Marshallable = (*FUSEWriteOut)(nil) 74 var _ marshal.Marshallable = (*FUSEWritePayloadIn)(nil) 75 var _ marshal.Marshallable = (*FileMode)(nil) 76 var _ marshal.Marshallable = (*Flock)(nil) 77 var _ marshal.Marshallable = (*ICMP6Filter)(nil) 78 var _ marshal.Marshallable = (*IFConf)(nil) 79 var _ marshal.Marshallable = (*IFReq)(nil) 80 var _ marshal.Marshallable = (*IOCallback)(nil) 81 var _ marshal.Marshallable = (*IOCqRingOffsets)(nil) 82 var _ marshal.Marshallable = (*IOEvent)(nil) 83 var _ marshal.Marshallable = (*IORingIndex)(nil) 84 var _ marshal.Marshallable = (*IORings)(nil) 85 var _ marshal.Marshallable = (*IOSqRingOffsets)(nil) 86 var _ marshal.Marshallable = (*IOUring)(nil) 87 var _ marshal.Marshallable = (*IOUringCqe)(nil) 88 var _ marshal.Marshallable = (*IOUringParams)(nil) 89 var _ marshal.Marshallable = (*IOUringSqe)(nil) 90 var _ marshal.Marshallable = (*IP6TEntry)(nil) 91 var _ marshal.Marshallable = (*IP6TIP)(nil) 92 var _ marshal.Marshallable = (*IP6TReplace)(nil) 93 var _ marshal.Marshallable = (*IPCPerm)(nil) 94 var _ marshal.Marshallable = (*IPTEntry)(nil) 95 var _ marshal.Marshallable = (*IPTGetEntries)(nil) 96 var _ marshal.Marshallable = (*IPTGetinfo)(nil) 97 var _ marshal.Marshallable = (*IPTIP)(nil) 98 var _ marshal.Marshallable = (*IPTOwnerInfo)(nil) 99 var _ marshal.Marshallable = (*IPTReplace)(nil) 100 var _ marshal.Marshallable = (*Inet6Addr)(nil) 101 var _ marshal.Marshallable = (*Inet6MulticastRequest)(nil) 102 var _ marshal.Marshallable = (*InetAddr)(nil) 103 var _ marshal.Marshallable = (*InetMulticastRequest)(nil) 104 var _ marshal.Marshallable = (*InetMulticastRequestWithNIC)(nil) 105 var _ marshal.Marshallable = (*InterfaceAddrMessage)(nil) 106 var _ marshal.Marshallable = (*InterfaceInfoMessage)(nil) 107 var _ marshal.Marshallable = (*ItimerVal)(nil) 108 var _ marshal.Marshallable = (*Itimerspec)(nil) 109 var _ marshal.Marshallable = (*KernelIP6TEntry)(nil) 110 var _ marshal.Marshallable = (*KernelIP6TGetEntries)(nil) 111 var _ marshal.Marshallable = (*KernelIPTEntry)(nil) 112 var _ marshal.Marshallable = (*KernelIPTGetEntries)(nil) 113 var _ marshal.Marshallable = (*Linger)(nil) 114 var _ marshal.Marshallable = (*MqAttr)(nil) 115 var _ marshal.Marshallable = (*MsgBuf)(nil) 116 var _ marshal.Marshallable = (*MsgInfo)(nil) 117 var _ marshal.Marshallable = (*MsqidDS)(nil) 118 var _ marshal.Marshallable = (*NFNATRange)(nil) 119 var _ marshal.Marshallable = (*NFNATRange2)(nil) 120 var _ marshal.Marshallable = (*NetlinkAttrHeader)(nil) 121 var _ marshal.Marshallable = (*NetlinkErrorMessage)(nil) 122 var _ marshal.Marshallable = (*NetlinkMessageHeader)(nil) 123 var _ marshal.Marshallable = (*NfNATIPV4MultiRangeCompat)(nil) 124 var _ marshal.Marshallable = (*NfNATIPV4Range)(nil) 125 var _ marshal.Marshallable = (*NumaPolicy)(nil) 126 var _ marshal.Marshallable = (*PollFD)(nil) 127 var _ marshal.Marshallable = (*RSeqCriticalSection)(nil) 128 var _ marshal.Marshallable = (*RobustListHead)(nil) 129 var _ marshal.Marshallable = (*RouteMessage)(nil) 130 var _ marshal.Marshallable = (*RtAttr)(nil) 131 var _ marshal.Marshallable = (*Rusage)(nil) 132 var _ marshal.Marshallable = (*SeccompData)(nil) 133 var _ marshal.Marshallable = (*SeccompNotif)(nil) 134 var _ marshal.Marshallable = (*SeccompNotifResp)(nil) 135 var _ marshal.Marshallable = (*SeccompNotifSizes)(nil) 136 var _ marshal.Marshallable = (*SemInfo)(nil) 137 var _ marshal.Marshallable = (*Sembuf)(nil) 138 var _ marshal.Marshallable = (*ShmInfo)(nil) 139 var _ marshal.Marshallable = (*ShmParams)(nil) 140 var _ marshal.Marshallable = (*ShmidDS)(nil) 141 var _ marshal.Marshallable = (*SigAction)(nil) 142 var _ marshal.Marshallable = (*Sigevent)(nil) 143 var _ marshal.Marshallable = (*SignalInfo)(nil) 144 var _ marshal.Marshallable = (*SignalSet)(nil) 145 var _ marshal.Marshallable = (*SignalStack)(nil) 146 var _ marshal.Marshallable = (*SignalfdSiginfo)(nil) 147 var _ marshal.Marshallable = (*SockAddrInet)(nil) 148 var _ marshal.Marshallable = (*SockAddrInet6)(nil) 149 var _ marshal.Marshallable = (*SockAddrLink)(nil) 150 var _ marshal.Marshallable = (*SockAddrNetlink)(nil) 151 var _ marshal.Marshallable = (*SockAddrUnix)(nil) 152 var _ marshal.Marshallable = (*SockErrCMsgIPv4)(nil) 153 var _ marshal.Marshallable = (*SockErrCMsgIPv6)(nil) 154 var _ marshal.Marshallable = (*SockExtendedErr)(nil) 155 var _ marshal.Marshallable = (*Statfs)(nil) 156 var _ marshal.Marshallable = (*Statx)(nil) 157 var _ marshal.Marshallable = (*StatxTimestamp)(nil) 158 var _ marshal.Marshallable = (*Sysinfo)(nil) 159 var _ marshal.Marshallable = (*TCPInfo)(nil) 160 var _ marshal.Marshallable = (*TableName)(nil) 161 var _ marshal.Marshallable = (*Termios)(nil) 162 var _ marshal.Marshallable = (*TimeT)(nil) 163 var _ marshal.Marshallable = (*TimerID)(nil) 164 var _ marshal.Marshallable = (*Timespec)(nil) 165 var _ marshal.Marshallable = (*Timeval)(nil) 166 var _ marshal.Marshallable = (*Tms)(nil) 167 var _ marshal.Marshallable = (*Utime)(nil) 168 var _ marshal.Marshallable = (*UtsName)(nil) 169 var _ marshal.Marshallable = (*VFIODeviceInfo)(nil) 170 var _ marshal.Marshallable = (*VFIOIommuType1DmaMap)(nil) 171 var _ marshal.Marshallable = (*VFIOIommuType1DmaUnmap)(nil) 172 var _ marshal.Marshallable = (*VFIOIrqInfo)(nil) 173 var _ marshal.Marshallable = (*VFIOIrqSet)(nil) 174 var _ marshal.Marshallable = (*VFIORegionInfo)(nil) 175 var _ marshal.Marshallable = (*WindowSize)(nil) 176 var _ marshal.Marshallable = (*Winsize)(nil) 177 var _ marshal.Marshallable = (*XTCounters)(nil) 178 var _ marshal.Marshallable = (*XTEntryMatch)(nil) 179 var _ marshal.Marshallable = (*XTEntryTarget)(nil) 180 var _ marshal.Marshallable = (*XTErrorTarget)(nil) 181 var _ marshal.Marshallable = (*XTGetRevision)(nil) 182 var _ marshal.Marshallable = (*XTNATTargetV0)(nil) 183 var _ marshal.Marshallable = (*XTNATTargetV1)(nil) 184 var _ marshal.Marshallable = (*XTNATTargetV2)(nil) 185 var _ marshal.Marshallable = (*XTOwnerMatchInfo)(nil) 186 var _ marshal.Marshallable = (*XTRedirectTarget)(nil) 187 var _ marshal.Marshallable = (*XTStandardTarget)(nil) 188 var _ marshal.Marshallable = (*XTTCP)(nil) 189 var _ marshal.Marshallable = (*XTUDP)(nil) 190 191 // SizeBytes implements marshal.Marshallable.SizeBytes. 192 func (i *IOCallback) SizeBytes() int { 193 return 64 194 } 195 196 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 197 func (i *IOCallback) MarshalBytes(dst []byte) []byte { 198 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Data)) 199 dst = dst[8:] 200 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Key)) 201 dst = dst[4:] 202 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 203 dst = dst[4:] 204 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.OpCode)) 205 dst = dst[2:] 206 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.ReqPrio)) 207 dst = dst[2:] 208 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.FD)) 209 dst = dst[4:] 210 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Buf)) 211 dst = dst[8:] 212 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Bytes)) 213 dst = dst[8:] 214 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Offset)) 215 dst = dst[8:] 216 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Reserved2)) 217 dst = dst[8:] 218 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Flags)) 219 dst = dst[4:] 220 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.ResFD)) 221 dst = dst[4:] 222 return dst 223 } 224 225 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 226 func (i *IOCallback) UnmarshalBytes(src []byte) []byte { 227 i.Data = uint64(hostarch.ByteOrder.Uint64(src[:8])) 228 src = src[8:] 229 i.Key = uint32(hostarch.ByteOrder.Uint32(src[:4])) 230 src = src[4:] 231 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 232 src = src[4:] 233 i.OpCode = uint16(hostarch.ByteOrder.Uint16(src[:2])) 234 src = src[2:] 235 i.ReqPrio = int16(hostarch.ByteOrder.Uint16(src[:2])) 236 src = src[2:] 237 i.FD = int32(hostarch.ByteOrder.Uint32(src[:4])) 238 src = src[4:] 239 i.Buf = uint64(hostarch.ByteOrder.Uint64(src[:8])) 240 src = src[8:] 241 i.Bytes = uint64(hostarch.ByteOrder.Uint64(src[:8])) 242 src = src[8:] 243 i.Offset = int64(hostarch.ByteOrder.Uint64(src[:8])) 244 src = src[8:] 245 i.Reserved2 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 246 src = src[8:] 247 i.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 248 src = src[4:] 249 i.ResFD = int32(hostarch.ByteOrder.Uint32(src[:4])) 250 src = src[4:] 251 return src 252 } 253 254 // Packed implements marshal.Marshallable.Packed. 255 //go:nosplit 256 func (i *IOCallback) Packed() bool { 257 return true 258 } 259 260 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 261 func (i *IOCallback) MarshalUnsafe(dst []byte) []byte { 262 size := i.SizeBytes() 263 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 264 return dst[size:] 265 } 266 267 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 268 func (i *IOCallback) UnmarshalUnsafe(src []byte) []byte { 269 size := i.SizeBytes() 270 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 271 return src[size:] 272 } 273 274 // CopyOutN implements marshal.Marshallable.CopyOutN. 275 func (i *IOCallback) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 276 // Construct a slice backed by dst's underlying memory. 277 var buf []byte 278 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 279 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 280 hdr.Len = i.SizeBytes() 281 hdr.Cap = i.SizeBytes() 282 283 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 284 // Since we bypassed the compiler's escape analysis, indicate that i 285 // must live until the use above. 286 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 287 return length, err 288 } 289 290 // CopyOut implements marshal.Marshallable.CopyOut. 291 func (i *IOCallback) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 292 return i.CopyOutN(cc, addr, i.SizeBytes()) 293 } 294 295 // CopyInN implements marshal.Marshallable.CopyInN. 296 func (i *IOCallback) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 297 // Construct a slice backed by dst's underlying memory. 298 var buf []byte 299 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 300 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 301 hdr.Len = i.SizeBytes() 302 hdr.Cap = i.SizeBytes() 303 304 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 305 // Since we bypassed the compiler's escape analysis, indicate that i 306 // must live until the use above. 307 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 308 return length, err 309 } 310 311 // CopyIn implements marshal.Marshallable.CopyIn. 312 func (i *IOCallback) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 313 return i.CopyInN(cc, addr, i.SizeBytes()) 314 } 315 316 // WriteTo implements io.WriterTo.WriteTo. 317 func (i *IOCallback) WriteTo(writer io.Writer) (int64, error) { 318 // Construct a slice backed by dst's underlying memory. 319 var buf []byte 320 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 321 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 322 hdr.Len = i.SizeBytes() 323 hdr.Cap = i.SizeBytes() 324 325 length, err := writer.Write(buf) 326 // Since we bypassed the compiler's escape analysis, indicate that i 327 // must live until the use above. 328 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 329 return int64(length), err 330 } 331 332 // SizeBytes implements marshal.Marshallable.SizeBytes. 333 func (i *IOEvent) SizeBytes() int { 334 return 32 335 } 336 337 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 338 func (i *IOEvent) MarshalBytes(dst []byte) []byte { 339 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Data)) 340 dst = dst[8:] 341 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Obj)) 342 dst = dst[8:] 343 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Result)) 344 dst = dst[8:] 345 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Result2)) 346 dst = dst[8:] 347 return dst 348 } 349 350 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 351 func (i *IOEvent) UnmarshalBytes(src []byte) []byte { 352 i.Data = uint64(hostarch.ByteOrder.Uint64(src[:8])) 353 src = src[8:] 354 i.Obj = uint64(hostarch.ByteOrder.Uint64(src[:8])) 355 src = src[8:] 356 i.Result = int64(hostarch.ByteOrder.Uint64(src[:8])) 357 src = src[8:] 358 i.Result2 = int64(hostarch.ByteOrder.Uint64(src[:8])) 359 src = src[8:] 360 return src 361 } 362 363 // Packed implements marshal.Marshallable.Packed. 364 //go:nosplit 365 func (i *IOEvent) Packed() bool { 366 return true 367 } 368 369 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 370 func (i *IOEvent) MarshalUnsafe(dst []byte) []byte { 371 size := i.SizeBytes() 372 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 373 return dst[size:] 374 } 375 376 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 377 func (i *IOEvent) UnmarshalUnsafe(src []byte) []byte { 378 size := i.SizeBytes() 379 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 380 return src[size:] 381 } 382 383 // CopyOutN implements marshal.Marshallable.CopyOutN. 384 func (i *IOEvent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 385 // Construct a slice backed by dst's underlying memory. 386 var buf []byte 387 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 388 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 389 hdr.Len = i.SizeBytes() 390 hdr.Cap = i.SizeBytes() 391 392 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 393 // Since we bypassed the compiler's escape analysis, indicate that i 394 // must live until the use above. 395 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 396 return length, err 397 } 398 399 // CopyOut implements marshal.Marshallable.CopyOut. 400 func (i *IOEvent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 401 return i.CopyOutN(cc, addr, i.SizeBytes()) 402 } 403 404 // CopyInN implements marshal.Marshallable.CopyInN. 405 func (i *IOEvent) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 406 // Construct a slice backed by dst's underlying memory. 407 var buf []byte 408 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 409 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 410 hdr.Len = i.SizeBytes() 411 hdr.Cap = i.SizeBytes() 412 413 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 414 // Since we bypassed the compiler's escape analysis, indicate that i 415 // must live until the use above. 416 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 417 return length, err 418 } 419 420 // CopyIn implements marshal.Marshallable.CopyIn. 421 func (i *IOEvent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 422 return i.CopyInN(cc, addr, i.SizeBytes()) 423 } 424 425 // WriteTo implements io.WriterTo.WriteTo. 426 func (i *IOEvent) WriteTo(writer io.Writer) (int64, error) { 427 // Construct a slice backed by dst's underlying memory. 428 var buf []byte 429 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 430 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 431 hdr.Len = i.SizeBytes() 432 hdr.Cap = i.SizeBytes() 433 434 length, err := writer.Write(buf) 435 // Since we bypassed the compiler's escape analysis, indicate that i 436 // must live until the use above. 437 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 438 return int64(length), err 439 } 440 441 // SizeBytes implements marshal.Marshallable.SizeBytes. 442 func (b *BPFInstruction) SizeBytes() int { 443 return 8 444 } 445 446 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 447 func (b *BPFInstruction) MarshalBytes(dst []byte) []byte { 448 hostarch.ByteOrder.PutUint16(dst[:2], uint16(b.OpCode)) 449 dst = dst[2:] 450 dst[0] = byte(b.JumpIfTrue) 451 dst = dst[1:] 452 dst[0] = byte(b.JumpIfFalse) 453 dst = dst[1:] 454 hostarch.ByteOrder.PutUint32(dst[:4], uint32(b.K)) 455 dst = dst[4:] 456 return dst 457 } 458 459 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 460 func (b *BPFInstruction) UnmarshalBytes(src []byte) []byte { 461 b.OpCode = uint16(hostarch.ByteOrder.Uint16(src[:2])) 462 src = src[2:] 463 b.JumpIfTrue = uint8(src[0]) 464 src = src[1:] 465 b.JumpIfFalse = uint8(src[0]) 466 src = src[1:] 467 b.K = uint32(hostarch.ByteOrder.Uint32(src[:4])) 468 src = src[4:] 469 return src 470 } 471 472 // Packed implements marshal.Marshallable.Packed. 473 //go:nosplit 474 func (b *BPFInstruction) Packed() bool { 475 return true 476 } 477 478 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 479 func (b *BPFInstruction) MarshalUnsafe(dst []byte) []byte { 480 size := b.SizeBytes() 481 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(b), uintptr(size)) 482 return dst[size:] 483 } 484 485 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 486 func (b *BPFInstruction) UnmarshalUnsafe(src []byte) []byte { 487 size := b.SizeBytes() 488 gohacks.Memmove(unsafe.Pointer(b), unsafe.Pointer(&src[0]), uintptr(size)) 489 return src[size:] 490 } 491 492 // CopyOutN implements marshal.Marshallable.CopyOutN. 493 func (b *BPFInstruction) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 494 // Construct a slice backed by dst's underlying memory. 495 var buf []byte 496 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 497 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(b))) 498 hdr.Len = b.SizeBytes() 499 hdr.Cap = b.SizeBytes() 500 501 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 502 // Since we bypassed the compiler's escape analysis, indicate that b 503 // must live until the use above. 504 runtime.KeepAlive(b) // escapes: replaced by intrinsic. 505 return length, err 506 } 507 508 // CopyOut implements marshal.Marshallable.CopyOut. 509 func (b *BPFInstruction) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 510 return b.CopyOutN(cc, addr, b.SizeBytes()) 511 } 512 513 // CopyInN implements marshal.Marshallable.CopyInN. 514 func (b *BPFInstruction) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 515 // Construct a slice backed by dst's underlying memory. 516 var buf []byte 517 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 518 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(b))) 519 hdr.Len = b.SizeBytes() 520 hdr.Cap = b.SizeBytes() 521 522 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 523 // Since we bypassed the compiler's escape analysis, indicate that b 524 // must live until the use above. 525 runtime.KeepAlive(b) // escapes: replaced by intrinsic. 526 return length, err 527 } 528 529 // CopyIn implements marshal.Marshallable.CopyIn. 530 func (b *BPFInstruction) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 531 return b.CopyInN(cc, addr, b.SizeBytes()) 532 } 533 534 // WriteTo implements io.WriterTo.WriteTo. 535 func (b *BPFInstruction) WriteTo(writer io.Writer) (int64, error) { 536 // Construct a slice backed by dst's underlying memory. 537 var buf []byte 538 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 539 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(b))) 540 hdr.Len = b.SizeBytes() 541 hdr.Cap = b.SizeBytes() 542 543 length, err := writer.Write(buf) 544 // Since we bypassed the compiler's escape analysis, indicate that b 545 // must live until the use above. 546 runtime.KeepAlive(b) // escapes: replaced by intrinsic. 547 return int64(length), err 548 } 549 550 // CopyBPFInstructionSliceIn copies in a slice of BPFInstruction objects from the task's memory. 551 func CopyBPFInstructionSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []BPFInstruction) (int, error) { 552 count := len(dst) 553 if count == 0 { 554 return 0, nil 555 } 556 size := (*BPFInstruction)(nil).SizeBytes() 557 558 ptr := unsafe.Pointer(&dst) 559 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 560 561 // Construct a slice backed by dst's underlying memory. 562 var buf []byte 563 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 564 hdr.Data = uintptr(val) 565 hdr.Len = size * count 566 hdr.Cap = size * count 567 568 length, err := cc.CopyInBytes(addr, buf) 569 // Since we bypassed the compiler's escape analysis, indicate that dst 570 // must live until the use above. 571 runtime.KeepAlive(dst) // escapes: replaced by intrinsic. 572 return length, err 573 } 574 575 // CopyBPFInstructionSliceOut copies a slice of BPFInstruction objects to the task's memory. 576 func CopyBPFInstructionSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []BPFInstruction) (int, error) { 577 count := len(src) 578 if count == 0 { 579 return 0, nil 580 } 581 size := (*BPFInstruction)(nil).SizeBytes() 582 583 ptr := unsafe.Pointer(&src) 584 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 585 586 // Construct a slice backed by dst's underlying memory. 587 var buf []byte 588 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 589 hdr.Data = uintptr(val) 590 hdr.Len = size * count 591 hdr.Cap = size * count 592 593 length, err := cc.CopyOutBytes(addr, buf) 594 // Since we bypassed the compiler's escape analysis, indicate that src 595 // must live until the use above. 596 runtime.KeepAlive(src) // escapes: replaced by intrinsic. 597 return length, err 598 } 599 600 // MarshalUnsafeBPFInstructionSlice is like BPFInstruction.MarshalUnsafe, but for a []BPFInstruction. 601 func MarshalUnsafeBPFInstructionSlice(src []BPFInstruction, dst []byte) []byte { 602 count := len(src) 603 if count == 0 { 604 return dst 605 } 606 607 size := (*BPFInstruction)(nil).SizeBytes() 608 buf := dst[:size*count] 609 gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) 610 return dst[size*count:] 611 } 612 613 // UnmarshalUnsafeBPFInstructionSlice is like BPFInstruction.UnmarshalUnsafe, but for a []BPFInstruction. 614 func UnmarshalUnsafeBPFInstructionSlice(dst []BPFInstruction, src []byte) []byte { 615 count := len(dst) 616 if count == 0 { 617 return src 618 } 619 620 size := (*BPFInstruction)(nil).SizeBytes() 621 buf := src[:size*count] 622 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) 623 return src[size*count:] 624 } 625 626 // SizeBytes implements marshal.Marshallable.SizeBytes. 627 func (c *CapUserData) SizeBytes() int { 628 return 12 629 } 630 631 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 632 func (c *CapUserData) MarshalBytes(dst []byte) []byte { 633 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Effective)) 634 dst = dst[4:] 635 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Permitted)) 636 dst = dst[4:] 637 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Inheritable)) 638 dst = dst[4:] 639 return dst 640 } 641 642 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 643 func (c *CapUserData) UnmarshalBytes(src []byte) []byte { 644 c.Effective = uint32(hostarch.ByteOrder.Uint32(src[:4])) 645 src = src[4:] 646 c.Permitted = uint32(hostarch.ByteOrder.Uint32(src[:4])) 647 src = src[4:] 648 c.Inheritable = uint32(hostarch.ByteOrder.Uint32(src[:4])) 649 src = src[4:] 650 return src 651 } 652 653 // Packed implements marshal.Marshallable.Packed. 654 //go:nosplit 655 func (c *CapUserData) Packed() bool { 656 return true 657 } 658 659 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 660 func (c *CapUserData) MarshalUnsafe(dst []byte) []byte { 661 size := c.SizeBytes() 662 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) 663 return dst[size:] 664 } 665 666 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 667 func (c *CapUserData) UnmarshalUnsafe(src []byte) []byte { 668 size := c.SizeBytes() 669 gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) 670 return src[size:] 671 } 672 673 // CopyOutN implements marshal.Marshallable.CopyOutN. 674 func (c *CapUserData) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 675 // Construct a slice backed by dst's underlying memory. 676 var buf []byte 677 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 678 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 679 hdr.Len = c.SizeBytes() 680 hdr.Cap = c.SizeBytes() 681 682 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 683 // Since we bypassed the compiler's escape analysis, indicate that c 684 // must live until the use above. 685 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 686 return length, err 687 } 688 689 // CopyOut implements marshal.Marshallable.CopyOut. 690 func (c *CapUserData) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 691 return c.CopyOutN(cc, addr, c.SizeBytes()) 692 } 693 694 // CopyInN implements marshal.Marshallable.CopyInN. 695 func (c *CapUserData) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 696 // Construct a slice backed by dst's underlying memory. 697 var buf []byte 698 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 699 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 700 hdr.Len = c.SizeBytes() 701 hdr.Cap = c.SizeBytes() 702 703 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 704 // Since we bypassed the compiler's escape analysis, indicate that c 705 // must live until the use above. 706 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 707 return length, err 708 } 709 710 // CopyIn implements marshal.Marshallable.CopyIn. 711 func (c *CapUserData) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 712 return c.CopyInN(cc, addr, c.SizeBytes()) 713 } 714 715 // WriteTo implements io.WriterTo.WriteTo. 716 func (c *CapUserData) WriteTo(writer io.Writer) (int64, error) { 717 // Construct a slice backed by dst's underlying memory. 718 var buf []byte 719 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 720 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 721 hdr.Len = c.SizeBytes() 722 hdr.Cap = c.SizeBytes() 723 724 length, err := writer.Write(buf) 725 // Since we bypassed the compiler's escape analysis, indicate that c 726 // must live until the use above. 727 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 728 return int64(length), err 729 } 730 731 // CopyCapUserDataSliceIn copies in a slice of CapUserData objects from the task's memory. 732 func CopyCapUserDataSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []CapUserData) (int, error) { 733 count := len(dst) 734 if count == 0 { 735 return 0, nil 736 } 737 size := (*CapUserData)(nil).SizeBytes() 738 739 ptr := unsafe.Pointer(&dst) 740 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 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(val) 746 hdr.Len = size * count 747 hdr.Cap = size * count 748 749 length, err := cc.CopyInBytes(addr, buf) 750 // Since we bypassed the compiler's escape analysis, indicate that dst 751 // must live until the use above. 752 runtime.KeepAlive(dst) // escapes: replaced by intrinsic. 753 return length, err 754 } 755 756 // CopyCapUserDataSliceOut copies a slice of CapUserData objects to the task's memory. 757 func CopyCapUserDataSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []CapUserData) (int, error) { 758 count := len(src) 759 if count == 0 { 760 return 0, nil 761 } 762 size := (*CapUserData)(nil).SizeBytes() 763 764 ptr := unsafe.Pointer(&src) 765 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 766 767 // Construct a slice backed by dst's underlying memory. 768 var buf []byte 769 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 770 hdr.Data = uintptr(val) 771 hdr.Len = size * count 772 hdr.Cap = size * count 773 774 length, err := cc.CopyOutBytes(addr, buf) 775 // Since we bypassed the compiler's escape analysis, indicate that src 776 // must live until the use above. 777 runtime.KeepAlive(src) // escapes: replaced by intrinsic. 778 return length, err 779 } 780 781 // MarshalUnsafeCapUserDataSlice is like CapUserData.MarshalUnsafe, but for a []CapUserData. 782 func MarshalUnsafeCapUserDataSlice(src []CapUserData, dst []byte) []byte { 783 count := len(src) 784 if count == 0 { 785 return dst 786 } 787 788 size := (*CapUserData)(nil).SizeBytes() 789 buf := dst[:size*count] 790 gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) 791 return dst[size*count:] 792 } 793 794 // UnmarshalUnsafeCapUserDataSlice is like CapUserData.UnmarshalUnsafe, but for a []CapUserData. 795 func UnmarshalUnsafeCapUserDataSlice(dst []CapUserData, src []byte) []byte { 796 count := len(dst) 797 if count == 0 { 798 return src 799 } 800 801 size := (*CapUserData)(nil).SizeBytes() 802 buf := src[:size*count] 803 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) 804 return src[size*count:] 805 } 806 807 // SizeBytes implements marshal.Marshallable.SizeBytes. 808 func (c *CapUserHeader) SizeBytes() int { 809 return 8 810 } 811 812 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 813 func (c *CapUserHeader) MarshalBytes(dst []byte) []byte { 814 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Version)) 815 dst = dst[4:] 816 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Pid)) 817 dst = dst[4:] 818 return dst 819 } 820 821 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 822 func (c *CapUserHeader) UnmarshalBytes(src []byte) []byte { 823 c.Version = uint32(hostarch.ByteOrder.Uint32(src[:4])) 824 src = src[4:] 825 c.Pid = int32(hostarch.ByteOrder.Uint32(src[:4])) 826 src = src[4:] 827 return src 828 } 829 830 // Packed implements marshal.Marshallable.Packed. 831 //go:nosplit 832 func (c *CapUserHeader) Packed() bool { 833 return true 834 } 835 836 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 837 func (c *CapUserHeader) MarshalUnsafe(dst []byte) []byte { 838 size := c.SizeBytes() 839 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) 840 return dst[size:] 841 } 842 843 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 844 func (c *CapUserHeader) UnmarshalUnsafe(src []byte) []byte { 845 size := c.SizeBytes() 846 gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) 847 return src[size:] 848 } 849 850 // CopyOutN implements marshal.Marshallable.CopyOutN. 851 func (c *CapUserHeader) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 852 // Construct a slice backed by dst's underlying memory. 853 var buf []byte 854 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 855 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 856 hdr.Len = c.SizeBytes() 857 hdr.Cap = c.SizeBytes() 858 859 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 860 // Since we bypassed the compiler's escape analysis, indicate that c 861 // must live until the use above. 862 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 863 return length, err 864 } 865 866 // CopyOut implements marshal.Marshallable.CopyOut. 867 func (c *CapUserHeader) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 868 return c.CopyOutN(cc, addr, c.SizeBytes()) 869 } 870 871 // CopyInN implements marshal.Marshallable.CopyInN. 872 func (c *CapUserHeader) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 873 // Construct a slice backed by dst's underlying memory. 874 var buf []byte 875 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 876 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 877 hdr.Len = c.SizeBytes() 878 hdr.Cap = c.SizeBytes() 879 880 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 881 // Since we bypassed the compiler's escape analysis, indicate that c 882 // must live until the use above. 883 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 884 return length, err 885 } 886 887 // CopyIn implements marshal.Marshallable.CopyIn. 888 func (c *CapUserHeader) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 889 return c.CopyInN(cc, addr, c.SizeBytes()) 890 } 891 892 // WriteTo implements io.WriterTo.WriteTo. 893 func (c *CapUserHeader) WriteTo(writer io.Writer) (int64, error) { 894 // Construct a slice backed by dst's underlying memory. 895 var buf []byte 896 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 897 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 898 hdr.Len = c.SizeBytes() 899 hdr.Cap = c.SizeBytes() 900 901 length, err := writer.Write(buf) 902 // Since we bypassed the compiler's escape analysis, indicate that c 903 // must live until the use above. 904 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 905 return int64(length), err 906 } 907 908 // SizeBytes implements marshal.Marshallable.SizeBytes. 909 func (c *CloneArgs) SizeBytes() int { 910 return 88 911 } 912 913 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 914 func (c *CloneArgs) MarshalBytes(dst []byte) []byte { 915 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.Flags)) 916 dst = dst[8:] 917 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.Pidfd)) 918 dst = dst[8:] 919 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.ChildTID)) 920 dst = dst[8:] 921 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.ParentTID)) 922 dst = dst[8:] 923 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.ExitSignal)) 924 dst = dst[8:] 925 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.Stack)) 926 dst = dst[8:] 927 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.StackSize)) 928 dst = dst[8:] 929 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.TLS)) 930 dst = dst[8:] 931 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.SetTID)) 932 dst = dst[8:] 933 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.SetTIDSize)) 934 dst = dst[8:] 935 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.Cgroup)) 936 dst = dst[8:] 937 return dst 938 } 939 940 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 941 func (c *CloneArgs) UnmarshalBytes(src []byte) []byte { 942 c.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8])) 943 src = src[8:] 944 c.Pidfd = uint64(hostarch.ByteOrder.Uint64(src[:8])) 945 src = src[8:] 946 c.ChildTID = uint64(hostarch.ByteOrder.Uint64(src[:8])) 947 src = src[8:] 948 c.ParentTID = uint64(hostarch.ByteOrder.Uint64(src[:8])) 949 src = src[8:] 950 c.ExitSignal = uint64(hostarch.ByteOrder.Uint64(src[:8])) 951 src = src[8:] 952 c.Stack = uint64(hostarch.ByteOrder.Uint64(src[:8])) 953 src = src[8:] 954 c.StackSize = uint64(hostarch.ByteOrder.Uint64(src[:8])) 955 src = src[8:] 956 c.TLS = uint64(hostarch.ByteOrder.Uint64(src[:8])) 957 src = src[8:] 958 c.SetTID = uint64(hostarch.ByteOrder.Uint64(src[:8])) 959 src = src[8:] 960 c.SetTIDSize = uint64(hostarch.ByteOrder.Uint64(src[:8])) 961 src = src[8:] 962 c.Cgroup = uint64(hostarch.ByteOrder.Uint64(src[:8])) 963 src = src[8:] 964 return src 965 } 966 967 // Packed implements marshal.Marshallable.Packed. 968 //go:nosplit 969 func (c *CloneArgs) Packed() bool { 970 return true 971 } 972 973 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 974 func (c *CloneArgs) MarshalUnsafe(dst []byte) []byte { 975 size := c.SizeBytes() 976 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) 977 return dst[size:] 978 } 979 980 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 981 func (c *CloneArgs) UnmarshalUnsafe(src []byte) []byte { 982 size := c.SizeBytes() 983 gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) 984 return src[size:] 985 } 986 987 // CopyOutN implements marshal.Marshallable.CopyOutN. 988 func (c *CloneArgs) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 989 // Construct a slice backed by dst's underlying memory. 990 var buf []byte 991 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 992 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 993 hdr.Len = c.SizeBytes() 994 hdr.Cap = c.SizeBytes() 995 996 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 997 // Since we bypassed the compiler's escape analysis, indicate that c 998 // must live until the use above. 999 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 1000 return length, err 1001 } 1002 1003 // CopyOut implements marshal.Marshallable.CopyOut. 1004 func (c *CloneArgs) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1005 return c.CopyOutN(cc, addr, c.SizeBytes()) 1006 } 1007 1008 // CopyInN implements marshal.Marshallable.CopyInN. 1009 func (c *CloneArgs) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1010 // Construct a slice backed by dst's underlying memory. 1011 var buf []byte 1012 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1013 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 1014 hdr.Len = c.SizeBytes() 1015 hdr.Cap = c.SizeBytes() 1016 1017 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1018 // Since we bypassed the compiler's escape analysis, indicate that c 1019 // must live until the use above. 1020 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 1021 return length, err 1022 } 1023 1024 // CopyIn implements marshal.Marshallable.CopyIn. 1025 func (c *CloneArgs) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1026 return c.CopyInN(cc, addr, c.SizeBytes()) 1027 } 1028 1029 // WriteTo implements io.WriterTo.WriteTo. 1030 func (c *CloneArgs) WriteTo(writer io.Writer) (int64, error) { 1031 // Construct a slice backed by dst's underlying memory. 1032 var buf []byte 1033 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1034 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 1035 hdr.Len = c.SizeBytes() 1036 hdr.Cap = c.SizeBytes() 1037 1038 length, err := writer.Write(buf) 1039 // Since we bypassed the compiler's escape analysis, indicate that c 1040 // must live until the use above. 1041 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 1042 return int64(length), err 1043 } 1044 1045 // SizeBytes implements marshal.Marshallable.SizeBytes. 1046 func (e *ElfHeader64) SizeBytes() int { 1047 return 48 + 1048 1*16 1049 } 1050 1051 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1052 func (e *ElfHeader64) MarshalBytes(dst []byte) []byte { 1053 for idx := 0; idx < 16; idx++ { 1054 dst[0] = byte(e.Ident[idx]) 1055 dst = dst[1:] 1056 } 1057 hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Type)) 1058 dst = dst[2:] 1059 hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Machine)) 1060 dst = dst[2:] 1061 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Version)) 1062 dst = dst[4:] 1063 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Entry)) 1064 dst = dst[8:] 1065 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Phoff)) 1066 dst = dst[8:] 1067 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Shoff)) 1068 dst = dst[8:] 1069 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Flags)) 1070 dst = dst[4:] 1071 hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Ehsize)) 1072 dst = dst[2:] 1073 hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Phentsize)) 1074 dst = dst[2:] 1075 hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Phnum)) 1076 dst = dst[2:] 1077 hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Shentsize)) 1078 dst = dst[2:] 1079 hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Shnum)) 1080 dst = dst[2:] 1081 hostarch.ByteOrder.PutUint16(dst[:2], uint16(e.Shstrndx)) 1082 dst = dst[2:] 1083 return dst 1084 } 1085 1086 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1087 func (e *ElfHeader64) UnmarshalBytes(src []byte) []byte { 1088 for idx := 0; idx < 16; idx++ { 1089 e.Ident[idx] = src[0] 1090 src = src[1:] 1091 } 1092 e.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) 1093 src = src[2:] 1094 e.Machine = uint16(hostarch.ByteOrder.Uint16(src[:2])) 1095 src = src[2:] 1096 e.Version = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1097 src = src[4:] 1098 e.Entry = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1099 src = src[8:] 1100 e.Phoff = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1101 src = src[8:] 1102 e.Shoff = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1103 src = src[8:] 1104 e.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1105 src = src[4:] 1106 e.Ehsize = uint16(hostarch.ByteOrder.Uint16(src[:2])) 1107 src = src[2:] 1108 e.Phentsize = uint16(hostarch.ByteOrder.Uint16(src[:2])) 1109 src = src[2:] 1110 e.Phnum = uint16(hostarch.ByteOrder.Uint16(src[:2])) 1111 src = src[2:] 1112 e.Shentsize = uint16(hostarch.ByteOrder.Uint16(src[:2])) 1113 src = src[2:] 1114 e.Shnum = uint16(hostarch.ByteOrder.Uint16(src[:2])) 1115 src = src[2:] 1116 e.Shstrndx = uint16(hostarch.ByteOrder.Uint16(src[:2])) 1117 src = src[2:] 1118 return src 1119 } 1120 1121 // Packed implements marshal.Marshallable.Packed. 1122 //go:nosplit 1123 func (e *ElfHeader64) Packed() bool { 1124 return true 1125 } 1126 1127 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1128 func (e *ElfHeader64) MarshalUnsafe(dst []byte) []byte { 1129 size := e.SizeBytes() 1130 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(e), uintptr(size)) 1131 return dst[size:] 1132 } 1133 1134 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1135 func (e *ElfHeader64) UnmarshalUnsafe(src []byte) []byte { 1136 size := e.SizeBytes() 1137 gohacks.Memmove(unsafe.Pointer(e), unsafe.Pointer(&src[0]), uintptr(size)) 1138 return src[size:] 1139 } 1140 1141 // CopyOutN implements marshal.Marshallable.CopyOutN. 1142 func (e *ElfHeader64) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1143 // Construct a slice backed by dst's underlying memory. 1144 var buf []byte 1145 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1146 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 1147 hdr.Len = e.SizeBytes() 1148 hdr.Cap = e.SizeBytes() 1149 1150 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1151 // Since we bypassed the compiler's escape analysis, indicate that e 1152 // must live until the use above. 1153 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 1154 return length, err 1155 } 1156 1157 // CopyOut implements marshal.Marshallable.CopyOut. 1158 func (e *ElfHeader64) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1159 return e.CopyOutN(cc, addr, e.SizeBytes()) 1160 } 1161 1162 // CopyInN implements marshal.Marshallable.CopyInN. 1163 func (e *ElfHeader64) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1164 // Construct a slice backed by dst's underlying memory. 1165 var buf []byte 1166 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1167 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 1168 hdr.Len = e.SizeBytes() 1169 hdr.Cap = e.SizeBytes() 1170 1171 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1172 // Since we bypassed the compiler's escape analysis, indicate that e 1173 // must live until the use above. 1174 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 1175 return length, err 1176 } 1177 1178 // CopyIn implements marshal.Marshallable.CopyIn. 1179 func (e *ElfHeader64) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1180 return e.CopyInN(cc, addr, e.SizeBytes()) 1181 } 1182 1183 // WriteTo implements io.WriterTo.WriteTo. 1184 func (e *ElfHeader64) WriteTo(writer io.Writer) (int64, error) { 1185 // Construct a slice backed by dst's underlying memory. 1186 var buf []byte 1187 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1188 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 1189 hdr.Len = e.SizeBytes() 1190 hdr.Cap = e.SizeBytes() 1191 1192 length, err := writer.Write(buf) 1193 // Since we bypassed the compiler's escape analysis, indicate that e 1194 // must live until the use above. 1195 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 1196 return int64(length), err 1197 } 1198 1199 // SizeBytes implements marshal.Marshallable.SizeBytes. 1200 func (e *ElfProg64) SizeBytes() int { 1201 return 56 1202 } 1203 1204 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1205 func (e *ElfProg64) MarshalBytes(dst []byte) []byte { 1206 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Type)) 1207 dst = dst[4:] 1208 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Flags)) 1209 dst = dst[4:] 1210 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Off)) 1211 dst = dst[8:] 1212 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Vaddr)) 1213 dst = dst[8:] 1214 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Paddr)) 1215 dst = dst[8:] 1216 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Filesz)) 1217 dst = dst[8:] 1218 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Memsz)) 1219 dst = dst[8:] 1220 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Align)) 1221 dst = dst[8:] 1222 return dst 1223 } 1224 1225 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1226 func (e *ElfProg64) UnmarshalBytes(src []byte) []byte { 1227 e.Type = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1228 src = src[4:] 1229 e.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1230 src = src[4:] 1231 e.Off = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1232 src = src[8:] 1233 e.Vaddr = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1234 src = src[8:] 1235 e.Paddr = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1236 src = src[8:] 1237 e.Filesz = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1238 src = src[8:] 1239 e.Memsz = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1240 src = src[8:] 1241 e.Align = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1242 src = src[8:] 1243 return src 1244 } 1245 1246 // Packed implements marshal.Marshallable.Packed. 1247 //go:nosplit 1248 func (e *ElfProg64) Packed() bool { 1249 return true 1250 } 1251 1252 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1253 func (e *ElfProg64) MarshalUnsafe(dst []byte) []byte { 1254 size := e.SizeBytes() 1255 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(e), uintptr(size)) 1256 return dst[size:] 1257 } 1258 1259 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1260 func (e *ElfProg64) UnmarshalUnsafe(src []byte) []byte { 1261 size := e.SizeBytes() 1262 gohacks.Memmove(unsafe.Pointer(e), unsafe.Pointer(&src[0]), uintptr(size)) 1263 return src[size:] 1264 } 1265 1266 // CopyOutN implements marshal.Marshallable.CopyOutN. 1267 func (e *ElfProg64) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1268 // Construct a slice backed by dst's underlying memory. 1269 var buf []byte 1270 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1271 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 1272 hdr.Len = e.SizeBytes() 1273 hdr.Cap = e.SizeBytes() 1274 1275 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1276 // Since we bypassed the compiler's escape analysis, indicate that e 1277 // must live until the use above. 1278 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 1279 return length, err 1280 } 1281 1282 // CopyOut implements marshal.Marshallable.CopyOut. 1283 func (e *ElfProg64) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1284 return e.CopyOutN(cc, addr, e.SizeBytes()) 1285 } 1286 1287 // CopyInN implements marshal.Marshallable.CopyInN. 1288 func (e *ElfProg64) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1289 // Construct a slice backed by dst's underlying memory. 1290 var buf []byte 1291 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1292 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 1293 hdr.Len = e.SizeBytes() 1294 hdr.Cap = e.SizeBytes() 1295 1296 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1297 // Since we bypassed the compiler's escape analysis, indicate that e 1298 // must live until the use above. 1299 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 1300 return length, err 1301 } 1302 1303 // CopyIn implements marshal.Marshallable.CopyIn. 1304 func (e *ElfProg64) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1305 return e.CopyInN(cc, addr, e.SizeBytes()) 1306 } 1307 1308 // WriteTo implements io.WriterTo.WriteTo. 1309 func (e *ElfProg64) WriteTo(writer io.Writer) (int64, error) { 1310 // Construct a slice backed by dst's underlying memory. 1311 var buf []byte 1312 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1313 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 1314 hdr.Len = e.SizeBytes() 1315 hdr.Cap = e.SizeBytes() 1316 1317 length, err := writer.Write(buf) 1318 // Since we bypassed the compiler's escape analysis, indicate that e 1319 // must live until the use above. 1320 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 1321 return int64(length), err 1322 } 1323 1324 // SizeBytes implements marshal.Marshallable.SizeBytes. 1325 func (e *ElfSection64) SizeBytes() int { 1326 return 64 1327 } 1328 1329 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1330 func (e *ElfSection64) MarshalBytes(dst []byte) []byte { 1331 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Name)) 1332 dst = dst[4:] 1333 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Type)) 1334 dst = dst[4:] 1335 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Flags)) 1336 dst = dst[8:] 1337 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Addr)) 1338 dst = dst[8:] 1339 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Off)) 1340 dst = dst[8:] 1341 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Size)) 1342 dst = dst[8:] 1343 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Link)) 1344 dst = dst[4:] 1345 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Info)) 1346 dst = dst[4:] 1347 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Addralign)) 1348 dst = dst[8:] 1349 hostarch.ByteOrder.PutUint64(dst[:8], uint64(e.Entsize)) 1350 dst = dst[8:] 1351 return dst 1352 } 1353 1354 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1355 func (e *ElfSection64) UnmarshalBytes(src []byte) []byte { 1356 e.Name = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1357 src = src[4:] 1358 e.Type = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1359 src = src[4:] 1360 e.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1361 src = src[8:] 1362 e.Addr = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1363 src = src[8:] 1364 e.Off = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1365 src = src[8:] 1366 e.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1367 src = src[8:] 1368 e.Link = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1369 src = src[4:] 1370 e.Info = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1371 src = src[4:] 1372 e.Addralign = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1373 src = src[8:] 1374 e.Entsize = uint64(hostarch.ByteOrder.Uint64(src[:8])) 1375 src = src[8:] 1376 return src 1377 } 1378 1379 // Packed implements marshal.Marshallable.Packed. 1380 //go:nosplit 1381 func (e *ElfSection64) Packed() bool { 1382 return true 1383 } 1384 1385 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1386 func (e *ElfSection64) MarshalUnsafe(dst []byte) []byte { 1387 size := e.SizeBytes() 1388 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(e), uintptr(size)) 1389 return dst[size:] 1390 } 1391 1392 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1393 func (e *ElfSection64) UnmarshalUnsafe(src []byte) []byte { 1394 size := e.SizeBytes() 1395 gohacks.Memmove(unsafe.Pointer(e), unsafe.Pointer(&src[0]), uintptr(size)) 1396 return src[size:] 1397 } 1398 1399 // CopyOutN implements marshal.Marshallable.CopyOutN. 1400 func (e *ElfSection64) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1401 // Construct a slice backed by dst's underlying memory. 1402 var buf []byte 1403 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1404 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 1405 hdr.Len = e.SizeBytes() 1406 hdr.Cap = e.SizeBytes() 1407 1408 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1409 // Since we bypassed the compiler's escape analysis, indicate that e 1410 // must live until the use above. 1411 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 1412 return length, err 1413 } 1414 1415 // CopyOut implements marshal.Marshallable.CopyOut. 1416 func (e *ElfSection64) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1417 return e.CopyOutN(cc, addr, e.SizeBytes()) 1418 } 1419 1420 // CopyInN implements marshal.Marshallable.CopyInN. 1421 func (e *ElfSection64) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1422 // Construct a slice backed by dst's underlying memory. 1423 var buf []byte 1424 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1425 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 1426 hdr.Len = e.SizeBytes() 1427 hdr.Cap = e.SizeBytes() 1428 1429 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1430 // Since we bypassed the compiler's escape analysis, indicate that e 1431 // must live until the use above. 1432 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 1433 return length, err 1434 } 1435 1436 // CopyIn implements marshal.Marshallable.CopyIn. 1437 func (e *ElfSection64) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1438 return e.CopyInN(cc, addr, e.SizeBytes()) 1439 } 1440 1441 // WriteTo implements io.WriterTo.WriteTo. 1442 func (e *ElfSection64) WriteTo(writer io.Writer) (int64, error) { 1443 // Construct a slice backed by dst's underlying memory. 1444 var buf []byte 1445 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1446 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 1447 hdr.Len = e.SizeBytes() 1448 hdr.Cap = e.SizeBytes() 1449 1450 length, err := writer.Write(buf) 1451 // Since we bypassed the compiler's escape analysis, indicate that e 1452 // must live until the use above. 1453 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 1454 return int64(length), err 1455 } 1456 1457 // SizeBytes implements marshal.Marshallable.SizeBytes. 1458 func (s *SockErrCMsgIPv4) SizeBytes() int { 1459 return 0 + 1460 (*SockExtendedErr)(nil).SizeBytes() + 1461 (*SockAddrInet)(nil).SizeBytes() 1462 } 1463 1464 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1465 func (s *SockErrCMsgIPv4) MarshalBytes(dst []byte) []byte { 1466 dst = s.SockExtendedErr.MarshalUnsafe(dst) 1467 dst = s.Offender.MarshalUnsafe(dst) 1468 return dst 1469 } 1470 1471 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1472 func (s *SockErrCMsgIPv4) UnmarshalBytes(src []byte) []byte { 1473 src = s.SockExtendedErr.UnmarshalUnsafe(src) 1474 src = s.Offender.UnmarshalUnsafe(src) 1475 return src 1476 } 1477 1478 // Packed implements marshal.Marshallable.Packed. 1479 //go:nosplit 1480 func (s *SockErrCMsgIPv4) Packed() bool { 1481 return s.Offender.Packed() && s.SockExtendedErr.Packed() 1482 } 1483 1484 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1485 func (s *SockErrCMsgIPv4) MarshalUnsafe(dst []byte) []byte { 1486 if s.Offender.Packed() && s.SockExtendedErr.Packed() { 1487 size := s.SizeBytes() 1488 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 1489 return dst[size:] 1490 } 1491 // Type SockErrCMsgIPv4 doesn't have a packed layout in memory, fallback to MarshalBytes. 1492 return s.MarshalBytes(dst) 1493 } 1494 1495 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1496 func (s *SockErrCMsgIPv4) UnmarshalUnsafe(src []byte) []byte { 1497 if s.Offender.Packed() && s.SockExtendedErr.Packed() { 1498 size := s.SizeBytes() 1499 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 1500 return src[size:] 1501 } 1502 // Type SockErrCMsgIPv4 doesn't have a packed layout in memory, fallback to UnmarshalBytes. 1503 return s.UnmarshalBytes(src) 1504 } 1505 1506 // CopyOutN implements marshal.Marshallable.CopyOutN. 1507 func (s *SockErrCMsgIPv4) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1508 if !s.Offender.Packed() && s.SockExtendedErr.Packed() { 1509 // Type SockErrCMsgIPv4 doesn't have a packed layout in memory, fall back to MarshalBytes. 1510 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 1511 s.MarshalBytes(buf) // escapes: fallback. 1512 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1513 } 1514 1515 // Construct a slice backed by dst's underlying memory. 1516 var buf []byte 1517 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1518 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 1519 hdr.Len = s.SizeBytes() 1520 hdr.Cap = s.SizeBytes() 1521 1522 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1523 // Since we bypassed the compiler's escape analysis, indicate that s 1524 // must live until the use above. 1525 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 1526 return length, err 1527 } 1528 1529 // CopyOut implements marshal.Marshallable.CopyOut. 1530 func (s *SockErrCMsgIPv4) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1531 return s.CopyOutN(cc, addr, s.SizeBytes()) 1532 } 1533 1534 // CopyInN implements marshal.Marshallable.CopyInN. 1535 func (s *SockErrCMsgIPv4) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1536 if !s.Offender.Packed() && s.SockExtendedErr.Packed() { 1537 // Type SockErrCMsgIPv4 doesn't have a packed layout in memory, fall back to UnmarshalBytes. 1538 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 1539 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1540 // Unmarshal unconditionally. If we had a short copy-in, this results in a 1541 // partially unmarshalled struct. 1542 s.UnmarshalBytes(buf) // escapes: fallback. 1543 return length, err 1544 } 1545 1546 // Construct a slice backed by dst's underlying memory. 1547 var buf []byte 1548 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1549 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 1550 hdr.Len = s.SizeBytes() 1551 hdr.Cap = s.SizeBytes() 1552 1553 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1554 // Since we bypassed the compiler's escape analysis, indicate that s 1555 // must live until the use above. 1556 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 1557 return length, err 1558 } 1559 1560 // CopyIn implements marshal.Marshallable.CopyIn. 1561 func (s *SockErrCMsgIPv4) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1562 return s.CopyInN(cc, addr, s.SizeBytes()) 1563 } 1564 1565 // WriteTo implements io.WriterTo.WriteTo. 1566 func (s *SockErrCMsgIPv4) WriteTo(writer io.Writer) (int64, error) { 1567 if !s.Offender.Packed() && s.SockExtendedErr.Packed() { 1568 // Type SockErrCMsgIPv4 doesn't have a packed layout in memory, fall back to MarshalBytes. 1569 buf := make([]byte, s.SizeBytes()) 1570 s.MarshalBytes(buf) 1571 length, err := writer.Write(buf) 1572 return int64(length), err 1573 } 1574 1575 // Construct a slice backed by dst's underlying memory. 1576 var buf []byte 1577 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1578 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 1579 hdr.Len = s.SizeBytes() 1580 hdr.Cap = s.SizeBytes() 1581 1582 length, err := writer.Write(buf) 1583 // Since we bypassed the compiler's escape analysis, indicate that s 1584 // must live until the use above. 1585 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 1586 return int64(length), err 1587 } 1588 1589 // SizeBytes implements marshal.Marshallable.SizeBytes. 1590 func (s *SockErrCMsgIPv6) SizeBytes() int { 1591 return 0 + 1592 (*SockExtendedErr)(nil).SizeBytes() + 1593 (*SockAddrInet6)(nil).SizeBytes() 1594 } 1595 1596 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1597 func (s *SockErrCMsgIPv6) MarshalBytes(dst []byte) []byte { 1598 dst = s.SockExtendedErr.MarshalUnsafe(dst) 1599 dst = s.Offender.MarshalUnsafe(dst) 1600 return dst 1601 } 1602 1603 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1604 func (s *SockErrCMsgIPv6) UnmarshalBytes(src []byte) []byte { 1605 src = s.SockExtendedErr.UnmarshalUnsafe(src) 1606 src = s.Offender.UnmarshalUnsafe(src) 1607 return src 1608 } 1609 1610 // Packed implements marshal.Marshallable.Packed. 1611 //go:nosplit 1612 func (s *SockErrCMsgIPv6) Packed() bool { 1613 return s.Offender.Packed() && s.SockExtendedErr.Packed() 1614 } 1615 1616 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1617 func (s *SockErrCMsgIPv6) MarshalUnsafe(dst []byte) []byte { 1618 if s.Offender.Packed() && s.SockExtendedErr.Packed() { 1619 size := s.SizeBytes() 1620 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 1621 return dst[size:] 1622 } 1623 // Type SockErrCMsgIPv6 doesn't have a packed layout in memory, fallback to MarshalBytes. 1624 return s.MarshalBytes(dst) 1625 } 1626 1627 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1628 func (s *SockErrCMsgIPv6) UnmarshalUnsafe(src []byte) []byte { 1629 if s.Offender.Packed() && s.SockExtendedErr.Packed() { 1630 size := s.SizeBytes() 1631 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 1632 return src[size:] 1633 } 1634 // Type SockErrCMsgIPv6 doesn't have a packed layout in memory, fallback to UnmarshalBytes. 1635 return s.UnmarshalBytes(src) 1636 } 1637 1638 // CopyOutN implements marshal.Marshallable.CopyOutN. 1639 func (s *SockErrCMsgIPv6) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1640 if !s.Offender.Packed() && s.SockExtendedErr.Packed() { 1641 // Type SockErrCMsgIPv6 doesn't have a packed layout in memory, fall back to MarshalBytes. 1642 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 1643 s.MarshalBytes(buf) // escapes: fallback. 1644 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1645 } 1646 1647 // Construct a slice backed by dst's underlying memory. 1648 var buf []byte 1649 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1650 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 1651 hdr.Len = s.SizeBytes() 1652 hdr.Cap = s.SizeBytes() 1653 1654 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1655 // Since we bypassed the compiler's escape analysis, indicate that s 1656 // must live until the use above. 1657 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 1658 return length, err 1659 } 1660 1661 // CopyOut implements marshal.Marshallable.CopyOut. 1662 func (s *SockErrCMsgIPv6) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1663 return s.CopyOutN(cc, addr, s.SizeBytes()) 1664 } 1665 1666 // CopyInN implements marshal.Marshallable.CopyInN. 1667 func (s *SockErrCMsgIPv6) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1668 if !s.Offender.Packed() && s.SockExtendedErr.Packed() { 1669 // Type SockErrCMsgIPv6 doesn't have a packed layout in memory, fall back to UnmarshalBytes. 1670 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 1671 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1672 // Unmarshal unconditionally. If we had a short copy-in, this results in a 1673 // partially unmarshalled struct. 1674 s.UnmarshalBytes(buf) // escapes: fallback. 1675 return length, err 1676 } 1677 1678 // Construct a slice backed by dst's underlying memory. 1679 var buf []byte 1680 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1681 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 1682 hdr.Len = s.SizeBytes() 1683 hdr.Cap = s.SizeBytes() 1684 1685 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1686 // Since we bypassed the compiler's escape analysis, indicate that s 1687 // must live until the use above. 1688 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 1689 return length, err 1690 } 1691 1692 // CopyIn implements marshal.Marshallable.CopyIn. 1693 func (s *SockErrCMsgIPv6) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1694 return s.CopyInN(cc, addr, s.SizeBytes()) 1695 } 1696 1697 // WriteTo implements io.WriterTo.WriteTo. 1698 func (s *SockErrCMsgIPv6) WriteTo(writer io.Writer) (int64, error) { 1699 if !s.Offender.Packed() && s.SockExtendedErr.Packed() { 1700 // Type SockErrCMsgIPv6 doesn't have a packed layout in memory, fall back to MarshalBytes. 1701 buf := make([]byte, s.SizeBytes()) 1702 s.MarshalBytes(buf) 1703 length, err := writer.Write(buf) 1704 return int64(length), err 1705 } 1706 1707 // Construct a slice backed by dst's underlying memory. 1708 var buf []byte 1709 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1710 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 1711 hdr.Len = s.SizeBytes() 1712 hdr.Cap = s.SizeBytes() 1713 1714 length, err := writer.Write(buf) 1715 // Since we bypassed the compiler's escape analysis, indicate that s 1716 // must live until the use above. 1717 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 1718 return int64(length), err 1719 } 1720 1721 // SizeBytes implements marshal.Marshallable.SizeBytes. 1722 func (s *SockExtendedErr) SizeBytes() int { 1723 return 16 1724 } 1725 1726 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1727 func (s *SockExtendedErr) MarshalBytes(dst []byte) []byte { 1728 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Errno)) 1729 dst = dst[4:] 1730 dst[0] = byte(s.Origin) 1731 dst = dst[1:] 1732 dst[0] = byte(s.Type) 1733 dst = dst[1:] 1734 dst[0] = byte(s.Code) 1735 dst = dst[1:] 1736 dst[0] = byte(s.Pad) 1737 dst = dst[1:] 1738 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Info)) 1739 dst = dst[4:] 1740 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Data)) 1741 dst = dst[4:] 1742 return dst 1743 } 1744 1745 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1746 func (s *SockExtendedErr) UnmarshalBytes(src []byte) []byte { 1747 s.Errno = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1748 src = src[4:] 1749 s.Origin = uint8(src[0]) 1750 src = src[1:] 1751 s.Type = uint8(src[0]) 1752 src = src[1:] 1753 s.Code = uint8(src[0]) 1754 src = src[1:] 1755 s.Pad = uint8(src[0]) 1756 src = src[1:] 1757 s.Info = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1758 src = src[4:] 1759 s.Data = uint32(hostarch.ByteOrder.Uint32(src[:4])) 1760 src = src[4:] 1761 return src 1762 } 1763 1764 // Packed implements marshal.Marshallable.Packed. 1765 //go:nosplit 1766 func (s *SockExtendedErr) Packed() bool { 1767 return true 1768 } 1769 1770 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1771 func (s *SockExtendedErr) MarshalUnsafe(dst []byte) []byte { 1772 size := s.SizeBytes() 1773 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 1774 return dst[size:] 1775 } 1776 1777 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1778 func (s *SockExtendedErr) UnmarshalUnsafe(src []byte) []byte { 1779 size := s.SizeBytes() 1780 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 1781 return src[size:] 1782 } 1783 1784 // CopyOutN implements marshal.Marshallable.CopyOutN. 1785 func (s *SockExtendedErr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1786 // Construct a slice backed by dst's underlying memory. 1787 var buf []byte 1788 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1789 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 1790 hdr.Len = s.SizeBytes() 1791 hdr.Cap = s.SizeBytes() 1792 1793 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1794 // Since we bypassed the compiler's escape analysis, indicate that s 1795 // must live until the use above. 1796 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 1797 return length, err 1798 } 1799 1800 // CopyOut implements marshal.Marshallable.CopyOut. 1801 func (s *SockExtendedErr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1802 return s.CopyOutN(cc, addr, s.SizeBytes()) 1803 } 1804 1805 // CopyInN implements marshal.Marshallable.CopyInN. 1806 func (s *SockExtendedErr) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1807 // Construct a slice backed by dst's underlying memory. 1808 var buf []byte 1809 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1810 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 1811 hdr.Len = s.SizeBytes() 1812 hdr.Cap = s.SizeBytes() 1813 1814 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1815 // Since we bypassed the compiler's escape analysis, indicate that s 1816 // must live until the use above. 1817 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 1818 return length, err 1819 } 1820 1821 // CopyIn implements marshal.Marshallable.CopyIn. 1822 func (s *SockExtendedErr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1823 return s.CopyInN(cc, addr, s.SizeBytes()) 1824 } 1825 1826 // WriteTo implements io.WriterTo.WriteTo. 1827 func (s *SockExtendedErr) WriteTo(writer io.Writer) (int64, error) { 1828 // Construct a slice backed by dst's underlying memory. 1829 var buf []byte 1830 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1831 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 1832 hdr.Len = s.SizeBytes() 1833 hdr.Cap = s.SizeBytes() 1834 1835 length, err := writer.Write(buf) 1836 // Since we bypassed the compiler's escape analysis, indicate that s 1837 // must live until the use above. 1838 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 1839 return int64(length), err 1840 } 1841 1842 // SizeBytes implements marshal.Marshallable.SizeBytes. 1843 func (f *FOwnerEx) SizeBytes() int { 1844 return 8 1845 } 1846 1847 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1848 func (f *FOwnerEx) MarshalBytes(dst []byte) []byte { 1849 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Type)) 1850 dst = dst[4:] 1851 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.PID)) 1852 dst = dst[4:] 1853 return dst 1854 } 1855 1856 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1857 func (f *FOwnerEx) UnmarshalBytes(src []byte) []byte { 1858 f.Type = int32(hostarch.ByteOrder.Uint32(src[:4])) 1859 src = src[4:] 1860 f.PID = int32(hostarch.ByteOrder.Uint32(src[:4])) 1861 src = src[4:] 1862 return src 1863 } 1864 1865 // Packed implements marshal.Marshallable.Packed. 1866 //go:nosplit 1867 func (f *FOwnerEx) Packed() bool { 1868 return true 1869 } 1870 1871 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1872 func (f *FOwnerEx) MarshalUnsafe(dst []byte) []byte { 1873 size := f.SizeBytes() 1874 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 1875 return dst[size:] 1876 } 1877 1878 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 1879 func (f *FOwnerEx) UnmarshalUnsafe(src []byte) []byte { 1880 size := f.SizeBytes() 1881 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 1882 return src[size:] 1883 } 1884 1885 // CopyOutN implements marshal.Marshallable.CopyOutN. 1886 func (f *FOwnerEx) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1887 // Construct a slice backed by dst's underlying memory. 1888 var buf []byte 1889 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1890 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 1891 hdr.Len = f.SizeBytes() 1892 hdr.Cap = f.SizeBytes() 1893 1894 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 1895 // Since we bypassed the compiler's escape analysis, indicate that f 1896 // must live until the use above. 1897 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 1898 return length, err 1899 } 1900 1901 // CopyOut implements marshal.Marshallable.CopyOut. 1902 func (f *FOwnerEx) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1903 return f.CopyOutN(cc, addr, f.SizeBytes()) 1904 } 1905 1906 // CopyInN implements marshal.Marshallable.CopyInN. 1907 func (f *FOwnerEx) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 1908 // Construct a slice backed by dst's underlying memory. 1909 var buf []byte 1910 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1911 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 1912 hdr.Len = f.SizeBytes() 1913 hdr.Cap = f.SizeBytes() 1914 1915 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 1916 // Since we bypassed the compiler's escape analysis, indicate that f 1917 // must live until the use above. 1918 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 1919 return length, err 1920 } 1921 1922 // CopyIn implements marshal.Marshallable.CopyIn. 1923 func (f *FOwnerEx) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 1924 return f.CopyInN(cc, addr, f.SizeBytes()) 1925 } 1926 1927 // WriteTo implements io.WriterTo.WriteTo. 1928 func (f *FOwnerEx) WriteTo(writer io.Writer) (int64, error) { 1929 // Construct a slice backed by dst's underlying memory. 1930 var buf []byte 1931 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 1932 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 1933 hdr.Len = f.SizeBytes() 1934 hdr.Cap = f.SizeBytes() 1935 1936 length, err := writer.Write(buf) 1937 // Since we bypassed the compiler's escape analysis, indicate that f 1938 // must live until the use above. 1939 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 1940 return int64(length), err 1941 } 1942 1943 // SizeBytes implements marshal.Marshallable.SizeBytes. 1944 func (f *Flock) SizeBytes() int { 1945 return 24 + 1946 1*4 + 1947 1*4 1948 } 1949 1950 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 1951 func (f *Flock) MarshalBytes(dst []byte) []byte { 1952 hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.Type)) 1953 dst = dst[2:] 1954 hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.Whence)) 1955 dst = dst[2:] 1956 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 1957 dst = dst[1*(4):] 1958 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Start)) 1959 dst = dst[8:] 1960 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Len)) 1961 dst = dst[8:] 1962 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.PID)) 1963 dst = dst[4:] 1964 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 1965 dst = dst[1*(4):] 1966 return dst 1967 } 1968 1969 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 1970 func (f *Flock) UnmarshalBytes(src []byte) []byte { 1971 f.Type = int16(hostarch.ByteOrder.Uint16(src[:2])) 1972 src = src[2:] 1973 f.Whence = int16(hostarch.ByteOrder.Uint16(src[:2])) 1974 src = src[2:] 1975 // Padding: ~ copy([4]byte(f._), src[:sizeof(byte)*4]) 1976 src = src[1*(4):] 1977 f.Start = int64(hostarch.ByteOrder.Uint64(src[:8])) 1978 src = src[8:] 1979 f.Len = int64(hostarch.ByteOrder.Uint64(src[:8])) 1980 src = src[8:] 1981 f.PID = int32(hostarch.ByteOrder.Uint32(src[:4])) 1982 src = src[4:] 1983 // Padding: ~ copy([4]byte(f._), src[:sizeof(byte)*4]) 1984 src = src[1*(4):] 1985 return src 1986 } 1987 1988 // Packed implements marshal.Marshallable.Packed. 1989 //go:nosplit 1990 func (f *Flock) Packed() bool { 1991 return true 1992 } 1993 1994 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 1995 func (f *Flock) MarshalUnsafe(dst []byte) []byte { 1996 size := f.SizeBytes() 1997 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 1998 return dst[size:] 1999 } 2000 2001 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2002 func (f *Flock) UnmarshalUnsafe(src []byte) []byte { 2003 size := f.SizeBytes() 2004 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 2005 return src[size:] 2006 } 2007 2008 // CopyOutN implements marshal.Marshallable.CopyOutN. 2009 func (f *Flock) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2010 // Construct a slice backed by dst's underlying memory. 2011 var buf []byte 2012 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2013 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 2014 hdr.Len = f.SizeBytes() 2015 hdr.Cap = f.SizeBytes() 2016 2017 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2018 // Since we bypassed the compiler's escape analysis, indicate that f 2019 // must live until the use above. 2020 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 2021 return length, err 2022 } 2023 2024 // CopyOut implements marshal.Marshallable.CopyOut. 2025 func (f *Flock) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2026 return f.CopyOutN(cc, addr, f.SizeBytes()) 2027 } 2028 2029 // CopyInN implements marshal.Marshallable.CopyInN. 2030 func (f *Flock) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2031 // Construct a slice backed by dst's underlying memory. 2032 var buf []byte 2033 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2034 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 2035 hdr.Len = f.SizeBytes() 2036 hdr.Cap = f.SizeBytes() 2037 2038 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2039 // Since we bypassed the compiler's escape analysis, indicate that f 2040 // must live until the use above. 2041 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 2042 return length, err 2043 } 2044 2045 // CopyIn implements marshal.Marshallable.CopyIn. 2046 func (f *Flock) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2047 return f.CopyInN(cc, addr, f.SizeBytes()) 2048 } 2049 2050 // WriteTo implements io.WriterTo.WriteTo. 2051 func (f *Flock) WriteTo(writer io.Writer) (int64, error) { 2052 // Construct a slice backed by dst's underlying memory. 2053 var buf []byte 2054 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2055 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 2056 hdr.Len = f.SizeBytes() 2057 hdr.Cap = f.SizeBytes() 2058 2059 length, err := writer.Write(buf) 2060 // Since we bypassed the compiler's escape analysis, indicate that f 2061 // must live until the use above. 2062 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 2063 return int64(length), err 2064 } 2065 2066 // SizeBytes implements marshal.Marshallable.SizeBytes. 2067 //go:nosplit 2068 func (m *FileMode) SizeBytes() int { 2069 return 2 2070 } 2071 2072 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2073 func (m *FileMode) MarshalBytes(dst []byte) []byte { 2074 hostarch.ByteOrder.PutUint16(dst[:2], uint16(*m)) 2075 return dst[2:] 2076 } 2077 2078 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2079 func (m *FileMode) UnmarshalBytes(src []byte) []byte { 2080 *m = FileMode(uint16(hostarch.ByteOrder.Uint16(src[:2]))) 2081 return src[2:] 2082 } 2083 2084 // Packed implements marshal.Marshallable.Packed. 2085 //go:nosplit 2086 func (m *FileMode) Packed() bool { 2087 // Scalar newtypes are always packed. 2088 return true 2089 } 2090 2091 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2092 func (m *FileMode) MarshalUnsafe(dst []byte) []byte { 2093 size := m.SizeBytes() 2094 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(size)) 2095 return dst[size:] 2096 } 2097 2098 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2099 func (m *FileMode) UnmarshalUnsafe(src []byte) []byte { 2100 size := m.SizeBytes() 2101 gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(size)) 2102 return src[size:] 2103 } 2104 2105 // CopyOutN implements marshal.Marshallable.CopyOutN. 2106 func (m *FileMode) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2107 // Construct a slice backed by dst's underlying memory. 2108 var buf []byte 2109 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2110 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) 2111 hdr.Len = m.SizeBytes() 2112 hdr.Cap = m.SizeBytes() 2113 2114 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2115 // Since we bypassed the compiler's escape analysis, indicate that m 2116 // must live until the use above. 2117 runtime.KeepAlive(m) // escapes: replaced by intrinsic. 2118 return length, err 2119 } 2120 2121 // CopyOut implements marshal.Marshallable.CopyOut. 2122 func (m *FileMode) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2123 return m.CopyOutN(cc, addr, m.SizeBytes()) 2124 } 2125 2126 // CopyInN implements marshal.Marshallable.CopyInN. 2127 func (m *FileMode) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2128 // Construct a slice backed by dst's underlying memory. 2129 var buf []byte 2130 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2131 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) 2132 hdr.Len = m.SizeBytes() 2133 hdr.Cap = m.SizeBytes() 2134 2135 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2136 // Since we bypassed the compiler's escape analysis, indicate that m 2137 // must live until the use above. 2138 runtime.KeepAlive(m) // escapes: replaced by intrinsic. 2139 return length, err 2140 } 2141 2142 // CopyIn implements marshal.Marshallable.CopyIn. 2143 func (m *FileMode) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2144 return m.CopyInN(cc, addr, m.SizeBytes()) 2145 } 2146 2147 // WriteTo implements io.WriterTo.WriteTo. 2148 func (m *FileMode) WriteTo(writer io.Writer) (int64, error) { 2149 // Construct a slice backed by dst's underlying memory. 2150 var buf []byte 2151 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2152 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) 2153 hdr.Len = m.SizeBytes() 2154 hdr.Cap = m.SizeBytes() 2155 2156 length, err := writer.Write(buf) 2157 // Since we bypassed the compiler's escape analysis, indicate that m 2158 // must live until the use above. 2159 runtime.KeepAlive(m) // escapes: replaced by intrinsic. 2160 return int64(length), err 2161 } 2162 2163 // SizeBytes implements marshal.Marshallable.SizeBytes. 2164 func (s *Statx) SizeBytes() int { 2165 return 80 + 2166 (*StatxTimestamp)(nil).SizeBytes() + 2167 (*StatxTimestamp)(nil).SizeBytes() + 2168 (*StatxTimestamp)(nil).SizeBytes() + 2169 (*StatxTimestamp)(nil).SizeBytes() 2170 } 2171 2172 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2173 func (s *Statx) MarshalBytes(dst []byte) []byte { 2174 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Mask)) 2175 dst = dst[4:] 2176 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Blksize)) 2177 dst = dst[4:] 2178 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Attributes)) 2179 dst = dst[8:] 2180 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Nlink)) 2181 dst = dst[4:] 2182 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.UID)) 2183 dst = dst[4:] 2184 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.GID)) 2185 dst = dst[4:] 2186 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Mode)) 2187 dst = dst[2:] 2188 // Padding: dst[:sizeof(uint16)] ~= uint16(0) 2189 dst = dst[2:] 2190 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Ino)) 2191 dst = dst[8:] 2192 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Size)) 2193 dst = dst[8:] 2194 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Blocks)) 2195 dst = dst[8:] 2196 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.AttributesMask)) 2197 dst = dst[8:] 2198 dst = s.Atime.MarshalUnsafe(dst) 2199 dst = s.Btime.MarshalUnsafe(dst) 2200 dst = s.Ctime.MarshalUnsafe(dst) 2201 dst = s.Mtime.MarshalUnsafe(dst) 2202 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.RdevMajor)) 2203 dst = dst[4:] 2204 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.RdevMinor)) 2205 dst = dst[4:] 2206 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.DevMajor)) 2207 dst = dst[4:] 2208 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.DevMinor)) 2209 dst = dst[4:] 2210 return dst 2211 } 2212 2213 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2214 func (s *Statx) UnmarshalBytes(src []byte) []byte { 2215 s.Mask = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2216 src = src[4:] 2217 s.Blksize = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2218 src = src[4:] 2219 s.Attributes = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2220 src = src[8:] 2221 s.Nlink = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2222 src = src[4:] 2223 s.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2224 src = src[4:] 2225 s.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2226 src = src[4:] 2227 s.Mode = uint16(hostarch.ByteOrder.Uint16(src[:2])) 2228 src = src[2:] 2229 // Padding: var _ uint16 ~= src[:sizeof(uint16)] 2230 src = src[2:] 2231 s.Ino = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2232 src = src[8:] 2233 s.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2234 src = src[8:] 2235 s.Blocks = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2236 src = src[8:] 2237 s.AttributesMask = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2238 src = src[8:] 2239 src = s.Atime.UnmarshalUnsafe(src) 2240 src = s.Btime.UnmarshalUnsafe(src) 2241 src = s.Ctime.UnmarshalUnsafe(src) 2242 src = s.Mtime.UnmarshalUnsafe(src) 2243 s.RdevMajor = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2244 src = src[4:] 2245 s.RdevMinor = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2246 src = src[4:] 2247 s.DevMajor = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2248 src = src[4:] 2249 s.DevMinor = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2250 src = src[4:] 2251 return src 2252 } 2253 2254 // Packed implements marshal.Marshallable.Packed. 2255 //go:nosplit 2256 func (s *Statx) Packed() bool { 2257 return s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() 2258 } 2259 2260 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2261 func (s *Statx) MarshalUnsafe(dst []byte) []byte { 2262 if s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { 2263 size := s.SizeBytes() 2264 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 2265 return dst[size:] 2266 } 2267 // Type Statx doesn't have a packed layout in memory, fallback to MarshalBytes. 2268 return s.MarshalBytes(dst) 2269 } 2270 2271 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2272 func (s *Statx) UnmarshalUnsafe(src []byte) []byte { 2273 if s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { 2274 size := s.SizeBytes() 2275 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 2276 return src[size:] 2277 } 2278 // Type Statx doesn't have a packed layout in memory, fallback to UnmarshalBytes. 2279 return s.UnmarshalBytes(src) 2280 } 2281 2282 // CopyOutN implements marshal.Marshallable.CopyOutN. 2283 func (s *Statx) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2284 if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { 2285 // Type Statx doesn't have a packed layout in memory, fall back to MarshalBytes. 2286 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 2287 s.MarshalBytes(buf) // escapes: fallback. 2288 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2289 } 2290 2291 // Construct a slice backed by dst's underlying memory. 2292 var buf []byte 2293 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2294 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 2295 hdr.Len = s.SizeBytes() 2296 hdr.Cap = s.SizeBytes() 2297 2298 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2299 // Since we bypassed the compiler's escape analysis, indicate that s 2300 // must live until the use above. 2301 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 2302 return length, err 2303 } 2304 2305 // CopyOut implements marshal.Marshallable.CopyOut. 2306 func (s *Statx) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2307 return s.CopyOutN(cc, addr, s.SizeBytes()) 2308 } 2309 2310 // CopyInN implements marshal.Marshallable.CopyInN. 2311 func (s *Statx) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2312 if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { 2313 // Type Statx doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2314 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 2315 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2316 // Unmarshal unconditionally. If we had a short copy-in, this results in a 2317 // partially unmarshalled struct. 2318 s.UnmarshalBytes(buf) // escapes: fallback. 2319 return length, err 2320 } 2321 2322 // Construct a slice backed by dst's underlying memory. 2323 var buf []byte 2324 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2325 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 2326 hdr.Len = s.SizeBytes() 2327 hdr.Cap = s.SizeBytes() 2328 2329 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2330 // Since we bypassed the compiler's escape analysis, indicate that s 2331 // must live until the use above. 2332 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 2333 return length, err 2334 } 2335 2336 // CopyIn implements marshal.Marshallable.CopyIn. 2337 func (s *Statx) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2338 return s.CopyInN(cc, addr, s.SizeBytes()) 2339 } 2340 2341 // WriteTo implements io.WriterTo.WriteTo. 2342 func (s *Statx) WriteTo(writer io.Writer) (int64, error) { 2343 if !s.Atime.Packed() && s.Btime.Packed() && s.Ctime.Packed() && s.Mtime.Packed() { 2344 // Type Statx doesn't have a packed layout in memory, fall back to MarshalBytes. 2345 buf := make([]byte, s.SizeBytes()) 2346 s.MarshalBytes(buf) 2347 length, err := writer.Write(buf) 2348 return int64(length), err 2349 } 2350 2351 // Construct a slice backed by dst's underlying memory. 2352 var buf []byte 2353 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2354 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 2355 hdr.Len = s.SizeBytes() 2356 hdr.Cap = s.SizeBytes() 2357 2358 length, err := writer.Write(buf) 2359 // Since we bypassed the compiler's escape analysis, indicate that s 2360 // must live until the use above. 2361 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 2362 return int64(length), err 2363 } 2364 2365 // CheckedMarshal implements marshal.CheckedMarshallable.CheckedMarshal. 2366 func (s *Statx) CheckedMarshal(dst []byte) ([]byte, bool) { 2367 if s.SizeBytes() > len(dst) { 2368 return dst, false 2369 } 2370 return s.MarshalUnsafe(dst), true 2371 } 2372 2373 // CheckedUnmarshal implements marshal.CheckedMarshallable.CheckedUnmarshal. 2374 func (s *Statx) CheckedUnmarshal(src []byte) ([]byte, bool) { 2375 if s.SizeBytes() > len(src) { 2376 return src, false 2377 } 2378 return s.UnmarshalUnsafe(src), true 2379 } 2380 2381 // CopyStatxSliceIn copies in a slice of Statx objects from the task's memory. 2382 func CopyStatxSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []Statx) (int, error) { 2383 count := len(dst) 2384 if count == 0 { 2385 return 0, nil 2386 } 2387 size := (*Statx)(nil).SizeBytes() 2388 2389 if !dst[0].Packed() { 2390 // Type Statx doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2391 buf := cc.CopyScratchBuffer(size * count) 2392 length, err := cc.CopyInBytes(addr, buf) 2393 2394 // Unmarshal as much as possible, even on error. First handle full objects. 2395 limit := length/size 2396 for idx := 0; idx < limit; idx++ { 2397 buf = dst[idx].UnmarshalBytes(buf) 2398 } 2399 2400 // Handle any final partial object. buf is guaranteed to be long enough for the 2401 // final element, but may not contain valid data for the entire range. This may 2402 // result in unmarshalling zero values for some parts of the object. 2403 if length%size != 0 { 2404 dst[limit].UnmarshalBytes(buf) 2405 } 2406 2407 return length, err 2408 } 2409 2410 ptr := unsafe.Pointer(&dst) 2411 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 2412 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(val) 2417 hdr.Len = size * count 2418 hdr.Cap = size * count 2419 2420 length, err := cc.CopyInBytes(addr, buf) 2421 // Since we bypassed the compiler's escape analysis, indicate that dst 2422 // must live until the use above. 2423 runtime.KeepAlive(dst) // escapes: replaced by intrinsic. 2424 return length, err 2425 } 2426 2427 // CopyStatxSliceOut copies a slice of Statx objects to the task's memory. 2428 func CopyStatxSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []Statx) (int, error) { 2429 count := len(src) 2430 if count == 0 { 2431 return 0, nil 2432 } 2433 size := (*Statx)(nil).SizeBytes() 2434 2435 if !src[0].Packed() { 2436 // Type Statx doesn't have a packed layout in memory, fall back to MarshalBytes. 2437 buf := cc.CopyScratchBuffer(size * count) 2438 curBuf := buf 2439 for idx := 0; idx < count; idx++ { 2440 curBuf = src[idx].MarshalBytes(curBuf) 2441 } 2442 return cc.CopyOutBytes(addr, buf) 2443 } 2444 2445 ptr := unsafe.Pointer(&src) 2446 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 2447 2448 // Construct a slice backed by dst's underlying memory. 2449 var buf []byte 2450 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2451 hdr.Data = uintptr(val) 2452 hdr.Len = size * count 2453 hdr.Cap = size * count 2454 2455 length, err := cc.CopyOutBytes(addr, buf) 2456 // Since we bypassed the compiler's escape analysis, indicate that src 2457 // must live until the use above. 2458 runtime.KeepAlive(src) // escapes: replaced by intrinsic. 2459 return length, err 2460 } 2461 2462 // MarshalUnsafeStatxSlice is like Statx.MarshalUnsafe, but for a []Statx. 2463 func MarshalUnsafeStatxSlice(src []Statx, dst []byte) []byte { 2464 count := len(src) 2465 if count == 0 { 2466 return dst 2467 } 2468 2469 if !src[0].Packed() { 2470 // Type Statx doesn't have a packed layout in memory, fall back to MarshalBytes. 2471 for idx := 0; idx < count; idx++ { 2472 dst = src[idx].MarshalBytes(dst) 2473 } 2474 return dst 2475 } 2476 2477 size := (*Statx)(nil).SizeBytes() 2478 buf := dst[:size*count] 2479 gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) 2480 return dst[size*count:] 2481 } 2482 2483 // UnmarshalUnsafeStatxSlice is like Statx.UnmarshalUnsafe, but for a []Statx. 2484 func UnmarshalUnsafeStatxSlice(dst []Statx, src []byte) []byte { 2485 count := len(dst) 2486 if count == 0 { 2487 return src 2488 } 2489 2490 if !dst[0].Packed() { 2491 // Type Statx doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2492 for idx := 0; idx < count; idx++ { 2493 src = dst[idx].UnmarshalBytes(src) 2494 } 2495 return src 2496 } 2497 2498 size := (*Statx)(nil).SizeBytes() 2499 buf := src[:size*count] 2500 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) 2501 return src[size*count:] 2502 } 2503 2504 // SizeBytes implements marshal.Marshallable.SizeBytes. 2505 func (s *Statfs) SizeBytes() int { 2506 return 80 + 2507 4*2 + 2508 8*4 2509 } 2510 2511 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2512 func (s *Statfs) MarshalBytes(dst []byte) []byte { 2513 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Type)) 2514 dst = dst[8:] 2515 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.BlockSize)) 2516 dst = dst[8:] 2517 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Blocks)) 2518 dst = dst[8:] 2519 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.BlocksFree)) 2520 dst = dst[8:] 2521 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.BlocksAvailable)) 2522 dst = dst[8:] 2523 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Files)) 2524 dst = dst[8:] 2525 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FilesFree)) 2526 dst = dst[8:] 2527 for idx := 0; idx < 2; idx++ { 2528 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.FSID[idx])) 2529 dst = dst[4:] 2530 } 2531 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.NameLength)) 2532 dst = dst[8:] 2533 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FragmentSize)) 2534 dst = dst[8:] 2535 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Flags)) 2536 dst = dst[8:] 2537 for idx := 0; idx < 4; idx++ { 2538 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Spare[idx])) 2539 dst = dst[8:] 2540 } 2541 return dst 2542 } 2543 2544 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2545 func (s *Statfs) UnmarshalBytes(src []byte) []byte { 2546 s.Type = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2547 src = src[8:] 2548 s.BlockSize = int64(hostarch.ByteOrder.Uint64(src[:8])) 2549 src = src[8:] 2550 s.Blocks = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2551 src = src[8:] 2552 s.BlocksFree = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2553 src = src[8:] 2554 s.BlocksAvailable = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2555 src = src[8:] 2556 s.Files = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2557 src = src[8:] 2558 s.FilesFree = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2559 src = src[8:] 2560 for idx := 0; idx < 2; idx++ { 2561 s.FSID[idx] = int32(hostarch.ByteOrder.Uint32(src[:4])) 2562 src = src[4:] 2563 } 2564 s.NameLength = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2565 src = src[8:] 2566 s.FragmentSize = int64(hostarch.ByteOrder.Uint64(src[:8])) 2567 src = src[8:] 2568 s.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2569 src = src[8:] 2570 for idx := 0; idx < 4; idx++ { 2571 s.Spare[idx] = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2572 src = src[8:] 2573 } 2574 return src 2575 } 2576 2577 // Packed implements marshal.Marshallable.Packed. 2578 //go:nosplit 2579 func (s *Statfs) Packed() bool { 2580 return true 2581 } 2582 2583 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2584 func (s *Statfs) MarshalUnsafe(dst []byte) []byte { 2585 size := s.SizeBytes() 2586 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 2587 return dst[size:] 2588 } 2589 2590 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2591 func (s *Statfs) UnmarshalUnsafe(src []byte) []byte { 2592 size := s.SizeBytes() 2593 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 2594 return src[size:] 2595 } 2596 2597 // CopyOutN implements marshal.Marshallable.CopyOutN. 2598 func (s *Statfs) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2599 // Construct a slice backed by dst's underlying memory. 2600 var buf []byte 2601 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2602 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 2603 hdr.Len = s.SizeBytes() 2604 hdr.Cap = s.SizeBytes() 2605 2606 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2607 // Since we bypassed the compiler's escape analysis, indicate that s 2608 // must live until the use above. 2609 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 2610 return length, err 2611 } 2612 2613 // CopyOut implements marshal.Marshallable.CopyOut. 2614 func (s *Statfs) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2615 return s.CopyOutN(cc, addr, s.SizeBytes()) 2616 } 2617 2618 // CopyInN implements marshal.Marshallable.CopyInN. 2619 func (s *Statfs) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2620 // Construct a slice backed by dst's underlying memory. 2621 var buf []byte 2622 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2623 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 2624 hdr.Len = s.SizeBytes() 2625 hdr.Cap = s.SizeBytes() 2626 2627 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2628 // Since we bypassed the compiler's escape analysis, indicate that s 2629 // must live until the use above. 2630 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 2631 return length, err 2632 } 2633 2634 // CopyIn implements marshal.Marshallable.CopyIn. 2635 func (s *Statfs) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2636 return s.CopyInN(cc, addr, s.SizeBytes()) 2637 } 2638 2639 // WriteTo implements io.WriterTo.WriteTo. 2640 func (s *Statfs) WriteTo(writer io.Writer) (int64, error) { 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(s))) 2645 hdr.Len = s.SizeBytes() 2646 hdr.Cap = s.SizeBytes() 2647 2648 length, err := writer.Write(buf) 2649 // Since we bypassed the compiler's escape analysis, indicate that s 2650 // must live until the use above. 2651 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 2652 return int64(length), err 2653 } 2654 2655 // Packed implements marshal.Marshallable.Packed. 2656 //go:nosplit 2657 func (s *CString) Packed() bool { 2658 // Type CString is dynamic so it might have slice/string headers. Hence, it is not packed. 2659 return false 2660 } 2661 2662 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2663 func (s *CString) MarshalUnsafe(dst []byte) []byte { 2664 // Type CString doesn't have a packed layout in memory, fallback to MarshalBytes. 2665 return s.MarshalBytes(dst) 2666 } 2667 2668 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2669 func (s *CString) UnmarshalUnsafe(src []byte) []byte { 2670 // Type CString doesn't have a packed layout in memory, fallback to UnmarshalBytes. 2671 return s.UnmarshalBytes(src) 2672 } 2673 2674 // CopyOutN implements marshal.Marshallable.CopyOutN. 2675 //go:nosplit 2676 func (s *CString) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2677 // Type CString doesn't have a packed layout in memory, fall back to MarshalBytes. 2678 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 2679 s.MarshalBytes(buf) // escapes: fallback. 2680 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2681 } 2682 2683 // CopyOut implements marshal.Marshallable.CopyOut. 2684 func (s *CString) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2685 return s.CopyOutN(cc, addr, s.SizeBytes()) 2686 } 2687 2688 // CopyInN implements marshal.Marshallable.CopyInN. 2689 //go:nosplit 2690 func (s *CString) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2691 // Type CString doesn't have a packed layout in memory, fall back to UnmarshalBytes. 2692 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 2693 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 2694 // Unmarshal unconditionally. If we had a short copy-in, this results in a 2695 // partially unmarshalled struct. 2696 s.UnmarshalBytes(buf) // escapes: fallback. 2697 return length, err 2698 } 2699 2700 // CopyIn implements marshal.Marshallable.CopyIn. 2701 func (s *CString) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2702 return s.CopyInN(cc, addr, s.SizeBytes()) 2703 } 2704 2705 // WriteTo implements io.WriterTo.WriteTo. 2706 func (s *CString) WriteTo(writer io.Writer) (int64, error) { 2707 // Type CString doesn't have a packed layout in memory, fall back to MarshalBytes. 2708 buf := make([]byte, s.SizeBytes()) 2709 s.MarshalBytes(buf) 2710 length, err := writer.Write(buf) 2711 return int64(length), err 2712 } 2713 2714 // SizeBytes implements marshal.Marshallable.SizeBytes. 2715 func (f *FUSEAccessIn) SizeBytes() int { 2716 return 8 2717 } 2718 2719 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2720 func (f *FUSEAccessIn) MarshalBytes(dst []byte) []byte { 2721 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mask)) 2722 dst = dst[4:] 2723 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 2724 dst = dst[4:] 2725 return dst 2726 } 2727 2728 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2729 func (f *FUSEAccessIn) UnmarshalBytes(src []byte) []byte { 2730 f.Mask = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2731 src = src[4:] 2732 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 2733 src = src[4:] 2734 return src 2735 } 2736 2737 // Packed implements marshal.Marshallable.Packed. 2738 //go:nosplit 2739 func (f *FUSEAccessIn) Packed() bool { 2740 return true 2741 } 2742 2743 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2744 func (f *FUSEAccessIn) MarshalUnsafe(dst []byte) []byte { 2745 size := f.SizeBytes() 2746 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 2747 return dst[size:] 2748 } 2749 2750 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2751 func (f *FUSEAccessIn) UnmarshalUnsafe(src []byte) []byte { 2752 size := f.SizeBytes() 2753 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 2754 return src[size:] 2755 } 2756 2757 // CopyOutN implements marshal.Marshallable.CopyOutN. 2758 func (f *FUSEAccessIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2759 // Construct a slice backed by dst's underlying memory. 2760 var buf []byte 2761 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2762 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 2763 hdr.Len = f.SizeBytes() 2764 hdr.Cap = f.SizeBytes() 2765 2766 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2767 // Since we bypassed the compiler's escape analysis, indicate that f 2768 // must live until the use above. 2769 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 2770 return length, err 2771 } 2772 2773 // CopyOut implements marshal.Marshallable.CopyOut. 2774 func (f *FUSEAccessIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2775 return f.CopyOutN(cc, addr, f.SizeBytes()) 2776 } 2777 2778 // CopyInN implements marshal.Marshallable.CopyInN. 2779 func (f *FUSEAccessIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2780 // Construct a slice backed by dst's underlying memory. 2781 var buf []byte 2782 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2783 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 2784 hdr.Len = f.SizeBytes() 2785 hdr.Cap = f.SizeBytes() 2786 2787 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2788 // Since we bypassed the compiler's escape analysis, indicate that f 2789 // must live until the use above. 2790 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 2791 return length, err 2792 } 2793 2794 // CopyIn implements marshal.Marshallable.CopyIn. 2795 func (f *FUSEAccessIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2796 return f.CopyInN(cc, addr, f.SizeBytes()) 2797 } 2798 2799 // WriteTo implements io.WriterTo.WriteTo. 2800 func (f *FUSEAccessIn) WriteTo(writer io.Writer) (int64, error) { 2801 // Construct a slice backed by dst's underlying memory. 2802 var buf []byte 2803 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2804 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 2805 hdr.Len = f.SizeBytes() 2806 hdr.Cap = f.SizeBytes() 2807 2808 length, err := writer.Write(buf) 2809 // Since we bypassed the compiler's escape analysis, indicate that f 2810 // must live until the use above. 2811 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 2812 return int64(length), err 2813 } 2814 2815 // SizeBytes implements marshal.Marshallable.SizeBytes. 2816 func (a *FUSEAttr) SizeBytes() int { 2817 return 88 2818 } 2819 2820 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2821 func (a *FUSEAttr) MarshalBytes(dst []byte) []byte { 2822 hostarch.ByteOrder.PutUint64(dst[:8], uint64(a.Ino)) 2823 dst = dst[8:] 2824 hostarch.ByteOrder.PutUint64(dst[:8], uint64(a.Size)) 2825 dst = dst[8:] 2826 hostarch.ByteOrder.PutUint64(dst[:8], uint64(a.Blocks)) 2827 dst = dst[8:] 2828 hostarch.ByteOrder.PutUint64(dst[:8], uint64(a.Atime)) 2829 dst = dst[8:] 2830 hostarch.ByteOrder.PutUint64(dst[:8], uint64(a.Mtime)) 2831 dst = dst[8:] 2832 hostarch.ByteOrder.PutUint64(dst[:8], uint64(a.Ctime)) 2833 dst = dst[8:] 2834 hostarch.ByteOrder.PutUint32(dst[:4], uint32(a.AtimeNsec)) 2835 dst = dst[4:] 2836 hostarch.ByteOrder.PutUint32(dst[:4], uint32(a.MtimeNsec)) 2837 dst = dst[4:] 2838 hostarch.ByteOrder.PutUint32(dst[:4], uint32(a.CtimeNsec)) 2839 dst = dst[4:] 2840 hostarch.ByteOrder.PutUint32(dst[:4], uint32(a.Mode)) 2841 dst = dst[4:] 2842 hostarch.ByteOrder.PutUint32(dst[:4], uint32(a.Nlink)) 2843 dst = dst[4:] 2844 hostarch.ByteOrder.PutUint32(dst[:4], uint32(a.UID)) 2845 dst = dst[4:] 2846 hostarch.ByteOrder.PutUint32(dst[:4], uint32(a.GID)) 2847 dst = dst[4:] 2848 hostarch.ByteOrder.PutUint32(dst[:4], uint32(a.Rdev)) 2849 dst = dst[4:] 2850 hostarch.ByteOrder.PutUint32(dst[:4], uint32(a.BlkSize)) 2851 dst = dst[4:] 2852 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 2853 dst = dst[4:] 2854 return dst 2855 } 2856 2857 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2858 func (a *FUSEAttr) UnmarshalBytes(src []byte) []byte { 2859 a.Ino = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2860 src = src[8:] 2861 a.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2862 src = src[8:] 2863 a.Blocks = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2864 src = src[8:] 2865 a.Atime = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2866 src = src[8:] 2867 a.Mtime = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2868 src = src[8:] 2869 a.Ctime = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2870 src = src[8:] 2871 a.AtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2872 src = src[4:] 2873 a.MtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2874 src = src[4:] 2875 a.CtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2876 src = src[4:] 2877 a.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2878 src = src[4:] 2879 a.Nlink = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2880 src = src[4:] 2881 a.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2882 src = src[4:] 2883 a.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2884 src = src[4:] 2885 a.Rdev = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2886 src = src[4:] 2887 a.BlkSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2888 src = src[4:] 2889 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 2890 src = src[4:] 2891 return src 2892 } 2893 2894 // Packed implements marshal.Marshallable.Packed. 2895 //go:nosplit 2896 func (a *FUSEAttr) Packed() bool { 2897 return true 2898 } 2899 2900 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 2901 func (a *FUSEAttr) MarshalUnsafe(dst []byte) []byte { 2902 size := a.SizeBytes() 2903 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(a), uintptr(size)) 2904 return dst[size:] 2905 } 2906 2907 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 2908 func (a *FUSEAttr) UnmarshalUnsafe(src []byte) []byte { 2909 size := a.SizeBytes() 2910 gohacks.Memmove(unsafe.Pointer(a), unsafe.Pointer(&src[0]), uintptr(size)) 2911 return src[size:] 2912 } 2913 2914 // CopyOutN implements marshal.Marshallable.CopyOutN. 2915 func (a *FUSEAttr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2916 // Construct a slice backed by dst's underlying memory. 2917 var buf []byte 2918 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2919 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(a))) 2920 hdr.Len = a.SizeBytes() 2921 hdr.Cap = a.SizeBytes() 2922 2923 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 2924 // Since we bypassed the compiler's escape analysis, indicate that a 2925 // must live until the use above. 2926 runtime.KeepAlive(a) // escapes: replaced by intrinsic. 2927 return length, err 2928 } 2929 2930 // CopyOut implements marshal.Marshallable.CopyOut. 2931 func (a *FUSEAttr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2932 return a.CopyOutN(cc, addr, a.SizeBytes()) 2933 } 2934 2935 // CopyInN implements marshal.Marshallable.CopyInN. 2936 func (a *FUSEAttr) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 2937 // Construct a slice backed by dst's underlying memory. 2938 var buf []byte 2939 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2940 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(a))) 2941 hdr.Len = a.SizeBytes() 2942 hdr.Cap = a.SizeBytes() 2943 2944 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 2945 // Since we bypassed the compiler's escape analysis, indicate that a 2946 // must live until the use above. 2947 runtime.KeepAlive(a) // escapes: replaced by intrinsic. 2948 return length, err 2949 } 2950 2951 // CopyIn implements marshal.Marshallable.CopyIn. 2952 func (a *FUSEAttr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 2953 return a.CopyInN(cc, addr, a.SizeBytes()) 2954 } 2955 2956 // WriteTo implements io.WriterTo.WriteTo. 2957 func (a *FUSEAttr) WriteTo(writer io.Writer) (int64, error) { 2958 // Construct a slice backed by dst's underlying memory. 2959 var buf []byte 2960 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 2961 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(a))) 2962 hdr.Len = a.SizeBytes() 2963 hdr.Cap = a.SizeBytes() 2964 2965 length, err := writer.Write(buf) 2966 // Since we bypassed the compiler's escape analysis, indicate that a 2967 // must live until the use above. 2968 runtime.KeepAlive(a) // escapes: replaced by intrinsic. 2969 return int64(length), err 2970 } 2971 2972 // SizeBytes implements marshal.Marshallable.SizeBytes. 2973 func (f *FUSEAttrOut) SizeBytes() int { 2974 return 16 + 2975 (*FUSEAttr)(nil).SizeBytes() 2976 } 2977 2978 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 2979 func (f *FUSEAttrOut) MarshalBytes(dst []byte) []byte { 2980 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.AttrValid)) 2981 dst = dst[8:] 2982 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.AttrValidNsec)) 2983 dst = dst[4:] 2984 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 2985 dst = dst[4:] 2986 dst = f.Attr.MarshalUnsafe(dst) 2987 return dst 2988 } 2989 2990 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 2991 func (f *FUSEAttrOut) UnmarshalBytes(src []byte) []byte { 2992 f.AttrValid = uint64(hostarch.ByteOrder.Uint64(src[:8])) 2993 src = src[8:] 2994 f.AttrValidNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 2995 src = src[4:] 2996 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 2997 src = src[4:] 2998 src = f.Attr.UnmarshalUnsafe(src) 2999 return src 3000 } 3001 3002 // Packed implements marshal.Marshallable.Packed. 3003 //go:nosplit 3004 func (f *FUSEAttrOut) Packed() bool { 3005 return f.Attr.Packed() 3006 } 3007 3008 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3009 func (f *FUSEAttrOut) MarshalUnsafe(dst []byte) []byte { 3010 if f.Attr.Packed() { 3011 size := f.SizeBytes() 3012 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 3013 return dst[size:] 3014 } 3015 // Type FUSEAttrOut doesn't have a packed layout in memory, fallback to MarshalBytes. 3016 return f.MarshalBytes(dst) 3017 } 3018 3019 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3020 func (f *FUSEAttrOut) UnmarshalUnsafe(src []byte) []byte { 3021 if f.Attr.Packed() { 3022 size := f.SizeBytes() 3023 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 3024 return src[size:] 3025 } 3026 // Type FUSEAttrOut doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3027 return f.UnmarshalBytes(src) 3028 } 3029 3030 // CopyOutN implements marshal.Marshallable.CopyOutN. 3031 func (f *FUSEAttrOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3032 if !f.Attr.Packed() { 3033 // Type FUSEAttrOut doesn't have a packed layout in memory, fall back to MarshalBytes. 3034 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 3035 f.MarshalBytes(buf) // escapes: fallback. 3036 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3037 } 3038 3039 // Construct a slice backed by dst's underlying memory. 3040 var buf []byte 3041 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3042 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3043 hdr.Len = f.SizeBytes() 3044 hdr.Cap = f.SizeBytes() 3045 3046 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3047 // Since we bypassed the compiler's escape analysis, indicate that f 3048 // must live until the use above. 3049 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3050 return length, err 3051 } 3052 3053 // CopyOut implements marshal.Marshallable.CopyOut. 3054 func (f *FUSEAttrOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3055 return f.CopyOutN(cc, addr, f.SizeBytes()) 3056 } 3057 3058 // CopyInN implements marshal.Marshallable.CopyInN. 3059 func (f *FUSEAttrOut) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3060 if !f.Attr.Packed() { 3061 // Type FUSEAttrOut doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3062 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 3063 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3064 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3065 // partially unmarshalled struct. 3066 f.UnmarshalBytes(buf) // escapes: fallback. 3067 return length, err 3068 } 3069 3070 // Construct a slice backed by dst's underlying memory. 3071 var buf []byte 3072 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3073 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3074 hdr.Len = f.SizeBytes() 3075 hdr.Cap = f.SizeBytes() 3076 3077 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3078 // Since we bypassed the compiler's escape analysis, indicate that f 3079 // must live until the use above. 3080 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3081 return length, err 3082 } 3083 3084 // CopyIn implements marshal.Marshallable.CopyIn. 3085 func (f *FUSEAttrOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3086 return f.CopyInN(cc, addr, f.SizeBytes()) 3087 } 3088 3089 // WriteTo implements io.WriterTo.WriteTo. 3090 func (f *FUSEAttrOut) WriteTo(writer io.Writer) (int64, error) { 3091 if !f.Attr.Packed() { 3092 // Type FUSEAttrOut doesn't have a packed layout in memory, fall back to MarshalBytes. 3093 buf := make([]byte, f.SizeBytes()) 3094 f.MarshalBytes(buf) 3095 length, err := writer.Write(buf) 3096 return int64(length), err 3097 } 3098 3099 // Construct a slice backed by dst's underlying memory. 3100 var buf []byte 3101 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3102 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3103 hdr.Len = f.SizeBytes() 3104 hdr.Cap = f.SizeBytes() 3105 3106 length, err := writer.Write(buf) 3107 // Since we bypassed the compiler's escape analysis, indicate that f 3108 // must live until the use above. 3109 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3110 return int64(length), err 3111 } 3112 3113 // Packed implements marshal.Marshallable.Packed. 3114 //go:nosplit 3115 func (r *FUSECreateIn) Packed() bool { 3116 // Type FUSECreateIn is dynamic so it might have slice/string headers. Hence, it is not packed. 3117 return false 3118 } 3119 3120 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3121 func (r *FUSECreateIn) MarshalUnsafe(dst []byte) []byte { 3122 // Type FUSECreateIn doesn't have a packed layout in memory, fallback to MarshalBytes. 3123 return r.MarshalBytes(dst) 3124 } 3125 3126 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3127 func (r *FUSECreateIn) UnmarshalUnsafe(src []byte) []byte { 3128 // Type FUSECreateIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3129 return r.UnmarshalBytes(src) 3130 } 3131 3132 // CopyOutN implements marshal.Marshallable.CopyOutN. 3133 //go:nosplit 3134 func (r *FUSECreateIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3135 // Type FUSECreateIn doesn't have a packed layout in memory, fall back to MarshalBytes. 3136 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 3137 r.MarshalBytes(buf) // escapes: fallback. 3138 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3139 } 3140 3141 // CopyOut implements marshal.Marshallable.CopyOut. 3142 func (r *FUSECreateIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3143 return r.CopyOutN(cc, addr, r.SizeBytes()) 3144 } 3145 3146 // CopyInN implements marshal.Marshallable.CopyInN. 3147 //go:nosplit 3148 func (r *FUSECreateIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3149 // Type FUSECreateIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3150 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 3151 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 3152 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3153 // partially unmarshalled struct. 3154 r.UnmarshalBytes(buf) // escapes: fallback. 3155 return length, err 3156 } 3157 3158 // CopyIn implements marshal.Marshallable.CopyIn. 3159 func (r *FUSECreateIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3160 return r.CopyInN(cc, addr, r.SizeBytes()) 3161 } 3162 3163 // WriteTo implements io.WriterTo.WriteTo. 3164 func (r *FUSECreateIn) WriteTo(writer io.Writer) (int64, error) { 3165 // Type FUSECreateIn doesn't have a packed layout in memory, fall back to MarshalBytes. 3166 buf := make([]byte, r.SizeBytes()) 3167 r.MarshalBytes(buf) 3168 length, err := writer.Write(buf) 3169 return int64(length), err 3170 } 3171 3172 // SizeBytes implements marshal.Marshallable.SizeBytes. 3173 func (f *FUSECreateMeta) SizeBytes() int { 3174 return 16 3175 } 3176 3177 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3178 func (f *FUSECreateMeta) MarshalBytes(dst []byte) []byte { 3179 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) 3180 dst = dst[4:] 3181 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) 3182 dst = dst[4:] 3183 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Umask)) 3184 dst = dst[4:] 3185 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 3186 dst = dst[4:] 3187 return dst 3188 } 3189 3190 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3191 func (f *FUSECreateMeta) UnmarshalBytes(src []byte) []byte { 3192 f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3193 src = src[4:] 3194 f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3195 src = src[4:] 3196 f.Umask = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3197 src = src[4:] 3198 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 3199 src = src[4:] 3200 return src 3201 } 3202 3203 // Packed implements marshal.Marshallable.Packed. 3204 //go:nosplit 3205 func (f *FUSECreateMeta) Packed() bool { 3206 return true 3207 } 3208 3209 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3210 func (f *FUSECreateMeta) MarshalUnsafe(dst []byte) []byte { 3211 size := f.SizeBytes() 3212 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 3213 return dst[size:] 3214 } 3215 3216 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3217 func (f *FUSECreateMeta) UnmarshalUnsafe(src []byte) []byte { 3218 size := f.SizeBytes() 3219 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 3220 return src[size:] 3221 } 3222 3223 // CopyOutN implements marshal.Marshallable.CopyOutN. 3224 func (f *FUSECreateMeta) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3225 // Construct a slice backed by dst's underlying memory. 3226 var buf []byte 3227 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3228 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3229 hdr.Len = f.SizeBytes() 3230 hdr.Cap = f.SizeBytes() 3231 3232 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3233 // Since we bypassed the compiler's escape analysis, indicate that f 3234 // must live until the use above. 3235 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3236 return length, err 3237 } 3238 3239 // CopyOut implements marshal.Marshallable.CopyOut. 3240 func (f *FUSECreateMeta) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3241 return f.CopyOutN(cc, addr, f.SizeBytes()) 3242 } 3243 3244 // CopyInN implements marshal.Marshallable.CopyInN. 3245 func (f *FUSECreateMeta) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3246 // Construct a slice backed by dst's underlying memory. 3247 var buf []byte 3248 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3249 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3250 hdr.Len = f.SizeBytes() 3251 hdr.Cap = f.SizeBytes() 3252 3253 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3254 // Since we bypassed the compiler's escape analysis, indicate that f 3255 // must live until the use above. 3256 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3257 return length, err 3258 } 3259 3260 // CopyIn implements marshal.Marshallable.CopyIn. 3261 func (f *FUSECreateMeta) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3262 return f.CopyInN(cc, addr, f.SizeBytes()) 3263 } 3264 3265 // WriteTo implements io.WriterTo.WriteTo. 3266 func (f *FUSECreateMeta) WriteTo(writer io.Writer) (int64, error) { 3267 // Construct a slice backed by dst's underlying memory. 3268 var buf []byte 3269 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3270 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3271 hdr.Len = f.SizeBytes() 3272 hdr.Cap = f.SizeBytes() 3273 3274 length, err := writer.Write(buf) 3275 // Since we bypassed the compiler's escape analysis, indicate that f 3276 // must live until the use above. 3277 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3278 return int64(length), err 3279 } 3280 3281 // SizeBytes implements marshal.Marshallable.SizeBytes. 3282 func (f *FUSECreateOut) SizeBytes() int { 3283 return 0 + 3284 (*FUSEEntryOut)(nil).SizeBytes() + 3285 (*FUSEOpenOut)(nil).SizeBytes() 3286 } 3287 3288 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3289 func (f *FUSECreateOut) MarshalBytes(dst []byte) []byte { 3290 dst = f.FUSEEntryOut.MarshalUnsafe(dst) 3291 dst = f.FUSEOpenOut.MarshalUnsafe(dst) 3292 return dst 3293 } 3294 3295 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3296 func (f *FUSECreateOut) UnmarshalBytes(src []byte) []byte { 3297 src = f.FUSEEntryOut.UnmarshalUnsafe(src) 3298 src = f.FUSEOpenOut.UnmarshalUnsafe(src) 3299 return src 3300 } 3301 3302 // Packed implements marshal.Marshallable.Packed. 3303 //go:nosplit 3304 func (f *FUSECreateOut) Packed() bool { 3305 return f.FUSEEntryOut.Packed() && f.FUSEOpenOut.Packed() 3306 } 3307 3308 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3309 func (f *FUSECreateOut) MarshalUnsafe(dst []byte) []byte { 3310 if f.FUSEEntryOut.Packed() && f.FUSEOpenOut.Packed() { 3311 size := f.SizeBytes() 3312 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 3313 return dst[size:] 3314 } 3315 // Type FUSECreateOut doesn't have a packed layout in memory, fallback to MarshalBytes. 3316 return f.MarshalBytes(dst) 3317 } 3318 3319 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3320 func (f *FUSECreateOut) UnmarshalUnsafe(src []byte) []byte { 3321 if f.FUSEEntryOut.Packed() && f.FUSEOpenOut.Packed() { 3322 size := f.SizeBytes() 3323 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 3324 return src[size:] 3325 } 3326 // Type FUSECreateOut doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3327 return f.UnmarshalBytes(src) 3328 } 3329 3330 // CopyOutN implements marshal.Marshallable.CopyOutN. 3331 func (f *FUSECreateOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3332 if !f.FUSEEntryOut.Packed() && f.FUSEOpenOut.Packed() { 3333 // Type FUSECreateOut doesn't have a packed layout in memory, fall back to MarshalBytes. 3334 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 3335 f.MarshalBytes(buf) // escapes: fallback. 3336 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3337 } 3338 3339 // Construct a slice backed by dst's underlying memory. 3340 var buf []byte 3341 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3342 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3343 hdr.Len = f.SizeBytes() 3344 hdr.Cap = f.SizeBytes() 3345 3346 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3347 // Since we bypassed the compiler's escape analysis, indicate that f 3348 // must live until the use above. 3349 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3350 return length, err 3351 } 3352 3353 // CopyOut implements marshal.Marshallable.CopyOut. 3354 func (f *FUSECreateOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3355 return f.CopyOutN(cc, addr, f.SizeBytes()) 3356 } 3357 3358 // CopyInN implements marshal.Marshallable.CopyInN. 3359 func (f *FUSECreateOut) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3360 if !f.FUSEEntryOut.Packed() && f.FUSEOpenOut.Packed() { 3361 // Type FUSECreateOut doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3362 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 3363 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3364 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3365 // partially unmarshalled struct. 3366 f.UnmarshalBytes(buf) // escapes: fallback. 3367 return length, err 3368 } 3369 3370 // Construct a slice backed by dst's underlying memory. 3371 var buf []byte 3372 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3373 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3374 hdr.Len = f.SizeBytes() 3375 hdr.Cap = f.SizeBytes() 3376 3377 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3378 // Since we bypassed the compiler's escape analysis, indicate that f 3379 // must live until the use above. 3380 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3381 return length, err 3382 } 3383 3384 // CopyIn implements marshal.Marshallable.CopyIn. 3385 func (f *FUSECreateOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3386 return f.CopyInN(cc, addr, f.SizeBytes()) 3387 } 3388 3389 // WriteTo implements io.WriterTo.WriteTo. 3390 func (f *FUSECreateOut) WriteTo(writer io.Writer) (int64, error) { 3391 if !f.FUSEEntryOut.Packed() && f.FUSEOpenOut.Packed() { 3392 // Type FUSECreateOut doesn't have a packed layout in memory, fall back to MarshalBytes. 3393 buf := make([]byte, f.SizeBytes()) 3394 f.MarshalBytes(buf) 3395 length, err := writer.Write(buf) 3396 return int64(length), err 3397 } 3398 3399 // Construct a slice backed by dst's underlying memory. 3400 var buf []byte 3401 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3402 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3403 hdr.Len = f.SizeBytes() 3404 hdr.Cap = f.SizeBytes() 3405 3406 length, err := writer.Write(buf) 3407 // Since we bypassed the compiler's escape analysis, indicate that f 3408 // must live until the use above. 3409 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3410 return int64(length), err 3411 } 3412 3413 // Packed implements marshal.Marshallable.Packed. 3414 //go:nosplit 3415 func (r *FUSEDirent) Packed() bool { 3416 // Type FUSEDirent is dynamic so it might have slice/string headers. Hence, it is not packed. 3417 return false 3418 } 3419 3420 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3421 func (r *FUSEDirent) MarshalUnsafe(dst []byte) []byte { 3422 // Type FUSEDirent doesn't have a packed layout in memory, fallback to MarshalBytes. 3423 return r.MarshalBytes(dst) 3424 } 3425 3426 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3427 func (r *FUSEDirent) UnmarshalUnsafe(src []byte) []byte { 3428 // Type FUSEDirent doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3429 return r.UnmarshalBytes(src) 3430 } 3431 3432 // CopyOutN implements marshal.Marshallable.CopyOutN. 3433 //go:nosplit 3434 func (r *FUSEDirent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3435 // Type FUSEDirent doesn't have a packed layout in memory, fall back to MarshalBytes. 3436 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 3437 r.MarshalBytes(buf) // escapes: fallback. 3438 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3439 } 3440 3441 // CopyOut implements marshal.Marshallable.CopyOut. 3442 func (r *FUSEDirent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3443 return r.CopyOutN(cc, addr, r.SizeBytes()) 3444 } 3445 3446 // CopyInN implements marshal.Marshallable.CopyInN. 3447 //go:nosplit 3448 func (r *FUSEDirent) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3449 // Type FUSEDirent doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3450 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 3451 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 3452 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3453 // partially unmarshalled struct. 3454 r.UnmarshalBytes(buf) // escapes: fallback. 3455 return length, err 3456 } 3457 3458 // CopyIn implements marshal.Marshallable.CopyIn. 3459 func (r *FUSEDirent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3460 return r.CopyInN(cc, addr, r.SizeBytes()) 3461 } 3462 3463 // WriteTo implements io.WriterTo.WriteTo. 3464 func (r *FUSEDirent) WriteTo(writer io.Writer) (int64, error) { 3465 // Type FUSEDirent doesn't have a packed layout in memory, fall back to MarshalBytes. 3466 buf := make([]byte, r.SizeBytes()) 3467 r.MarshalBytes(buf) 3468 length, err := writer.Write(buf) 3469 return int64(length), err 3470 } 3471 3472 // SizeBytes implements marshal.Marshallable.SizeBytes. 3473 func (f *FUSEDirentMeta) SizeBytes() int { 3474 return 24 3475 } 3476 3477 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3478 func (f *FUSEDirentMeta) MarshalBytes(dst []byte) []byte { 3479 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Ino)) 3480 dst = dst[8:] 3481 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Off)) 3482 dst = dst[8:] 3483 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.NameLen)) 3484 dst = dst[4:] 3485 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Type)) 3486 dst = dst[4:] 3487 return dst 3488 } 3489 3490 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3491 func (f *FUSEDirentMeta) UnmarshalBytes(src []byte) []byte { 3492 f.Ino = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3493 src = src[8:] 3494 f.Off = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3495 src = src[8:] 3496 f.NameLen = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3497 src = src[4:] 3498 f.Type = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3499 src = src[4:] 3500 return src 3501 } 3502 3503 // Packed implements marshal.Marshallable.Packed. 3504 //go:nosplit 3505 func (f *FUSEDirentMeta) Packed() bool { 3506 return true 3507 } 3508 3509 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3510 func (f *FUSEDirentMeta) MarshalUnsafe(dst []byte) []byte { 3511 size := f.SizeBytes() 3512 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 3513 return dst[size:] 3514 } 3515 3516 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3517 func (f *FUSEDirentMeta) UnmarshalUnsafe(src []byte) []byte { 3518 size := f.SizeBytes() 3519 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 3520 return src[size:] 3521 } 3522 3523 // CopyOutN implements marshal.Marshallable.CopyOutN. 3524 func (f *FUSEDirentMeta) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3525 // Construct a slice backed by dst's underlying memory. 3526 var buf []byte 3527 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3528 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3529 hdr.Len = f.SizeBytes() 3530 hdr.Cap = f.SizeBytes() 3531 3532 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3533 // Since we bypassed the compiler's escape analysis, indicate that f 3534 // must live until the use above. 3535 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3536 return length, err 3537 } 3538 3539 // CopyOut implements marshal.Marshallable.CopyOut. 3540 func (f *FUSEDirentMeta) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3541 return f.CopyOutN(cc, addr, f.SizeBytes()) 3542 } 3543 3544 // CopyInN implements marshal.Marshallable.CopyInN. 3545 func (f *FUSEDirentMeta) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3546 // Construct a slice backed by dst's underlying memory. 3547 var buf []byte 3548 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3549 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3550 hdr.Len = f.SizeBytes() 3551 hdr.Cap = f.SizeBytes() 3552 3553 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3554 // Since we bypassed the compiler's escape analysis, indicate that f 3555 // must live until the use above. 3556 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3557 return length, err 3558 } 3559 3560 // CopyIn implements marshal.Marshallable.CopyIn. 3561 func (f *FUSEDirentMeta) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3562 return f.CopyInN(cc, addr, f.SizeBytes()) 3563 } 3564 3565 // WriteTo implements io.WriterTo.WriteTo. 3566 func (f *FUSEDirentMeta) WriteTo(writer io.Writer) (int64, error) { 3567 // Construct a slice backed by dst's underlying memory. 3568 var buf []byte 3569 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3570 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3571 hdr.Len = f.SizeBytes() 3572 hdr.Cap = f.SizeBytes() 3573 3574 length, err := writer.Write(buf) 3575 // Since we bypassed the compiler's escape analysis, indicate that f 3576 // must live until the use above. 3577 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3578 return int64(length), err 3579 } 3580 3581 // Packed implements marshal.Marshallable.Packed. 3582 //go:nosplit 3583 func (r *FUSEDirents) Packed() bool { 3584 // Type FUSEDirents is dynamic so it might have slice/string headers. Hence, it is not packed. 3585 return false 3586 } 3587 3588 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3589 func (r *FUSEDirents) MarshalUnsafe(dst []byte) []byte { 3590 // Type FUSEDirents doesn't have a packed layout in memory, fallback to MarshalBytes. 3591 return r.MarshalBytes(dst) 3592 } 3593 3594 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3595 func (r *FUSEDirents) UnmarshalUnsafe(src []byte) []byte { 3596 // Type FUSEDirents doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3597 return r.UnmarshalBytes(src) 3598 } 3599 3600 // CopyOutN implements marshal.Marshallable.CopyOutN. 3601 //go:nosplit 3602 func (r *FUSEDirents) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3603 // Type FUSEDirents doesn't have a packed layout in memory, fall back to MarshalBytes. 3604 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 3605 r.MarshalBytes(buf) // escapes: fallback. 3606 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3607 } 3608 3609 // CopyOut implements marshal.Marshallable.CopyOut. 3610 func (r *FUSEDirents) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3611 return r.CopyOutN(cc, addr, r.SizeBytes()) 3612 } 3613 3614 // CopyInN implements marshal.Marshallable.CopyInN. 3615 //go:nosplit 3616 func (r *FUSEDirents) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3617 // Type FUSEDirents doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3618 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 3619 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 3620 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3621 // partially unmarshalled struct. 3622 r.UnmarshalBytes(buf) // escapes: fallback. 3623 return length, err 3624 } 3625 3626 // CopyIn implements marshal.Marshallable.CopyIn. 3627 func (r *FUSEDirents) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3628 return r.CopyInN(cc, addr, r.SizeBytes()) 3629 } 3630 3631 // WriteTo implements io.WriterTo.WriteTo. 3632 func (r *FUSEDirents) WriteTo(writer io.Writer) (int64, error) { 3633 // Type FUSEDirents doesn't have a packed layout in memory, fall back to MarshalBytes. 3634 buf := make([]byte, r.SizeBytes()) 3635 r.MarshalBytes(buf) 3636 length, err := writer.Write(buf) 3637 return int64(length), err 3638 } 3639 3640 // Packed implements marshal.Marshallable.Packed. 3641 //go:nosplit 3642 func (r *FUSEEmptyIn) Packed() bool { 3643 // Type FUSEEmptyIn is dynamic so it might have slice/string headers. Hence, it is not packed. 3644 return false 3645 } 3646 3647 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3648 func (r *FUSEEmptyIn) MarshalUnsafe(dst []byte) []byte { 3649 // Type FUSEEmptyIn doesn't have a packed layout in memory, fallback to MarshalBytes. 3650 return r.MarshalBytes(dst) 3651 } 3652 3653 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3654 func (r *FUSEEmptyIn) UnmarshalUnsafe(src []byte) []byte { 3655 // Type FUSEEmptyIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3656 return r.UnmarshalBytes(src) 3657 } 3658 3659 // CopyOutN implements marshal.Marshallable.CopyOutN. 3660 //go:nosplit 3661 func (r *FUSEEmptyIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3662 // Type FUSEEmptyIn doesn't have a packed layout in memory, fall back to MarshalBytes. 3663 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 3664 r.MarshalBytes(buf) // escapes: fallback. 3665 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3666 } 3667 3668 // CopyOut implements marshal.Marshallable.CopyOut. 3669 func (r *FUSEEmptyIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3670 return r.CopyOutN(cc, addr, r.SizeBytes()) 3671 } 3672 3673 // CopyInN implements marshal.Marshallable.CopyInN. 3674 //go:nosplit 3675 func (r *FUSEEmptyIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3676 // Type FUSEEmptyIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3677 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 3678 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 3679 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3680 // partially unmarshalled struct. 3681 r.UnmarshalBytes(buf) // escapes: fallback. 3682 return length, err 3683 } 3684 3685 // CopyIn implements marshal.Marshallable.CopyIn. 3686 func (r *FUSEEmptyIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3687 return r.CopyInN(cc, addr, r.SizeBytes()) 3688 } 3689 3690 // WriteTo implements io.WriterTo.WriteTo. 3691 func (r *FUSEEmptyIn) WriteTo(writer io.Writer) (int64, error) { 3692 // Type FUSEEmptyIn doesn't have a packed layout in memory, fall back to MarshalBytes. 3693 buf := make([]byte, r.SizeBytes()) 3694 r.MarshalBytes(buf) 3695 length, err := writer.Write(buf) 3696 return int64(length), err 3697 } 3698 3699 // SizeBytes implements marshal.Marshallable.SizeBytes. 3700 func (f *FUSEEntryOut) SizeBytes() int { 3701 return 40 + 3702 (*FUSEAttr)(nil).SizeBytes() 3703 } 3704 3705 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3706 func (f *FUSEEntryOut) MarshalBytes(dst []byte) []byte { 3707 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.NodeID)) 3708 dst = dst[8:] 3709 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Generation)) 3710 dst = dst[8:] 3711 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.EntryValid)) 3712 dst = dst[8:] 3713 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.AttrValid)) 3714 dst = dst[8:] 3715 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.EntryValidNSec)) 3716 dst = dst[4:] 3717 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.AttrValidNSec)) 3718 dst = dst[4:] 3719 dst = f.Attr.MarshalUnsafe(dst) 3720 return dst 3721 } 3722 3723 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3724 func (f *FUSEEntryOut) UnmarshalBytes(src []byte) []byte { 3725 f.NodeID = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3726 src = src[8:] 3727 f.Generation = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3728 src = src[8:] 3729 f.EntryValid = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3730 src = src[8:] 3731 f.AttrValid = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3732 src = src[8:] 3733 f.EntryValidNSec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3734 src = src[4:] 3735 f.AttrValidNSec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3736 src = src[4:] 3737 src = f.Attr.UnmarshalUnsafe(src) 3738 return src 3739 } 3740 3741 // Packed implements marshal.Marshallable.Packed. 3742 //go:nosplit 3743 func (f *FUSEEntryOut) Packed() bool { 3744 return f.Attr.Packed() 3745 } 3746 3747 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3748 func (f *FUSEEntryOut) MarshalUnsafe(dst []byte) []byte { 3749 if f.Attr.Packed() { 3750 size := f.SizeBytes() 3751 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 3752 return dst[size:] 3753 } 3754 // Type FUSEEntryOut doesn't have a packed layout in memory, fallback to MarshalBytes. 3755 return f.MarshalBytes(dst) 3756 } 3757 3758 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3759 func (f *FUSEEntryOut) UnmarshalUnsafe(src []byte) []byte { 3760 if f.Attr.Packed() { 3761 size := f.SizeBytes() 3762 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 3763 return src[size:] 3764 } 3765 // Type FUSEEntryOut doesn't have a packed layout in memory, fallback to UnmarshalBytes. 3766 return f.UnmarshalBytes(src) 3767 } 3768 3769 // CopyOutN implements marshal.Marshallable.CopyOutN. 3770 func (f *FUSEEntryOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3771 if !f.Attr.Packed() { 3772 // Type FUSEEntryOut doesn't have a packed layout in memory, fall back to MarshalBytes. 3773 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 3774 f.MarshalBytes(buf) // escapes: fallback. 3775 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3776 } 3777 3778 // Construct a slice backed by dst's underlying memory. 3779 var buf []byte 3780 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3781 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3782 hdr.Len = f.SizeBytes() 3783 hdr.Cap = f.SizeBytes() 3784 3785 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3786 // Since we bypassed the compiler's escape analysis, indicate that f 3787 // must live until the use above. 3788 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3789 return length, err 3790 } 3791 3792 // CopyOut implements marshal.Marshallable.CopyOut. 3793 func (f *FUSEEntryOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3794 return f.CopyOutN(cc, addr, f.SizeBytes()) 3795 } 3796 3797 // CopyInN implements marshal.Marshallable.CopyInN. 3798 func (f *FUSEEntryOut) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3799 if !f.Attr.Packed() { 3800 // Type FUSEEntryOut doesn't have a packed layout in memory, fall back to UnmarshalBytes. 3801 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 3802 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3803 // Unmarshal unconditionally. If we had a short copy-in, this results in a 3804 // partially unmarshalled struct. 3805 f.UnmarshalBytes(buf) // escapes: fallback. 3806 return length, err 3807 } 3808 3809 // Construct a slice backed by dst's underlying memory. 3810 var buf []byte 3811 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3812 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3813 hdr.Len = f.SizeBytes() 3814 hdr.Cap = f.SizeBytes() 3815 3816 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3817 // Since we bypassed the compiler's escape analysis, indicate that f 3818 // must live until the use above. 3819 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3820 return length, err 3821 } 3822 3823 // CopyIn implements marshal.Marshallable.CopyIn. 3824 func (f *FUSEEntryOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3825 return f.CopyInN(cc, addr, f.SizeBytes()) 3826 } 3827 3828 // WriteTo implements io.WriterTo.WriteTo. 3829 func (f *FUSEEntryOut) WriteTo(writer io.Writer) (int64, error) { 3830 if !f.Attr.Packed() { 3831 // Type FUSEEntryOut doesn't have a packed layout in memory, fall back to MarshalBytes. 3832 buf := make([]byte, f.SizeBytes()) 3833 f.MarshalBytes(buf) 3834 length, err := writer.Write(buf) 3835 return int64(length), err 3836 } 3837 3838 // Construct a slice backed by dst's underlying memory. 3839 var buf []byte 3840 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3841 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3842 hdr.Len = f.SizeBytes() 3843 hdr.Cap = f.SizeBytes() 3844 3845 length, err := writer.Write(buf) 3846 // Since we bypassed the compiler's escape analysis, indicate that f 3847 // must live until the use above. 3848 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3849 return int64(length), err 3850 } 3851 3852 // SizeBytes implements marshal.Marshallable.SizeBytes. 3853 func (f *FUSEFallocateIn) SizeBytes() int { 3854 return 32 3855 } 3856 3857 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3858 func (f *FUSEFallocateIn) MarshalBytes(dst []byte) []byte { 3859 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) 3860 dst = dst[8:] 3861 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Offset)) 3862 dst = dst[8:] 3863 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Length)) 3864 dst = dst[8:] 3865 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) 3866 dst = dst[4:] 3867 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 3868 dst = dst[4:] 3869 return dst 3870 } 3871 3872 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3873 func (f *FUSEFallocateIn) UnmarshalBytes(src []byte) []byte { 3874 f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3875 src = src[8:] 3876 f.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3877 src = src[8:] 3878 f.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3879 src = src[8:] 3880 f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) 3881 src = src[4:] 3882 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 3883 src = src[4:] 3884 return src 3885 } 3886 3887 // Packed implements marshal.Marshallable.Packed. 3888 //go:nosplit 3889 func (f *FUSEFallocateIn) Packed() bool { 3890 return true 3891 } 3892 3893 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 3894 func (f *FUSEFallocateIn) MarshalUnsafe(dst []byte) []byte { 3895 size := f.SizeBytes() 3896 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 3897 return dst[size:] 3898 } 3899 3900 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 3901 func (f *FUSEFallocateIn) UnmarshalUnsafe(src []byte) []byte { 3902 size := f.SizeBytes() 3903 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 3904 return src[size:] 3905 } 3906 3907 // CopyOutN implements marshal.Marshallable.CopyOutN. 3908 func (f *FUSEFallocateIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3909 // Construct a slice backed by dst's underlying memory. 3910 var buf []byte 3911 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3912 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3913 hdr.Len = f.SizeBytes() 3914 hdr.Cap = f.SizeBytes() 3915 3916 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 3917 // Since we bypassed the compiler's escape analysis, indicate that f 3918 // must live until the use above. 3919 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3920 return length, err 3921 } 3922 3923 // CopyOut implements marshal.Marshallable.CopyOut. 3924 func (f *FUSEFallocateIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3925 return f.CopyOutN(cc, addr, f.SizeBytes()) 3926 } 3927 3928 // CopyInN implements marshal.Marshallable.CopyInN. 3929 func (f *FUSEFallocateIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 3930 // Construct a slice backed by dst's underlying memory. 3931 var buf []byte 3932 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3933 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3934 hdr.Len = f.SizeBytes() 3935 hdr.Cap = f.SizeBytes() 3936 3937 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 3938 // Since we bypassed the compiler's escape analysis, indicate that f 3939 // must live until the use above. 3940 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3941 return length, err 3942 } 3943 3944 // CopyIn implements marshal.Marshallable.CopyIn. 3945 func (f *FUSEFallocateIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 3946 return f.CopyInN(cc, addr, f.SizeBytes()) 3947 } 3948 3949 // WriteTo implements io.WriterTo.WriteTo. 3950 func (f *FUSEFallocateIn) WriteTo(writer io.Writer) (int64, error) { 3951 // Construct a slice backed by dst's underlying memory. 3952 var buf []byte 3953 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 3954 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 3955 hdr.Len = f.SizeBytes() 3956 hdr.Cap = f.SizeBytes() 3957 3958 length, err := writer.Write(buf) 3959 // Since we bypassed the compiler's escape analysis, indicate that f 3960 // must live until the use above. 3961 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 3962 return int64(length), err 3963 } 3964 3965 // SizeBytes implements marshal.Marshallable.SizeBytes. 3966 func (f *FUSEFlushIn) SizeBytes() int { 3967 return 24 3968 } 3969 3970 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 3971 func (f *FUSEFlushIn) MarshalBytes(dst []byte) []byte { 3972 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) 3973 dst = dst[8:] 3974 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 3975 dst = dst[4:] 3976 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 3977 dst = dst[4:] 3978 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.LockOwner)) 3979 dst = dst[8:] 3980 return dst 3981 } 3982 3983 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 3984 func (f *FUSEFlushIn) UnmarshalBytes(src []byte) []byte { 3985 f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3986 src = src[8:] 3987 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 3988 src = src[4:] 3989 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 3990 src = src[4:] 3991 f.LockOwner = uint64(hostarch.ByteOrder.Uint64(src[:8])) 3992 src = src[8:] 3993 return src 3994 } 3995 3996 // Packed implements marshal.Marshallable.Packed. 3997 //go:nosplit 3998 func (f *FUSEFlushIn) Packed() bool { 3999 return true 4000 } 4001 4002 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4003 func (f *FUSEFlushIn) MarshalUnsafe(dst []byte) []byte { 4004 size := f.SizeBytes() 4005 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 4006 return dst[size:] 4007 } 4008 4009 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4010 func (f *FUSEFlushIn) UnmarshalUnsafe(src []byte) []byte { 4011 size := f.SizeBytes() 4012 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 4013 return src[size:] 4014 } 4015 4016 // CopyOutN implements marshal.Marshallable.CopyOutN. 4017 func (f *FUSEFlushIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4018 // Construct a slice backed by dst's underlying memory. 4019 var buf []byte 4020 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4021 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4022 hdr.Len = f.SizeBytes() 4023 hdr.Cap = f.SizeBytes() 4024 4025 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4026 // Since we bypassed the compiler's escape analysis, indicate that f 4027 // must live until the use above. 4028 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4029 return length, err 4030 } 4031 4032 // CopyOut implements marshal.Marshallable.CopyOut. 4033 func (f *FUSEFlushIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4034 return f.CopyOutN(cc, addr, f.SizeBytes()) 4035 } 4036 4037 // CopyInN implements marshal.Marshallable.CopyInN. 4038 func (f *FUSEFlushIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 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(f))) 4043 hdr.Len = f.SizeBytes() 4044 hdr.Cap = f.SizeBytes() 4045 4046 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4047 // Since we bypassed the compiler's escape analysis, indicate that f 4048 // must live until the use above. 4049 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4050 return length, err 4051 } 4052 4053 // CopyIn implements marshal.Marshallable.CopyIn. 4054 func (f *FUSEFlushIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4055 return f.CopyInN(cc, addr, f.SizeBytes()) 4056 } 4057 4058 // WriteTo implements io.WriterTo.WriteTo. 4059 func (f *FUSEFlushIn) WriteTo(writer io.Writer) (int64, error) { 4060 // Construct a slice backed by dst's underlying memory. 4061 var buf []byte 4062 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4063 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4064 hdr.Len = f.SizeBytes() 4065 hdr.Cap = f.SizeBytes() 4066 4067 length, err := writer.Write(buf) 4068 // Since we bypassed the compiler's escape analysis, indicate that f 4069 // must live until the use above. 4070 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4071 return int64(length), err 4072 } 4073 4074 // SizeBytes implements marshal.Marshallable.SizeBytes. 4075 func (f *FUSEFsyncIn) SizeBytes() int { 4076 return 16 4077 } 4078 4079 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4080 func (f *FUSEFsyncIn) MarshalBytes(dst []byte) []byte { 4081 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) 4082 dst = dst[8:] 4083 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.FsyncFlags)) 4084 dst = dst[4:] 4085 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 4086 dst = dst[4:] 4087 return dst 4088 } 4089 4090 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4091 func (f *FUSEFsyncIn) UnmarshalBytes(src []byte) []byte { 4092 f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 4093 src = src[8:] 4094 f.FsyncFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4095 src = src[4:] 4096 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 4097 src = src[4:] 4098 return src 4099 } 4100 4101 // Packed implements marshal.Marshallable.Packed. 4102 //go:nosplit 4103 func (f *FUSEFsyncIn) Packed() bool { 4104 return true 4105 } 4106 4107 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4108 func (f *FUSEFsyncIn) MarshalUnsafe(dst []byte) []byte { 4109 size := f.SizeBytes() 4110 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 4111 return dst[size:] 4112 } 4113 4114 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4115 func (f *FUSEFsyncIn) UnmarshalUnsafe(src []byte) []byte { 4116 size := f.SizeBytes() 4117 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 4118 return src[size:] 4119 } 4120 4121 // CopyOutN implements marshal.Marshallable.CopyOutN. 4122 func (f *FUSEFsyncIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4123 // Construct a slice backed by dst's underlying memory. 4124 var buf []byte 4125 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4126 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4127 hdr.Len = f.SizeBytes() 4128 hdr.Cap = f.SizeBytes() 4129 4130 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4131 // Since we bypassed the compiler's escape analysis, indicate that f 4132 // must live until the use above. 4133 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4134 return length, err 4135 } 4136 4137 // CopyOut implements marshal.Marshallable.CopyOut. 4138 func (f *FUSEFsyncIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4139 return f.CopyOutN(cc, addr, f.SizeBytes()) 4140 } 4141 4142 // CopyInN implements marshal.Marshallable.CopyInN. 4143 func (f *FUSEFsyncIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4144 // Construct a slice backed by dst's underlying memory. 4145 var buf []byte 4146 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4147 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4148 hdr.Len = f.SizeBytes() 4149 hdr.Cap = f.SizeBytes() 4150 4151 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4152 // Since we bypassed the compiler's escape analysis, indicate that f 4153 // must live until the use above. 4154 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4155 return length, err 4156 } 4157 4158 // CopyIn implements marshal.Marshallable.CopyIn. 4159 func (f *FUSEFsyncIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4160 return f.CopyInN(cc, addr, f.SizeBytes()) 4161 } 4162 4163 // WriteTo implements io.WriterTo.WriteTo. 4164 func (f *FUSEFsyncIn) WriteTo(writer io.Writer) (int64, error) { 4165 // Construct a slice backed by dst's underlying memory. 4166 var buf []byte 4167 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4168 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4169 hdr.Len = f.SizeBytes() 4170 hdr.Cap = f.SizeBytes() 4171 4172 length, err := writer.Write(buf) 4173 // Since we bypassed the compiler's escape analysis, indicate that f 4174 // must live until the use above. 4175 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4176 return int64(length), err 4177 } 4178 4179 // SizeBytes implements marshal.Marshallable.SizeBytes. 4180 func (f *FUSEGetAttrIn) SizeBytes() int { 4181 return 16 4182 } 4183 4184 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4185 func (f *FUSEGetAttrIn) MarshalBytes(dst []byte) []byte { 4186 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.GetAttrFlags)) 4187 dst = dst[4:] 4188 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 4189 dst = dst[4:] 4190 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) 4191 dst = dst[8:] 4192 return dst 4193 } 4194 4195 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4196 func (f *FUSEGetAttrIn) UnmarshalBytes(src []byte) []byte { 4197 f.GetAttrFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4198 src = src[4:] 4199 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 4200 src = src[4:] 4201 f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 4202 src = src[8:] 4203 return src 4204 } 4205 4206 // Packed implements marshal.Marshallable.Packed. 4207 //go:nosplit 4208 func (f *FUSEGetAttrIn) Packed() bool { 4209 return true 4210 } 4211 4212 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4213 func (f *FUSEGetAttrIn) MarshalUnsafe(dst []byte) []byte { 4214 size := f.SizeBytes() 4215 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 4216 return dst[size:] 4217 } 4218 4219 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4220 func (f *FUSEGetAttrIn) UnmarshalUnsafe(src []byte) []byte { 4221 size := f.SizeBytes() 4222 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 4223 return src[size:] 4224 } 4225 4226 // CopyOutN implements marshal.Marshallable.CopyOutN. 4227 func (f *FUSEGetAttrIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4228 // Construct a slice backed by dst's underlying memory. 4229 var buf []byte 4230 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4231 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4232 hdr.Len = f.SizeBytes() 4233 hdr.Cap = f.SizeBytes() 4234 4235 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4236 // Since we bypassed the compiler's escape analysis, indicate that f 4237 // must live until the use above. 4238 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4239 return length, err 4240 } 4241 4242 // CopyOut implements marshal.Marshallable.CopyOut. 4243 func (f *FUSEGetAttrIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4244 return f.CopyOutN(cc, addr, f.SizeBytes()) 4245 } 4246 4247 // CopyInN implements marshal.Marshallable.CopyInN. 4248 func (f *FUSEGetAttrIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4249 // Construct a slice backed by dst's underlying memory. 4250 var buf []byte 4251 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4252 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4253 hdr.Len = f.SizeBytes() 4254 hdr.Cap = f.SizeBytes() 4255 4256 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4257 // Since we bypassed the compiler's escape analysis, indicate that f 4258 // must live until the use above. 4259 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4260 return length, err 4261 } 4262 4263 // CopyIn implements marshal.Marshallable.CopyIn. 4264 func (f *FUSEGetAttrIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4265 return f.CopyInN(cc, addr, f.SizeBytes()) 4266 } 4267 4268 // WriteTo implements io.WriterTo.WriteTo. 4269 func (f *FUSEGetAttrIn) WriteTo(writer io.Writer) (int64, error) { 4270 // Construct a slice backed by dst's underlying memory. 4271 var buf []byte 4272 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4273 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4274 hdr.Len = f.SizeBytes() 4275 hdr.Cap = f.SizeBytes() 4276 4277 length, err := writer.Write(buf) 4278 // Since we bypassed the compiler's escape analysis, indicate that f 4279 // must live until the use above. 4280 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4281 return int64(length), err 4282 } 4283 4284 // SizeBytes implements marshal.Marshallable.SizeBytes. 4285 func (f *FUSEHeaderIn) SizeBytes() int { 4286 return 28 + 4287 (*FUSEOpcode)(nil).SizeBytes() + 4288 (*FUSEOpID)(nil).SizeBytes() 4289 } 4290 4291 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4292 func (f *FUSEHeaderIn) MarshalBytes(dst []byte) []byte { 4293 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Len)) 4294 dst = dst[4:] 4295 dst = f.Opcode.MarshalUnsafe(dst) 4296 dst = f.Unique.MarshalUnsafe(dst) 4297 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.NodeID)) 4298 dst = dst[8:] 4299 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.UID)) 4300 dst = dst[4:] 4301 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.GID)) 4302 dst = dst[4:] 4303 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.PID)) 4304 dst = dst[4:] 4305 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 4306 dst = dst[4:] 4307 return dst 4308 } 4309 4310 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4311 func (f *FUSEHeaderIn) UnmarshalBytes(src []byte) []byte { 4312 f.Len = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4313 src = src[4:] 4314 src = f.Opcode.UnmarshalUnsafe(src) 4315 src = f.Unique.UnmarshalUnsafe(src) 4316 f.NodeID = uint64(hostarch.ByteOrder.Uint64(src[:8])) 4317 src = src[8:] 4318 f.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4319 src = src[4:] 4320 f.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4321 src = src[4:] 4322 f.PID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4323 src = src[4:] 4324 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 4325 src = src[4:] 4326 return src 4327 } 4328 4329 // Packed implements marshal.Marshallable.Packed. 4330 //go:nosplit 4331 func (f *FUSEHeaderIn) Packed() bool { 4332 return f.Opcode.Packed() && f.Unique.Packed() 4333 } 4334 4335 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4336 func (f *FUSEHeaderIn) MarshalUnsafe(dst []byte) []byte { 4337 if f.Opcode.Packed() && f.Unique.Packed() { 4338 size := f.SizeBytes() 4339 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 4340 return dst[size:] 4341 } 4342 // Type FUSEHeaderIn doesn't have a packed layout in memory, fallback to MarshalBytes. 4343 return f.MarshalBytes(dst) 4344 } 4345 4346 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4347 func (f *FUSEHeaderIn) UnmarshalUnsafe(src []byte) []byte { 4348 if f.Opcode.Packed() && f.Unique.Packed() { 4349 size := f.SizeBytes() 4350 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 4351 return src[size:] 4352 } 4353 // Type FUSEHeaderIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4354 return f.UnmarshalBytes(src) 4355 } 4356 4357 // CopyOutN implements marshal.Marshallable.CopyOutN. 4358 func (f *FUSEHeaderIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4359 if !f.Opcode.Packed() && f.Unique.Packed() { 4360 // Type FUSEHeaderIn doesn't have a packed layout in memory, fall back to MarshalBytes. 4361 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 4362 f.MarshalBytes(buf) // escapes: fallback. 4363 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4364 } 4365 4366 // Construct a slice backed by dst's underlying memory. 4367 var buf []byte 4368 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4369 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4370 hdr.Len = f.SizeBytes() 4371 hdr.Cap = f.SizeBytes() 4372 4373 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4374 // Since we bypassed the compiler's escape analysis, indicate that f 4375 // must live until the use above. 4376 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4377 return length, err 4378 } 4379 4380 // CopyOut implements marshal.Marshallable.CopyOut. 4381 func (f *FUSEHeaderIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4382 return f.CopyOutN(cc, addr, f.SizeBytes()) 4383 } 4384 4385 // CopyInN implements marshal.Marshallable.CopyInN. 4386 func (f *FUSEHeaderIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4387 if !f.Opcode.Packed() && f.Unique.Packed() { 4388 // Type FUSEHeaderIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4389 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 4390 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4391 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4392 // partially unmarshalled struct. 4393 f.UnmarshalBytes(buf) // escapes: fallback. 4394 return length, err 4395 } 4396 4397 // Construct a slice backed by dst's underlying memory. 4398 var buf []byte 4399 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4400 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4401 hdr.Len = f.SizeBytes() 4402 hdr.Cap = f.SizeBytes() 4403 4404 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4405 // Since we bypassed the compiler's escape analysis, indicate that f 4406 // must live until the use above. 4407 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4408 return length, err 4409 } 4410 4411 // CopyIn implements marshal.Marshallable.CopyIn. 4412 func (f *FUSEHeaderIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4413 return f.CopyInN(cc, addr, f.SizeBytes()) 4414 } 4415 4416 // WriteTo implements io.WriterTo.WriteTo. 4417 func (f *FUSEHeaderIn) WriteTo(writer io.Writer) (int64, error) { 4418 if !f.Opcode.Packed() && f.Unique.Packed() { 4419 // Type FUSEHeaderIn doesn't have a packed layout in memory, fall back to MarshalBytes. 4420 buf := make([]byte, f.SizeBytes()) 4421 f.MarshalBytes(buf) 4422 length, err := writer.Write(buf) 4423 return int64(length), err 4424 } 4425 4426 // Construct a slice backed by dst's underlying memory. 4427 var buf []byte 4428 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4429 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4430 hdr.Len = f.SizeBytes() 4431 hdr.Cap = f.SizeBytes() 4432 4433 length, err := writer.Write(buf) 4434 // Since we bypassed the compiler's escape analysis, indicate that f 4435 // must live until the use above. 4436 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4437 return int64(length), err 4438 } 4439 4440 // SizeBytes implements marshal.Marshallable.SizeBytes. 4441 func (f *FUSEHeaderOut) SizeBytes() int { 4442 return 8 + 4443 (*FUSEOpID)(nil).SizeBytes() 4444 } 4445 4446 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4447 func (f *FUSEHeaderOut) MarshalBytes(dst []byte) []byte { 4448 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Len)) 4449 dst = dst[4:] 4450 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Error)) 4451 dst = dst[4:] 4452 dst = f.Unique.MarshalUnsafe(dst) 4453 return dst 4454 } 4455 4456 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4457 func (f *FUSEHeaderOut) UnmarshalBytes(src []byte) []byte { 4458 f.Len = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4459 src = src[4:] 4460 f.Error = int32(hostarch.ByteOrder.Uint32(src[:4])) 4461 src = src[4:] 4462 src = f.Unique.UnmarshalUnsafe(src) 4463 return src 4464 } 4465 4466 // Packed implements marshal.Marshallable.Packed. 4467 //go:nosplit 4468 func (f *FUSEHeaderOut) Packed() bool { 4469 return f.Unique.Packed() 4470 } 4471 4472 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4473 func (f *FUSEHeaderOut) MarshalUnsafe(dst []byte) []byte { 4474 if f.Unique.Packed() { 4475 size := f.SizeBytes() 4476 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 4477 return dst[size:] 4478 } 4479 // Type FUSEHeaderOut doesn't have a packed layout in memory, fallback to MarshalBytes. 4480 return f.MarshalBytes(dst) 4481 } 4482 4483 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4484 func (f *FUSEHeaderOut) UnmarshalUnsafe(src []byte) []byte { 4485 if f.Unique.Packed() { 4486 size := f.SizeBytes() 4487 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 4488 return src[size:] 4489 } 4490 // Type FUSEHeaderOut doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4491 return f.UnmarshalBytes(src) 4492 } 4493 4494 // CopyOutN implements marshal.Marshallable.CopyOutN. 4495 func (f *FUSEHeaderOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4496 if !f.Unique.Packed() { 4497 // Type FUSEHeaderOut doesn't have a packed layout in memory, fall back to MarshalBytes. 4498 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 4499 f.MarshalBytes(buf) // escapes: fallback. 4500 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4501 } 4502 4503 // Construct a slice backed by dst's underlying memory. 4504 var buf []byte 4505 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4506 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4507 hdr.Len = f.SizeBytes() 4508 hdr.Cap = f.SizeBytes() 4509 4510 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4511 // Since we bypassed the compiler's escape analysis, indicate that f 4512 // must live until the use above. 4513 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4514 return length, err 4515 } 4516 4517 // CopyOut implements marshal.Marshallable.CopyOut. 4518 func (f *FUSEHeaderOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4519 return f.CopyOutN(cc, addr, f.SizeBytes()) 4520 } 4521 4522 // CopyInN implements marshal.Marshallable.CopyInN. 4523 func (f *FUSEHeaderOut) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4524 if !f.Unique.Packed() { 4525 // Type FUSEHeaderOut doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4526 buf := cc.CopyScratchBuffer(f.SizeBytes()) // escapes: okay. 4527 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4528 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4529 // partially unmarshalled struct. 4530 f.UnmarshalBytes(buf) // escapes: fallback. 4531 return length, err 4532 } 4533 4534 // Construct a slice backed by dst's underlying memory. 4535 var buf []byte 4536 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4537 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4538 hdr.Len = f.SizeBytes() 4539 hdr.Cap = f.SizeBytes() 4540 4541 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4542 // Since we bypassed the compiler's escape analysis, indicate that f 4543 // must live until the use above. 4544 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4545 return length, err 4546 } 4547 4548 // CopyIn implements marshal.Marshallable.CopyIn. 4549 func (f *FUSEHeaderOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4550 return f.CopyInN(cc, addr, f.SizeBytes()) 4551 } 4552 4553 // WriteTo implements io.WriterTo.WriteTo. 4554 func (f *FUSEHeaderOut) WriteTo(writer io.Writer) (int64, error) { 4555 if !f.Unique.Packed() { 4556 // Type FUSEHeaderOut doesn't have a packed layout in memory, fall back to MarshalBytes. 4557 buf := make([]byte, f.SizeBytes()) 4558 f.MarshalBytes(buf) 4559 length, err := writer.Write(buf) 4560 return int64(length), err 4561 } 4562 4563 // Construct a slice backed by dst's underlying memory. 4564 var buf []byte 4565 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4566 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4567 hdr.Len = f.SizeBytes() 4568 hdr.Cap = f.SizeBytes() 4569 4570 length, err := writer.Write(buf) 4571 // Since we bypassed the compiler's escape analysis, indicate that f 4572 // must live until the use above. 4573 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4574 return int64(length), err 4575 } 4576 4577 // SizeBytes implements marshal.Marshallable.SizeBytes. 4578 func (f *FUSEInitIn) SizeBytes() int { 4579 return 16 4580 } 4581 4582 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4583 func (f *FUSEInitIn) MarshalBytes(dst []byte) []byte { 4584 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Major)) 4585 dst = dst[4:] 4586 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Minor)) 4587 dst = dst[4:] 4588 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.MaxReadahead)) 4589 dst = dst[4:] 4590 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) 4591 dst = dst[4:] 4592 return dst 4593 } 4594 4595 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4596 func (f *FUSEInitIn) UnmarshalBytes(src []byte) []byte { 4597 f.Major = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4598 src = src[4:] 4599 f.Minor = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4600 src = src[4:] 4601 f.MaxReadahead = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4602 src = src[4:] 4603 f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4604 src = src[4:] 4605 return src 4606 } 4607 4608 // Packed implements marshal.Marshallable.Packed. 4609 //go:nosplit 4610 func (f *FUSEInitIn) Packed() bool { 4611 return true 4612 } 4613 4614 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4615 func (f *FUSEInitIn) MarshalUnsafe(dst []byte) []byte { 4616 size := f.SizeBytes() 4617 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 4618 return dst[size:] 4619 } 4620 4621 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4622 func (f *FUSEInitIn) UnmarshalUnsafe(src []byte) []byte { 4623 size := f.SizeBytes() 4624 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 4625 return src[size:] 4626 } 4627 4628 // CopyOutN implements marshal.Marshallable.CopyOutN. 4629 func (f *FUSEInitIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4630 // Construct a slice backed by dst's underlying memory. 4631 var buf []byte 4632 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4633 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4634 hdr.Len = f.SizeBytes() 4635 hdr.Cap = f.SizeBytes() 4636 4637 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4638 // Since we bypassed the compiler's escape analysis, indicate that f 4639 // must live until the use above. 4640 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4641 return length, err 4642 } 4643 4644 // CopyOut implements marshal.Marshallable.CopyOut. 4645 func (f *FUSEInitIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4646 return f.CopyOutN(cc, addr, f.SizeBytes()) 4647 } 4648 4649 // CopyInN implements marshal.Marshallable.CopyInN. 4650 func (f *FUSEInitIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4651 // Construct a slice backed by dst's underlying memory. 4652 var buf []byte 4653 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4654 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4655 hdr.Len = f.SizeBytes() 4656 hdr.Cap = f.SizeBytes() 4657 4658 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4659 // Since we bypassed the compiler's escape analysis, indicate that f 4660 // must live until the use above. 4661 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4662 return length, err 4663 } 4664 4665 // CopyIn implements marshal.Marshallable.CopyIn. 4666 func (f *FUSEInitIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4667 return f.CopyInN(cc, addr, f.SizeBytes()) 4668 } 4669 4670 // WriteTo implements io.WriterTo.WriteTo. 4671 func (f *FUSEInitIn) WriteTo(writer io.Writer) (int64, error) { 4672 // Construct a slice backed by dst's underlying memory. 4673 var buf []byte 4674 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4675 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4676 hdr.Len = f.SizeBytes() 4677 hdr.Cap = f.SizeBytes() 4678 4679 length, err := writer.Write(buf) 4680 // Since we bypassed the compiler's escape analysis, indicate that f 4681 // must live until the use above. 4682 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4683 return int64(length), err 4684 } 4685 4686 // SizeBytes implements marshal.Marshallable.SizeBytes. 4687 func (f *FUSEInitOut) SizeBytes() int { 4688 return 32 + 4689 4*8 4690 } 4691 4692 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 4693 func (f *FUSEInitOut) MarshalBytes(dst []byte) []byte { 4694 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Major)) 4695 dst = dst[4:] 4696 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Minor)) 4697 dst = dst[4:] 4698 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.MaxReadahead)) 4699 dst = dst[4:] 4700 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) 4701 dst = dst[4:] 4702 hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.MaxBackground)) 4703 dst = dst[2:] 4704 hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.CongestionThreshold)) 4705 dst = dst[2:] 4706 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.MaxWrite)) 4707 dst = dst[4:] 4708 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.TimeGran)) 4709 dst = dst[4:] 4710 hostarch.ByteOrder.PutUint16(dst[:2], uint16(f.MaxPages)) 4711 dst = dst[2:] 4712 // Padding: dst[:sizeof(uint16)] ~= uint16(0) 4713 dst = dst[2:] 4714 // Padding: dst[:sizeof(uint32)*8] ~= [8]uint32{0} 4715 dst = dst[4*(8):] 4716 return dst 4717 } 4718 4719 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 4720 func (f *FUSEInitOut) UnmarshalBytes(src []byte) []byte { 4721 f.Major = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4722 src = src[4:] 4723 f.Minor = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4724 src = src[4:] 4725 f.MaxReadahead = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4726 src = src[4:] 4727 f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4728 src = src[4:] 4729 f.MaxBackground = uint16(hostarch.ByteOrder.Uint16(src[:2])) 4730 src = src[2:] 4731 f.CongestionThreshold = uint16(hostarch.ByteOrder.Uint16(src[:2])) 4732 src = src[2:] 4733 f.MaxWrite = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4734 src = src[4:] 4735 f.TimeGran = uint32(hostarch.ByteOrder.Uint32(src[:4])) 4736 src = src[4:] 4737 f.MaxPages = uint16(hostarch.ByteOrder.Uint16(src[:2])) 4738 src = src[2:] 4739 // Padding: var _ uint16 ~= src[:sizeof(uint16)] 4740 src = src[2:] 4741 // Padding: ~ copy([8]uint32(f._), src[:sizeof(uint32)*8]) 4742 src = src[4*(8):] 4743 return src 4744 } 4745 4746 // Packed implements marshal.Marshallable.Packed. 4747 //go:nosplit 4748 func (f *FUSEInitOut) Packed() bool { 4749 return true 4750 } 4751 4752 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4753 func (f *FUSEInitOut) MarshalUnsafe(dst []byte) []byte { 4754 size := f.SizeBytes() 4755 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 4756 return dst[size:] 4757 } 4758 4759 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4760 func (f *FUSEInitOut) UnmarshalUnsafe(src []byte) []byte { 4761 size := f.SizeBytes() 4762 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 4763 return src[size:] 4764 } 4765 4766 // CopyOutN implements marshal.Marshallable.CopyOutN. 4767 func (f *FUSEInitOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4768 // Construct a slice backed by dst's underlying memory. 4769 var buf []byte 4770 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4771 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4772 hdr.Len = f.SizeBytes() 4773 hdr.Cap = f.SizeBytes() 4774 4775 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4776 // Since we bypassed the compiler's escape analysis, indicate that f 4777 // must live until the use above. 4778 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4779 return length, err 4780 } 4781 4782 // CopyOut implements marshal.Marshallable.CopyOut. 4783 func (f *FUSEInitOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4784 return f.CopyOutN(cc, addr, f.SizeBytes()) 4785 } 4786 4787 // CopyInN implements marshal.Marshallable.CopyInN. 4788 func (f *FUSEInitOut) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4789 // Construct a slice backed by dst's underlying memory. 4790 var buf []byte 4791 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4792 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4793 hdr.Len = f.SizeBytes() 4794 hdr.Cap = f.SizeBytes() 4795 4796 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 4797 // Since we bypassed the compiler's escape analysis, indicate that f 4798 // must live until the use above. 4799 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4800 return length, err 4801 } 4802 4803 // CopyIn implements marshal.Marshallable.CopyIn. 4804 func (f *FUSEInitOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4805 return f.CopyInN(cc, addr, f.SizeBytes()) 4806 } 4807 4808 // WriteTo implements io.WriterTo.WriteTo. 4809 func (f *FUSEInitOut) WriteTo(writer io.Writer) (int64, error) { 4810 // Construct a slice backed by dst's underlying memory. 4811 var buf []byte 4812 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 4813 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 4814 hdr.Len = f.SizeBytes() 4815 hdr.Cap = f.SizeBytes() 4816 4817 length, err := writer.Write(buf) 4818 // Since we bypassed the compiler's escape analysis, indicate that f 4819 // must live until the use above. 4820 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 4821 return int64(length), err 4822 } 4823 4824 // Packed implements marshal.Marshallable.Packed. 4825 //go:nosplit 4826 func (r *FUSELinkIn) Packed() bool { 4827 // Type FUSELinkIn is dynamic so it might have slice/string headers. Hence, it is not packed. 4828 return false 4829 } 4830 4831 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4832 func (r *FUSELinkIn) MarshalUnsafe(dst []byte) []byte { 4833 // Type FUSELinkIn doesn't have a packed layout in memory, fallback to MarshalBytes. 4834 return r.MarshalBytes(dst) 4835 } 4836 4837 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4838 func (r *FUSELinkIn) UnmarshalUnsafe(src []byte) []byte { 4839 // Type FUSELinkIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4840 return r.UnmarshalBytes(src) 4841 } 4842 4843 // CopyOutN implements marshal.Marshallable.CopyOutN. 4844 //go:nosplit 4845 func (r *FUSELinkIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4846 // Type FUSELinkIn doesn't have a packed layout in memory, fall back to MarshalBytes. 4847 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 4848 r.MarshalBytes(buf) // escapes: fallback. 4849 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4850 } 4851 4852 // CopyOut implements marshal.Marshallable.CopyOut. 4853 func (r *FUSELinkIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4854 return r.CopyOutN(cc, addr, r.SizeBytes()) 4855 } 4856 4857 // CopyInN implements marshal.Marshallable.CopyInN. 4858 //go:nosplit 4859 func (r *FUSELinkIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4860 // Type FUSELinkIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4861 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 4862 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 4863 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4864 // partially unmarshalled struct. 4865 r.UnmarshalBytes(buf) // escapes: fallback. 4866 return length, err 4867 } 4868 4869 // CopyIn implements marshal.Marshallable.CopyIn. 4870 func (r *FUSELinkIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4871 return r.CopyInN(cc, addr, r.SizeBytes()) 4872 } 4873 4874 // WriteTo implements io.WriterTo.WriteTo. 4875 func (r *FUSELinkIn) WriteTo(writer io.Writer) (int64, error) { 4876 // Type FUSELinkIn doesn't have a packed layout in memory, fall back to MarshalBytes. 4877 buf := make([]byte, r.SizeBytes()) 4878 r.MarshalBytes(buf) 4879 length, err := writer.Write(buf) 4880 return int64(length), err 4881 } 4882 4883 // Packed implements marshal.Marshallable.Packed. 4884 //go:nosplit 4885 func (r *FUSELookupIn) Packed() bool { 4886 // Type FUSELookupIn is dynamic so it might have slice/string headers. Hence, it is not packed. 4887 return false 4888 } 4889 4890 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4891 func (r *FUSELookupIn) MarshalUnsafe(dst []byte) []byte { 4892 // Type FUSELookupIn doesn't have a packed layout in memory, fallback to MarshalBytes. 4893 return r.MarshalBytes(dst) 4894 } 4895 4896 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4897 func (r *FUSELookupIn) UnmarshalUnsafe(src []byte) []byte { 4898 // Type FUSELookupIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4899 return r.UnmarshalBytes(src) 4900 } 4901 4902 // CopyOutN implements marshal.Marshallable.CopyOutN. 4903 //go:nosplit 4904 func (r *FUSELookupIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4905 // Type FUSELookupIn doesn't have a packed layout in memory, fall back to MarshalBytes. 4906 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 4907 r.MarshalBytes(buf) // escapes: fallback. 4908 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4909 } 4910 4911 // CopyOut implements marshal.Marshallable.CopyOut. 4912 func (r *FUSELookupIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4913 return r.CopyOutN(cc, addr, r.SizeBytes()) 4914 } 4915 4916 // CopyInN implements marshal.Marshallable.CopyInN. 4917 //go:nosplit 4918 func (r *FUSELookupIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4919 // Type FUSELookupIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4920 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 4921 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 4922 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4923 // partially unmarshalled struct. 4924 r.UnmarshalBytes(buf) // escapes: fallback. 4925 return length, err 4926 } 4927 4928 // CopyIn implements marshal.Marshallable.CopyIn. 4929 func (r *FUSELookupIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4930 return r.CopyInN(cc, addr, r.SizeBytes()) 4931 } 4932 4933 // WriteTo implements io.WriterTo.WriteTo. 4934 func (r *FUSELookupIn) WriteTo(writer io.Writer) (int64, error) { 4935 // Type FUSELookupIn doesn't have a packed layout in memory, fall back to MarshalBytes. 4936 buf := make([]byte, r.SizeBytes()) 4937 r.MarshalBytes(buf) 4938 length, err := writer.Write(buf) 4939 return int64(length), err 4940 } 4941 4942 // Packed implements marshal.Marshallable.Packed. 4943 //go:nosplit 4944 func (r *FUSEMkdirIn) Packed() bool { 4945 // Type FUSEMkdirIn is dynamic so it might have slice/string headers. Hence, it is not packed. 4946 return false 4947 } 4948 4949 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 4950 func (r *FUSEMkdirIn) MarshalUnsafe(dst []byte) []byte { 4951 // Type FUSEMkdirIn doesn't have a packed layout in memory, fallback to MarshalBytes. 4952 return r.MarshalBytes(dst) 4953 } 4954 4955 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 4956 func (r *FUSEMkdirIn) UnmarshalUnsafe(src []byte) []byte { 4957 // Type FUSEMkdirIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 4958 return r.UnmarshalBytes(src) 4959 } 4960 4961 // CopyOutN implements marshal.Marshallable.CopyOutN. 4962 //go:nosplit 4963 func (r *FUSEMkdirIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4964 // Type FUSEMkdirIn doesn't have a packed layout in memory, fall back to MarshalBytes. 4965 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 4966 r.MarshalBytes(buf) // escapes: fallback. 4967 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 4968 } 4969 4970 // CopyOut implements marshal.Marshallable.CopyOut. 4971 func (r *FUSEMkdirIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4972 return r.CopyOutN(cc, addr, r.SizeBytes()) 4973 } 4974 4975 // CopyInN implements marshal.Marshallable.CopyInN. 4976 //go:nosplit 4977 func (r *FUSEMkdirIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 4978 // Type FUSEMkdirIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 4979 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 4980 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 4981 // Unmarshal unconditionally. If we had a short copy-in, this results in a 4982 // partially unmarshalled struct. 4983 r.UnmarshalBytes(buf) // escapes: fallback. 4984 return length, err 4985 } 4986 4987 // CopyIn implements marshal.Marshallable.CopyIn. 4988 func (r *FUSEMkdirIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 4989 return r.CopyInN(cc, addr, r.SizeBytes()) 4990 } 4991 4992 // WriteTo implements io.WriterTo.WriteTo. 4993 func (r *FUSEMkdirIn) WriteTo(writer io.Writer) (int64, error) { 4994 // Type FUSEMkdirIn doesn't have a packed layout in memory, fall back to MarshalBytes. 4995 buf := make([]byte, r.SizeBytes()) 4996 r.MarshalBytes(buf) 4997 length, err := writer.Write(buf) 4998 return int64(length), err 4999 } 5000 5001 // SizeBytes implements marshal.Marshallable.SizeBytes. 5002 func (f *FUSEMkdirMeta) SizeBytes() int { 5003 return 8 5004 } 5005 5006 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5007 func (f *FUSEMkdirMeta) MarshalBytes(dst []byte) []byte { 5008 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) 5009 dst = dst[4:] 5010 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Umask)) 5011 dst = dst[4:] 5012 return dst 5013 } 5014 5015 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5016 func (f *FUSEMkdirMeta) UnmarshalBytes(src []byte) []byte { 5017 f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5018 src = src[4:] 5019 f.Umask = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5020 src = src[4:] 5021 return src 5022 } 5023 5024 // Packed implements marshal.Marshallable.Packed. 5025 //go:nosplit 5026 func (f *FUSEMkdirMeta) Packed() bool { 5027 return true 5028 } 5029 5030 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5031 func (f *FUSEMkdirMeta) MarshalUnsafe(dst []byte) []byte { 5032 size := f.SizeBytes() 5033 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 5034 return dst[size:] 5035 } 5036 5037 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5038 func (f *FUSEMkdirMeta) UnmarshalUnsafe(src []byte) []byte { 5039 size := f.SizeBytes() 5040 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 5041 return src[size:] 5042 } 5043 5044 // CopyOutN implements marshal.Marshallable.CopyOutN. 5045 func (f *FUSEMkdirMeta) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5046 // Construct a slice backed by dst's underlying memory. 5047 var buf []byte 5048 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5049 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5050 hdr.Len = f.SizeBytes() 5051 hdr.Cap = f.SizeBytes() 5052 5053 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5054 // Since we bypassed the compiler's escape analysis, indicate that f 5055 // must live until the use above. 5056 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5057 return length, err 5058 } 5059 5060 // CopyOut implements marshal.Marshallable.CopyOut. 5061 func (f *FUSEMkdirMeta) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5062 return f.CopyOutN(cc, addr, f.SizeBytes()) 5063 } 5064 5065 // CopyInN implements marshal.Marshallable.CopyInN. 5066 func (f *FUSEMkdirMeta) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5067 // Construct a slice backed by dst's underlying memory. 5068 var buf []byte 5069 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5070 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5071 hdr.Len = f.SizeBytes() 5072 hdr.Cap = f.SizeBytes() 5073 5074 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5075 // Since we bypassed the compiler's escape analysis, indicate that f 5076 // must live until the use above. 5077 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5078 return length, err 5079 } 5080 5081 // CopyIn implements marshal.Marshallable.CopyIn. 5082 func (f *FUSEMkdirMeta) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5083 return f.CopyInN(cc, addr, f.SizeBytes()) 5084 } 5085 5086 // WriteTo implements io.WriterTo.WriteTo. 5087 func (f *FUSEMkdirMeta) WriteTo(writer io.Writer) (int64, error) { 5088 // Construct a slice backed by dst's underlying memory. 5089 var buf []byte 5090 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5091 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5092 hdr.Len = f.SizeBytes() 5093 hdr.Cap = f.SizeBytes() 5094 5095 length, err := writer.Write(buf) 5096 // Since we bypassed the compiler's escape analysis, indicate that f 5097 // must live until the use above. 5098 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5099 return int64(length), err 5100 } 5101 5102 // Packed implements marshal.Marshallable.Packed. 5103 //go:nosplit 5104 func (r *FUSEMknodIn) Packed() bool { 5105 // Type FUSEMknodIn is dynamic so it might have slice/string headers. Hence, it is not packed. 5106 return false 5107 } 5108 5109 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5110 func (r *FUSEMknodIn) MarshalUnsafe(dst []byte) []byte { 5111 // Type FUSEMknodIn doesn't have a packed layout in memory, fallback to MarshalBytes. 5112 return r.MarshalBytes(dst) 5113 } 5114 5115 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5116 func (r *FUSEMknodIn) UnmarshalUnsafe(src []byte) []byte { 5117 // Type FUSEMknodIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 5118 return r.UnmarshalBytes(src) 5119 } 5120 5121 // CopyOutN implements marshal.Marshallable.CopyOutN. 5122 //go:nosplit 5123 func (r *FUSEMknodIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5124 // Type FUSEMknodIn doesn't have a packed layout in memory, fall back to MarshalBytes. 5125 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 5126 r.MarshalBytes(buf) // escapes: fallback. 5127 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5128 } 5129 5130 // CopyOut implements marshal.Marshallable.CopyOut. 5131 func (r *FUSEMknodIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5132 return r.CopyOutN(cc, addr, r.SizeBytes()) 5133 } 5134 5135 // CopyInN implements marshal.Marshallable.CopyInN. 5136 //go:nosplit 5137 func (r *FUSEMknodIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5138 // Type FUSEMknodIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 5139 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 5140 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 5141 // Unmarshal unconditionally. If we had a short copy-in, this results in a 5142 // partially unmarshalled struct. 5143 r.UnmarshalBytes(buf) // escapes: fallback. 5144 return length, err 5145 } 5146 5147 // CopyIn implements marshal.Marshallable.CopyIn. 5148 func (r *FUSEMknodIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5149 return r.CopyInN(cc, addr, r.SizeBytes()) 5150 } 5151 5152 // WriteTo implements io.WriterTo.WriteTo. 5153 func (r *FUSEMknodIn) WriteTo(writer io.Writer) (int64, error) { 5154 // Type FUSEMknodIn doesn't have a packed layout in memory, fall back to MarshalBytes. 5155 buf := make([]byte, r.SizeBytes()) 5156 r.MarshalBytes(buf) 5157 length, err := writer.Write(buf) 5158 return int64(length), err 5159 } 5160 5161 // SizeBytes implements marshal.Marshallable.SizeBytes. 5162 func (f *FUSEMknodMeta) SizeBytes() int { 5163 return 16 5164 } 5165 5166 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5167 func (f *FUSEMknodMeta) MarshalBytes(dst []byte) []byte { 5168 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) 5169 dst = dst[4:] 5170 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Rdev)) 5171 dst = dst[4:] 5172 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Umask)) 5173 dst = dst[4:] 5174 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 5175 dst = dst[4:] 5176 return dst 5177 } 5178 5179 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5180 func (f *FUSEMknodMeta) UnmarshalBytes(src []byte) []byte { 5181 f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5182 src = src[4:] 5183 f.Rdev = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5184 src = src[4:] 5185 f.Umask = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5186 src = src[4:] 5187 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 5188 src = src[4:] 5189 return src 5190 } 5191 5192 // Packed implements marshal.Marshallable.Packed. 5193 //go:nosplit 5194 func (f *FUSEMknodMeta) Packed() bool { 5195 return true 5196 } 5197 5198 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5199 func (f *FUSEMknodMeta) MarshalUnsafe(dst []byte) []byte { 5200 size := f.SizeBytes() 5201 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 5202 return dst[size:] 5203 } 5204 5205 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5206 func (f *FUSEMknodMeta) UnmarshalUnsafe(src []byte) []byte { 5207 size := f.SizeBytes() 5208 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 5209 return src[size:] 5210 } 5211 5212 // CopyOutN implements marshal.Marshallable.CopyOutN. 5213 func (f *FUSEMknodMeta) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5214 // Construct a slice backed by dst's underlying memory. 5215 var buf []byte 5216 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5217 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5218 hdr.Len = f.SizeBytes() 5219 hdr.Cap = f.SizeBytes() 5220 5221 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5222 // Since we bypassed the compiler's escape analysis, indicate that f 5223 // must live until the use above. 5224 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5225 return length, err 5226 } 5227 5228 // CopyOut implements marshal.Marshallable.CopyOut. 5229 func (f *FUSEMknodMeta) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5230 return f.CopyOutN(cc, addr, f.SizeBytes()) 5231 } 5232 5233 // CopyInN implements marshal.Marshallable.CopyInN. 5234 func (f *FUSEMknodMeta) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5235 // Construct a slice backed by dst's underlying memory. 5236 var buf []byte 5237 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5238 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5239 hdr.Len = f.SizeBytes() 5240 hdr.Cap = f.SizeBytes() 5241 5242 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5243 // Since we bypassed the compiler's escape analysis, indicate that f 5244 // must live until the use above. 5245 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5246 return length, err 5247 } 5248 5249 // CopyIn implements marshal.Marshallable.CopyIn. 5250 func (f *FUSEMknodMeta) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5251 return f.CopyInN(cc, addr, f.SizeBytes()) 5252 } 5253 5254 // WriteTo implements io.WriterTo.WriteTo. 5255 func (f *FUSEMknodMeta) WriteTo(writer io.Writer) (int64, error) { 5256 // Construct a slice backed by dst's underlying memory. 5257 var buf []byte 5258 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5259 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5260 hdr.Len = f.SizeBytes() 5261 hdr.Cap = f.SizeBytes() 5262 5263 length, err := writer.Write(buf) 5264 // Since we bypassed the compiler's escape analysis, indicate that f 5265 // must live until the use above. 5266 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5267 return int64(length), err 5268 } 5269 5270 // SizeBytes implements marshal.Marshallable.SizeBytes. 5271 //go:nosplit 5272 func (f *FUSEOpID) SizeBytes() int { 5273 return 8 5274 } 5275 5276 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5277 func (f *FUSEOpID) MarshalBytes(dst []byte) []byte { 5278 hostarch.ByteOrder.PutUint64(dst[:8], uint64(*f)) 5279 return dst[8:] 5280 } 5281 5282 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5283 func (f *FUSEOpID) UnmarshalBytes(src []byte) []byte { 5284 *f = FUSEOpID(uint64(hostarch.ByteOrder.Uint64(src[:8]))) 5285 return src[8:] 5286 } 5287 5288 // Packed implements marshal.Marshallable.Packed. 5289 //go:nosplit 5290 func (f *FUSEOpID) Packed() bool { 5291 // Scalar newtypes are always packed. 5292 return true 5293 } 5294 5295 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5296 func (f *FUSEOpID) MarshalUnsafe(dst []byte) []byte { 5297 size := f.SizeBytes() 5298 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 5299 return dst[size:] 5300 } 5301 5302 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5303 func (f *FUSEOpID) UnmarshalUnsafe(src []byte) []byte { 5304 size := f.SizeBytes() 5305 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 5306 return src[size:] 5307 } 5308 5309 // CopyOutN implements marshal.Marshallable.CopyOutN. 5310 func (f *FUSEOpID) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5311 // Construct a slice backed by dst's underlying memory. 5312 var buf []byte 5313 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5314 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5315 hdr.Len = f.SizeBytes() 5316 hdr.Cap = f.SizeBytes() 5317 5318 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5319 // Since we bypassed the compiler's escape analysis, indicate that f 5320 // must live until the use above. 5321 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5322 return length, err 5323 } 5324 5325 // CopyOut implements marshal.Marshallable.CopyOut. 5326 func (f *FUSEOpID) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5327 return f.CopyOutN(cc, addr, f.SizeBytes()) 5328 } 5329 5330 // CopyInN implements marshal.Marshallable.CopyInN. 5331 func (f *FUSEOpID) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5332 // Construct a slice backed by dst's underlying memory. 5333 var buf []byte 5334 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5335 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5336 hdr.Len = f.SizeBytes() 5337 hdr.Cap = f.SizeBytes() 5338 5339 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5340 // Since we bypassed the compiler's escape analysis, indicate that f 5341 // must live until the use above. 5342 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5343 return length, err 5344 } 5345 5346 // CopyIn implements marshal.Marshallable.CopyIn. 5347 func (f *FUSEOpID) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5348 return f.CopyInN(cc, addr, f.SizeBytes()) 5349 } 5350 5351 // WriteTo implements io.WriterTo.WriteTo. 5352 func (f *FUSEOpID) WriteTo(writer io.Writer) (int64, error) { 5353 // Construct a slice backed by dst's underlying memory. 5354 var buf []byte 5355 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5356 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5357 hdr.Len = f.SizeBytes() 5358 hdr.Cap = f.SizeBytes() 5359 5360 length, err := writer.Write(buf) 5361 // Since we bypassed the compiler's escape analysis, indicate that f 5362 // must live until the use above. 5363 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5364 return int64(length), err 5365 } 5366 5367 // SizeBytes implements marshal.Marshallable.SizeBytes. 5368 //go:nosplit 5369 func (f *FUSEOpcode) SizeBytes() int { 5370 return 4 5371 } 5372 5373 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5374 func (f *FUSEOpcode) MarshalBytes(dst []byte) []byte { 5375 hostarch.ByteOrder.PutUint32(dst[:4], uint32(*f)) 5376 return dst[4:] 5377 } 5378 5379 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5380 func (f *FUSEOpcode) UnmarshalBytes(src []byte) []byte { 5381 *f = FUSEOpcode(uint32(hostarch.ByteOrder.Uint32(src[:4]))) 5382 return src[4:] 5383 } 5384 5385 // Packed implements marshal.Marshallable.Packed. 5386 //go:nosplit 5387 func (f *FUSEOpcode) Packed() bool { 5388 // Scalar newtypes are always packed. 5389 return true 5390 } 5391 5392 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5393 func (f *FUSEOpcode) MarshalUnsafe(dst []byte) []byte { 5394 size := f.SizeBytes() 5395 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 5396 return dst[size:] 5397 } 5398 5399 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5400 func (f *FUSEOpcode) UnmarshalUnsafe(src []byte) []byte { 5401 size := f.SizeBytes() 5402 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 5403 return src[size:] 5404 } 5405 5406 // CopyOutN implements marshal.Marshallable.CopyOutN. 5407 func (f *FUSEOpcode) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5408 // Construct a slice backed by dst's underlying memory. 5409 var buf []byte 5410 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5411 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5412 hdr.Len = f.SizeBytes() 5413 hdr.Cap = f.SizeBytes() 5414 5415 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5416 // Since we bypassed the compiler's escape analysis, indicate that f 5417 // must live until the use above. 5418 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5419 return length, err 5420 } 5421 5422 // CopyOut implements marshal.Marshallable.CopyOut. 5423 func (f *FUSEOpcode) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5424 return f.CopyOutN(cc, addr, f.SizeBytes()) 5425 } 5426 5427 // CopyInN implements marshal.Marshallable.CopyInN. 5428 func (f *FUSEOpcode) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5429 // Construct a slice backed by dst's underlying memory. 5430 var buf []byte 5431 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5432 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5433 hdr.Len = f.SizeBytes() 5434 hdr.Cap = f.SizeBytes() 5435 5436 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5437 // Since we bypassed the compiler's escape analysis, indicate that f 5438 // must live until the use above. 5439 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5440 return length, err 5441 } 5442 5443 // CopyIn implements marshal.Marshallable.CopyIn. 5444 func (f *FUSEOpcode) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5445 return f.CopyInN(cc, addr, f.SizeBytes()) 5446 } 5447 5448 // WriteTo implements io.WriterTo.WriteTo. 5449 func (f *FUSEOpcode) WriteTo(writer io.Writer) (int64, error) { 5450 // Construct a slice backed by dst's underlying memory. 5451 var buf []byte 5452 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5453 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5454 hdr.Len = f.SizeBytes() 5455 hdr.Cap = f.SizeBytes() 5456 5457 length, err := writer.Write(buf) 5458 // Since we bypassed the compiler's escape analysis, indicate that f 5459 // must live until the use above. 5460 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5461 return int64(length), err 5462 } 5463 5464 // SizeBytes implements marshal.Marshallable.SizeBytes. 5465 func (f *FUSEOpenIn) SizeBytes() int { 5466 return 8 5467 } 5468 5469 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5470 func (f *FUSEOpenIn) MarshalBytes(dst []byte) []byte { 5471 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) 5472 dst = dst[4:] 5473 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 5474 dst = dst[4:] 5475 return dst 5476 } 5477 5478 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5479 func (f *FUSEOpenIn) UnmarshalBytes(src []byte) []byte { 5480 f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5481 src = src[4:] 5482 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 5483 src = src[4:] 5484 return src 5485 } 5486 5487 // Packed implements marshal.Marshallable.Packed. 5488 //go:nosplit 5489 func (f *FUSEOpenIn) Packed() bool { 5490 return true 5491 } 5492 5493 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5494 func (f *FUSEOpenIn) MarshalUnsafe(dst []byte) []byte { 5495 size := f.SizeBytes() 5496 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 5497 return dst[size:] 5498 } 5499 5500 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5501 func (f *FUSEOpenIn) UnmarshalUnsafe(src []byte) []byte { 5502 size := f.SizeBytes() 5503 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 5504 return src[size:] 5505 } 5506 5507 // CopyOutN implements marshal.Marshallable.CopyOutN. 5508 func (f *FUSEOpenIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 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(f))) 5513 hdr.Len = f.SizeBytes() 5514 hdr.Cap = f.SizeBytes() 5515 5516 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5517 // Since we bypassed the compiler's escape analysis, indicate that f 5518 // must live until the use above. 5519 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5520 return length, err 5521 } 5522 5523 // CopyOut implements marshal.Marshallable.CopyOut. 5524 func (f *FUSEOpenIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5525 return f.CopyOutN(cc, addr, f.SizeBytes()) 5526 } 5527 5528 // CopyInN implements marshal.Marshallable.CopyInN. 5529 func (f *FUSEOpenIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5530 // Construct a slice backed by dst's underlying memory. 5531 var buf []byte 5532 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5533 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5534 hdr.Len = f.SizeBytes() 5535 hdr.Cap = f.SizeBytes() 5536 5537 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5538 // Since we bypassed the compiler's escape analysis, indicate that f 5539 // must live until the use above. 5540 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5541 return length, err 5542 } 5543 5544 // CopyIn implements marshal.Marshallable.CopyIn. 5545 func (f *FUSEOpenIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5546 return f.CopyInN(cc, addr, f.SizeBytes()) 5547 } 5548 5549 // WriteTo implements io.WriterTo.WriteTo. 5550 func (f *FUSEOpenIn) WriteTo(writer io.Writer) (int64, error) { 5551 // Construct a slice backed by dst's underlying memory. 5552 var buf []byte 5553 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5554 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5555 hdr.Len = f.SizeBytes() 5556 hdr.Cap = f.SizeBytes() 5557 5558 length, err := writer.Write(buf) 5559 // Since we bypassed the compiler's escape analysis, indicate that f 5560 // must live until the use above. 5561 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5562 return int64(length), err 5563 } 5564 5565 // SizeBytes implements marshal.Marshallable.SizeBytes. 5566 func (f *FUSEOpenOut) SizeBytes() int { 5567 return 16 5568 } 5569 5570 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5571 func (f *FUSEOpenOut) MarshalBytes(dst []byte) []byte { 5572 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) 5573 dst = dst[8:] 5574 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.OpenFlag)) 5575 dst = dst[4:] 5576 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 5577 dst = dst[4:] 5578 return dst 5579 } 5580 5581 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5582 func (f *FUSEOpenOut) UnmarshalBytes(src []byte) []byte { 5583 f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 5584 src = src[8:] 5585 f.OpenFlag = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5586 src = src[4:] 5587 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 5588 src = src[4:] 5589 return src 5590 } 5591 5592 // Packed implements marshal.Marshallable.Packed. 5593 //go:nosplit 5594 func (f *FUSEOpenOut) Packed() bool { 5595 return true 5596 } 5597 5598 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5599 func (f *FUSEOpenOut) MarshalUnsafe(dst []byte) []byte { 5600 size := f.SizeBytes() 5601 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 5602 return dst[size:] 5603 } 5604 5605 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5606 func (f *FUSEOpenOut) UnmarshalUnsafe(src []byte) []byte { 5607 size := f.SizeBytes() 5608 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 5609 return src[size:] 5610 } 5611 5612 // CopyOutN implements marshal.Marshallable.CopyOutN. 5613 func (f *FUSEOpenOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5614 // Construct a slice backed by dst's underlying memory. 5615 var buf []byte 5616 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5617 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5618 hdr.Len = f.SizeBytes() 5619 hdr.Cap = f.SizeBytes() 5620 5621 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5622 // Since we bypassed the compiler's escape analysis, indicate that f 5623 // must live until the use above. 5624 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5625 return length, err 5626 } 5627 5628 // CopyOut implements marshal.Marshallable.CopyOut. 5629 func (f *FUSEOpenOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5630 return f.CopyOutN(cc, addr, f.SizeBytes()) 5631 } 5632 5633 // CopyInN implements marshal.Marshallable.CopyInN. 5634 func (f *FUSEOpenOut) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5635 // Construct a slice backed by dst's underlying memory. 5636 var buf []byte 5637 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5638 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5639 hdr.Len = f.SizeBytes() 5640 hdr.Cap = f.SizeBytes() 5641 5642 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5643 // Since we bypassed the compiler's escape analysis, indicate that f 5644 // must live until the use above. 5645 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5646 return length, err 5647 } 5648 5649 // CopyIn implements marshal.Marshallable.CopyIn. 5650 func (f *FUSEOpenOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5651 return f.CopyInN(cc, addr, f.SizeBytes()) 5652 } 5653 5654 // WriteTo implements io.WriterTo.WriteTo. 5655 func (f *FUSEOpenOut) WriteTo(writer io.Writer) (int64, error) { 5656 // Construct a slice backed by dst's underlying memory. 5657 var buf []byte 5658 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5659 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5660 hdr.Len = f.SizeBytes() 5661 hdr.Cap = f.SizeBytes() 5662 5663 length, err := writer.Write(buf) 5664 // Since we bypassed the compiler's escape analysis, indicate that f 5665 // must live until the use above. 5666 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5667 return int64(length), err 5668 } 5669 5670 // SizeBytes implements marshal.Marshallable.SizeBytes. 5671 func (f *FUSEReadIn) SizeBytes() int { 5672 return 40 5673 } 5674 5675 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5676 func (f *FUSEReadIn) MarshalBytes(dst []byte) []byte { 5677 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) 5678 dst = dst[8:] 5679 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Offset)) 5680 dst = dst[8:] 5681 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Size)) 5682 dst = dst[4:] 5683 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.ReadFlags)) 5684 dst = dst[4:] 5685 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.LockOwner)) 5686 dst = dst[8:] 5687 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) 5688 dst = dst[4:] 5689 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 5690 dst = dst[4:] 5691 return dst 5692 } 5693 5694 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5695 func (f *FUSEReadIn) UnmarshalBytes(src []byte) []byte { 5696 f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 5697 src = src[8:] 5698 f.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 5699 src = src[8:] 5700 f.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5701 src = src[4:] 5702 f.ReadFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5703 src = src[4:] 5704 f.LockOwner = uint64(hostarch.ByteOrder.Uint64(src[:8])) 5705 src = src[8:] 5706 f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5707 src = src[4:] 5708 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 5709 src = src[4:] 5710 return src 5711 } 5712 5713 // Packed implements marshal.Marshallable.Packed. 5714 //go:nosplit 5715 func (f *FUSEReadIn) Packed() bool { 5716 return true 5717 } 5718 5719 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5720 func (f *FUSEReadIn) MarshalUnsafe(dst []byte) []byte { 5721 size := f.SizeBytes() 5722 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 5723 return dst[size:] 5724 } 5725 5726 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5727 func (f *FUSEReadIn) UnmarshalUnsafe(src []byte) []byte { 5728 size := f.SizeBytes() 5729 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 5730 return src[size:] 5731 } 5732 5733 // CopyOutN implements marshal.Marshallable.CopyOutN. 5734 func (f *FUSEReadIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5735 // Construct a slice backed by dst's underlying memory. 5736 var buf []byte 5737 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5738 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5739 hdr.Len = f.SizeBytes() 5740 hdr.Cap = f.SizeBytes() 5741 5742 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5743 // Since we bypassed the compiler's escape analysis, indicate that f 5744 // must live until the use above. 5745 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5746 return length, err 5747 } 5748 5749 // CopyOut implements marshal.Marshallable.CopyOut. 5750 func (f *FUSEReadIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5751 return f.CopyOutN(cc, addr, f.SizeBytes()) 5752 } 5753 5754 // CopyInN implements marshal.Marshallable.CopyInN. 5755 func (f *FUSEReadIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5756 // Construct a slice backed by dst's underlying memory. 5757 var buf []byte 5758 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5759 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5760 hdr.Len = f.SizeBytes() 5761 hdr.Cap = f.SizeBytes() 5762 5763 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5764 // Since we bypassed the compiler's escape analysis, indicate that f 5765 // must live until the use above. 5766 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5767 return length, err 5768 } 5769 5770 // CopyIn implements marshal.Marshallable.CopyIn. 5771 func (f *FUSEReadIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5772 return f.CopyInN(cc, addr, f.SizeBytes()) 5773 } 5774 5775 // WriteTo implements io.WriterTo.WriteTo. 5776 func (f *FUSEReadIn) WriteTo(writer io.Writer) (int64, error) { 5777 // Construct a slice backed by dst's underlying memory. 5778 var buf []byte 5779 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5780 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5781 hdr.Len = f.SizeBytes() 5782 hdr.Cap = f.SizeBytes() 5783 5784 length, err := writer.Write(buf) 5785 // Since we bypassed the compiler's escape analysis, indicate that f 5786 // must live until the use above. 5787 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5788 return int64(length), err 5789 } 5790 5791 // SizeBytes implements marshal.Marshallable.SizeBytes. 5792 func (f *FUSEReleaseIn) SizeBytes() int { 5793 return 24 5794 } 5795 5796 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 5797 func (f *FUSEReleaseIn) MarshalBytes(dst []byte) []byte { 5798 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) 5799 dst = dst[8:] 5800 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) 5801 dst = dst[4:] 5802 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.ReleaseFlags)) 5803 dst = dst[4:] 5804 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.LockOwner)) 5805 dst = dst[8:] 5806 return dst 5807 } 5808 5809 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 5810 func (f *FUSEReleaseIn) UnmarshalBytes(src []byte) []byte { 5811 f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 5812 src = src[8:] 5813 f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5814 src = src[4:] 5815 f.ReleaseFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 5816 src = src[4:] 5817 f.LockOwner = uint64(hostarch.ByteOrder.Uint64(src[:8])) 5818 src = src[8:] 5819 return src 5820 } 5821 5822 // Packed implements marshal.Marshallable.Packed. 5823 //go:nosplit 5824 func (f *FUSEReleaseIn) Packed() bool { 5825 return true 5826 } 5827 5828 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5829 func (f *FUSEReleaseIn) MarshalUnsafe(dst []byte) []byte { 5830 size := f.SizeBytes() 5831 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 5832 return dst[size:] 5833 } 5834 5835 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5836 func (f *FUSEReleaseIn) UnmarshalUnsafe(src []byte) []byte { 5837 size := f.SizeBytes() 5838 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 5839 return src[size:] 5840 } 5841 5842 // CopyOutN implements marshal.Marshallable.CopyOutN. 5843 func (f *FUSEReleaseIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5844 // Construct a slice backed by dst's underlying memory. 5845 var buf []byte 5846 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5847 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5848 hdr.Len = f.SizeBytes() 5849 hdr.Cap = f.SizeBytes() 5850 5851 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5852 // Since we bypassed the compiler's escape analysis, indicate that f 5853 // must live until the use above. 5854 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5855 return length, err 5856 } 5857 5858 // CopyOut implements marshal.Marshallable.CopyOut. 5859 func (f *FUSEReleaseIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5860 return f.CopyOutN(cc, addr, f.SizeBytes()) 5861 } 5862 5863 // CopyInN implements marshal.Marshallable.CopyInN. 5864 func (f *FUSEReleaseIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5865 // Construct a slice backed by dst's underlying memory. 5866 var buf []byte 5867 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5868 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5869 hdr.Len = f.SizeBytes() 5870 hdr.Cap = f.SizeBytes() 5871 5872 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 5873 // Since we bypassed the compiler's escape analysis, indicate that f 5874 // must live until the use above. 5875 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5876 return length, err 5877 } 5878 5879 // CopyIn implements marshal.Marshallable.CopyIn. 5880 func (f *FUSEReleaseIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5881 return f.CopyInN(cc, addr, f.SizeBytes()) 5882 } 5883 5884 // WriteTo implements io.WriterTo.WriteTo. 5885 func (f *FUSEReleaseIn) WriteTo(writer io.Writer) (int64, error) { 5886 // Construct a slice backed by dst's underlying memory. 5887 var buf []byte 5888 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 5889 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 5890 hdr.Len = f.SizeBytes() 5891 hdr.Cap = f.SizeBytes() 5892 5893 length, err := writer.Write(buf) 5894 // Since we bypassed the compiler's escape analysis, indicate that f 5895 // must live until the use above. 5896 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 5897 return int64(length), err 5898 } 5899 5900 // Packed implements marshal.Marshallable.Packed. 5901 //go:nosplit 5902 func (r *FUSERenameIn) Packed() bool { 5903 // Type FUSERenameIn is dynamic so it might have slice/string headers. Hence, it is not packed. 5904 return false 5905 } 5906 5907 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5908 func (r *FUSERenameIn) MarshalUnsafe(dst []byte) []byte { 5909 // Type FUSERenameIn doesn't have a packed layout in memory, fallback to MarshalBytes. 5910 return r.MarshalBytes(dst) 5911 } 5912 5913 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5914 func (r *FUSERenameIn) UnmarshalUnsafe(src []byte) []byte { 5915 // Type FUSERenameIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 5916 return r.UnmarshalBytes(src) 5917 } 5918 5919 // CopyOutN implements marshal.Marshallable.CopyOutN. 5920 //go:nosplit 5921 func (r *FUSERenameIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5922 // Type FUSERenameIn doesn't have a packed layout in memory, fall back to MarshalBytes. 5923 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 5924 r.MarshalBytes(buf) // escapes: fallback. 5925 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5926 } 5927 5928 // CopyOut implements marshal.Marshallable.CopyOut. 5929 func (r *FUSERenameIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5930 return r.CopyOutN(cc, addr, r.SizeBytes()) 5931 } 5932 5933 // CopyInN implements marshal.Marshallable.CopyInN. 5934 //go:nosplit 5935 func (r *FUSERenameIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5936 // Type FUSERenameIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 5937 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 5938 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 5939 // Unmarshal unconditionally. If we had a short copy-in, this results in a 5940 // partially unmarshalled struct. 5941 r.UnmarshalBytes(buf) // escapes: fallback. 5942 return length, err 5943 } 5944 5945 // CopyIn implements marshal.Marshallable.CopyIn. 5946 func (r *FUSERenameIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5947 return r.CopyInN(cc, addr, r.SizeBytes()) 5948 } 5949 5950 // WriteTo implements io.WriterTo.WriteTo. 5951 func (r *FUSERenameIn) WriteTo(writer io.Writer) (int64, error) { 5952 // Type FUSERenameIn doesn't have a packed layout in memory, fall back to MarshalBytes. 5953 buf := make([]byte, r.SizeBytes()) 5954 r.MarshalBytes(buf) 5955 length, err := writer.Write(buf) 5956 return int64(length), err 5957 } 5958 5959 // Packed implements marshal.Marshallable.Packed. 5960 //go:nosplit 5961 func (r *FUSERmDirIn) Packed() bool { 5962 // Type FUSERmDirIn is dynamic so it might have slice/string headers. Hence, it is not packed. 5963 return false 5964 } 5965 5966 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 5967 func (r *FUSERmDirIn) MarshalUnsafe(dst []byte) []byte { 5968 // Type FUSERmDirIn doesn't have a packed layout in memory, fallback to MarshalBytes. 5969 return r.MarshalBytes(dst) 5970 } 5971 5972 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 5973 func (r *FUSERmDirIn) UnmarshalUnsafe(src []byte) []byte { 5974 // Type FUSERmDirIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 5975 return r.UnmarshalBytes(src) 5976 } 5977 5978 // CopyOutN implements marshal.Marshallable.CopyOutN. 5979 //go:nosplit 5980 func (r *FUSERmDirIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5981 // Type FUSERmDirIn doesn't have a packed layout in memory, fall back to MarshalBytes. 5982 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 5983 r.MarshalBytes(buf) // escapes: fallback. 5984 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 5985 } 5986 5987 // CopyOut implements marshal.Marshallable.CopyOut. 5988 func (r *FUSERmDirIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 5989 return r.CopyOutN(cc, addr, r.SizeBytes()) 5990 } 5991 5992 // CopyInN implements marshal.Marshallable.CopyInN. 5993 //go:nosplit 5994 func (r *FUSERmDirIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 5995 // Type FUSERmDirIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 5996 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 5997 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 5998 // Unmarshal unconditionally. If we had a short copy-in, this results in a 5999 // partially unmarshalled struct. 6000 r.UnmarshalBytes(buf) // escapes: fallback. 6001 return length, err 6002 } 6003 6004 // CopyIn implements marshal.Marshallable.CopyIn. 6005 func (r *FUSERmDirIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6006 return r.CopyInN(cc, addr, r.SizeBytes()) 6007 } 6008 6009 // WriteTo implements io.WriterTo.WriteTo. 6010 func (r *FUSERmDirIn) WriteTo(writer io.Writer) (int64, error) { 6011 // Type FUSERmDirIn doesn't have a packed layout in memory, fall back to MarshalBytes. 6012 buf := make([]byte, r.SizeBytes()) 6013 r.MarshalBytes(buf) 6014 length, err := writer.Write(buf) 6015 return int64(length), err 6016 } 6017 6018 // SizeBytes implements marshal.Marshallable.SizeBytes. 6019 func (f *FUSESetAttrIn) SizeBytes() int { 6020 return 88 6021 } 6022 6023 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6024 func (f *FUSESetAttrIn) MarshalBytes(dst []byte) []byte { 6025 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Valid)) 6026 dst = dst[4:] 6027 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 6028 dst = dst[4:] 6029 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) 6030 dst = dst[8:] 6031 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Size)) 6032 dst = dst[8:] 6033 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.LockOwner)) 6034 dst = dst[8:] 6035 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Atime)) 6036 dst = dst[8:] 6037 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Mtime)) 6038 dst = dst[8:] 6039 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Ctime)) 6040 dst = dst[8:] 6041 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.AtimeNsec)) 6042 dst = dst[4:] 6043 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.MtimeNsec)) 6044 dst = dst[4:] 6045 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.CtimeNsec)) 6046 dst = dst[4:] 6047 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Mode)) 6048 dst = dst[4:] 6049 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 6050 dst = dst[4:] 6051 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.UID)) 6052 dst = dst[4:] 6053 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.GID)) 6054 dst = dst[4:] 6055 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 6056 dst = dst[4:] 6057 return dst 6058 } 6059 6060 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6061 func (f *FUSESetAttrIn) UnmarshalBytes(src []byte) []byte { 6062 f.Valid = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6063 src = src[4:] 6064 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 6065 src = src[4:] 6066 f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6067 src = src[8:] 6068 f.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6069 src = src[8:] 6070 f.LockOwner = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6071 src = src[8:] 6072 f.Atime = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6073 src = src[8:] 6074 f.Mtime = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6075 src = src[8:] 6076 f.Ctime = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6077 src = src[8:] 6078 f.AtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6079 src = src[4:] 6080 f.MtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6081 src = src[4:] 6082 f.CtimeNsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6083 src = src[4:] 6084 f.Mode = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6085 src = src[4:] 6086 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 6087 src = src[4:] 6088 f.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6089 src = src[4:] 6090 f.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6091 src = src[4:] 6092 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 6093 src = src[4:] 6094 return src 6095 } 6096 6097 // Packed implements marshal.Marshallable.Packed. 6098 //go:nosplit 6099 func (f *FUSESetAttrIn) Packed() bool { 6100 return true 6101 } 6102 6103 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6104 func (f *FUSESetAttrIn) MarshalUnsafe(dst []byte) []byte { 6105 size := f.SizeBytes() 6106 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 6107 return dst[size:] 6108 } 6109 6110 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6111 func (f *FUSESetAttrIn) UnmarshalUnsafe(src []byte) []byte { 6112 size := f.SizeBytes() 6113 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 6114 return src[size:] 6115 } 6116 6117 // CopyOutN implements marshal.Marshallable.CopyOutN. 6118 func (f *FUSESetAttrIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6119 // Construct a slice backed by dst's underlying memory. 6120 var buf []byte 6121 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6122 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6123 hdr.Len = f.SizeBytes() 6124 hdr.Cap = f.SizeBytes() 6125 6126 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6127 // Since we bypassed the compiler's escape analysis, indicate that f 6128 // must live until the use above. 6129 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6130 return length, err 6131 } 6132 6133 // CopyOut implements marshal.Marshallable.CopyOut. 6134 func (f *FUSESetAttrIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6135 return f.CopyOutN(cc, addr, f.SizeBytes()) 6136 } 6137 6138 // CopyInN implements marshal.Marshallable.CopyInN. 6139 func (f *FUSESetAttrIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6140 // Construct a slice backed by dst's underlying memory. 6141 var buf []byte 6142 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6143 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6144 hdr.Len = f.SizeBytes() 6145 hdr.Cap = f.SizeBytes() 6146 6147 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6148 // Since we bypassed the compiler's escape analysis, indicate that f 6149 // must live until the use above. 6150 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6151 return length, err 6152 } 6153 6154 // CopyIn implements marshal.Marshallable.CopyIn. 6155 func (f *FUSESetAttrIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6156 return f.CopyInN(cc, addr, f.SizeBytes()) 6157 } 6158 6159 // WriteTo implements io.WriterTo.WriteTo. 6160 func (f *FUSESetAttrIn) WriteTo(writer io.Writer) (int64, error) { 6161 // Construct a slice backed by dst's underlying memory. 6162 var buf []byte 6163 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6164 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6165 hdr.Len = f.SizeBytes() 6166 hdr.Cap = f.SizeBytes() 6167 6168 length, err := writer.Write(buf) 6169 // Since we bypassed the compiler's escape analysis, indicate that f 6170 // must live until the use above. 6171 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6172 return int64(length), err 6173 } 6174 6175 // SizeBytes implements marshal.Marshallable.SizeBytes. 6176 func (f *FUSEStatfsOut) SizeBytes() int { 6177 return 56 + 6178 4*6 6179 } 6180 6181 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6182 func (f *FUSEStatfsOut) MarshalBytes(dst []byte) []byte { 6183 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Blocks)) 6184 dst = dst[8:] 6185 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.BlocksFree)) 6186 dst = dst[8:] 6187 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.BlocksAvailable)) 6188 dst = dst[8:] 6189 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Files)) 6190 dst = dst[8:] 6191 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.FilesFree)) 6192 dst = dst[8:] 6193 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.BlockSize)) 6194 dst = dst[4:] 6195 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.NameLength)) 6196 dst = dst[4:] 6197 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.FragmentSize)) 6198 dst = dst[4:] 6199 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 6200 dst = dst[4:] 6201 for idx := 0; idx < 6; idx++ { 6202 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Spare[idx])) 6203 dst = dst[4:] 6204 } 6205 return dst 6206 } 6207 6208 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6209 func (f *FUSEStatfsOut) UnmarshalBytes(src []byte) []byte { 6210 f.Blocks = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6211 src = src[8:] 6212 f.BlocksFree = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6213 src = src[8:] 6214 f.BlocksAvailable = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6215 src = src[8:] 6216 f.Files = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6217 src = src[8:] 6218 f.FilesFree = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6219 src = src[8:] 6220 f.BlockSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6221 src = src[4:] 6222 f.NameLength = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6223 src = src[4:] 6224 f.FragmentSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6225 src = src[4:] 6226 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 6227 src = src[4:] 6228 for idx := 0; idx < 6; idx++ { 6229 f.Spare[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6230 src = src[4:] 6231 } 6232 return src 6233 } 6234 6235 // Packed implements marshal.Marshallable.Packed. 6236 //go:nosplit 6237 func (f *FUSEStatfsOut) Packed() bool { 6238 return true 6239 } 6240 6241 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6242 func (f *FUSEStatfsOut) MarshalUnsafe(dst []byte) []byte { 6243 size := f.SizeBytes() 6244 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 6245 return dst[size:] 6246 } 6247 6248 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6249 func (f *FUSEStatfsOut) UnmarshalUnsafe(src []byte) []byte { 6250 size := f.SizeBytes() 6251 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 6252 return src[size:] 6253 } 6254 6255 // CopyOutN implements marshal.Marshallable.CopyOutN. 6256 func (f *FUSEStatfsOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6257 // Construct a slice backed by dst's underlying memory. 6258 var buf []byte 6259 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6260 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6261 hdr.Len = f.SizeBytes() 6262 hdr.Cap = f.SizeBytes() 6263 6264 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6265 // Since we bypassed the compiler's escape analysis, indicate that f 6266 // must live until the use above. 6267 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6268 return length, err 6269 } 6270 6271 // CopyOut implements marshal.Marshallable.CopyOut. 6272 func (f *FUSEStatfsOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6273 return f.CopyOutN(cc, addr, f.SizeBytes()) 6274 } 6275 6276 // CopyInN implements marshal.Marshallable.CopyInN. 6277 func (f *FUSEStatfsOut) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6278 // Construct a slice backed by dst's underlying memory. 6279 var buf []byte 6280 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6281 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6282 hdr.Len = f.SizeBytes() 6283 hdr.Cap = f.SizeBytes() 6284 6285 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6286 // Since we bypassed the compiler's escape analysis, indicate that f 6287 // must live until the use above. 6288 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6289 return length, err 6290 } 6291 6292 // CopyIn implements marshal.Marshallable.CopyIn. 6293 func (f *FUSEStatfsOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6294 return f.CopyInN(cc, addr, f.SizeBytes()) 6295 } 6296 6297 // WriteTo implements io.WriterTo.WriteTo. 6298 func (f *FUSEStatfsOut) WriteTo(writer io.Writer) (int64, error) { 6299 // Construct a slice backed by dst's underlying memory. 6300 var buf []byte 6301 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6302 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6303 hdr.Len = f.SizeBytes() 6304 hdr.Cap = f.SizeBytes() 6305 6306 length, err := writer.Write(buf) 6307 // Since we bypassed the compiler's escape analysis, indicate that f 6308 // must live until the use above. 6309 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6310 return int64(length), err 6311 } 6312 6313 // Packed implements marshal.Marshallable.Packed. 6314 //go:nosplit 6315 func (r *FUSESymlinkIn) Packed() bool { 6316 // Type FUSESymlinkIn is dynamic so it might have slice/string headers. Hence, it is not packed. 6317 return false 6318 } 6319 6320 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6321 func (r *FUSESymlinkIn) MarshalUnsafe(dst []byte) []byte { 6322 // Type FUSESymlinkIn doesn't have a packed layout in memory, fallback to MarshalBytes. 6323 return r.MarshalBytes(dst) 6324 } 6325 6326 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6327 func (r *FUSESymlinkIn) UnmarshalUnsafe(src []byte) []byte { 6328 // Type FUSESymlinkIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 6329 return r.UnmarshalBytes(src) 6330 } 6331 6332 // CopyOutN implements marshal.Marshallable.CopyOutN. 6333 //go:nosplit 6334 func (r *FUSESymlinkIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6335 // Type FUSESymlinkIn doesn't have a packed layout in memory, fall back to MarshalBytes. 6336 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 6337 r.MarshalBytes(buf) // escapes: fallback. 6338 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6339 } 6340 6341 // CopyOut implements marshal.Marshallable.CopyOut. 6342 func (r *FUSESymlinkIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6343 return r.CopyOutN(cc, addr, r.SizeBytes()) 6344 } 6345 6346 // CopyInN implements marshal.Marshallable.CopyInN. 6347 //go:nosplit 6348 func (r *FUSESymlinkIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6349 // Type FUSESymlinkIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 6350 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 6351 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 6352 // Unmarshal unconditionally. If we had a short copy-in, this results in a 6353 // partially unmarshalled struct. 6354 r.UnmarshalBytes(buf) // escapes: fallback. 6355 return length, err 6356 } 6357 6358 // CopyIn implements marshal.Marshallable.CopyIn. 6359 func (r *FUSESymlinkIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6360 return r.CopyInN(cc, addr, r.SizeBytes()) 6361 } 6362 6363 // WriteTo implements io.WriterTo.WriteTo. 6364 func (r *FUSESymlinkIn) WriteTo(writer io.Writer) (int64, error) { 6365 // Type FUSESymlinkIn doesn't have a packed layout in memory, fall back to MarshalBytes. 6366 buf := make([]byte, r.SizeBytes()) 6367 r.MarshalBytes(buf) 6368 length, err := writer.Write(buf) 6369 return int64(length), err 6370 } 6371 6372 // Packed implements marshal.Marshallable.Packed. 6373 //go:nosplit 6374 func (r *FUSEUnlinkIn) Packed() bool { 6375 // Type FUSEUnlinkIn is dynamic so it might have slice/string headers. Hence, it is not packed. 6376 return false 6377 } 6378 6379 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6380 func (r *FUSEUnlinkIn) MarshalUnsafe(dst []byte) []byte { 6381 // Type FUSEUnlinkIn doesn't have a packed layout in memory, fallback to MarshalBytes. 6382 return r.MarshalBytes(dst) 6383 } 6384 6385 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6386 func (r *FUSEUnlinkIn) UnmarshalUnsafe(src []byte) []byte { 6387 // Type FUSEUnlinkIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 6388 return r.UnmarshalBytes(src) 6389 } 6390 6391 // CopyOutN implements marshal.Marshallable.CopyOutN. 6392 //go:nosplit 6393 func (r *FUSEUnlinkIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6394 // Type FUSEUnlinkIn doesn't have a packed layout in memory, fall back to MarshalBytes. 6395 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 6396 r.MarshalBytes(buf) // escapes: fallback. 6397 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6398 } 6399 6400 // CopyOut implements marshal.Marshallable.CopyOut. 6401 func (r *FUSEUnlinkIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6402 return r.CopyOutN(cc, addr, r.SizeBytes()) 6403 } 6404 6405 // CopyInN implements marshal.Marshallable.CopyInN. 6406 //go:nosplit 6407 func (r *FUSEUnlinkIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6408 // Type FUSEUnlinkIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 6409 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 6410 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 6411 // Unmarshal unconditionally. If we had a short copy-in, this results in a 6412 // partially unmarshalled struct. 6413 r.UnmarshalBytes(buf) // escapes: fallback. 6414 return length, err 6415 } 6416 6417 // CopyIn implements marshal.Marshallable.CopyIn. 6418 func (r *FUSEUnlinkIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6419 return r.CopyInN(cc, addr, r.SizeBytes()) 6420 } 6421 6422 // WriteTo implements io.WriterTo.WriteTo. 6423 func (r *FUSEUnlinkIn) WriteTo(writer io.Writer) (int64, error) { 6424 // Type FUSEUnlinkIn doesn't have a packed layout in memory, fall back to MarshalBytes. 6425 buf := make([]byte, r.SizeBytes()) 6426 r.MarshalBytes(buf) 6427 length, err := writer.Write(buf) 6428 return int64(length), err 6429 } 6430 6431 // SizeBytes implements marshal.Marshallable.SizeBytes. 6432 func (f *FUSEWriteIn) SizeBytes() int { 6433 return 40 6434 } 6435 6436 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6437 func (f *FUSEWriteIn) MarshalBytes(dst []byte) []byte { 6438 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Fh)) 6439 dst = dst[8:] 6440 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.Offset)) 6441 dst = dst[8:] 6442 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Size)) 6443 dst = dst[4:] 6444 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.WriteFlags)) 6445 dst = dst[4:] 6446 hostarch.ByteOrder.PutUint64(dst[:8], uint64(f.LockOwner)) 6447 dst = dst[8:] 6448 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Flags)) 6449 dst = dst[4:] 6450 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 6451 dst = dst[4:] 6452 return dst 6453 } 6454 6455 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6456 func (f *FUSEWriteIn) UnmarshalBytes(src []byte) []byte { 6457 f.Fh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6458 src = src[8:] 6459 f.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6460 src = src[8:] 6461 f.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6462 src = src[4:] 6463 f.WriteFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6464 src = src[4:] 6465 f.LockOwner = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6466 src = src[8:] 6467 f.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6468 src = src[4:] 6469 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 6470 src = src[4:] 6471 return src 6472 } 6473 6474 // Packed implements marshal.Marshallable.Packed. 6475 //go:nosplit 6476 func (f *FUSEWriteIn) Packed() bool { 6477 return true 6478 } 6479 6480 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6481 func (f *FUSEWriteIn) MarshalUnsafe(dst []byte) []byte { 6482 size := f.SizeBytes() 6483 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 6484 return dst[size:] 6485 } 6486 6487 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6488 func (f *FUSEWriteIn) UnmarshalUnsafe(src []byte) []byte { 6489 size := f.SizeBytes() 6490 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 6491 return src[size:] 6492 } 6493 6494 // CopyOutN implements marshal.Marshallable.CopyOutN. 6495 func (f *FUSEWriteIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6496 // Construct a slice backed by dst's underlying memory. 6497 var buf []byte 6498 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6499 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6500 hdr.Len = f.SizeBytes() 6501 hdr.Cap = f.SizeBytes() 6502 6503 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6504 // Since we bypassed the compiler's escape analysis, indicate that f 6505 // must live until the use above. 6506 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6507 return length, err 6508 } 6509 6510 // CopyOut implements marshal.Marshallable.CopyOut. 6511 func (f *FUSEWriteIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6512 return f.CopyOutN(cc, addr, f.SizeBytes()) 6513 } 6514 6515 // CopyInN implements marshal.Marshallable.CopyInN. 6516 func (f *FUSEWriteIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6517 // Construct a slice backed by dst's underlying memory. 6518 var buf []byte 6519 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6520 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6521 hdr.Len = f.SizeBytes() 6522 hdr.Cap = f.SizeBytes() 6523 6524 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6525 // Since we bypassed the compiler's escape analysis, indicate that f 6526 // must live until the use above. 6527 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6528 return length, err 6529 } 6530 6531 // CopyIn implements marshal.Marshallable.CopyIn. 6532 func (f *FUSEWriteIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6533 return f.CopyInN(cc, addr, f.SizeBytes()) 6534 } 6535 6536 // WriteTo implements io.WriterTo.WriteTo. 6537 func (f *FUSEWriteIn) WriteTo(writer io.Writer) (int64, error) { 6538 // Construct a slice backed by dst's underlying memory. 6539 var buf []byte 6540 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6541 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6542 hdr.Len = f.SizeBytes() 6543 hdr.Cap = f.SizeBytes() 6544 6545 length, err := writer.Write(buf) 6546 // Since we bypassed the compiler's escape analysis, indicate that f 6547 // must live until the use above. 6548 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6549 return int64(length), err 6550 } 6551 6552 // SizeBytes implements marshal.Marshallable.SizeBytes. 6553 func (f *FUSEWriteOut) SizeBytes() int { 6554 return 8 6555 } 6556 6557 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6558 func (f *FUSEWriteOut) MarshalBytes(dst []byte) []byte { 6559 hostarch.ByteOrder.PutUint32(dst[:4], uint32(f.Size)) 6560 dst = dst[4:] 6561 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 6562 dst = dst[4:] 6563 return dst 6564 } 6565 6566 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6567 func (f *FUSEWriteOut) UnmarshalBytes(src []byte) []byte { 6568 f.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6569 src = src[4:] 6570 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 6571 src = src[4:] 6572 return src 6573 } 6574 6575 // Packed implements marshal.Marshallable.Packed. 6576 //go:nosplit 6577 func (f *FUSEWriteOut) Packed() bool { 6578 return true 6579 } 6580 6581 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6582 func (f *FUSEWriteOut) MarshalUnsafe(dst []byte) []byte { 6583 size := f.SizeBytes() 6584 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(f), uintptr(size)) 6585 return dst[size:] 6586 } 6587 6588 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6589 func (f *FUSEWriteOut) UnmarshalUnsafe(src []byte) []byte { 6590 size := f.SizeBytes() 6591 gohacks.Memmove(unsafe.Pointer(f), unsafe.Pointer(&src[0]), uintptr(size)) 6592 return src[size:] 6593 } 6594 6595 // CopyOutN implements marshal.Marshallable.CopyOutN. 6596 func (f *FUSEWriteOut) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6597 // Construct a slice backed by dst's underlying memory. 6598 var buf []byte 6599 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6600 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6601 hdr.Len = f.SizeBytes() 6602 hdr.Cap = f.SizeBytes() 6603 6604 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6605 // Since we bypassed the compiler's escape analysis, indicate that f 6606 // must live until the use above. 6607 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6608 return length, err 6609 } 6610 6611 // CopyOut implements marshal.Marshallable.CopyOut. 6612 func (f *FUSEWriteOut) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6613 return f.CopyOutN(cc, addr, f.SizeBytes()) 6614 } 6615 6616 // CopyInN implements marshal.Marshallable.CopyInN. 6617 func (f *FUSEWriteOut) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6618 // Construct a slice backed by dst's underlying memory. 6619 var buf []byte 6620 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6621 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6622 hdr.Len = f.SizeBytes() 6623 hdr.Cap = f.SizeBytes() 6624 6625 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6626 // Since we bypassed the compiler's escape analysis, indicate that f 6627 // must live until the use above. 6628 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6629 return length, err 6630 } 6631 6632 // CopyIn implements marshal.Marshallable.CopyIn. 6633 func (f *FUSEWriteOut) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6634 return f.CopyInN(cc, addr, f.SizeBytes()) 6635 } 6636 6637 // WriteTo implements io.WriterTo.WriteTo. 6638 func (f *FUSEWriteOut) WriteTo(writer io.Writer) (int64, error) { 6639 // Construct a slice backed by dst's underlying memory. 6640 var buf []byte 6641 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6642 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(f))) 6643 hdr.Len = f.SizeBytes() 6644 hdr.Cap = f.SizeBytes() 6645 6646 length, err := writer.Write(buf) 6647 // Since we bypassed the compiler's escape analysis, indicate that f 6648 // must live until the use above. 6649 runtime.KeepAlive(f) // escapes: replaced by intrinsic. 6650 return int64(length), err 6651 } 6652 6653 // Packed implements marshal.Marshallable.Packed. 6654 //go:nosplit 6655 func (r *FUSEWritePayloadIn) Packed() bool { 6656 // Type FUSEWritePayloadIn is dynamic so it might have slice/string headers. Hence, it is not packed. 6657 return false 6658 } 6659 6660 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6661 func (r *FUSEWritePayloadIn) MarshalUnsafe(dst []byte) []byte { 6662 // Type FUSEWritePayloadIn doesn't have a packed layout in memory, fallback to MarshalBytes. 6663 return r.MarshalBytes(dst) 6664 } 6665 6666 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6667 func (r *FUSEWritePayloadIn) UnmarshalUnsafe(src []byte) []byte { 6668 // Type FUSEWritePayloadIn doesn't have a packed layout in memory, fallback to UnmarshalBytes. 6669 return r.UnmarshalBytes(src) 6670 } 6671 6672 // CopyOutN implements marshal.Marshallable.CopyOutN. 6673 //go:nosplit 6674 func (r *FUSEWritePayloadIn) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6675 // Type FUSEWritePayloadIn doesn't have a packed layout in memory, fall back to MarshalBytes. 6676 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 6677 r.MarshalBytes(buf) // escapes: fallback. 6678 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6679 } 6680 6681 // CopyOut implements marshal.Marshallable.CopyOut. 6682 func (r *FUSEWritePayloadIn) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6683 return r.CopyOutN(cc, addr, r.SizeBytes()) 6684 } 6685 6686 // CopyInN implements marshal.Marshallable.CopyInN. 6687 //go:nosplit 6688 func (r *FUSEWritePayloadIn) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6689 // Type FUSEWritePayloadIn doesn't have a packed layout in memory, fall back to UnmarshalBytes. 6690 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 6691 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 6692 // Unmarshal unconditionally. If we had a short copy-in, this results in a 6693 // partially unmarshalled struct. 6694 r.UnmarshalBytes(buf) // escapes: fallback. 6695 return length, err 6696 } 6697 6698 // CopyIn implements marshal.Marshallable.CopyIn. 6699 func (r *FUSEWritePayloadIn) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6700 return r.CopyInN(cc, addr, r.SizeBytes()) 6701 } 6702 6703 // WriteTo implements io.WriterTo.WriteTo. 6704 func (r *FUSEWritePayloadIn) WriteTo(writer io.Writer) (int64, error) { 6705 // Type FUSEWritePayloadIn doesn't have a packed layout in memory, fall back to MarshalBytes. 6706 buf := make([]byte, r.SizeBytes()) 6707 r.MarshalBytes(buf) 6708 length, err := writer.Write(buf) 6709 return int64(length), err 6710 } 6711 6712 // SizeBytes implements marshal.Marshallable.SizeBytes. 6713 func (r *RobustListHead) SizeBytes() int { 6714 return 24 6715 } 6716 6717 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6718 func (r *RobustListHead) MarshalBytes(dst []byte) []byte { 6719 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.List)) 6720 dst = dst[8:] 6721 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.FutexOffset)) 6722 dst = dst[8:] 6723 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.ListOpPending)) 6724 dst = dst[8:] 6725 return dst 6726 } 6727 6728 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6729 func (r *RobustListHead) UnmarshalBytes(src []byte) []byte { 6730 r.List = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6731 src = src[8:] 6732 r.FutexOffset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6733 src = src[8:] 6734 r.ListOpPending = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6735 src = src[8:] 6736 return src 6737 } 6738 6739 // Packed implements marshal.Marshallable.Packed. 6740 //go:nosplit 6741 func (r *RobustListHead) Packed() bool { 6742 return true 6743 } 6744 6745 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6746 func (r *RobustListHead) MarshalUnsafe(dst []byte) []byte { 6747 size := r.SizeBytes() 6748 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) 6749 return dst[size:] 6750 } 6751 6752 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6753 func (r *RobustListHead) UnmarshalUnsafe(src []byte) []byte { 6754 size := r.SizeBytes() 6755 gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) 6756 return src[size:] 6757 } 6758 6759 // CopyOutN implements marshal.Marshallable.CopyOutN. 6760 func (r *RobustListHead) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6761 // Construct a slice backed by dst's underlying memory. 6762 var buf []byte 6763 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6764 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 6765 hdr.Len = r.SizeBytes() 6766 hdr.Cap = r.SizeBytes() 6767 6768 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6769 // Since we bypassed the compiler's escape analysis, indicate that r 6770 // must live until the use above. 6771 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 6772 return length, err 6773 } 6774 6775 // CopyOut implements marshal.Marshallable.CopyOut. 6776 func (r *RobustListHead) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6777 return r.CopyOutN(cc, addr, r.SizeBytes()) 6778 } 6779 6780 // CopyInN implements marshal.Marshallable.CopyInN. 6781 func (r *RobustListHead) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6782 // Construct a slice backed by dst's underlying memory. 6783 var buf []byte 6784 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6785 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 6786 hdr.Len = r.SizeBytes() 6787 hdr.Cap = r.SizeBytes() 6788 6789 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6790 // Since we bypassed the compiler's escape analysis, indicate that r 6791 // must live until the use above. 6792 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 6793 return length, err 6794 } 6795 6796 // CopyIn implements marshal.Marshallable.CopyIn. 6797 func (r *RobustListHead) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6798 return r.CopyInN(cc, addr, r.SizeBytes()) 6799 } 6800 6801 // WriteTo implements io.WriterTo.WriteTo. 6802 func (r *RobustListHead) WriteTo(writer io.Writer) (int64, error) { 6803 // Construct a slice backed by dst's underlying memory. 6804 var buf []byte 6805 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6806 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 6807 hdr.Len = r.SizeBytes() 6808 hdr.Cap = r.SizeBytes() 6809 6810 length, err := writer.Write(buf) 6811 // Since we bypassed the compiler's escape analysis, indicate that r 6812 // must live until the use above. 6813 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 6814 return int64(length), err 6815 } 6816 6817 // SizeBytes implements marshal.Marshallable.SizeBytes. 6818 func (i *IOCqRingOffsets) SizeBytes() int { 6819 return 40 6820 } 6821 6822 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6823 func (i *IOCqRingOffsets) MarshalBytes(dst []byte) []byte { 6824 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Head)) 6825 dst = dst[4:] 6826 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Tail)) 6827 dst = dst[4:] 6828 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.RingMask)) 6829 dst = dst[4:] 6830 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.RingEntries)) 6831 dst = dst[4:] 6832 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Overflow)) 6833 dst = dst[4:] 6834 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Cqes)) 6835 dst = dst[4:] 6836 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Flags)) 6837 dst = dst[4:] 6838 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Resv1)) 6839 dst = dst[4:] 6840 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Resv2)) 6841 dst = dst[8:] 6842 return dst 6843 } 6844 6845 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6846 func (i *IOCqRingOffsets) UnmarshalBytes(src []byte) []byte { 6847 i.Head = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6848 src = src[4:] 6849 i.Tail = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6850 src = src[4:] 6851 i.RingMask = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6852 src = src[4:] 6853 i.RingEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6854 src = src[4:] 6855 i.Overflow = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6856 src = src[4:] 6857 i.Cqes = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6858 src = src[4:] 6859 i.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6860 src = src[4:] 6861 i.Resv1 = uint32(hostarch.ByteOrder.Uint32(src[:4])) 6862 src = src[4:] 6863 i.Resv2 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 6864 src = src[8:] 6865 return src 6866 } 6867 6868 // Packed implements marshal.Marshallable.Packed. 6869 //go:nosplit 6870 func (i *IOCqRingOffsets) Packed() bool { 6871 return true 6872 } 6873 6874 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6875 func (i *IOCqRingOffsets) MarshalUnsafe(dst []byte) []byte { 6876 size := i.SizeBytes() 6877 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 6878 return dst[size:] 6879 } 6880 6881 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6882 func (i *IOCqRingOffsets) UnmarshalUnsafe(src []byte) []byte { 6883 size := i.SizeBytes() 6884 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 6885 return src[size:] 6886 } 6887 6888 // CopyOutN implements marshal.Marshallable.CopyOutN. 6889 func (i *IOCqRingOffsets) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6890 // Construct a slice backed by dst's underlying memory. 6891 var buf []byte 6892 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6893 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 6894 hdr.Len = i.SizeBytes() 6895 hdr.Cap = i.SizeBytes() 6896 6897 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6898 // Since we bypassed the compiler's escape analysis, indicate that i 6899 // must live until the use above. 6900 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 6901 return length, err 6902 } 6903 6904 // CopyOut implements marshal.Marshallable.CopyOut. 6905 func (i *IOCqRingOffsets) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6906 return i.CopyOutN(cc, addr, i.SizeBytes()) 6907 } 6908 6909 // CopyInN implements marshal.Marshallable.CopyInN. 6910 func (i *IOCqRingOffsets) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6911 // Construct a slice backed by dst's underlying memory. 6912 var buf []byte 6913 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6914 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 6915 hdr.Len = i.SizeBytes() 6916 hdr.Cap = i.SizeBytes() 6917 6918 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 6919 // Since we bypassed the compiler's escape analysis, indicate that i 6920 // must live until the use above. 6921 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 6922 return length, err 6923 } 6924 6925 // CopyIn implements marshal.Marshallable.CopyIn. 6926 func (i *IOCqRingOffsets) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 6927 return i.CopyInN(cc, addr, i.SizeBytes()) 6928 } 6929 6930 // WriteTo implements io.WriterTo.WriteTo. 6931 func (i *IOCqRingOffsets) WriteTo(writer io.Writer) (int64, error) { 6932 // Construct a slice backed by dst's underlying memory. 6933 var buf []byte 6934 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6935 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 6936 hdr.Len = i.SizeBytes() 6937 hdr.Cap = i.SizeBytes() 6938 6939 length, err := writer.Write(buf) 6940 // Since we bypassed the compiler's escape analysis, indicate that i 6941 // must live until the use above. 6942 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 6943 return int64(length), err 6944 } 6945 6946 // SizeBytes implements marshal.Marshallable.SizeBytes. 6947 //go:nosplit 6948 func (i *IORingIndex) SizeBytes() int { 6949 return 4 6950 } 6951 6952 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 6953 func (i *IORingIndex) MarshalBytes(dst []byte) []byte { 6954 hostarch.ByteOrder.PutUint32(dst[:4], uint32(*i)) 6955 return dst[4:] 6956 } 6957 6958 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 6959 func (i *IORingIndex) UnmarshalBytes(src []byte) []byte { 6960 *i = IORingIndex(uint32(hostarch.ByteOrder.Uint32(src[:4]))) 6961 return src[4:] 6962 } 6963 6964 // Packed implements marshal.Marshallable.Packed. 6965 //go:nosplit 6966 func (i *IORingIndex) Packed() bool { 6967 // Scalar newtypes are always packed. 6968 return true 6969 } 6970 6971 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 6972 func (i *IORingIndex) MarshalUnsafe(dst []byte) []byte { 6973 size := i.SizeBytes() 6974 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 6975 return dst[size:] 6976 } 6977 6978 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 6979 func (i *IORingIndex) UnmarshalUnsafe(src []byte) []byte { 6980 size := i.SizeBytes() 6981 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 6982 return src[size:] 6983 } 6984 6985 // CopyOutN implements marshal.Marshallable.CopyOutN. 6986 func (i *IORingIndex) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 6987 // Construct a slice backed by dst's underlying memory. 6988 var buf []byte 6989 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 6990 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 6991 hdr.Len = i.SizeBytes() 6992 hdr.Cap = i.SizeBytes() 6993 6994 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 6995 // Since we bypassed the compiler's escape analysis, indicate that i 6996 // must live until the use above. 6997 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 6998 return length, err 6999 } 7000 7001 // CopyOut implements marshal.Marshallable.CopyOut. 7002 func (i *IORingIndex) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7003 return i.CopyOutN(cc, addr, i.SizeBytes()) 7004 } 7005 7006 // CopyInN implements marshal.Marshallable.CopyInN. 7007 func (i *IORingIndex) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7008 // Construct a slice backed by dst's underlying memory. 7009 var buf []byte 7010 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7011 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7012 hdr.Len = i.SizeBytes() 7013 hdr.Cap = i.SizeBytes() 7014 7015 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7016 // Since we bypassed the compiler's escape analysis, indicate that i 7017 // must live until the use above. 7018 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7019 return length, err 7020 } 7021 7022 // CopyIn implements marshal.Marshallable.CopyIn. 7023 func (i *IORingIndex) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7024 return i.CopyInN(cc, addr, i.SizeBytes()) 7025 } 7026 7027 // WriteTo implements io.WriterTo.WriteTo. 7028 func (i *IORingIndex) WriteTo(writer io.Writer) (int64, error) { 7029 // Construct a slice backed by dst's underlying memory. 7030 var buf []byte 7031 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7032 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7033 hdr.Len = i.SizeBytes() 7034 hdr.Cap = i.SizeBytes() 7035 7036 length, err := writer.Write(buf) 7037 // Since we bypassed the compiler's escape analysis, indicate that i 7038 // must live until the use above. 7039 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7040 return int64(length), err 7041 } 7042 7043 // SizeBytes implements marshal.Marshallable.SizeBytes. 7044 func (i *IORings) SizeBytes() int { 7045 return 32 + 7046 (*IOUring)(nil).SizeBytes() + 7047 (*IOUring)(nil).SizeBytes() + 7048 1*32 7049 } 7050 7051 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7052 func (i *IORings) MarshalBytes(dst []byte) []byte { 7053 dst = i.Sq.MarshalUnsafe(dst) 7054 dst = i.Cq.MarshalUnsafe(dst) 7055 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.SqRingMask)) 7056 dst = dst[4:] 7057 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CqRingMask)) 7058 dst = dst[4:] 7059 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.SqRingEntries)) 7060 dst = dst[4:] 7061 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CqRingEntries)) 7062 dst = dst[4:] 7063 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.sqDropped)) 7064 dst = dst[4:] 7065 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.sqFlags)) 7066 dst = dst[4:] 7067 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.cqFlags)) 7068 dst = dst[4:] 7069 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CqOverflow)) 7070 dst = dst[4:] 7071 // Padding: dst[:sizeof(byte)*32] ~= [32]byte{0} 7072 dst = dst[1*(32):] 7073 return dst 7074 } 7075 7076 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7077 func (i *IORings) UnmarshalBytes(src []byte) []byte { 7078 src = i.Sq.UnmarshalUnsafe(src) 7079 src = i.Cq.UnmarshalUnsafe(src) 7080 i.SqRingMask = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7081 src = src[4:] 7082 i.CqRingMask = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7083 src = src[4:] 7084 i.SqRingEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7085 src = src[4:] 7086 i.CqRingEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7087 src = src[4:] 7088 i.sqDropped = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7089 src = src[4:] 7090 i.sqFlags = int32(hostarch.ByteOrder.Uint32(src[:4])) 7091 src = src[4:] 7092 i.cqFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7093 src = src[4:] 7094 i.CqOverflow = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7095 src = src[4:] 7096 // Padding: ~ copy([32]byte(i._), src[:sizeof(byte)*32]) 7097 src = src[1*(32):] 7098 return src 7099 } 7100 7101 // Packed implements marshal.Marshallable.Packed. 7102 //go:nosplit 7103 func (i *IORings) Packed() bool { 7104 return i.Cq.Packed() && i.Sq.Packed() 7105 } 7106 7107 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7108 func (i *IORings) MarshalUnsafe(dst []byte) []byte { 7109 if i.Cq.Packed() && i.Sq.Packed() { 7110 size := i.SizeBytes() 7111 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 7112 return dst[size:] 7113 } 7114 // Type IORings doesn't have a packed layout in memory, fallback to MarshalBytes. 7115 return i.MarshalBytes(dst) 7116 } 7117 7118 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7119 func (i *IORings) UnmarshalUnsafe(src []byte) []byte { 7120 if i.Cq.Packed() && i.Sq.Packed() { 7121 size := i.SizeBytes() 7122 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 7123 return src[size:] 7124 } 7125 // Type IORings doesn't have a packed layout in memory, fallback to UnmarshalBytes. 7126 return i.UnmarshalBytes(src) 7127 } 7128 7129 // CopyOutN implements marshal.Marshallable.CopyOutN. 7130 func (i *IORings) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7131 if !i.Cq.Packed() && i.Sq.Packed() { 7132 // Type IORings doesn't have a packed layout in memory, fall back to MarshalBytes. 7133 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 7134 i.MarshalBytes(buf) // escapes: fallback. 7135 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7136 } 7137 7138 // Construct a slice backed by dst's underlying memory. 7139 var buf []byte 7140 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7141 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7142 hdr.Len = i.SizeBytes() 7143 hdr.Cap = i.SizeBytes() 7144 7145 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7146 // Since we bypassed the compiler's escape analysis, indicate that i 7147 // must live until the use above. 7148 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7149 return length, err 7150 } 7151 7152 // CopyOut implements marshal.Marshallable.CopyOut. 7153 func (i *IORings) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7154 return i.CopyOutN(cc, addr, i.SizeBytes()) 7155 } 7156 7157 // CopyInN implements marshal.Marshallable.CopyInN. 7158 func (i *IORings) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7159 if !i.Cq.Packed() && i.Sq.Packed() { 7160 // Type IORings doesn't have a packed layout in memory, fall back to UnmarshalBytes. 7161 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 7162 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7163 // Unmarshal unconditionally. If we had a short copy-in, this results in a 7164 // partially unmarshalled struct. 7165 i.UnmarshalBytes(buf) // escapes: fallback. 7166 return length, err 7167 } 7168 7169 // Construct a slice backed by dst's underlying memory. 7170 var buf []byte 7171 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7172 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7173 hdr.Len = i.SizeBytes() 7174 hdr.Cap = i.SizeBytes() 7175 7176 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7177 // Since we bypassed the compiler's escape analysis, indicate that i 7178 // must live until the use above. 7179 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7180 return length, err 7181 } 7182 7183 // CopyIn implements marshal.Marshallable.CopyIn. 7184 func (i *IORings) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7185 return i.CopyInN(cc, addr, i.SizeBytes()) 7186 } 7187 7188 // WriteTo implements io.WriterTo.WriteTo. 7189 func (i *IORings) WriteTo(writer io.Writer) (int64, error) { 7190 if !i.Cq.Packed() && i.Sq.Packed() { 7191 // Type IORings doesn't have a packed layout in memory, fall back to MarshalBytes. 7192 buf := make([]byte, i.SizeBytes()) 7193 i.MarshalBytes(buf) 7194 length, err := writer.Write(buf) 7195 return int64(length), err 7196 } 7197 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(i))) 7202 hdr.Len = i.SizeBytes() 7203 hdr.Cap = i.SizeBytes() 7204 7205 length, err := writer.Write(buf) 7206 // Since we bypassed the compiler's escape analysis, indicate that i 7207 // must live until the use above. 7208 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7209 return int64(length), err 7210 } 7211 7212 // SizeBytes implements marshal.Marshallable.SizeBytes. 7213 func (i *IOSqRingOffsets) SizeBytes() int { 7214 return 40 7215 } 7216 7217 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7218 func (i *IOSqRingOffsets) MarshalBytes(dst []byte) []byte { 7219 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Head)) 7220 dst = dst[4:] 7221 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Tail)) 7222 dst = dst[4:] 7223 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.RingMask)) 7224 dst = dst[4:] 7225 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.RingEntries)) 7226 dst = dst[4:] 7227 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Flags)) 7228 dst = dst[4:] 7229 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Dropped)) 7230 dst = dst[4:] 7231 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Array)) 7232 dst = dst[4:] 7233 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Resv1)) 7234 dst = dst[4:] 7235 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Resv2)) 7236 dst = dst[8:] 7237 return dst 7238 } 7239 7240 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7241 func (i *IOSqRingOffsets) UnmarshalBytes(src []byte) []byte { 7242 i.Head = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7243 src = src[4:] 7244 i.Tail = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7245 src = src[4:] 7246 i.RingMask = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7247 src = src[4:] 7248 i.RingEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7249 src = src[4:] 7250 i.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7251 src = src[4:] 7252 i.Dropped = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7253 src = src[4:] 7254 i.Array = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7255 src = src[4:] 7256 i.Resv1 = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7257 src = src[4:] 7258 i.Resv2 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7259 src = src[8:] 7260 return src 7261 } 7262 7263 // Packed implements marshal.Marshallable.Packed. 7264 //go:nosplit 7265 func (i *IOSqRingOffsets) Packed() bool { 7266 return true 7267 } 7268 7269 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7270 func (i *IOSqRingOffsets) MarshalUnsafe(dst []byte) []byte { 7271 size := i.SizeBytes() 7272 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 7273 return dst[size:] 7274 } 7275 7276 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7277 func (i *IOSqRingOffsets) UnmarshalUnsafe(src []byte) []byte { 7278 size := i.SizeBytes() 7279 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 7280 return src[size:] 7281 } 7282 7283 // CopyOutN implements marshal.Marshallable.CopyOutN. 7284 func (i *IOSqRingOffsets) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7285 // Construct a slice backed by dst's underlying memory. 7286 var buf []byte 7287 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7288 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7289 hdr.Len = i.SizeBytes() 7290 hdr.Cap = i.SizeBytes() 7291 7292 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7293 // Since we bypassed the compiler's escape analysis, indicate that i 7294 // must live until the use above. 7295 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7296 return length, err 7297 } 7298 7299 // CopyOut implements marshal.Marshallable.CopyOut. 7300 func (i *IOSqRingOffsets) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7301 return i.CopyOutN(cc, addr, i.SizeBytes()) 7302 } 7303 7304 // CopyInN implements marshal.Marshallable.CopyInN. 7305 func (i *IOSqRingOffsets) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7306 // Construct a slice backed by dst's underlying memory. 7307 var buf []byte 7308 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7309 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7310 hdr.Len = i.SizeBytes() 7311 hdr.Cap = i.SizeBytes() 7312 7313 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7314 // Since we bypassed the compiler's escape analysis, indicate that i 7315 // must live until the use above. 7316 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7317 return length, err 7318 } 7319 7320 // CopyIn implements marshal.Marshallable.CopyIn. 7321 func (i *IOSqRingOffsets) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7322 return i.CopyInN(cc, addr, i.SizeBytes()) 7323 } 7324 7325 // WriteTo implements io.WriterTo.WriteTo. 7326 func (i *IOSqRingOffsets) WriteTo(writer io.Writer) (int64, error) { 7327 // Construct a slice backed by dst's underlying memory. 7328 var buf []byte 7329 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7330 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7331 hdr.Len = i.SizeBytes() 7332 hdr.Cap = i.SizeBytes() 7333 7334 length, err := writer.Write(buf) 7335 // Since we bypassed the compiler's escape analysis, indicate that i 7336 // must live until the use above. 7337 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7338 return int64(length), err 7339 } 7340 7341 // SizeBytes implements marshal.Marshallable.SizeBytes. 7342 func (i *IOUring) SizeBytes() int { 7343 return 8 + 7344 1*60 + 7345 1*60 7346 } 7347 7348 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7349 func (i *IOUring) MarshalBytes(dst []byte) []byte { 7350 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Head)) 7351 dst = dst[4:] 7352 // Padding: dst[:sizeof(byte)*60] ~= [60]byte{0} 7353 dst = dst[1*(60):] 7354 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Tail)) 7355 dst = dst[4:] 7356 // Padding: dst[:sizeof(byte)*60] ~= [60]byte{0} 7357 dst = dst[1*(60):] 7358 return dst 7359 } 7360 7361 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7362 func (i *IOUring) UnmarshalBytes(src []byte) []byte { 7363 i.Head = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7364 src = src[4:] 7365 // Padding: ~ copy([60]byte(i._), src[:sizeof(byte)*60]) 7366 src = src[1*(60):] 7367 i.Tail = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7368 src = src[4:] 7369 // Padding: ~ copy([60]byte(i._), src[:sizeof(byte)*60]) 7370 src = src[1*(60):] 7371 return src 7372 } 7373 7374 // Packed implements marshal.Marshallable.Packed. 7375 //go:nosplit 7376 func (i *IOUring) Packed() bool { 7377 return true 7378 } 7379 7380 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7381 func (i *IOUring) MarshalUnsafe(dst []byte) []byte { 7382 size := i.SizeBytes() 7383 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 7384 return dst[size:] 7385 } 7386 7387 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7388 func (i *IOUring) UnmarshalUnsafe(src []byte) []byte { 7389 size := i.SizeBytes() 7390 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 7391 return src[size:] 7392 } 7393 7394 // CopyOutN implements marshal.Marshallable.CopyOutN. 7395 func (i *IOUring) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7396 // Construct a slice backed by dst's underlying memory. 7397 var buf []byte 7398 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7399 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7400 hdr.Len = i.SizeBytes() 7401 hdr.Cap = i.SizeBytes() 7402 7403 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7404 // Since we bypassed the compiler's escape analysis, indicate that i 7405 // must live until the use above. 7406 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7407 return length, err 7408 } 7409 7410 // CopyOut implements marshal.Marshallable.CopyOut. 7411 func (i *IOUring) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7412 return i.CopyOutN(cc, addr, i.SizeBytes()) 7413 } 7414 7415 // CopyInN implements marshal.Marshallable.CopyInN. 7416 func (i *IOUring) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7417 // Construct a slice backed by dst's underlying memory. 7418 var buf []byte 7419 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7420 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7421 hdr.Len = i.SizeBytes() 7422 hdr.Cap = i.SizeBytes() 7423 7424 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7425 // Since we bypassed the compiler's escape analysis, indicate that i 7426 // must live until the use above. 7427 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7428 return length, err 7429 } 7430 7431 // CopyIn implements marshal.Marshallable.CopyIn. 7432 func (i *IOUring) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7433 return i.CopyInN(cc, addr, i.SizeBytes()) 7434 } 7435 7436 // WriteTo implements io.WriterTo.WriteTo. 7437 func (i *IOUring) WriteTo(writer io.Writer) (int64, error) { 7438 // Construct a slice backed by dst's underlying memory. 7439 var buf []byte 7440 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7441 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7442 hdr.Len = i.SizeBytes() 7443 hdr.Cap = i.SizeBytes() 7444 7445 length, err := writer.Write(buf) 7446 // Since we bypassed the compiler's escape analysis, indicate that i 7447 // must live until the use above. 7448 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7449 return int64(length), err 7450 } 7451 7452 // SizeBytes implements marshal.Marshallable.SizeBytes. 7453 func (i *IOUringCqe) SizeBytes() int { 7454 return 16 7455 } 7456 7457 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7458 func (i *IOUringCqe) MarshalBytes(dst []byte) []byte { 7459 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.UserData)) 7460 dst = dst[8:] 7461 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Res)) 7462 dst = dst[4:] 7463 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Flags)) 7464 dst = dst[4:] 7465 return dst 7466 } 7467 7468 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7469 func (i *IOUringCqe) UnmarshalBytes(src []byte) []byte { 7470 i.UserData = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7471 src = src[8:] 7472 i.Res = int32(hostarch.ByteOrder.Uint32(src[:4])) 7473 src = src[4:] 7474 i.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7475 src = src[4:] 7476 return src 7477 } 7478 7479 // Packed implements marshal.Marshallable.Packed. 7480 //go:nosplit 7481 func (i *IOUringCqe) Packed() bool { 7482 return true 7483 } 7484 7485 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7486 func (i *IOUringCqe) MarshalUnsafe(dst []byte) []byte { 7487 size := i.SizeBytes() 7488 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 7489 return dst[size:] 7490 } 7491 7492 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7493 func (i *IOUringCqe) UnmarshalUnsafe(src []byte) []byte { 7494 size := i.SizeBytes() 7495 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 7496 return src[size:] 7497 } 7498 7499 // CopyOutN implements marshal.Marshallable.CopyOutN. 7500 func (i *IOUringCqe) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7501 // Construct a slice backed by dst's underlying memory. 7502 var buf []byte 7503 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7504 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7505 hdr.Len = i.SizeBytes() 7506 hdr.Cap = i.SizeBytes() 7507 7508 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7509 // Since we bypassed the compiler's escape analysis, indicate that i 7510 // must live until the use above. 7511 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7512 return length, err 7513 } 7514 7515 // CopyOut implements marshal.Marshallable.CopyOut. 7516 func (i *IOUringCqe) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7517 return i.CopyOutN(cc, addr, i.SizeBytes()) 7518 } 7519 7520 // CopyInN implements marshal.Marshallable.CopyInN. 7521 func (i *IOUringCqe) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7522 // Construct a slice backed by dst's underlying memory. 7523 var buf []byte 7524 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7525 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7526 hdr.Len = i.SizeBytes() 7527 hdr.Cap = i.SizeBytes() 7528 7529 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7530 // Since we bypassed the compiler's escape analysis, indicate that i 7531 // must live until the use above. 7532 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7533 return length, err 7534 } 7535 7536 // CopyIn implements marshal.Marshallable.CopyIn. 7537 func (i *IOUringCqe) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7538 return i.CopyInN(cc, addr, i.SizeBytes()) 7539 } 7540 7541 // WriteTo implements io.WriterTo.WriteTo. 7542 func (i *IOUringCqe) WriteTo(writer io.Writer) (int64, error) { 7543 // Construct a slice backed by dst's underlying memory. 7544 var buf []byte 7545 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7546 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7547 hdr.Len = i.SizeBytes() 7548 hdr.Cap = i.SizeBytes() 7549 7550 length, err := writer.Write(buf) 7551 // Since we bypassed the compiler's escape analysis, indicate that i 7552 // must live until the use above. 7553 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7554 return int64(length), err 7555 } 7556 7557 // SizeBytes implements marshal.Marshallable.SizeBytes. 7558 func (i *IOUringParams) SizeBytes() int { 7559 return 28 + 7560 4*3 + 7561 (*IOSqRingOffsets)(nil).SizeBytes() + 7562 (*IOCqRingOffsets)(nil).SizeBytes() 7563 } 7564 7565 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7566 func (i *IOUringParams) MarshalBytes(dst []byte) []byte { 7567 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.SqEntries)) 7568 dst = dst[4:] 7569 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CqEntries)) 7570 dst = dst[4:] 7571 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Flags)) 7572 dst = dst[4:] 7573 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.SqThreadCPU)) 7574 dst = dst[4:] 7575 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.SqThreadIdle)) 7576 dst = dst[4:] 7577 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Features)) 7578 dst = dst[4:] 7579 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.WqFd)) 7580 dst = dst[4:] 7581 for idx := 0; idx < 3; idx++ { 7582 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Resv[idx])) 7583 dst = dst[4:] 7584 } 7585 dst = i.SqOff.MarshalUnsafe(dst) 7586 dst = i.CqOff.MarshalUnsafe(dst) 7587 return dst 7588 } 7589 7590 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7591 func (i *IOUringParams) UnmarshalBytes(src []byte) []byte { 7592 i.SqEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7593 src = src[4:] 7594 i.CqEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7595 src = src[4:] 7596 i.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7597 src = src[4:] 7598 i.SqThreadCPU = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7599 src = src[4:] 7600 i.SqThreadIdle = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7601 src = src[4:] 7602 i.Features = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7603 src = src[4:] 7604 i.WqFd = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7605 src = src[4:] 7606 for idx := 0; idx < 3; idx++ { 7607 i.Resv[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7608 src = src[4:] 7609 } 7610 src = i.SqOff.UnmarshalUnsafe(src) 7611 src = i.CqOff.UnmarshalUnsafe(src) 7612 return src 7613 } 7614 7615 // Packed implements marshal.Marshallable.Packed. 7616 //go:nosplit 7617 func (i *IOUringParams) Packed() bool { 7618 return i.CqOff.Packed() && i.SqOff.Packed() 7619 } 7620 7621 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7622 func (i *IOUringParams) MarshalUnsafe(dst []byte) []byte { 7623 if i.CqOff.Packed() && i.SqOff.Packed() { 7624 size := i.SizeBytes() 7625 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 7626 return dst[size:] 7627 } 7628 // Type IOUringParams doesn't have a packed layout in memory, fallback to MarshalBytes. 7629 return i.MarshalBytes(dst) 7630 } 7631 7632 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7633 func (i *IOUringParams) UnmarshalUnsafe(src []byte) []byte { 7634 if i.CqOff.Packed() && i.SqOff.Packed() { 7635 size := i.SizeBytes() 7636 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 7637 return src[size:] 7638 } 7639 // Type IOUringParams doesn't have a packed layout in memory, fallback to UnmarshalBytes. 7640 return i.UnmarshalBytes(src) 7641 } 7642 7643 // CopyOutN implements marshal.Marshallable.CopyOutN. 7644 func (i *IOUringParams) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7645 if !i.CqOff.Packed() && i.SqOff.Packed() { 7646 // Type IOUringParams doesn't have a packed layout in memory, fall back to MarshalBytes. 7647 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 7648 i.MarshalBytes(buf) // escapes: fallback. 7649 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7650 } 7651 7652 // Construct a slice backed by dst's underlying memory. 7653 var buf []byte 7654 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7655 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7656 hdr.Len = i.SizeBytes() 7657 hdr.Cap = i.SizeBytes() 7658 7659 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7660 // Since we bypassed the compiler's escape analysis, indicate that i 7661 // must live until the use above. 7662 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7663 return length, err 7664 } 7665 7666 // CopyOut implements marshal.Marshallable.CopyOut. 7667 func (i *IOUringParams) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7668 return i.CopyOutN(cc, addr, i.SizeBytes()) 7669 } 7670 7671 // CopyInN implements marshal.Marshallable.CopyInN. 7672 func (i *IOUringParams) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7673 if !i.CqOff.Packed() && i.SqOff.Packed() { 7674 // Type IOUringParams doesn't have a packed layout in memory, fall back to UnmarshalBytes. 7675 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 7676 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7677 // Unmarshal unconditionally. If we had a short copy-in, this results in a 7678 // partially unmarshalled struct. 7679 i.UnmarshalBytes(buf) // escapes: fallback. 7680 return length, err 7681 } 7682 7683 // Construct a slice backed by dst's underlying memory. 7684 var buf []byte 7685 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7686 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7687 hdr.Len = i.SizeBytes() 7688 hdr.Cap = i.SizeBytes() 7689 7690 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7691 // Since we bypassed the compiler's escape analysis, indicate that i 7692 // must live until the use above. 7693 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7694 return length, err 7695 } 7696 7697 // CopyIn implements marshal.Marshallable.CopyIn. 7698 func (i *IOUringParams) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7699 return i.CopyInN(cc, addr, i.SizeBytes()) 7700 } 7701 7702 // WriteTo implements io.WriterTo.WriteTo. 7703 func (i *IOUringParams) WriteTo(writer io.Writer) (int64, error) { 7704 if !i.CqOff.Packed() && i.SqOff.Packed() { 7705 // Type IOUringParams doesn't have a packed layout in memory, fall back to MarshalBytes. 7706 buf := make([]byte, i.SizeBytes()) 7707 i.MarshalBytes(buf) 7708 length, err := writer.Write(buf) 7709 return int64(length), err 7710 } 7711 7712 // Construct a slice backed by dst's underlying memory. 7713 var buf []byte 7714 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7715 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7716 hdr.Len = i.SizeBytes() 7717 hdr.Cap = i.SizeBytes() 7718 7719 length, err := writer.Write(buf) 7720 // Since we bypassed the compiler's escape analysis, indicate that i 7721 // must live until the use above. 7722 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7723 return int64(length), err 7724 } 7725 7726 // SizeBytes implements marshal.Marshallable.SizeBytes. 7727 func (i *IOUringSqe) SizeBytes() int { 7728 return 64 7729 } 7730 7731 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7732 func (i *IOUringSqe) MarshalBytes(dst []byte) []byte { 7733 dst[0] = byte(i.Opcode) 7734 dst = dst[1:] 7735 dst[0] = byte(i.Flags) 7736 dst = dst[1:] 7737 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.IoPrio)) 7738 dst = dst[2:] 7739 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Fd)) 7740 dst = dst[4:] 7741 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.OffOrAddrOrCmdOp)) 7742 dst = dst[8:] 7743 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.AddrOrSpliceOff)) 7744 dst = dst[8:] 7745 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Len)) 7746 dst = dst[4:] 7747 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.specialFlags)) 7748 dst = dst[4:] 7749 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.UserData)) 7750 dst = dst[8:] 7751 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.BufIndexOrGroup)) 7752 dst = dst[2:] 7753 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.personality)) 7754 dst = dst[2:] 7755 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.spliceFDOrFileIndex)) 7756 dst = dst[4:] 7757 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.addr3)) 7758 dst = dst[8:] 7759 // Padding: dst[:sizeof(uint64)] ~= uint64(0) 7760 dst = dst[8:] 7761 return dst 7762 } 7763 7764 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7765 func (i *IOUringSqe) UnmarshalBytes(src []byte) []byte { 7766 i.Opcode = uint8(src[0]) 7767 src = src[1:] 7768 i.Flags = uint8(src[0]) 7769 src = src[1:] 7770 i.IoPrio = uint16(hostarch.ByteOrder.Uint16(src[:2])) 7771 src = src[2:] 7772 i.Fd = int32(hostarch.ByteOrder.Uint32(src[:4])) 7773 src = src[4:] 7774 i.OffOrAddrOrCmdOp = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7775 src = src[8:] 7776 i.AddrOrSpliceOff = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7777 src = src[8:] 7778 i.Len = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7779 src = src[4:] 7780 i.specialFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7781 src = src[4:] 7782 i.UserData = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7783 src = src[8:] 7784 i.BufIndexOrGroup = uint16(hostarch.ByteOrder.Uint16(src[:2])) 7785 src = src[2:] 7786 i.personality = uint16(hostarch.ByteOrder.Uint16(src[:2])) 7787 src = src[2:] 7788 i.spliceFDOrFileIndex = int32(hostarch.ByteOrder.Uint32(src[:4])) 7789 src = src[4:] 7790 i.addr3 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7791 src = src[8:] 7792 // Padding: var _ uint64 ~= src[:sizeof(uint64)] 7793 src = src[8:] 7794 return src 7795 } 7796 7797 // Packed implements marshal.Marshallable.Packed. 7798 //go:nosplit 7799 func (i *IOUringSqe) Packed() bool { 7800 return true 7801 } 7802 7803 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7804 func (i *IOUringSqe) MarshalUnsafe(dst []byte) []byte { 7805 size := i.SizeBytes() 7806 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 7807 return dst[size:] 7808 } 7809 7810 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7811 func (i *IOUringSqe) UnmarshalUnsafe(src []byte) []byte { 7812 size := i.SizeBytes() 7813 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 7814 return src[size:] 7815 } 7816 7817 // CopyOutN implements marshal.Marshallable.CopyOutN. 7818 func (i *IOUringSqe) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7819 // Construct a slice backed by dst's underlying memory. 7820 var buf []byte 7821 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7822 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7823 hdr.Len = i.SizeBytes() 7824 hdr.Cap = i.SizeBytes() 7825 7826 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7827 // Since we bypassed the compiler's escape analysis, indicate that i 7828 // must live until the use above. 7829 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7830 return length, err 7831 } 7832 7833 // CopyOut implements marshal.Marshallable.CopyOut. 7834 func (i *IOUringSqe) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7835 return i.CopyOutN(cc, addr, i.SizeBytes()) 7836 } 7837 7838 // CopyInN implements marshal.Marshallable.CopyInN. 7839 func (i *IOUringSqe) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7840 // Construct a slice backed by dst's underlying memory. 7841 var buf []byte 7842 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7843 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7844 hdr.Len = i.SizeBytes() 7845 hdr.Cap = i.SizeBytes() 7846 7847 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7848 // Since we bypassed the compiler's escape analysis, indicate that i 7849 // must live until the use above. 7850 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7851 return length, err 7852 } 7853 7854 // CopyIn implements marshal.Marshallable.CopyIn. 7855 func (i *IOUringSqe) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7856 return i.CopyInN(cc, addr, i.SizeBytes()) 7857 } 7858 7859 // WriteTo implements io.WriterTo.WriteTo. 7860 func (i *IOUringSqe) WriteTo(writer io.Writer) (int64, error) { 7861 // Construct a slice backed by dst's underlying memory. 7862 var buf []byte 7863 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7864 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7865 hdr.Len = i.SizeBytes() 7866 hdr.Cap = i.SizeBytes() 7867 7868 length, err := writer.Write(buf) 7869 // Since we bypassed the compiler's escape analysis, indicate that i 7870 // must live until the use above. 7871 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7872 return int64(length), err 7873 } 7874 7875 // SizeBytes implements marshal.Marshallable.SizeBytes. 7876 func (i *IPCPerm) SizeBytes() int { 7877 return 48 7878 } 7879 7880 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 7881 func (i *IPCPerm) MarshalBytes(dst []byte) []byte { 7882 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Key)) 7883 dst = dst[4:] 7884 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.UID)) 7885 dst = dst[4:] 7886 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.GID)) 7887 dst = dst[4:] 7888 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CUID)) 7889 dst = dst[4:] 7890 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.CGID)) 7891 dst = dst[4:] 7892 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Mode)) 7893 dst = dst[2:] 7894 // Padding: dst[:sizeof(uint16)] ~= uint16(0) 7895 dst = dst[2:] 7896 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Seq)) 7897 dst = dst[2:] 7898 // Padding: dst[:sizeof(uint16)] ~= uint16(0) 7899 dst = dst[2:] 7900 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 7901 dst = dst[4:] 7902 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.unused1)) 7903 dst = dst[8:] 7904 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.unused2)) 7905 dst = dst[8:] 7906 return dst 7907 } 7908 7909 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 7910 func (i *IPCPerm) UnmarshalBytes(src []byte) []byte { 7911 i.Key = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7912 src = src[4:] 7913 i.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7914 src = src[4:] 7915 i.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7916 src = src[4:] 7917 i.CUID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7918 src = src[4:] 7919 i.CGID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 7920 src = src[4:] 7921 i.Mode = uint16(hostarch.ByteOrder.Uint16(src[:2])) 7922 src = src[2:] 7923 // Padding: var _ uint16 ~= src[:sizeof(uint16)] 7924 src = src[2:] 7925 i.Seq = uint16(hostarch.ByteOrder.Uint16(src[:2])) 7926 src = src[2:] 7927 // Padding: var _ uint16 ~= src[:sizeof(uint16)] 7928 src = src[2:] 7929 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 7930 src = src[4:] 7931 i.unused1 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7932 src = src[8:] 7933 i.unused2 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 7934 src = src[8:] 7935 return src 7936 } 7937 7938 // Packed implements marshal.Marshallable.Packed. 7939 //go:nosplit 7940 func (i *IPCPerm) Packed() bool { 7941 return true 7942 } 7943 7944 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 7945 func (i *IPCPerm) MarshalUnsafe(dst []byte) []byte { 7946 size := i.SizeBytes() 7947 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 7948 return dst[size:] 7949 } 7950 7951 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 7952 func (i *IPCPerm) UnmarshalUnsafe(src []byte) []byte { 7953 size := i.SizeBytes() 7954 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 7955 return src[size:] 7956 } 7957 7958 // CopyOutN implements marshal.Marshallable.CopyOutN. 7959 func (i *IPCPerm) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7960 // Construct a slice backed by dst's underlying memory. 7961 var buf []byte 7962 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7963 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7964 hdr.Len = i.SizeBytes() 7965 hdr.Cap = i.SizeBytes() 7966 7967 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 7968 // Since we bypassed the compiler's escape analysis, indicate that i 7969 // must live until the use above. 7970 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7971 return length, err 7972 } 7973 7974 // CopyOut implements marshal.Marshallable.CopyOut. 7975 func (i *IPCPerm) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7976 return i.CopyOutN(cc, addr, i.SizeBytes()) 7977 } 7978 7979 // CopyInN implements marshal.Marshallable.CopyInN. 7980 func (i *IPCPerm) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 7981 // Construct a slice backed by dst's underlying memory. 7982 var buf []byte 7983 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 7984 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 7985 hdr.Len = i.SizeBytes() 7986 hdr.Cap = i.SizeBytes() 7987 7988 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 7989 // Since we bypassed the compiler's escape analysis, indicate that i 7990 // must live until the use above. 7991 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 7992 return length, err 7993 } 7994 7995 // CopyIn implements marshal.Marshallable.CopyIn. 7996 func (i *IPCPerm) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 7997 return i.CopyInN(cc, addr, i.SizeBytes()) 7998 } 7999 8000 // WriteTo implements io.WriterTo.WriteTo. 8001 func (i *IPCPerm) WriteTo(writer io.Writer) (int64, error) { 8002 // Construct a slice backed by dst's underlying memory. 8003 var buf []byte 8004 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8005 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 8006 hdr.Len = i.SizeBytes() 8007 hdr.Cap = i.SizeBytes() 8008 8009 length, err := writer.Write(buf) 8010 // Since we bypassed the compiler's escape analysis, indicate that i 8011 // must live until the use above. 8012 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 8013 return int64(length), err 8014 } 8015 8016 // SizeBytes implements marshal.Marshallable.SizeBytes. 8017 func (s *Sysinfo) SizeBytes() int { 8018 return 78 + 8019 8*3 + 8020 1*6 8021 } 8022 8023 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8024 func (s *Sysinfo) MarshalBytes(dst []byte) []byte { 8025 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Uptime)) 8026 dst = dst[8:] 8027 for idx := 0; idx < 3; idx++ { 8028 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Loads[idx])) 8029 dst = dst[8:] 8030 } 8031 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.TotalRAM)) 8032 dst = dst[8:] 8033 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FreeRAM)) 8034 dst = dst[8:] 8035 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.SharedRAM)) 8036 dst = dst[8:] 8037 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.BufferRAM)) 8038 dst = dst[8:] 8039 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.TotalSwap)) 8040 dst = dst[8:] 8041 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FreeSwap)) 8042 dst = dst[8:] 8043 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Procs)) 8044 dst = dst[2:] 8045 // Padding: dst[:sizeof(byte)*6] ~= [6]byte{0} 8046 dst = dst[1*(6):] 8047 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.TotalHigh)) 8048 dst = dst[8:] 8049 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.FreeHigh)) 8050 dst = dst[8:] 8051 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Unit)) 8052 dst = dst[4:] 8053 return dst 8054 } 8055 8056 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 8057 func (s *Sysinfo) UnmarshalBytes(src []byte) []byte { 8058 s.Uptime = int64(hostarch.ByteOrder.Uint64(src[:8])) 8059 src = src[8:] 8060 for idx := 0; idx < 3; idx++ { 8061 s.Loads[idx] = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8062 src = src[8:] 8063 } 8064 s.TotalRAM = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8065 src = src[8:] 8066 s.FreeRAM = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8067 src = src[8:] 8068 s.SharedRAM = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8069 src = src[8:] 8070 s.BufferRAM = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8071 src = src[8:] 8072 s.TotalSwap = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8073 src = src[8:] 8074 s.FreeSwap = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8075 src = src[8:] 8076 s.Procs = uint16(hostarch.ByteOrder.Uint16(src[:2])) 8077 src = src[2:] 8078 // Padding: ~ copy([6]byte(s._), src[:sizeof(byte)*6]) 8079 src = src[1*(6):] 8080 s.TotalHigh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8081 src = src[8:] 8082 s.FreeHigh = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8083 src = src[8:] 8084 s.Unit = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8085 src = src[4:] 8086 return src 8087 } 8088 8089 // Packed implements marshal.Marshallable.Packed. 8090 //go:nosplit 8091 func (s *Sysinfo) Packed() bool { 8092 return false 8093 } 8094 8095 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8096 func (s *Sysinfo) MarshalUnsafe(dst []byte) []byte { 8097 // Type Sysinfo doesn't have a packed layout in memory, fallback to MarshalBytes. 8098 return s.MarshalBytes(dst) 8099 } 8100 8101 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8102 func (s *Sysinfo) UnmarshalUnsafe(src []byte) []byte { 8103 // Type Sysinfo doesn't have a packed layout in memory, fallback to UnmarshalBytes. 8104 return s.UnmarshalBytes(src) 8105 } 8106 8107 // CopyOutN implements marshal.Marshallable.CopyOutN. 8108 func (s *Sysinfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8109 // Type Sysinfo doesn't have a packed layout in memory, fall back to MarshalBytes. 8110 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 8111 s.MarshalBytes(buf) // escapes: fallback. 8112 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8113 } 8114 8115 // CopyOut implements marshal.Marshallable.CopyOut. 8116 func (s *Sysinfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8117 return s.CopyOutN(cc, addr, s.SizeBytes()) 8118 } 8119 8120 // CopyInN implements marshal.Marshallable.CopyInN. 8121 func (s *Sysinfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8122 // Type Sysinfo doesn't have a packed layout in memory, fall back to UnmarshalBytes. 8123 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 8124 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8125 // Unmarshal unconditionally. If we had a short copy-in, this results in a 8126 // partially unmarshalled struct. 8127 s.UnmarshalBytes(buf) // escapes: fallback. 8128 return length, err 8129 } 8130 8131 // CopyIn implements marshal.Marshallable.CopyIn. 8132 func (s *Sysinfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8133 return s.CopyInN(cc, addr, s.SizeBytes()) 8134 } 8135 8136 // WriteTo implements io.WriterTo.WriteTo. 8137 func (s *Sysinfo) WriteTo(writer io.Writer) (int64, error) { 8138 // Type Sysinfo doesn't have a packed layout in memory, fall back to MarshalBytes. 8139 buf := make([]byte, s.SizeBytes()) 8140 s.MarshalBytes(buf) 8141 length, err := writer.Write(buf) 8142 return int64(length), err 8143 } 8144 8145 // SizeBytes implements marshal.Marshallable.SizeBytes. 8146 //go:nosplit 8147 func (n *NumaPolicy) SizeBytes() int { 8148 return 4 8149 } 8150 8151 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8152 func (n *NumaPolicy) MarshalBytes(dst []byte) []byte { 8153 hostarch.ByteOrder.PutUint32(dst[:4], uint32(*n)) 8154 return dst[4:] 8155 } 8156 8157 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 8158 func (n *NumaPolicy) UnmarshalBytes(src []byte) []byte { 8159 *n = NumaPolicy(int32(hostarch.ByteOrder.Uint32(src[:4]))) 8160 return src[4:] 8161 } 8162 8163 // Packed implements marshal.Marshallable.Packed. 8164 //go:nosplit 8165 func (n *NumaPolicy) Packed() bool { 8166 // Scalar newtypes are always packed. 8167 return true 8168 } 8169 8170 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8171 func (n *NumaPolicy) MarshalUnsafe(dst []byte) []byte { 8172 size := n.SizeBytes() 8173 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 8174 return dst[size:] 8175 } 8176 8177 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8178 func (n *NumaPolicy) UnmarshalUnsafe(src []byte) []byte { 8179 size := n.SizeBytes() 8180 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 8181 return src[size:] 8182 } 8183 8184 // CopyOutN implements marshal.Marshallable.CopyOutN. 8185 func (n *NumaPolicy) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8186 // Construct a slice backed by dst's underlying memory. 8187 var buf []byte 8188 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8189 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 8190 hdr.Len = n.SizeBytes() 8191 hdr.Cap = n.SizeBytes() 8192 8193 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8194 // Since we bypassed the compiler's escape analysis, indicate that n 8195 // must live until the use above. 8196 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 8197 return length, err 8198 } 8199 8200 // CopyOut implements marshal.Marshallable.CopyOut. 8201 func (n *NumaPolicy) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8202 return n.CopyOutN(cc, addr, n.SizeBytes()) 8203 } 8204 8205 // CopyInN implements marshal.Marshallable.CopyInN. 8206 func (n *NumaPolicy) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8207 // Construct a slice backed by dst's underlying memory. 8208 var buf []byte 8209 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8210 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 8211 hdr.Len = n.SizeBytes() 8212 hdr.Cap = n.SizeBytes() 8213 8214 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8215 // Since we bypassed the compiler's escape analysis, indicate that n 8216 // must live until the use above. 8217 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 8218 return length, err 8219 } 8220 8221 // CopyIn implements marshal.Marshallable.CopyIn. 8222 func (n *NumaPolicy) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8223 return n.CopyInN(cc, addr, n.SizeBytes()) 8224 } 8225 8226 // WriteTo implements io.WriterTo.WriteTo. 8227 func (n *NumaPolicy) WriteTo(writer io.Writer) (int64, error) { 8228 // Construct a slice backed by dst's underlying memory. 8229 var buf []byte 8230 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8231 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 8232 hdr.Len = n.SizeBytes() 8233 hdr.Cap = n.SizeBytes() 8234 8235 length, err := writer.Write(buf) 8236 // Since we bypassed the compiler's escape analysis, indicate that n 8237 // must live until the use above. 8238 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 8239 return int64(length), err 8240 } 8241 8242 // SizeBytes implements marshal.Marshallable.SizeBytes. 8243 func (m *MqAttr) SizeBytes() int { 8244 return 32 + 8245 8*4 8246 } 8247 8248 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8249 func (m *MqAttr) MarshalBytes(dst []byte) []byte { 8250 hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MqFlags)) 8251 dst = dst[8:] 8252 hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MqMaxmsg)) 8253 dst = dst[8:] 8254 hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MqMsgsize)) 8255 dst = dst[8:] 8256 hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MqCurmsgs)) 8257 dst = dst[8:] 8258 // Padding: dst[:sizeof(int64)*4] ~= [4]int64{0} 8259 dst = dst[8*(4):] 8260 return dst 8261 } 8262 8263 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 8264 func (m *MqAttr) UnmarshalBytes(src []byte) []byte { 8265 m.MqFlags = int64(hostarch.ByteOrder.Uint64(src[:8])) 8266 src = src[8:] 8267 m.MqMaxmsg = int64(hostarch.ByteOrder.Uint64(src[:8])) 8268 src = src[8:] 8269 m.MqMsgsize = int64(hostarch.ByteOrder.Uint64(src[:8])) 8270 src = src[8:] 8271 m.MqCurmsgs = int64(hostarch.ByteOrder.Uint64(src[:8])) 8272 src = src[8:] 8273 // Padding: ~ copy([4]int64(m._), src[:sizeof(int64)*4]) 8274 src = src[8*(4):] 8275 return src 8276 } 8277 8278 // Packed implements marshal.Marshallable.Packed. 8279 //go:nosplit 8280 func (m *MqAttr) Packed() bool { 8281 return true 8282 } 8283 8284 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8285 func (m *MqAttr) MarshalUnsafe(dst []byte) []byte { 8286 size := m.SizeBytes() 8287 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(size)) 8288 return dst[size:] 8289 } 8290 8291 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8292 func (m *MqAttr) UnmarshalUnsafe(src []byte) []byte { 8293 size := m.SizeBytes() 8294 gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(size)) 8295 return src[size:] 8296 } 8297 8298 // CopyOutN implements marshal.Marshallable.CopyOutN. 8299 func (m *MqAttr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8300 // Construct a slice backed by dst's underlying memory. 8301 var buf []byte 8302 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8303 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) 8304 hdr.Len = m.SizeBytes() 8305 hdr.Cap = m.SizeBytes() 8306 8307 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8308 // Since we bypassed the compiler's escape analysis, indicate that m 8309 // must live until the use above. 8310 runtime.KeepAlive(m) // escapes: replaced by intrinsic. 8311 return length, err 8312 } 8313 8314 // CopyOut implements marshal.Marshallable.CopyOut. 8315 func (m *MqAttr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8316 return m.CopyOutN(cc, addr, m.SizeBytes()) 8317 } 8318 8319 // CopyInN implements marshal.Marshallable.CopyInN. 8320 func (m *MqAttr) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8321 // Construct a slice backed by dst's underlying memory. 8322 var buf []byte 8323 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8324 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) 8325 hdr.Len = m.SizeBytes() 8326 hdr.Cap = m.SizeBytes() 8327 8328 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8329 // Since we bypassed the compiler's escape analysis, indicate that m 8330 // must live until the use above. 8331 runtime.KeepAlive(m) // escapes: replaced by intrinsic. 8332 return length, err 8333 } 8334 8335 // CopyIn implements marshal.Marshallable.CopyIn. 8336 func (m *MqAttr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8337 return m.CopyInN(cc, addr, m.SizeBytes()) 8338 } 8339 8340 // WriteTo implements io.WriterTo.WriteTo. 8341 func (m *MqAttr) WriteTo(writer io.Writer) (int64, error) { 8342 // Construct a slice backed by dst's underlying memory. 8343 var buf []byte 8344 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8345 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) 8346 hdr.Len = m.SizeBytes() 8347 hdr.Cap = m.SizeBytes() 8348 8349 length, err := writer.Write(buf) 8350 // Since we bypassed the compiler's escape analysis, indicate that m 8351 // must live until the use above. 8352 runtime.KeepAlive(m) // escapes: replaced by intrinsic. 8353 return int64(length), err 8354 } 8355 8356 // Packed implements marshal.Marshallable.Packed. 8357 //go:nosplit 8358 func (b *MsgBuf) Packed() bool { 8359 // Type MsgBuf is dynamic so it might have slice/string headers. Hence, it is not packed. 8360 return false 8361 } 8362 8363 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8364 func (b *MsgBuf) MarshalUnsafe(dst []byte) []byte { 8365 // Type MsgBuf doesn't have a packed layout in memory, fallback to MarshalBytes. 8366 return b.MarshalBytes(dst) 8367 } 8368 8369 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8370 func (b *MsgBuf) UnmarshalUnsafe(src []byte) []byte { 8371 // Type MsgBuf doesn't have a packed layout in memory, fallback to UnmarshalBytes. 8372 return b.UnmarshalBytes(src) 8373 } 8374 8375 // CopyOutN implements marshal.Marshallable.CopyOutN. 8376 //go:nosplit 8377 func (b *MsgBuf) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8378 // Type MsgBuf doesn't have a packed layout in memory, fall back to MarshalBytes. 8379 buf := cc.CopyScratchBuffer(b.SizeBytes()) // escapes: okay. 8380 b.MarshalBytes(buf) // escapes: fallback. 8381 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8382 } 8383 8384 // CopyOut implements marshal.Marshallable.CopyOut. 8385 func (b *MsgBuf) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8386 return b.CopyOutN(cc, addr, b.SizeBytes()) 8387 } 8388 8389 // CopyInN implements marshal.Marshallable.CopyInN. 8390 //go:nosplit 8391 func (b *MsgBuf) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8392 // Type MsgBuf doesn't have a packed layout in memory, fall back to UnmarshalBytes. 8393 buf := cc.CopyScratchBuffer(b.SizeBytes()) // escapes: okay. 8394 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 8395 // Unmarshal unconditionally. If we had a short copy-in, this results in a 8396 // partially unmarshalled struct. 8397 b.UnmarshalBytes(buf) // escapes: fallback. 8398 return length, err 8399 } 8400 8401 // CopyIn implements marshal.Marshallable.CopyIn. 8402 func (b *MsgBuf) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8403 return b.CopyInN(cc, addr, b.SizeBytes()) 8404 } 8405 8406 // WriteTo implements io.WriterTo.WriteTo. 8407 func (b *MsgBuf) WriteTo(writer io.Writer) (int64, error) { 8408 // Type MsgBuf doesn't have a packed layout in memory, fall back to MarshalBytes. 8409 buf := make([]byte, b.SizeBytes()) 8410 b.MarshalBytes(buf) 8411 length, err := writer.Write(buf) 8412 return int64(length), err 8413 } 8414 8415 // SizeBytes implements marshal.Marshallable.SizeBytes. 8416 func (m *MsgInfo) SizeBytes() int { 8417 return 30 8418 } 8419 8420 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8421 func (m *MsgInfo) MarshalBytes(dst []byte) []byte { 8422 hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgPool)) 8423 dst = dst[4:] 8424 hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgMap)) 8425 dst = dst[4:] 8426 hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgMax)) 8427 dst = dst[4:] 8428 hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgMnb)) 8429 dst = dst[4:] 8430 hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgMni)) 8431 dst = dst[4:] 8432 hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgSsz)) 8433 dst = dst[4:] 8434 hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgTql)) 8435 dst = dst[4:] 8436 hostarch.ByteOrder.PutUint16(dst[:2], uint16(m.MsgSeg)) 8437 dst = dst[2:] 8438 return dst 8439 } 8440 8441 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 8442 func (m *MsgInfo) UnmarshalBytes(src []byte) []byte { 8443 m.MsgPool = int32(hostarch.ByteOrder.Uint32(src[:4])) 8444 src = src[4:] 8445 m.MsgMap = int32(hostarch.ByteOrder.Uint32(src[:4])) 8446 src = src[4:] 8447 m.MsgMax = int32(hostarch.ByteOrder.Uint32(src[:4])) 8448 src = src[4:] 8449 m.MsgMnb = int32(hostarch.ByteOrder.Uint32(src[:4])) 8450 src = src[4:] 8451 m.MsgMni = int32(hostarch.ByteOrder.Uint32(src[:4])) 8452 src = src[4:] 8453 m.MsgSsz = int32(hostarch.ByteOrder.Uint32(src[:4])) 8454 src = src[4:] 8455 m.MsgTql = int32(hostarch.ByteOrder.Uint32(src[:4])) 8456 src = src[4:] 8457 m.MsgSeg = uint16(hostarch.ByteOrder.Uint16(src[:2])) 8458 src = src[2:] 8459 return src 8460 } 8461 8462 // Packed implements marshal.Marshallable.Packed. 8463 //go:nosplit 8464 func (m *MsgInfo) Packed() bool { 8465 return false 8466 } 8467 8468 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8469 func (m *MsgInfo) MarshalUnsafe(dst []byte) []byte { 8470 // Type MsgInfo doesn't have a packed layout in memory, fallback to MarshalBytes. 8471 return m.MarshalBytes(dst) 8472 } 8473 8474 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8475 func (m *MsgInfo) UnmarshalUnsafe(src []byte) []byte { 8476 // Type MsgInfo doesn't have a packed layout in memory, fallback to UnmarshalBytes. 8477 return m.UnmarshalBytes(src) 8478 } 8479 8480 // CopyOutN implements marshal.Marshallable.CopyOutN. 8481 func (m *MsgInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8482 // Type MsgInfo doesn't have a packed layout in memory, fall back to MarshalBytes. 8483 buf := cc.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. 8484 m.MarshalBytes(buf) // escapes: fallback. 8485 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8486 } 8487 8488 // CopyOut implements marshal.Marshallable.CopyOut. 8489 func (m *MsgInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8490 return m.CopyOutN(cc, addr, m.SizeBytes()) 8491 } 8492 8493 // CopyInN implements marshal.Marshallable.CopyInN. 8494 func (m *MsgInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8495 // Type MsgInfo doesn't have a packed layout in memory, fall back to UnmarshalBytes. 8496 buf := cc.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. 8497 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8498 // Unmarshal unconditionally. If we had a short copy-in, this results in a 8499 // partially unmarshalled struct. 8500 m.UnmarshalBytes(buf) // escapes: fallback. 8501 return length, err 8502 } 8503 8504 // CopyIn implements marshal.Marshallable.CopyIn. 8505 func (m *MsgInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8506 return m.CopyInN(cc, addr, m.SizeBytes()) 8507 } 8508 8509 // WriteTo implements io.WriterTo.WriteTo. 8510 func (m *MsgInfo) WriteTo(writer io.Writer) (int64, error) { 8511 // Type MsgInfo doesn't have a packed layout in memory, fall back to MarshalBytes. 8512 buf := make([]byte, m.SizeBytes()) 8513 m.MarshalBytes(buf) 8514 length, err := writer.Write(buf) 8515 return int64(length), err 8516 } 8517 8518 // SizeBytes implements marshal.Marshallable.SizeBytes. 8519 func (m *MsqidDS) SizeBytes() int { 8520 return 48 + 8521 (*IPCPerm)(nil).SizeBytes() + 8522 (*TimeT)(nil).SizeBytes() + 8523 (*TimeT)(nil).SizeBytes() + 8524 (*TimeT)(nil).SizeBytes() 8525 } 8526 8527 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8528 func (m *MsqidDS) MarshalBytes(dst []byte) []byte { 8529 dst = m.MsgPerm.MarshalUnsafe(dst) 8530 dst = m.MsgStime.MarshalUnsafe(dst) 8531 dst = m.MsgRtime.MarshalUnsafe(dst) 8532 dst = m.MsgCtime.MarshalUnsafe(dst) 8533 hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MsgCbytes)) 8534 dst = dst[8:] 8535 hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MsgQnum)) 8536 dst = dst[8:] 8537 hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.MsgQbytes)) 8538 dst = dst[8:] 8539 hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgLspid)) 8540 dst = dst[4:] 8541 hostarch.ByteOrder.PutUint32(dst[:4], uint32(m.MsgLrpid)) 8542 dst = dst[4:] 8543 hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.unused4)) 8544 dst = dst[8:] 8545 hostarch.ByteOrder.PutUint64(dst[:8], uint64(m.unused5)) 8546 dst = dst[8:] 8547 return dst 8548 } 8549 8550 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 8551 func (m *MsqidDS) UnmarshalBytes(src []byte) []byte { 8552 src = m.MsgPerm.UnmarshalUnsafe(src) 8553 src = m.MsgStime.UnmarshalUnsafe(src) 8554 src = m.MsgRtime.UnmarshalUnsafe(src) 8555 src = m.MsgCtime.UnmarshalUnsafe(src) 8556 m.MsgCbytes = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8557 src = src[8:] 8558 m.MsgQnum = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8559 src = src[8:] 8560 m.MsgQbytes = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8561 src = src[8:] 8562 m.MsgLspid = int32(hostarch.ByteOrder.Uint32(src[:4])) 8563 src = src[4:] 8564 m.MsgLrpid = int32(hostarch.ByteOrder.Uint32(src[:4])) 8565 src = src[4:] 8566 m.unused4 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8567 src = src[8:] 8568 m.unused5 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 8569 src = src[8:] 8570 return src 8571 } 8572 8573 // Packed implements marshal.Marshallable.Packed. 8574 //go:nosplit 8575 func (m *MsqidDS) Packed() bool { 8576 return m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() 8577 } 8578 8579 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8580 func (m *MsqidDS) MarshalUnsafe(dst []byte) []byte { 8581 if m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { 8582 size := m.SizeBytes() 8583 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(m), uintptr(size)) 8584 return dst[size:] 8585 } 8586 // Type MsqidDS doesn't have a packed layout in memory, fallback to MarshalBytes. 8587 return m.MarshalBytes(dst) 8588 } 8589 8590 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8591 func (m *MsqidDS) UnmarshalUnsafe(src []byte) []byte { 8592 if m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { 8593 size := m.SizeBytes() 8594 gohacks.Memmove(unsafe.Pointer(m), unsafe.Pointer(&src[0]), uintptr(size)) 8595 return src[size:] 8596 } 8597 // Type MsqidDS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 8598 return m.UnmarshalBytes(src) 8599 } 8600 8601 // CopyOutN implements marshal.Marshallable.CopyOutN. 8602 func (m *MsqidDS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8603 if !m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { 8604 // Type MsqidDS doesn't have a packed layout in memory, fall back to MarshalBytes. 8605 buf := cc.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. 8606 m.MarshalBytes(buf) // escapes: fallback. 8607 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8608 } 8609 8610 // Construct a slice backed by dst's underlying memory. 8611 var buf []byte 8612 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8613 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) 8614 hdr.Len = m.SizeBytes() 8615 hdr.Cap = m.SizeBytes() 8616 8617 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8618 // Since we bypassed the compiler's escape analysis, indicate that m 8619 // must live until the use above. 8620 runtime.KeepAlive(m) // escapes: replaced by intrinsic. 8621 return length, err 8622 } 8623 8624 // CopyOut implements marshal.Marshallable.CopyOut. 8625 func (m *MsqidDS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8626 return m.CopyOutN(cc, addr, m.SizeBytes()) 8627 } 8628 8629 // CopyInN implements marshal.Marshallable.CopyInN. 8630 func (m *MsqidDS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8631 if !m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { 8632 // Type MsqidDS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 8633 buf := cc.CopyScratchBuffer(m.SizeBytes()) // escapes: okay. 8634 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8635 // Unmarshal unconditionally. If we had a short copy-in, this results in a 8636 // partially unmarshalled struct. 8637 m.UnmarshalBytes(buf) // escapes: fallback. 8638 return length, err 8639 } 8640 8641 // Construct a slice backed by dst's underlying memory. 8642 var buf []byte 8643 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8644 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) 8645 hdr.Len = m.SizeBytes() 8646 hdr.Cap = m.SizeBytes() 8647 8648 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8649 // Since we bypassed the compiler's escape analysis, indicate that m 8650 // must live until the use above. 8651 runtime.KeepAlive(m) // escapes: replaced by intrinsic. 8652 return length, err 8653 } 8654 8655 // CopyIn implements marshal.Marshallable.CopyIn. 8656 func (m *MsqidDS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8657 return m.CopyInN(cc, addr, m.SizeBytes()) 8658 } 8659 8660 // WriteTo implements io.WriterTo.WriteTo. 8661 func (m *MsqidDS) WriteTo(writer io.Writer) (int64, error) { 8662 if !m.MsgCtime.Packed() && m.MsgPerm.Packed() && m.MsgRtime.Packed() && m.MsgStime.Packed() { 8663 // Type MsqidDS doesn't have a packed layout in memory, fall back to MarshalBytes. 8664 buf := make([]byte, m.SizeBytes()) 8665 m.MarshalBytes(buf) 8666 length, err := writer.Write(buf) 8667 return int64(length), err 8668 } 8669 8670 // Construct a slice backed by dst's underlying memory. 8671 var buf []byte 8672 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8673 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(m))) 8674 hdr.Len = m.SizeBytes() 8675 hdr.Cap = m.SizeBytes() 8676 8677 length, err := writer.Write(buf) 8678 // Since we bypassed the compiler's escape analysis, indicate that m 8679 // must live until the use above. 8680 runtime.KeepAlive(m) // escapes: replaced by intrinsic. 8681 return int64(length), err 8682 } 8683 8684 // SizeBytes implements marshal.Marshallable.SizeBytes. 8685 //go:nosplit 8686 func (e *EthtoolCmd) SizeBytes() int { 8687 return 4 8688 } 8689 8690 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8691 func (e *EthtoolCmd) MarshalBytes(dst []byte) []byte { 8692 hostarch.ByteOrder.PutUint32(dst[:4], uint32(*e)) 8693 return dst[4:] 8694 } 8695 8696 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 8697 func (e *EthtoolCmd) UnmarshalBytes(src []byte) []byte { 8698 *e = EthtoolCmd(uint32(hostarch.ByteOrder.Uint32(src[:4]))) 8699 return src[4:] 8700 } 8701 8702 // Packed implements marshal.Marshallable.Packed. 8703 //go:nosplit 8704 func (e *EthtoolCmd) Packed() bool { 8705 // Scalar newtypes are always packed. 8706 return true 8707 } 8708 8709 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8710 func (e *EthtoolCmd) MarshalUnsafe(dst []byte) []byte { 8711 size := e.SizeBytes() 8712 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(e), uintptr(size)) 8713 return dst[size:] 8714 } 8715 8716 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8717 func (e *EthtoolCmd) UnmarshalUnsafe(src []byte) []byte { 8718 size := e.SizeBytes() 8719 gohacks.Memmove(unsafe.Pointer(e), unsafe.Pointer(&src[0]), uintptr(size)) 8720 return src[size:] 8721 } 8722 8723 // CopyOutN implements marshal.Marshallable.CopyOutN. 8724 func (e *EthtoolCmd) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8725 // Construct a slice backed by dst's underlying memory. 8726 var buf []byte 8727 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8728 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 8729 hdr.Len = e.SizeBytes() 8730 hdr.Cap = e.SizeBytes() 8731 8732 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8733 // Since we bypassed the compiler's escape analysis, indicate that e 8734 // must live until the use above. 8735 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 8736 return length, err 8737 } 8738 8739 // CopyOut implements marshal.Marshallable.CopyOut. 8740 func (e *EthtoolCmd) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8741 return e.CopyOutN(cc, addr, e.SizeBytes()) 8742 } 8743 8744 // CopyInN implements marshal.Marshallable.CopyInN. 8745 func (e *EthtoolCmd) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8746 // Construct a slice backed by dst's underlying memory. 8747 var buf []byte 8748 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8749 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 8750 hdr.Len = e.SizeBytes() 8751 hdr.Cap = e.SizeBytes() 8752 8753 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8754 // Since we bypassed the compiler's escape analysis, indicate that e 8755 // must live until the use above. 8756 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 8757 return length, err 8758 } 8759 8760 // CopyIn implements marshal.Marshallable.CopyIn. 8761 func (e *EthtoolCmd) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8762 return e.CopyInN(cc, addr, e.SizeBytes()) 8763 } 8764 8765 // WriteTo implements io.WriterTo.WriteTo. 8766 func (e *EthtoolCmd) WriteTo(writer io.Writer) (int64, error) { 8767 // Construct a slice backed by dst's underlying memory. 8768 var buf []byte 8769 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8770 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 8771 hdr.Len = e.SizeBytes() 8772 hdr.Cap = e.SizeBytes() 8773 8774 length, err := writer.Write(buf) 8775 // Since we bypassed the compiler's escape analysis, indicate that e 8776 // must live until the use above. 8777 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 8778 return int64(length), err 8779 } 8780 8781 // SizeBytes implements marshal.Marshallable.SizeBytes. 8782 func (e *EthtoolGFeatures) SizeBytes() int { 8783 return 8 8784 } 8785 8786 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8787 func (e *EthtoolGFeatures) MarshalBytes(dst []byte) []byte { 8788 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Cmd)) 8789 dst = dst[4:] 8790 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Size)) 8791 dst = dst[4:] 8792 return dst 8793 } 8794 8795 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 8796 func (e *EthtoolGFeatures) UnmarshalBytes(src []byte) []byte { 8797 e.Cmd = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8798 src = src[4:] 8799 e.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8800 src = src[4:] 8801 return src 8802 } 8803 8804 // Packed implements marshal.Marshallable.Packed. 8805 //go:nosplit 8806 func (e *EthtoolGFeatures) Packed() bool { 8807 return true 8808 } 8809 8810 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8811 func (e *EthtoolGFeatures) MarshalUnsafe(dst []byte) []byte { 8812 size := e.SizeBytes() 8813 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(e), uintptr(size)) 8814 return dst[size:] 8815 } 8816 8817 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8818 func (e *EthtoolGFeatures) UnmarshalUnsafe(src []byte) []byte { 8819 size := e.SizeBytes() 8820 gohacks.Memmove(unsafe.Pointer(e), unsafe.Pointer(&src[0]), uintptr(size)) 8821 return src[size:] 8822 } 8823 8824 // CopyOutN implements marshal.Marshallable.CopyOutN. 8825 func (e *EthtoolGFeatures) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8826 // Construct a slice backed by dst's underlying memory. 8827 var buf []byte 8828 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8829 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 8830 hdr.Len = e.SizeBytes() 8831 hdr.Cap = e.SizeBytes() 8832 8833 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8834 // Since we bypassed the compiler's escape analysis, indicate that e 8835 // must live until the use above. 8836 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 8837 return length, err 8838 } 8839 8840 // CopyOut implements marshal.Marshallable.CopyOut. 8841 func (e *EthtoolGFeatures) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8842 return e.CopyOutN(cc, addr, e.SizeBytes()) 8843 } 8844 8845 // CopyInN implements marshal.Marshallable.CopyInN. 8846 func (e *EthtoolGFeatures) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8847 // Construct a slice backed by dst's underlying memory. 8848 var buf []byte 8849 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8850 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 8851 hdr.Len = e.SizeBytes() 8852 hdr.Cap = e.SizeBytes() 8853 8854 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8855 // Since we bypassed the compiler's escape analysis, indicate that e 8856 // must live until the use above. 8857 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 8858 return length, err 8859 } 8860 8861 // CopyIn implements marshal.Marshallable.CopyIn. 8862 func (e *EthtoolGFeatures) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8863 return e.CopyInN(cc, addr, e.SizeBytes()) 8864 } 8865 8866 // WriteTo implements io.WriterTo.WriteTo. 8867 func (e *EthtoolGFeatures) WriteTo(writer io.Writer) (int64, error) { 8868 // Construct a slice backed by dst's underlying memory. 8869 var buf []byte 8870 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8871 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 8872 hdr.Len = e.SizeBytes() 8873 hdr.Cap = e.SizeBytes() 8874 8875 length, err := writer.Write(buf) 8876 // Since we bypassed the compiler's escape analysis, indicate that e 8877 // must live until the use above. 8878 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 8879 return int64(length), err 8880 } 8881 8882 // SizeBytes implements marshal.Marshallable.SizeBytes. 8883 func (e *EthtoolGetFeaturesBlock) SizeBytes() int { 8884 return 16 8885 } 8886 8887 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8888 func (e *EthtoolGetFeaturesBlock) MarshalBytes(dst []byte) []byte { 8889 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Available)) 8890 dst = dst[4:] 8891 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Requested)) 8892 dst = dst[4:] 8893 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.Active)) 8894 dst = dst[4:] 8895 hostarch.ByteOrder.PutUint32(dst[:4], uint32(e.NeverChanged)) 8896 dst = dst[4:] 8897 return dst 8898 } 8899 8900 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 8901 func (e *EthtoolGetFeaturesBlock) UnmarshalBytes(src []byte) []byte { 8902 e.Available = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8903 src = src[4:] 8904 e.Requested = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8905 src = src[4:] 8906 e.Active = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8907 src = src[4:] 8908 e.NeverChanged = uint32(hostarch.ByteOrder.Uint32(src[:4])) 8909 src = src[4:] 8910 return src 8911 } 8912 8913 // Packed implements marshal.Marshallable.Packed. 8914 //go:nosplit 8915 func (e *EthtoolGetFeaturesBlock) Packed() bool { 8916 return true 8917 } 8918 8919 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 8920 func (e *EthtoolGetFeaturesBlock) MarshalUnsafe(dst []byte) []byte { 8921 size := e.SizeBytes() 8922 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(e), uintptr(size)) 8923 return dst[size:] 8924 } 8925 8926 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 8927 func (e *EthtoolGetFeaturesBlock) UnmarshalUnsafe(src []byte) []byte { 8928 size := e.SizeBytes() 8929 gohacks.Memmove(unsafe.Pointer(e), unsafe.Pointer(&src[0]), uintptr(size)) 8930 return src[size:] 8931 } 8932 8933 // CopyOutN implements marshal.Marshallable.CopyOutN. 8934 func (e *EthtoolGetFeaturesBlock) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8935 // Construct a slice backed by dst's underlying memory. 8936 var buf []byte 8937 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8938 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 8939 hdr.Len = e.SizeBytes() 8940 hdr.Cap = e.SizeBytes() 8941 8942 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 8943 // Since we bypassed the compiler's escape analysis, indicate that e 8944 // must live until the use above. 8945 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 8946 return length, err 8947 } 8948 8949 // CopyOut implements marshal.Marshallable.CopyOut. 8950 func (e *EthtoolGetFeaturesBlock) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8951 return e.CopyOutN(cc, addr, e.SizeBytes()) 8952 } 8953 8954 // CopyInN implements marshal.Marshallable.CopyInN. 8955 func (e *EthtoolGetFeaturesBlock) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 8956 // Construct a slice backed by dst's underlying memory. 8957 var buf []byte 8958 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8959 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 8960 hdr.Len = e.SizeBytes() 8961 hdr.Cap = e.SizeBytes() 8962 8963 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 8964 // Since we bypassed the compiler's escape analysis, indicate that e 8965 // must live until the use above. 8966 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 8967 return length, err 8968 } 8969 8970 // CopyIn implements marshal.Marshallable.CopyIn. 8971 func (e *EthtoolGetFeaturesBlock) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 8972 return e.CopyInN(cc, addr, e.SizeBytes()) 8973 } 8974 8975 // WriteTo implements io.WriterTo.WriteTo. 8976 func (e *EthtoolGetFeaturesBlock) WriteTo(writer io.Writer) (int64, error) { 8977 // Construct a slice backed by dst's underlying memory. 8978 var buf []byte 8979 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 8980 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(e))) 8981 hdr.Len = e.SizeBytes() 8982 hdr.Cap = e.SizeBytes() 8983 8984 length, err := writer.Write(buf) 8985 // Since we bypassed the compiler's escape analysis, indicate that e 8986 // must live until the use above. 8987 runtime.KeepAlive(e) // escapes: replaced by intrinsic. 8988 return int64(length), err 8989 } 8990 8991 // SizeBytes implements marshal.Marshallable.SizeBytes. 8992 func (i *IFConf) SizeBytes() int { 8993 return 12 + 8994 1*4 8995 } 8996 8997 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 8998 func (i *IFConf) MarshalBytes(dst []byte) []byte { 8999 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Len)) 9000 dst = dst[4:] 9001 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 9002 dst = dst[1*(4):] 9003 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Ptr)) 9004 dst = dst[8:] 9005 return dst 9006 } 9007 9008 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 9009 func (i *IFConf) UnmarshalBytes(src []byte) []byte { 9010 i.Len = int32(hostarch.ByteOrder.Uint32(src[:4])) 9011 src = src[4:] 9012 // Padding: ~ copy([4]byte(i._), src[:sizeof(byte)*4]) 9013 src = src[1*(4):] 9014 i.Ptr = uint64(hostarch.ByteOrder.Uint64(src[:8])) 9015 src = src[8:] 9016 return src 9017 } 9018 9019 // Packed implements marshal.Marshallable.Packed. 9020 //go:nosplit 9021 func (i *IFConf) Packed() bool { 9022 return true 9023 } 9024 9025 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 9026 func (i *IFConf) MarshalUnsafe(dst []byte) []byte { 9027 size := i.SizeBytes() 9028 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 9029 return dst[size:] 9030 } 9031 9032 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 9033 func (i *IFConf) UnmarshalUnsafe(src []byte) []byte { 9034 size := i.SizeBytes() 9035 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 9036 return src[size:] 9037 } 9038 9039 // CopyOutN implements marshal.Marshallable.CopyOutN. 9040 func (i *IFConf) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9041 // Construct a slice backed by dst's underlying memory. 9042 var buf []byte 9043 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9044 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9045 hdr.Len = i.SizeBytes() 9046 hdr.Cap = i.SizeBytes() 9047 9048 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9049 // Since we bypassed the compiler's escape analysis, indicate that i 9050 // must live until the use above. 9051 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9052 return length, err 9053 } 9054 9055 // CopyOut implements marshal.Marshallable.CopyOut. 9056 func (i *IFConf) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9057 return i.CopyOutN(cc, addr, i.SizeBytes()) 9058 } 9059 9060 // CopyInN implements marshal.Marshallable.CopyInN. 9061 func (i *IFConf) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9062 // Construct a slice backed by dst's underlying memory. 9063 var buf []byte 9064 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9065 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9066 hdr.Len = i.SizeBytes() 9067 hdr.Cap = i.SizeBytes() 9068 9069 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9070 // Since we bypassed the compiler's escape analysis, indicate that i 9071 // must live until the use above. 9072 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9073 return length, err 9074 } 9075 9076 // CopyIn implements marshal.Marshallable.CopyIn. 9077 func (i *IFConf) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9078 return i.CopyInN(cc, addr, i.SizeBytes()) 9079 } 9080 9081 // WriteTo implements io.WriterTo.WriteTo. 9082 func (i *IFConf) WriteTo(writer io.Writer) (int64, error) { 9083 // Construct a slice backed by dst's underlying memory. 9084 var buf []byte 9085 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9086 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9087 hdr.Len = i.SizeBytes() 9088 hdr.Cap = i.SizeBytes() 9089 9090 length, err := writer.Write(buf) 9091 // Since we bypassed the compiler's escape analysis, indicate that i 9092 // must live until the use above. 9093 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9094 return int64(length), err 9095 } 9096 9097 // SizeBytes implements marshal.Marshallable.SizeBytes. 9098 func (ifr *IFReq) SizeBytes() int { 9099 return 0 + 9100 1*IFNAMSIZ + 9101 1*24 9102 } 9103 9104 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 9105 func (ifr *IFReq) MarshalBytes(dst []byte) []byte { 9106 for idx := 0; idx < IFNAMSIZ; idx++ { 9107 dst[0] = byte(ifr.IFName[idx]) 9108 dst = dst[1:] 9109 } 9110 for idx := 0; idx < 24; idx++ { 9111 dst[0] = byte(ifr.Data[idx]) 9112 dst = dst[1:] 9113 } 9114 return dst 9115 } 9116 9117 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 9118 func (ifr *IFReq) UnmarshalBytes(src []byte) []byte { 9119 for idx := 0; idx < IFNAMSIZ; idx++ { 9120 ifr.IFName[idx] = src[0] 9121 src = src[1:] 9122 } 9123 for idx := 0; idx < 24; idx++ { 9124 ifr.Data[idx] = src[0] 9125 src = src[1:] 9126 } 9127 return src 9128 } 9129 9130 // Packed implements marshal.Marshallable.Packed. 9131 //go:nosplit 9132 func (ifr *IFReq) Packed() bool { 9133 return true 9134 } 9135 9136 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 9137 func (ifr *IFReq) MarshalUnsafe(dst []byte) []byte { 9138 size := ifr.SizeBytes() 9139 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(ifr), uintptr(size)) 9140 return dst[size:] 9141 } 9142 9143 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 9144 func (ifr *IFReq) UnmarshalUnsafe(src []byte) []byte { 9145 size := ifr.SizeBytes() 9146 gohacks.Memmove(unsafe.Pointer(ifr), unsafe.Pointer(&src[0]), uintptr(size)) 9147 return src[size:] 9148 } 9149 9150 // CopyOutN implements marshal.Marshallable.CopyOutN. 9151 func (ifr *IFReq) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9152 // Construct a slice backed by dst's underlying memory. 9153 var buf []byte 9154 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9155 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ifr))) 9156 hdr.Len = ifr.SizeBytes() 9157 hdr.Cap = ifr.SizeBytes() 9158 9159 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9160 // Since we bypassed the compiler's escape analysis, indicate that ifr 9161 // must live until the use above. 9162 runtime.KeepAlive(ifr) // escapes: replaced by intrinsic. 9163 return length, err 9164 } 9165 9166 // CopyOut implements marshal.Marshallable.CopyOut. 9167 func (ifr *IFReq) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9168 return ifr.CopyOutN(cc, addr, ifr.SizeBytes()) 9169 } 9170 9171 // CopyInN implements marshal.Marshallable.CopyInN. 9172 func (ifr *IFReq) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9173 // Construct a slice backed by dst's underlying memory. 9174 var buf []byte 9175 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9176 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ifr))) 9177 hdr.Len = ifr.SizeBytes() 9178 hdr.Cap = ifr.SizeBytes() 9179 9180 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9181 // Since we bypassed the compiler's escape analysis, indicate that ifr 9182 // must live until the use above. 9183 runtime.KeepAlive(ifr) // escapes: replaced by intrinsic. 9184 return length, err 9185 } 9186 9187 // CopyIn implements marshal.Marshallable.CopyIn. 9188 func (ifr *IFReq) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9189 return ifr.CopyInN(cc, addr, ifr.SizeBytes()) 9190 } 9191 9192 // WriteTo implements io.WriterTo.WriteTo. 9193 func (ifr *IFReq) WriteTo(writer io.Writer) (int64, error) { 9194 // Construct a slice backed by dst's underlying memory. 9195 var buf []byte 9196 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9197 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ifr))) 9198 hdr.Len = ifr.SizeBytes() 9199 hdr.Cap = ifr.SizeBytes() 9200 9201 length, err := writer.Write(buf) 9202 // Since we bypassed the compiler's escape analysis, indicate that ifr 9203 // must live until the use above. 9204 runtime.KeepAlive(ifr) // escapes: replaced by intrinsic. 9205 return int64(length), err 9206 } 9207 9208 // SizeBytes implements marshal.Marshallable.SizeBytes. 9209 //go:nosplit 9210 func (en *ErrorName) SizeBytes() int { 9211 return 1 * XT_FUNCTION_MAXNAMELEN 9212 } 9213 9214 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 9215 func (en *ErrorName) MarshalBytes(dst []byte) []byte { 9216 for idx := 0; idx < XT_FUNCTION_MAXNAMELEN; idx++ { 9217 dst[0] = byte(en[idx]) 9218 dst = dst[1:] 9219 } 9220 return dst 9221 } 9222 9223 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 9224 func (en *ErrorName) UnmarshalBytes(src []byte) []byte { 9225 for idx := 0; idx < XT_FUNCTION_MAXNAMELEN; idx++ { 9226 en[idx] = src[0] 9227 src = src[1:] 9228 } 9229 return src 9230 } 9231 9232 // Packed implements marshal.Marshallable.Packed. 9233 //go:nosplit 9234 func (en *ErrorName) Packed() bool { 9235 // Array newtypes are always packed. 9236 return true 9237 } 9238 9239 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 9240 func (en *ErrorName) MarshalUnsafe(dst []byte) []byte { 9241 size := en.SizeBytes() 9242 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&en[0]), uintptr(size)) 9243 return dst[size:] 9244 } 9245 9246 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 9247 func (en *ErrorName) UnmarshalUnsafe(src []byte) []byte { 9248 size := en.SizeBytes() 9249 gohacks.Memmove(unsafe.Pointer(en), unsafe.Pointer(&src[0]), uintptr(size)) 9250 return src[size:] 9251 } 9252 9253 // CopyOutN implements marshal.Marshallable.CopyOutN. 9254 func (en *ErrorName) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9255 // Construct a slice backed by dst's underlying memory. 9256 var buf []byte 9257 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9258 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) 9259 hdr.Len = en.SizeBytes() 9260 hdr.Cap = en.SizeBytes() 9261 9262 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9263 // Since we bypassed the compiler's escape analysis, indicate that en 9264 // must live until the use above. 9265 runtime.KeepAlive(en) // escapes: replaced by intrinsic. 9266 return length, err 9267 } 9268 9269 // CopyOut implements marshal.Marshallable.CopyOut. 9270 func (en *ErrorName) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9271 return en.CopyOutN(cc, addr, en.SizeBytes()) 9272 } 9273 9274 // CopyInN implements marshal.Marshallable.CopyInN. 9275 func (en *ErrorName) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9276 // Construct a slice backed by dst's underlying memory. 9277 var buf []byte 9278 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9279 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) 9280 hdr.Len = en.SizeBytes() 9281 hdr.Cap = en.SizeBytes() 9282 9283 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9284 // Since we bypassed the compiler's escape analysis, indicate that en 9285 // must live until the use above. 9286 runtime.KeepAlive(en) // escapes: replaced by intrinsic. 9287 return length, err 9288 } 9289 9290 // CopyIn implements marshal.Marshallable.CopyIn. 9291 func (en *ErrorName) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9292 return en.CopyInN(cc, addr, en.SizeBytes()) 9293 } 9294 9295 // WriteTo implements io.WriterTo.WriteTo. 9296 func (en *ErrorName) WriteTo(writer io.Writer) (int64, error) { 9297 // Construct a slice backed by dst's underlying memory. 9298 var buf []byte 9299 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9300 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) 9301 hdr.Len = en.SizeBytes() 9302 hdr.Cap = en.SizeBytes() 9303 9304 length, err := writer.Write(buf) 9305 // Since we bypassed the compiler's escape analysis, indicate that en 9306 // must live until the use above. 9307 runtime.KeepAlive(en) // escapes: replaced by intrinsic. 9308 return int64(length), err 9309 } 9310 9311 // SizeBytes implements marshal.Marshallable.SizeBytes. 9312 //go:nosplit 9313 func (en *ExtensionName) SizeBytes() int { 9314 return 1 * XT_EXTENSION_MAXNAMELEN 9315 } 9316 9317 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 9318 func (en *ExtensionName) MarshalBytes(dst []byte) []byte { 9319 for idx := 0; idx < XT_EXTENSION_MAXNAMELEN; idx++ { 9320 dst[0] = byte(en[idx]) 9321 dst = dst[1:] 9322 } 9323 return dst 9324 } 9325 9326 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 9327 func (en *ExtensionName) UnmarshalBytes(src []byte) []byte { 9328 for idx := 0; idx < XT_EXTENSION_MAXNAMELEN; idx++ { 9329 en[idx] = src[0] 9330 src = src[1:] 9331 } 9332 return src 9333 } 9334 9335 // Packed implements marshal.Marshallable.Packed. 9336 //go:nosplit 9337 func (en *ExtensionName) Packed() bool { 9338 // Array newtypes are always packed. 9339 return true 9340 } 9341 9342 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 9343 func (en *ExtensionName) MarshalUnsafe(dst []byte) []byte { 9344 size := en.SizeBytes() 9345 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&en[0]), uintptr(size)) 9346 return dst[size:] 9347 } 9348 9349 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 9350 func (en *ExtensionName) UnmarshalUnsafe(src []byte) []byte { 9351 size := en.SizeBytes() 9352 gohacks.Memmove(unsafe.Pointer(en), unsafe.Pointer(&src[0]), uintptr(size)) 9353 return src[size:] 9354 } 9355 9356 // CopyOutN implements marshal.Marshallable.CopyOutN. 9357 func (en *ExtensionName) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9358 // Construct a slice backed by dst's underlying memory. 9359 var buf []byte 9360 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9361 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) 9362 hdr.Len = en.SizeBytes() 9363 hdr.Cap = en.SizeBytes() 9364 9365 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9366 // Since we bypassed the compiler's escape analysis, indicate that en 9367 // must live until the use above. 9368 runtime.KeepAlive(en) // escapes: replaced by intrinsic. 9369 return length, err 9370 } 9371 9372 // CopyOut implements marshal.Marshallable.CopyOut. 9373 func (en *ExtensionName) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9374 return en.CopyOutN(cc, addr, en.SizeBytes()) 9375 } 9376 9377 // CopyInN implements marshal.Marshallable.CopyInN. 9378 func (en *ExtensionName) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9379 // Construct a slice backed by dst's underlying memory. 9380 var buf []byte 9381 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9382 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) 9383 hdr.Len = en.SizeBytes() 9384 hdr.Cap = en.SizeBytes() 9385 9386 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9387 // Since we bypassed the compiler's escape analysis, indicate that en 9388 // must live until the use above. 9389 runtime.KeepAlive(en) // escapes: replaced by intrinsic. 9390 return length, err 9391 } 9392 9393 // CopyIn implements marshal.Marshallable.CopyIn. 9394 func (en *ExtensionName) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9395 return en.CopyInN(cc, addr, en.SizeBytes()) 9396 } 9397 9398 // WriteTo implements io.WriterTo.WriteTo. 9399 func (en *ExtensionName) WriteTo(writer io.Writer) (int64, error) { 9400 // Construct a slice backed by dst's underlying memory. 9401 var buf []byte 9402 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9403 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(en))) 9404 hdr.Len = en.SizeBytes() 9405 hdr.Cap = en.SizeBytes() 9406 9407 length, err := writer.Write(buf) 9408 // Since we bypassed the compiler's escape analysis, indicate that en 9409 // must live until the use above. 9410 runtime.KeepAlive(en) // escapes: replaced by intrinsic. 9411 return int64(length), err 9412 } 9413 9414 // SizeBytes implements marshal.Marshallable.SizeBytes. 9415 func (i *IPTEntry) SizeBytes() int { 9416 return 12 + 9417 (*IPTIP)(nil).SizeBytes() + 9418 (*XTCounters)(nil).SizeBytes() 9419 } 9420 9421 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 9422 func (i *IPTEntry) MarshalBytes(dst []byte) []byte { 9423 dst = i.IP.MarshalUnsafe(dst) 9424 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NFCache)) 9425 dst = dst[4:] 9426 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.TargetOffset)) 9427 dst = dst[2:] 9428 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.NextOffset)) 9429 dst = dst[2:] 9430 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Comeback)) 9431 dst = dst[4:] 9432 dst = i.Counters.MarshalUnsafe(dst) 9433 return dst 9434 } 9435 9436 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 9437 func (i *IPTEntry) UnmarshalBytes(src []byte) []byte { 9438 src = i.IP.UnmarshalUnsafe(src) 9439 i.NFCache = uint32(hostarch.ByteOrder.Uint32(src[:4])) 9440 src = src[4:] 9441 i.TargetOffset = uint16(hostarch.ByteOrder.Uint16(src[:2])) 9442 src = src[2:] 9443 i.NextOffset = uint16(hostarch.ByteOrder.Uint16(src[:2])) 9444 src = src[2:] 9445 i.Comeback = uint32(hostarch.ByteOrder.Uint32(src[:4])) 9446 src = src[4:] 9447 src = i.Counters.UnmarshalUnsafe(src) 9448 return src 9449 } 9450 9451 // Packed implements marshal.Marshallable.Packed. 9452 //go:nosplit 9453 func (i *IPTEntry) Packed() bool { 9454 return i.Counters.Packed() && i.IP.Packed() 9455 } 9456 9457 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 9458 func (i *IPTEntry) MarshalUnsafe(dst []byte) []byte { 9459 if i.Counters.Packed() && i.IP.Packed() { 9460 size := i.SizeBytes() 9461 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 9462 return dst[size:] 9463 } 9464 // Type IPTEntry doesn't have a packed layout in memory, fallback to MarshalBytes. 9465 return i.MarshalBytes(dst) 9466 } 9467 9468 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 9469 func (i *IPTEntry) UnmarshalUnsafe(src []byte) []byte { 9470 if i.Counters.Packed() && i.IP.Packed() { 9471 size := i.SizeBytes() 9472 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 9473 return src[size:] 9474 } 9475 // Type IPTEntry doesn't have a packed layout in memory, fallback to UnmarshalBytes. 9476 return i.UnmarshalBytes(src) 9477 } 9478 9479 // CopyOutN implements marshal.Marshallable.CopyOutN. 9480 func (i *IPTEntry) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9481 if !i.Counters.Packed() && i.IP.Packed() { 9482 // Type IPTEntry doesn't have a packed layout in memory, fall back to MarshalBytes. 9483 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 9484 i.MarshalBytes(buf) // escapes: fallback. 9485 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9486 } 9487 9488 // Construct a slice backed by dst's underlying memory. 9489 var buf []byte 9490 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9491 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9492 hdr.Len = i.SizeBytes() 9493 hdr.Cap = i.SizeBytes() 9494 9495 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9496 // Since we bypassed the compiler's escape analysis, indicate that i 9497 // must live until the use above. 9498 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9499 return length, err 9500 } 9501 9502 // CopyOut implements marshal.Marshallable.CopyOut. 9503 func (i *IPTEntry) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9504 return i.CopyOutN(cc, addr, i.SizeBytes()) 9505 } 9506 9507 // CopyInN implements marshal.Marshallable.CopyInN. 9508 func (i *IPTEntry) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9509 if !i.Counters.Packed() && i.IP.Packed() { 9510 // Type IPTEntry doesn't have a packed layout in memory, fall back to UnmarshalBytes. 9511 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 9512 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9513 // Unmarshal unconditionally. If we had a short copy-in, this results in a 9514 // partially unmarshalled struct. 9515 i.UnmarshalBytes(buf) // escapes: fallback. 9516 return length, err 9517 } 9518 9519 // Construct a slice backed by dst's underlying memory. 9520 var buf []byte 9521 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9522 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9523 hdr.Len = i.SizeBytes() 9524 hdr.Cap = i.SizeBytes() 9525 9526 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9527 // Since we bypassed the compiler's escape analysis, indicate that i 9528 // must live until the use above. 9529 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9530 return length, err 9531 } 9532 9533 // CopyIn implements marshal.Marshallable.CopyIn. 9534 func (i *IPTEntry) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9535 return i.CopyInN(cc, addr, i.SizeBytes()) 9536 } 9537 9538 // WriteTo implements io.WriterTo.WriteTo. 9539 func (i *IPTEntry) WriteTo(writer io.Writer) (int64, error) { 9540 if !i.Counters.Packed() && i.IP.Packed() { 9541 // Type IPTEntry doesn't have a packed layout in memory, fall back to MarshalBytes. 9542 buf := make([]byte, i.SizeBytes()) 9543 i.MarshalBytes(buf) 9544 length, err := writer.Write(buf) 9545 return int64(length), err 9546 } 9547 9548 // Construct a slice backed by dst's underlying memory. 9549 var buf []byte 9550 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9551 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9552 hdr.Len = i.SizeBytes() 9553 hdr.Cap = i.SizeBytes() 9554 9555 length, err := writer.Write(buf) 9556 // Since we bypassed the compiler's escape analysis, indicate that i 9557 // must live until the use above. 9558 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9559 return int64(length), err 9560 } 9561 9562 // SizeBytes implements marshal.Marshallable.SizeBytes. 9563 func (i *IPTGetEntries) SizeBytes() int { 9564 return 4 + 9565 (*TableName)(nil).SizeBytes() + 9566 1*4 9567 } 9568 9569 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 9570 func (i *IPTGetEntries) MarshalBytes(dst []byte) []byte { 9571 dst = i.Name.MarshalUnsafe(dst) 9572 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Size)) 9573 dst = dst[4:] 9574 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 9575 dst = dst[1*(4):] 9576 return dst 9577 } 9578 9579 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 9580 func (i *IPTGetEntries) UnmarshalBytes(src []byte) []byte { 9581 src = i.Name.UnmarshalUnsafe(src) 9582 i.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) 9583 src = src[4:] 9584 // Padding: ~ copy([4]byte(i._), src[:sizeof(byte)*4]) 9585 src = src[1*(4):] 9586 return src 9587 } 9588 9589 // Packed implements marshal.Marshallable.Packed. 9590 //go:nosplit 9591 func (i *IPTGetEntries) Packed() bool { 9592 return i.Name.Packed() 9593 } 9594 9595 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 9596 func (i *IPTGetEntries) MarshalUnsafe(dst []byte) []byte { 9597 if i.Name.Packed() { 9598 size := i.SizeBytes() 9599 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 9600 return dst[size:] 9601 } 9602 // Type IPTGetEntries doesn't have a packed layout in memory, fallback to MarshalBytes. 9603 return i.MarshalBytes(dst) 9604 } 9605 9606 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 9607 func (i *IPTGetEntries) UnmarshalUnsafe(src []byte) []byte { 9608 if i.Name.Packed() { 9609 size := i.SizeBytes() 9610 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 9611 return src[size:] 9612 } 9613 // Type IPTGetEntries doesn't have a packed layout in memory, fallback to UnmarshalBytes. 9614 return i.UnmarshalBytes(src) 9615 } 9616 9617 // CopyOutN implements marshal.Marshallable.CopyOutN. 9618 func (i *IPTGetEntries) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9619 if !i.Name.Packed() { 9620 // Type IPTGetEntries doesn't have a packed layout in memory, fall back to MarshalBytes. 9621 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 9622 i.MarshalBytes(buf) // escapes: fallback. 9623 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9624 } 9625 9626 // Construct a slice backed by dst's underlying memory. 9627 var buf []byte 9628 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9629 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9630 hdr.Len = i.SizeBytes() 9631 hdr.Cap = i.SizeBytes() 9632 9633 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9634 // Since we bypassed the compiler's escape analysis, indicate that i 9635 // must live until the use above. 9636 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9637 return length, err 9638 } 9639 9640 // CopyOut implements marshal.Marshallable.CopyOut. 9641 func (i *IPTGetEntries) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9642 return i.CopyOutN(cc, addr, i.SizeBytes()) 9643 } 9644 9645 // CopyInN implements marshal.Marshallable.CopyInN. 9646 func (i *IPTGetEntries) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9647 if !i.Name.Packed() { 9648 // Type IPTGetEntries doesn't have a packed layout in memory, fall back to UnmarshalBytes. 9649 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 9650 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9651 // Unmarshal unconditionally. If we had a short copy-in, this results in a 9652 // partially unmarshalled struct. 9653 i.UnmarshalBytes(buf) // escapes: fallback. 9654 return length, err 9655 } 9656 9657 // Construct a slice backed by dst's underlying memory. 9658 var buf []byte 9659 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9660 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9661 hdr.Len = i.SizeBytes() 9662 hdr.Cap = i.SizeBytes() 9663 9664 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9665 // Since we bypassed the compiler's escape analysis, indicate that i 9666 // must live until the use above. 9667 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9668 return length, err 9669 } 9670 9671 // CopyIn implements marshal.Marshallable.CopyIn. 9672 func (i *IPTGetEntries) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9673 return i.CopyInN(cc, addr, i.SizeBytes()) 9674 } 9675 9676 // WriteTo implements io.WriterTo.WriteTo. 9677 func (i *IPTGetEntries) WriteTo(writer io.Writer) (int64, error) { 9678 if !i.Name.Packed() { 9679 // Type IPTGetEntries doesn't have a packed layout in memory, fall back to MarshalBytes. 9680 buf := make([]byte, i.SizeBytes()) 9681 i.MarshalBytes(buf) 9682 length, err := writer.Write(buf) 9683 return int64(length), err 9684 } 9685 9686 // Construct a slice backed by dst's underlying memory. 9687 var buf []byte 9688 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9689 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9690 hdr.Len = i.SizeBytes() 9691 hdr.Cap = i.SizeBytes() 9692 9693 length, err := writer.Write(buf) 9694 // Since we bypassed the compiler's escape analysis, indicate that i 9695 // must live until the use above. 9696 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9697 return int64(length), err 9698 } 9699 9700 // SizeBytes implements marshal.Marshallable.SizeBytes. 9701 func (i *IPTGetinfo) SizeBytes() int { 9702 return 12 + 9703 (*TableName)(nil).SizeBytes() + 9704 4*NF_INET_NUMHOOKS + 9705 4*NF_INET_NUMHOOKS 9706 } 9707 9708 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 9709 func (i *IPTGetinfo) MarshalBytes(dst []byte) []byte { 9710 dst = i.Name.MarshalUnsafe(dst) 9711 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.ValidHooks)) 9712 dst = dst[4:] 9713 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 9714 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.HookEntry[idx])) 9715 dst = dst[4:] 9716 } 9717 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 9718 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Underflow[idx])) 9719 dst = dst[4:] 9720 } 9721 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumEntries)) 9722 dst = dst[4:] 9723 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Size)) 9724 dst = dst[4:] 9725 return dst 9726 } 9727 9728 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 9729 func (i *IPTGetinfo) UnmarshalBytes(src []byte) []byte { 9730 src = i.Name.UnmarshalUnsafe(src) 9731 i.ValidHooks = uint32(hostarch.ByteOrder.Uint32(src[:4])) 9732 src = src[4:] 9733 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 9734 i.HookEntry[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 9735 src = src[4:] 9736 } 9737 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 9738 i.Underflow[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 9739 src = src[4:] 9740 } 9741 i.NumEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 9742 src = src[4:] 9743 i.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) 9744 src = src[4:] 9745 return src 9746 } 9747 9748 // Packed implements marshal.Marshallable.Packed. 9749 //go:nosplit 9750 func (i *IPTGetinfo) Packed() bool { 9751 return i.Name.Packed() 9752 } 9753 9754 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 9755 func (i *IPTGetinfo) MarshalUnsafe(dst []byte) []byte { 9756 if i.Name.Packed() { 9757 size := i.SizeBytes() 9758 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 9759 return dst[size:] 9760 } 9761 // Type IPTGetinfo doesn't have a packed layout in memory, fallback to MarshalBytes. 9762 return i.MarshalBytes(dst) 9763 } 9764 9765 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 9766 func (i *IPTGetinfo) UnmarshalUnsafe(src []byte) []byte { 9767 if i.Name.Packed() { 9768 size := i.SizeBytes() 9769 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 9770 return src[size:] 9771 } 9772 // Type IPTGetinfo doesn't have a packed layout in memory, fallback to UnmarshalBytes. 9773 return i.UnmarshalBytes(src) 9774 } 9775 9776 // CopyOutN implements marshal.Marshallable.CopyOutN. 9777 func (i *IPTGetinfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9778 if !i.Name.Packed() { 9779 // Type IPTGetinfo doesn't have a packed layout in memory, fall back to MarshalBytes. 9780 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 9781 i.MarshalBytes(buf) // escapes: fallback. 9782 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9783 } 9784 9785 // Construct a slice backed by dst's underlying memory. 9786 var buf []byte 9787 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9788 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9789 hdr.Len = i.SizeBytes() 9790 hdr.Cap = i.SizeBytes() 9791 9792 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9793 // Since we bypassed the compiler's escape analysis, indicate that i 9794 // must live until the use above. 9795 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9796 return length, err 9797 } 9798 9799 // CopyOut implements marshal.Marshallable.CopyOut. 9800 func (i *IPTGetinfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9801 return i.CopyOutN(cc, addr, i.SizeBytes()) 9802 } 9803 9804 // CopyInN implements marshal.Marshallable.CopyInN. 9805 func (i *IPTGetinfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9806 if !i.Name.Packed() { 9807 // Type IPTGetinfo doesn't have a packed layout in memory, fall back to UnmarshalBytes. 9808 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 9809 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9810 // Unmarshal unconditionally. If we had a short copy-in, this results in a 9811 // partially unmarshalled struct. 9812 i.UnmarshalBytes(buf) // escapes: fallback. 9813 return length, err 9814 } 9815 9816 // Construct a slice backed by dst's underlying memory. 9817 var buf []byte 9818 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9819 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9820 hdr.Len = i.SizeBytes() 9821 hdr.Cap = i.SizeBytes() 9822 9823 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9824 // Since we bypassed the compiler's escape analysis, indicate that i 9825 // must live until the use above. 9826 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9827 return length, err 9828 } 9829 9830 // CopyIn implements marshal.Marshallable.CopyIn. 9831 func (i *IPTGetinfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9832 return i.CopyInN(cc, addr, i.SizeBytes()) 9833 } 9834 9835 // WriteTo implements io.WriterTo.WriteTo. 9836 func (i *IPTGetinfo) WriteTo(writer io.Writer) (int64, error) { 9837 if !i.Name.Packed() { 9838 // Type IPTGetinfo doesn't have a packed layout in memory, fall back to MarshalBytes. 9839 buf := make([]byte, i.SizeBytes()) 9840 i.MarshalBytes(buf) 9841 length, err := writer.Write(buf) 9842 return int64(length), err 9843 } 9844 9845 // Construct a slice backed by dst's underlying memory. 9846 var buf []byte 9847 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9848 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9849 hdr.Len = i.SizeBytes() 9850 hdr.Cap = i.SizeBytes() 9851 9852 length, err := writer.Write(buf) 9853 // Since we bypassed the compiler's escape analysis, indicate that i 9854 // must live until the use above. 9855 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9856 return int64(length), err 9857 } 9858 9859 // SizeBytes implements marshal.Marshallable.SizeBytes. 9860 func (i *IPTIP) SizeBytes() int { 9861 return 4 + 9862 (*InetAddr)(nil).SizeBytes() + 9863 (*InetAddr)(nil).SizeBytes() + 9864 (*InetAddr)(nil).SizeBytes() + 9865 (*InetAddr)(nil).SizeBytes() + 9866 1*IFNAMSIZ + 9867 1*IFNAMSIZ + 9868 1*IFNAMSIZ + 9869 1*IFNAMSIZ 9870 } 9871 9872 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 9873 func (i *IPTIP) MarshalBytes(dst []byte) []byte { 9874 dst = i.Src.MarshalUnsafe(dst) 9875 dst = i.Dst.MarshalUnsafe(dst) 9876 dst = i.SrcMask.MarshalUnsafe(dst) 9877 dst = i.DstMask.MarshalUnsafe(dst) 9878 for idx := 0; idx < IFNAMSIZ; idx++ { 9879 dst[0] = byte(i.InputInterface[idx]) 9880 dst = dst[1:] 9881 } 9882 for idx := 0; idx < IFNAMSIZ; idx++ { 9883 dst[0] = byte(i.OutputInterface[idx]) 9884 dst = dst[1:] 9885 } 9886 for idx := 0; idx < IFNAMSIZ; idx++ { 9887 dst[0] = byte(i.InputInterfaceMask[idx]) 9888 dst = dst[1:] 9889 } 9890 for idx := 0; idx < IFNAMSIZ; idx++ { 9891 dst[0] = byte(i.OutputInterfaceMask[idx]) 9892 dst = dst[1:] 9893 } 9894 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Protocol)) 9895 dst = dst[2:] 9896 dst[0] = byte(i.Flags) 9897 dst = dst[1:] 9898 dst[0] = byte(i.InverseFlags) 9899 dst = dst[1:] 9900 return dst 9901 } 9902 9903 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 9904 func (i *IPTIP) UnmarshalBytes(src []byte) []byte { 9905 src = i.Src.UnmarshalUnsafe(src) 9906 src = i.Dst.UnmarshalUnsafe(src) 9907 src = i.SrcMask.UnmarshalUnsafe(src) 9908 src = i.DstMask.UnmarshalUnsafe(src) 9909 for idx := 0; idx < IFNAMSIZ; idx++ { 9910 i.InputInterface[idx] = src[0] 9911 src = src[1:] 9912 } 9913 for idx := 0; idx < IFNAMSIZ; idx++ { 9914 i.OutputInterface[idx] = src[0] 9915 src = src[1:] 9916 } 9917 for idx := 0; idx < IFNAMSIZ; idx++ { 9918 i.InputInterfaceMask[idx] = src[0] 9919 src = src[1:] 9920 } 9921 for idx := 0; idx < IFNAMSIZ; idx++ { 9922 i.OutputInterfaceMask[idx] = src[0] 9923 src = src[1:] 9924 } 9925 i.Protocol = uint16(hostarch.ByteOrder.Uint16(src[:2])) 9926 src = src[2:] 9927 i.Flags = uint8(src[0]) 9928 src = src[1:] 9929 i.InverseFlags = uint8(src[0]) 9930 src = src[1:] 9931 return src 9932 } 9933 9934 // Packed implements marshal.Marshallable.Packed. 9935 //go:nosplit 9936 func (i *IPTIP) Packed() bool { 9937 return i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() 9938 } 9939 9940 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 9941 func (i *IPTIP) MarshalUnsafe(dst []byte) []byte { 9942 if i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 9943 size := i.SizeBytes() 9944 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 9945 return dst[size:] 9946 } 9947 // Type IPTIP doesn't have a packed layout in memory, fallback to MarshalBytes. 9948 return i.MarshalBytes(dst) 9949 } 9950 9951 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 9952 func (i *IPTIP) UnmarshalUnsafe(src []byte) []byte { 9953 if i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 9954 size := i.SizeBytes() 9955 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 9956 return src[size:] 9957 } 9958 // Type IPTIP doesn't have a packed layout in memory, fallback to UnmarshalBytes. 9959 return i.UnmarshalBytes(src) 9960 } 9961 9962 // CopyOutN implements marshal.Marshallable.CopyOutN. 9963 func (i *IPTIP) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9964 if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 9965 // Type IPTIP doesn't have a packed layout in memory, fall back to MarshalBytes. 9966 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 9967 i.MarshalBytes(buf) // escapes: fallback. 9968 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9969 } 9970 9971 // Construct a slice backed by dst's underlying memory. 9972 var buf []byte 9973 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 9974 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 9975 hdr.Len = i.SizeBytes() 9976 hdr.Cap = i.SizeBytes() 9977 9978 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 9979 // Since we bypassed the compiler's escape analysis, indicate that i 9980 // must live until the use above. 9981 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 9982 return length, err 9983 } 9984 9985 // CopyOut implements marshal.Marshallable.CopyOut. 9986 func (i *IPTIP) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 9987 return i.CopyOutN(cc, addr, i.SizeBytes()) 9988 } 9989 9990 // CopyInN implements marshal.Marshallable.CopyInN. 9991 func (i *IPTIP) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 9992 if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 9993 // Type IPTIP doesn't have a packed layout in memory, fall back to UnmarshalBytes. 9994 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 9995 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 9996 // Unmarshal unconditionally. If we had a short copy-in, this results in a 9997 // partially unmarshalled struct. 9998 i.UnmarshalBytes(buf) // escapes: fallback. 9999 return length, err 10000 } 10001 10002 // Construct a slice backed by dst's underlying memory. 10003 var buf []byte 10004 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10005 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 10006 hdr.Len = i.SizeBytes() 10007 hdr.Cap = i.SizeBytes() 10008 10009 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10010 // Since we bypassed the compiler's escape analysis, indicate that i 10011 // must live until the use above. 10012 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 10013 return length, err 10014 } 10015 10016 // CopyIn implements marshal.Marshallable.CopyIn. 10017 func (i *IPTIP) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10018 return i.CopyInN(cc, addr, i.SizeBytes()) 10019 } 10020 10021 // WriteTo implements io.WriterTo.WriteTo. 10022 func (i *IPTIP) WriteTo(writer io.Writer) (int64, error) { 10023 if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 10024 // Type IPTIP doesn't have a packed layout in memory, fall back to MarshalBytes. 10025 buf := make([]byte, i.SizeBytes()) 10026 i.MarshalBytes(buf) 10027 length, err := writer.Write(buf) 10028 return int64(length), err 10029 } 10030 10031 // Construct a slice backed by dst's underlying memory. 10032 var buf []byte 10033 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10034 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 10035 hdr.Len = i.SizeBytes() 10036 hdr.Cap = i.SizeBytes() 10037 10038 length, err := writer.Write(buf) 10039 // Since we bypassed the compiler's escape analysis, indicate that i 10040 // must live until the use above. 10041 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 10042 return int64(length), err 10043 } 10044 10045 // SizeBytes implements marshal.Marshallable.SizeBytes. 10046 func (i *IPTOwnerInfo) SizeBytes() int { 10047 return 18 + 10048 1*16 10049 } 10050 10051 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 10052 func (i *IPTOwnerInfo) MarshalBytes(dst []byte) []byte { 10053 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.UID)) 10054 dst = dst[4:] 10055 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.GID)) 10056 dst = dst[4:] 10057 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.PID)) 10058 dst = dst[4:] 10059 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.SID)) 10060 dst = dst[4:] 10061 for idx := 0; idx < 16; idx++ { 10062 dst[0] = byte(i.Comm[idx]) 10063 dst = dst[1:] 10064 } 10065 dst[0] = byte(i.Match) 10066 dst = dst[1:] 10067 dst[0] = byte(i.Invert) 10068 dst = dst[1:] 10069 return dst 10070 } 10071 10072 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 10073 func (i *IPTOwnerInfo) UnmarshalBytes(src []byte) []byte { 10074 i.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10075 src = src[4:] 10076 i.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10077 src = src[4:] 10078 i.PID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10079 src = src[4:] 10080 i.SID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10081 src = src[4:] 10082 for idx := 0; idx < 16; idx++ { 10083 i.Comm[idx] = src[0] 10084 src = src[1:] 10085 } 10086 i.Match = uint8(src[0]) 10087 src = src[1:] 10088 i.Invert = uint8(src[0]) 10089 src = src[1:] 10090 return src 10091 } 10092 10093 // Packed implements marshal.Marshallable.Packed. 10094 //go:nosplit 10095 func (i *IPTOwnerInfo) Packed() bool { 10096 return false 10097 } 10098 10099 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 10100 func (i *IPTOwnerInfo) MarshalUnsafe(dst []byte) []byte { 10101 // Type IPTOwnerInfo doesn't have a packed layout in memory, fallback to MarshalBytes. 10102 return i.MarshalBytes(dst) 10103 } 10104 10105 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 10106 func (i *IPTOwnerInfo) UnmarshalUnsafe(src []byte) []byte { 10107 // Type IPTOwnerInfo doesn't have a packed layout in memory, fallback to UnmarshalBytes. 10108 return i.UnmarshalBytes(src) 10109 } 10110 10111 // CopyOutN implements marshal.Marshallable.CopyOutN. 10112 func (i *IPTOwnerInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10113 // Type IPTOwnerInfo doesn't have a packed layout in memory, fall back to MarshalBytes. 10114 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 10115 i.MarshalBytes(buf) // escapes: fallback. 10116 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10117 } 10118 10119 // CopyOut implements marshal.Marshallable.CopyOut. 10120 func (i *IPTOwnerInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10121 return i.CopyOutN(cc, addr, i.SizeBytes()) 10122 } 10123 10124 // CopyInN implements marshal.Marshallable.CopyInN. 10125 func (i *IPTOwnerInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10126 // Type IPTOwnerInfo doesn't have a packed layout in memory, fall back to UnmarshalBytes. 10127 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 10128 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10129 // Unmarshal unconditionally. If we had a short copy-in, this results in a 10130 // partially unmarshalled struct. 10131 i.UnmarshalBytes(buf) // escapes: fallback. 10132 return length, err 10133 } 10134 10135 // CopyIn implements marshal.Marshallable.CopyIn. 10136 func (i *IPTOwnerInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10137 return i.CopyInN(cc, addr, i.SizeBytes()) 10138 } 10139 10140 // WriteTo implements io.WriterTo.WriteTo. 10141 func (i *IPTOwnerInfo) WriteTo(writer io.Writer) (int64, error) { 10142 // Type IPTOwnerInfo doesn't have a packed layout in memory, fall back to MarshalBytes. 10143 buf := make([]byte, i.SizeBytes()) 10144 i.MarshalBytes(buf) 10145 length, err := writer.Write(buf) 10146 return int64(length), err 10147 } 10148 10149 // SizeBytes implements marshal.Marshallable.SizeBytes. 10150 func (i *IPTReplace) SizeBytes() int { 10151 return 24 + 10152 (*TableName)(nil).SizeBytes() + 10153 4*NF_INET_NUMHOOKS + 10154 4*NF_INET_NUMHOOKS 10155 } 10156 10157 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 10158 func (i *IPTReplace) MarshalBytes(dst []byte) []byte { 10159 dst = i.Name.MarshalUnsafe(dst) 10160 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.ValidHooks)) 10161 dst = dst[4:] 10162 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumEntries)) 10163 dst = dst[4:] 10164 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Size)) 10165 dst = dst[4:] 10166 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 10167 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.HookEntry[idx])) 10168 dst = dst[4:] 10169 } 10170 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 10171 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Underflow[idx])) 10172 dst = dst[4:] 10173 } 10174 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumCounters)) 10175 dst = dst[4:] 10176 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Counters)) 10177 dst = dst[8:] 10178 return dst 10179 } 10180 10181 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 10182 func (i *IPTReplace) UnmarshalBytes(src []byte) []byte { 10183 src = i.Name.UnmarshalUnsafe(src) 10184 i.ValidHooks = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10185 src = src[4:] 10186 i.NumEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10187 src = src[4:] 10188 i.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10189 src = src[4:] 10190 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 10191 i.HookEntry[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10192 src = src[4:] 10193 } 10194 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 10195 i.Underflow[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10196 src = src[4:] 10197 } 10198 i.NumCounters = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10199 src = src[4:] 10200 i.Counters = uint64(hostarch.ByteOrder.Uint64(src[:8])) 10201 src = src[8:] 10202 return src 10203 } 10204 10205 // Packed implements marshal.Marshallable.Packed. 10206 //go:nosplit 10207 func (i *IPTReplace) Packed() bool { 10208 return i.Name.Packed() 10209 } 10210 10211 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 10212 func (i *IPTReplace) MarshalUnsafe(dst []byte) []byte { 10213 if i.Name.Packed() { 10214 size := i.SizeBytes() 10215 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 10216 return dst[size:] 10217 } 10218 // Type IPTReplace doesn't have a packed layout in memory, fallback to MarshalBytes. 10219 return i.MarshalBytes(dst) 10220 } 10221 10222 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 10223 func (i *IPTReplace) UnmarshalUnsafe(src []byte) []byte { 10224 if i.Name.Packed() { 10225 size := i.SizeBytes() 10226 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 10227 return src[size:] 10228 } 10229 // Type IPTReplace doesn't have a packed layout in memory, fallback to UnmarshalBytes. 10230 return i.UnmarshalBytes(src) 10231 } 10232 10233 // CopyOutN implements marshal.Marshallable.CopyOutN. 10234 func (i *IPTReplace) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10235 if !i.Name.Packed() { 10236 // Type IPTReplace doesn't have a packed layout in memory, fall back to MarshalBytes. 10237 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 10238 i.MarshalBytes(buf) // escapes: fallback. 10239 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10240 } 10241 10242 // Construct a slice backed by dst's underlying memory. 10243 var buf []byte 10244 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10245 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 10246 hdr.Len = i.SizeBytes() 10247 hdr.Cap = i.SizeBytes() 10248 10249 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10250 // Since we bypassed the compiler's escape analysis, indicate that i 10251 // must live until the use above. 10252 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 10253 return length, err 10254 } 10255 10256 // CopyOut implements marshal.Marshallable.CopyOut. 10257 func (i *IPTReplace) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10258 return i.CopyOutN(cc, addr, i.SizeBytes()) 10259 } 10260 10261 // CopyInN implements marshal.Marshallable.CopyInN. 10262 func (i *IPTReplace) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10263 if !i.Name.Packed() { 10264 // Type IPTReplace doesn't have a packed layout in memory, fall back to UnmarshalBytes. 10265 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 10266 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10267 // Unmarshal unconditionally. If we had a short copy-in, this results in a 10268 // partially unmarshalled struct. 10269 i.UnmarshalBytes(buf) // escapes: fallback. 10270 return length, err 10271 } 10272 10273 // Construct a slice backed by dst's underlying memory. 10274 var buf []byte 10275 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10276 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 10277 hdr.Len = i.SizeBytes() 10278 hdr.Cap = i.SizeBytes() 10279 10280 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10281 // Since we bypassed the compiler's escape analysis, indicate that i 10282 // must live until the use above. 10283 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 10284 return length, err 10285 } 10286 10287 // CopyIn implements marshal.Marshallable.CopyIn. 10288 func (i *IPTReplace) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10289 return i.CopyInN(cc, addr, i.SizeBytes()) 10290 } 10291 10292 // WriteTo implements io.WriterTo.WriteTo. 10293 func (i *IPTReplace) WriteTo(writer io.Writer) (int64, error) { 10294 if !i.Name.Packed() { 10295 // Type IPTReplace doesn't have a packed layout in memory, fall back to MarshalBytes. 10296 buf := make([]byte, i.SizeBytes()) 10297 i.MarshalBytes(buf) 10298 length, err := writer.Write(buf) 10299 return int64(length), err 10300 } 10301 10302 // Construct a slice backed by dst's underlying memory. 10303 var buf []byte 10304 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10305 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 10306 hdr.Len = i.SizeBytes() 10307 hdr.Cap = i.SizeBytes() 10308 10309 length, err := writer.Write(buf) 10310 // Since we bypassed the compiler's escape analysis, indicate that i 10311 // must live until the use above. 10312 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 10313 return int64(length), err 10314 } 10315 10316 // Packed implements marshal.Marshallable.Packed. 10317 //go:nosplit 10318 func (ke *KernelIPTEntry) Packed() bool { 10319 // Type KernelIPTEntry is dynamic so it might have slice/string headers. Hence, it is not packed. 10320 return false 10321 } 10322 10323 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 10324 func (ke *KernelIPTEntry) MarshalUnsafe(dst []byte) []byte { 10325 // Type KernelIPTEntry doesn't have a packed layout in memory, fallback to MarshalBytes. 10326 return ke.MarshalBytes(dst) 10327 } 10328 10329 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 10330 func (ke *KernelIPTEntry) UnmarshalUnsafe(src []byte) []byte { 10331 // Type KernelIPTEntry doesn't have a packed layout in memory, fallback to UnmarshalBytes. 10332 return ke.UnmarshalBytes(src) 10333 } 10334 10335 // CopyOutN implements marshal.Marshallable.CopyOutN. 10336 //go:nosplit 10337 func (ke *KernelIPTEntry) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10338 // Type KernelIPTEntry doesn't have a packed layout in memory, fall back to MarshalBytes. 10339 buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. 10340 ke.MarshalBytes(buf) // escapes: fallback. 10341 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10342 } 10343 10344 // CopyOut implements marshal.Marshallable.CopyOut. 10345 func (ke *KernelIPTEntry) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10346 return ke.CopyOutN(cc, addr, ke.SizeBytes()) 10347 } 10348 10349 // CopyInN implements marshal.Marshallable.CopyInN. 10350 //go:nosplit 10351 func (ke *KernelIPTEntry) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10352 // Type KernelIPTEntry doesn't have a packed layout in memory, fall back to UnmarshalBytes. 10353 buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. 10354 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 10355 // Unmarshal unconditionally. If we had a short copy-in, this results in a 10356 // partially unmarshalled struct. 10357 ke.UnmarshalBytes(buf) // escapes: fallback. 10358 return length, err 10359 } 10360 10361 // CopyIn implements marshal.Marshallable.CopyIn. 10362 func (ke *KernelIPTEntry) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10363 return ke.CopyInN(cc, addr, ke.SizeBytes()) 10364 } 10365 10366 // WriteTo implements io.WriterTo.WriteTo. 10367 func (ke *KernelIPTEntry) WriteTo(writer io.Writer) (int64, error) { 10368 // Type KernelIPTEntry doesn't have a packed layout in memory, fall back to MarshalBytes. 10369 buf := make([]byte, ke.SizeBytes()) 10370 ke.MarshalBytes(buf) 10371 length, err := writer.Write(buf) 10372 return int64(length), err 10373 } 10374 10375 // Packed implements marshal.Marshallable.Packed. 10376 //go:nosplit 10377 func (ke *KernelIPTGetEntries) Packed() bool { 10378 // Type KernelIPTGetEntries is dynamic so it might have slice/string headers. Hence, it is not packed. 10379 return false 10380 } 10381 10382 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 10383 func (ke *KernelIPTGetEntries) MarshalUnsafe(dst []byte) []byte { 10384 // Type KernelIPTGetEntries doesn't have a packed layout in memory, fallback to MarshalBytes. 10385 return ke.MarshalBytes(dst) 10386 } 10387 10388 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 10389 func (ke *KernelIPTGetEntries) UnmarshalUnsafe(src []byte) []byte { 10390 // Type KernelIPTGetEntries doesn't have a packed layout in memory, fallback to UnmarshalBytes. 10391 return ke.UnmarshalBytes(src) 10392 } 10393 10394 // CopyOutN implements marshal.Marshallable.CopyOutN. 10395 //go:nosplit 10396 func (ke *KernelIPTGetEntries) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10397 // Type KernelIPTGetEntries doesn't have a packed layout in memory, fall back to MarshalBytes. 10398 buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. 10399 ke.MarshalBytes(buf) // escapes: fallback. 10400 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10401 } 10402 10403 // CopyOut implements marshal.Marshallable.CopyOut. 10404 func (ke *KernelIPTGetEntries) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10405 return ke.CopyOutN(cc, addr, ke.SizeBytes()) 10406 } 10407 10408 // CopyInN implements marshal.Marshallable.CopyInN. 10409 //go:nosplit 10410 func (ke *KernelIPTGetEntries) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10411 // Type KernelIPTGetEntries doesn't have a packed layout in memory, fall back to UnmarshalBytes. 10412 buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. 10413 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 10414 // Unmarshal unconditionally. If we had a short copy-in, this results in a 10415 // partially unmarshalled struct. 10416 ke.UnmarshalBytes(buf) // escapes: fallback. 10417 return length, err 10418 } 10419 10420 // CopyIn implements marshal.Marshallable.CopyIn. 10421 func (ke *KernelIPTGetEntries) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10422 return ke.CopyInN(cc, addr, ke.SizeBytes()) 10423 } 10424 10425 // WriteTo implements io.WriterTo.WriteTo. 10426 func (ke *KernelIPTGetEntries) WriteTo(writer io.Writer) (int64, error) { 10427 // Type KernelIPTGetEntries doesn't have a packed layout in memory, fall back to MarshalBytes. 10428 buf := make([]byte, ke.SizeBytes()) 10429 ke.MarshalBytes(buf) 10430 length, err := writer.Write(buf) 10431 return int64(length), err 10432 } 10433 10434 // SizeBytes implements marshal.Marshallable.SizeBytes. 10435 func (n *NfNATIPV4MultiRangeCompat) SizeBytes() int { 10436 return 4 + 10437 (*NfNATIPV4Range)(nil).SizeBytes() 10438 } 10439 10440 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 10441 func (n *NfNATIPV4MultiRangeCompat) MarshalBytes(dst []byte) []byte { 10442 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.RangeSize)) 10443 dst = dst[4:] 10444 dst = n.RangeIPV4.MarshalUnsafe(dst) 10445 return dst 10446 } 10447 10448 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 10449 func (n *NfNATIPV4MultiRangeCompat) UnmarshalBytes(src []byte) []byte { 10450 n.RangeSize = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10451 src = src[4:] 10452 src = n.RangeIPV4.UnmarshalUnsafe(src) 10453 return src 10454 } 10455 10456 // Packed implements marshal.Marshallable.Packed. 10457 //go:nosplit 10458 func (n *NfNATIPV4MultiRangeCompat) Packed() bool { 10459 return n.RangeIPV4.Packed() 10460 } 10461 10462 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 10463 func (n *NfNATIPV4MultiRangeCompat) MarshalUnsafe(dst []byte) []byte { 10464 if n.RangeIPV4.Packed() { 10465 size := n.SizeBytes() 10466 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 10467 return dst[size:] 10468 } 10469 // Type NfNATIPV4MultiRangeCompat doesn't have a packed layout in memory, fallback to MarshalBytes. 10470 return n.MarshalBytes(dst) 10471 } 10472 10473 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 10474 func (n *NfNATIPV4MultiRangeCompat) UnmarshalUnsafe(src []byte) []byte { 10475 if n.RangeIPV4.Packed() { 10476 size := n.SizeBytes() 10477 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 10478 return src[size:] 10479 } 10480 // Type NfNATIPV4MultiRangeCompat doesn't have a packed layout in memory, fallback to UnmarshalBytes. 10481 return n.UnmarshalBytes(src) 10482 } 10483 10484 // CopyOutN implements marshal.Marshallable.CopyOutN. 10485 func (n *NfNATIPV4MultiRangeCompat) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10486 if !n.RangeIPV4.Packed() { 10487 // Type NfNATIPV4MultiRangeCompat doesn't have a packed layout in memory, fall back to MarshalBytes. 10488 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 10489 n.MarshalBytes(buf) // escapes: fallback. 10490 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10491 } 10492 10493 // Construct a slice backed by dst's underlying memory. 10494 var buf []byte 10495 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10496 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 10497 hdr.Len = n.SizeBytes() 10498 hdr.Cap = n.SizeBytes() 10499 10500 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10501 // Since we bypassed the compiler's escape analysis, indicate that n 10502 // must live until the use above. 10503 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 10504 return length, err 10505 } 10506 10507 // CopyOut implements marshal.Marshallable.CopyOut. 10508 func (n *NfNATIPV4MultiRangeCompat) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10509 return n.CopyOutN(cc, addr, n.SizeBytes()) 10510 } 10511 10512 // CopyInN implements marshal.Marshallable.CopyInN. 10513 func (n *NfNATIPV4MultiRangeCompat) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10514 if !n.RangeIPV4.Packed() { 10515 // Type NfNATIPV4MultiRangeCompat doesn't have a packed layout in memory, fall back to UnmarshalBytes. 10516 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 10517 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10518 // Unmarshal unconditionally. If we had a short copy-in, this results in a 10519 // partially unmarshalled struct. 10520 n.UnmarshalBytes(buf) // escapes: fallback. 10521 return length, err 10522 } 10523 10524 // Construct a slice backed by dst's underlying memory. 10525 var buf []byte 10526 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10527 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 10528 hdr.Len = n.SizeBytes() 10529 hdr.Cap = n.SizeBytes() 10530 10531 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10532 // Since we bypassed the compiler's escape analysis, indicate that n 10533 // must live until the use above. 10534 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 10535 return length, err 10536 } 10537 10538 // CopyIn implements marshal.Marshallable.CopyIn. 10539 func (n *NfNATIPV4MultiRangeCompat) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10540 return n.CopyInN(cc, addr, n.SizeBytes()) 10541 } 10542 10543 // WriteTo implements io.WriterTo.WriteTo. 10544 func (n *NfNATIPV4MultiRangeCompat) WriteTo(writer io.Writer) (int64, error) { 10545 if !n.RangeIPV4.Packed() { 10546 // Type NfNATIPV4MultiRangeCompat doesn't have a packed layout in memory, fall back to MarshalBytes. 10547 buf := make([]byte, n.SizeBytes()) 10548 n.MarshalBytes(buf) 10549 length, err := writer.Write(buf) 10550 return int64(length), err 10551 } 10552 10553 // Construct a slice backed by dst's underlying memory. 10554 var buf []byte 10555 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10556 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 10557 hdr.Len = n.SizeBytes() 10558 hdr.Cap = n.SizeBytes() 10559 10560 length, err := writer.Write(buf) 10561 // Since we bypassed the compiler's escape analysis, indicate that n 10562 // must live until the use above. 10563 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 10564 return int64(length), err 10565 } 10566 10567 // SizeBytes implements marshal.Marshallable.SizeBytes. 10568 func (n *NfNATIPV4Range) SizeBytes() int { 10569 return 8 + 10570 1*4 + 10571 1*4 10572 } 10573 10574 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 10575 func (n *NfNATIPV4Range) MarshalBytes(dst []byte) []byte { 10576 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 10577 dst = dst[4:] 10578 for idx := 0; idx < 4; idx++ { 10579 dst[0] = byte(n.MinIP[idx]) 10580 dst = dst[1:] 10581 } 10582 for idx := 0; idx < 4; idx++ { 10583 dst[0] = byte(n.MaxIP[idx]) 10584 dst = dst[1:] 10585 } 10586 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MinPort)) 10587 dst = dst[2:] 10588 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MaxPort)) 10589 dst = dst[2:] 10590 return dst 10591 } 10592 10593 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 10594 func (n *NfNATIPV4Range) UnmarshalBytes(src []byte) []byte { 10595 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 10596 src = src[4:] 10597 for idx := 0; idx < 4; idx++ { 10598 n.MinIP[idx] = src[0] 10599 src = src[1:] 10600 } 10601 for idx := 0; idx < 4; idx++ { 10602 n.MaxIP[idx] = src[0] 10603 src = src[1:] 10604 } 10605 n.MinPort = uint16(hostarch.ByteOrder.Uint16(src[:2])) 10606 src = src[2:] 10607 n.MaxPort = uint16(hostarch.ByteOrder.Uint16(src[:2])) 10608 src = src[2:] 10609 return src 10610 } 10611 10612 // Packed implements marshal.Marshallable.Packed. 10613 //go:nosplit 10614 func (n *NfNATIPV4Range) Packed() bool { 10615 return true 10616 } 10617 10618 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 10619 func (n *NfNATIPV4Range) MarshalUnsafe(dst []byte) []byte { 10620 size := n.SizeBytes() 10621 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 10622 return dst[size:] 10623 } 10624 10625 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 10626 func (n *NfNATIPV4Range) UnmarshalUnsafe(src []byte) []byte { 10627 size := n.SizeBytes() 10628 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 10629 return src[size:] 10630 } 10631 10632 // CopyOutN implements marshal.Marshallable.CopyOutN. 10633 func (n *NfNATIPV4Range) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10634 // Construct a slice backed by dst's underlying memory. 10635 var buf []byte 10636 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10637 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 10638 hdr.Len = n.SizeBytes() 10639 hdr.Cap = n.SizeBytes() 10640 10641 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10642 // Since we bypassed the compiler's escape analysis, indicate that n 10643 // must live until the use above. 10644 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 10645 return length, err 10646 } 10647 10648 // CopyOut implements marshal.Marshallable.CopyOut. 10649 func (n *NfNATIPV4Range) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10650 return n.CopyOutN(cc, addr, n.SizeBytes()) 10651 } 10652 10653 // CopyInN implements marshal.Marshallable.CopyInN. 10654 func (n *NfNATIPV4Range) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10655 // Construct a slice backed by dst's underlying memory. 10656 var buf []byte 10657 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10658 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 10659 hdr.Len = n.SizeBytes() 10660 hdr.Cap = n.SizeBytes() 10661 10662 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10663 // Since we bypassed the compiler's escape analysis, indicate that n 10664 // must live until the use above. 10665 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 10666 return length, err 10667 } 10668 10669 // CopyIn implements marshal.Marshallable.CopyIn. 10670 func (n *NfNATIPV4Range) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10671 return n.CopyInN(cc, addr, n.SizeBytes()) 10672 } 10673 10674 // WriteTo implements io.WriterTo.WriteTo. 10675 func (n *NfNATIPV4Range) WriteTo(writer io.Writer) (int64, error) { 10676 // Construct a slice backed by dst's underlying memory. 10677 var buf []byte 10678 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10679 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 10680 hdr.Len = n.SizeBytes() 10681 hdr.Cap = n.SizeBytes() 10682 10683 length, err := writer.Write(buf) 10684 // Since we bypassed the compiler's escape analysis, indicate that n 10685 // must live until the use above. 10686 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 10687 return int64(length), err 10688 } 10689 10690 // SizeBytes implements marshal.Marshallable.SizeBytes. 10691 //go:nosplit 10692 func (tn *TableName) SizeBytes() int { 10693 return 1 * XT_TABLE_MAXNAMELEN 10694 } 10695 10696 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 10697 func (tn *TableName) MarshalBytes(dst []byte) []byte { 10698 for idx := 0; idx < XT_TABLE_MAXNAMELEN; idx++ { 10699 dst[0] = byte(tn[idx]) 10700 dst = dst[1:] 10701 } 10702 return dst 10703 } 10704 10705 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 10706 func (tn *TableName) UnmarshalBytes(src []byte) []byte { 10707 for idx := 0; idx < XT_TABLE_MAXNAMELEN; idx++ { 10708 tn[idx] = src[0] 10709 src = src[1:] 10710 } 10711 return src 10712 } 10713 10714 // Packed implements marshal.Marshallable.Packed. 10715 //go:nosplit 10716 func (tn *TableName) Packed() bool { 10717 // Array newtypes are always packed. 10718 return true 10719 } 10720 10721 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 10722 func (tn *TableName) MarshalUnsafe(dst []byte) []byte { 10723 size := tn.SizeBytes() 10724 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&tn[0]), uintptr(size)) 10725 return dst[size:] 10726 } 10727 10728 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 10729 func (tn *TableName) UnmarshalUnsafe(src []byte) []byte { 10730 size := tn.SizeBytes() 10731 gohacks.Memmove(unsafe.Pointer(tn), unsafe.Pointer(&src[0]), uintptr(size)) 10732 return src[size:] 10733 } 10734 10735 // CopyOutN implements marshal.Marshallable.CopyOutN. 10736 func (tn *TableName) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10737 // Construct a slice backed by dst's underlying memory. 10738 var buf []byte 10739 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10740 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tn))) 10741 hdr.Len = tn.SizeBytes() 10742 hdr.Cap = tn.SizeBytes() 10743 10744 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10745 // Since we bypassed the compiler's escape analysis, indicate that tn 10746 // must live until the use above. 10747 runtime.KeepAlive(tn) // escapes: replaced by intrinsic. 10748 return length, err 10749 } 10750 10751 // CopyOut implements marshal.Marshallable.CopyOut. 10752 func (tn *TableName) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10753 return tn.CopyOutN(cc, addr, tn.SizeBytes()) 10754 } 10755 10756 // CopyInN implements marshal.Marshallable.CopyInN. 10757 func (tn *TableName) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10758 // Construct a slice backed by dst's underlying memory. 10759 var buf []byte 10760 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10761 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tn))) 10762 hdr.Len = tn.SizeBytes() 10763 hdr.Cap = tn.SizeBytes() 10764 10765 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10766 // Since we bypassed the compiler's escape analysis, indicate that tn 10767 // must live until the use above. 10768 runtime.KeepAlive(tn) // escapes: replaced by intrinsic. 10769 return length, err 10770 } 10771 10772 // CopyIn implements marshal.Marshallable.CopyIn. 10773 func (tn *TableName) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10774 return tn.CopyInN(cc, addr, tn.SizeBytes()) 10775 } 10776 10777 // WriteTo implements io.WriterTo.WriteTo. 10778 func (tn *TableName) WriteTo(writer io.Writer) (int64, error) { 10779 // Construct a slice backed by dst's underlying memory. 10780 var buf []byte 10781 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10782 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tn))) 10783 hdr.Len = tn.SizeBytes() 10784 hdr.Cap = tn.SizeBytes() 10785 10786 length, err := writer.Write(buf) 10787 // Since we bypassed the compiler's escape analysis, indicate that tn 10788 // must live until the use above. 10789 runtime.KeepAlive(tn) // escapes: replaced by intrinsic. 10790 return int64(length), err 10791 } 10792 10793 // SizeBytes implements marshal.Marshallable.SizeBytes. 10794 func (x *XTCounters) SizeBytes() int { 10795 return 16 10796 } 10797 10798 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 10799 func (x *XTCounters) MarshalBytes(dst []byte) []byte { 10800 hostarch.ByteOrder.PutUint64(dst[:8], uint64(x.Pcnt)) 10801 dst = dst[8:] 10802 hostarch.ByteOrder.PutUint64(dst[:8], uint64(x.Bcnt)) 10803 dst = dst[8:] 10804 return dst 10805 } 10806 10807 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 10808 func (x *XTCounters) UnmarshalBytes(src []byte) []byte { 10809 x.Pcnt = uint64(hostarch.ByteOrder.Uint64(src[:8])) 10810 src = src[8:] 10811 x.Bcnt = uint64(hostarch.ByteOrder.Uint64(src[:8])) 10812 src = src[8:] 10813 return src 10814 } 10815 10816 // Packed implements marshal.Marshallable.Packed. 10817 //go:nosplit 10818 func (x *XTCounters) Packed() bool { 10819 return true 10820 } 10821 10822 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 10823 func (x *XTCounters) MarshalUnsafe(dst []byte) []byte { 10824 size := x.SizeBytes() 10825 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 10826 return dst[size:] 10827 } 10828 10829 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 10830 func (x *XTCounters) UnmarshalUnsafe(src []byte) []byte { 10831 size := x.SizeBytes() 10832 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 10833 return src[size:] 10834 } 10835 10836 // CopyOutN implements marshal.Marshallable.CopyOutN. 10837 func (x *XTCounters) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10838 // Construct a slice backed by dst's underlying memory. 10839 var buf []byte 10840 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10841 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 10842 hdr.Len = x.SizeBytes() 10843 hdr.Cap = x.SizeBytes() 10844 10845 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10846 // Since we bypassed the compiler's escape analysis, indicate that x 10847 // must live until the use above. 10848 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 10849 return length, err 10850 } 10851 10852 // CopyOut implements marshal.Marshallable.CopyOut. 10853 func (x *XTCounters) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10854 return x.CopyOutN(cc, addr, x.SizeBytes()) 10855 } 10856 10857 // CopyInN implements marshal.Marshallable.CopyInN. 10858 func (x *XTCounters) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10859 // Construct a slice backed by dst's underlying memory. 10860 var buf []byte 10861 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10862 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 10863 hdr.Len = x.SizeBytes() 10864 hdr.Cap = x.SizeBytes() 10865 10866 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10867 // Since we bypassed the compiler's escape analysis, indicate that x 10868 // must live until the use above. 10869 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 10870 return length, err 10871 } 10872 10873 // CopyIn implements marshal.Marshallable.CopyIn. 10874 func (x *XTCounters) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10875 return x.CopyInN(cc, addr, x.SizeBytes()) 10876 } 10877 10878 // WriteTo implements io.WriterTo.WriteTo. 10879 func (x *XTCounters) WriteTo(writer io.Writer) (int64, error) { 10880 // Construct a slice backed by dst's underlying memory. 10881 var buf []byte 10882 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10883 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 10884 hdr.Len = x.SizeBytes() 10885 hdr.Cap = x.SizeBytes() 10886 10887 length, err := writer.Write(buf) 10888 // Since we bypassed the compiler's escape analysis, indicate that x 10889 // must live until the use above. 10890 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 10891 return int64(length), err 10892 } 10893 10894 // SizeBytes implements marshal.Marshallable.SizeBytes. 10895 func (x *XTEntryMatch) SizeBytes() int { 10896 return 3 + 10897 (*ExtensionName)(nil).SizeBytes() 10898 } 10899 10900 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 10901 func (x *XTEntryMatch) MarshalBytes(dst []byte) []byte { 10902 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.MatchSize)) 10903 dst = dst[2:] 10904 dst = x.Name.MarshalUnsafe(dst) 10905 dst[0] = byte(x.Revision) 10906 dst = dst[1:] 10907 return dst 10908 } 10909 10910 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 10911 func (x *XTEntryMatch) UnmarshalBytes(src []byte) []byte { 10912 x.MatchSize = uint16(hostarch.ByteOrder.Uint16(src[:2])) 10913 src = src[2:] 10914 src = x.Name.UnmarshalUnsafe(src) 10915 x.Revision = uint8(src[0]) 10916 src = src[1:] 10917 return src 10918 } 10919 10920 // Packed implements marshal.Marshallable.Packed. 10921 //go:nosplit 10922 func (x *XTEntryMatch) Packed() bool { 10923 return x.Name.Packed() 10924 } 10925 10926 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 10927 func (x *XTEntryMatch) MarshalUnsafe(dst []byte) []byte { 10928 if x.Name.Packed() { 10929 size := x.SizeBytes() 10930 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 10931 return dst[size:] 10932 } 10933 // Type XTEntryMatch doesn't have a packed layout in memory, fallback to MarshalBytes. 10934 return x.MarshalBytes(dst) 10935 } 10936 10937 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 10938 func (x *XTEntryMatch) UnmarshalUnsafe(src []byte) []byte { 10939 if x.Name.Packed() { 10940 size := x.SizeBytes() 10941 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 10942 return src[size:] 10943 } 10944 // Type XTEntryMatch doesn't have a packed layout in memory, fallback to UnmarshalBytes. 10945 return x.UnmarshalBytes(src) 10946 } 10947 10948 // CopyOutN implements marshal.Marshallable.CopyOutN. 10949 func (x *XTEntryMatch) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10950 if !x.Name.Packed() { 10951 // Type XTEntryMatch doesn't have a packed layout in memory, fall back to MarshalBytes. 10952 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 10953 x.MarshalBytes(buf) // escapes: fallback. 10954 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10955 } 10956 10957 // Construct a slice backed by dst's underlying memory. 10958 var buf []byte 10959 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10960 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 10961 hdr.Len = x.SizeBytes() 10962 hdr.Cap = x.SizeBytes() 10963 10964 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 10965 // Since we bypassed the compiler's escape analysis, indicate that x 10966 // must live until the use above. 10967 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 10968 return length, err 10969 } 10970 10971 // CopyOut implements marshal.Marshallable.CopyOut. 10972 func (x *XTEntryMatch) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 10973 return x.CopyOutN(cc, addr, x.SizeBytes()) 10974 } 10975 10976 // CopyInN implements marshal.Marshallable.CopyInN. 10977 func (x *XTEntryMatch) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 10978 if !x.Name.Packed() { 10979 // Type XTEntryMatch doesn't have a packed layout in memory, fall back to UnmarshalBytes. 10980 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 10981 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10982 // Unmarshal unconditionally. If we had a short copy-in, this results in a 10983 // partially unmarshalled struct. 10984 x.UnmarshalBytes(buf) // escapes: fallback. 10985 return length, err 10986 } 10987 10988 // Construct a slice backed by dst's underlying memory. 10989 var buf []byte 10990 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 10991 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 10992 hdr.Len = x.SizeBytes() 10993 hdr.Cap = x.SizeBytes() 10994 10995 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 10996 // Since we bypassed the compiler's escape analysis, indicate that x 10997 // must live until the use above. 10998 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 10999 return length, err 11000 } 11001 11002 // CopyIn implements marshal.Marshallable.CopyIn. 11003 func (x *XTEntryMatch) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11004 return x.CopyInN(cc, addr, x.SizeBytes()) 11005 } 11006 11007 // WriteTo implements io.WriterTo.WriteTo. 11008 func (x *XTEntryMatch) WriteTo(writer io.Writer) (int64, error) { 11009 if !x.Name.Packed() { 11010 // Type XTEntryMatch doesn't have a packed layout in memory, fall back to MarshalBytes. 11011 buf := make([]byte, x.SizeBytes()) 11012 x.MarshalBytes(buf) 11013 length, err := writer.Write(buf) 11014 return int64(length), err 11015 } 11016 11017 // Construct a slice backed by dst's underlying memory. 11018 var buf []byte 11019 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11020 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11021 hdr.Len = x.SizeBytes() 11022 hdr.Cap = x.SizeBytes() 11023 11024 length, err := writer.Write(buf) 11025 // Since we bypassed the compiler's escape analysis, indicate that x 11026 // must live until the use above. 11027 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11028 return int64(length), err 11029 } 11030 11031 // SizeBytes implements marshal.Marshallable.SizeBytes. 11032 func (x *XTEntryTarget) SizeBytes() int { 11033 return 3 + 11034 (*ExtensionName)(nil).SizeBytes() 11035 } 11036 11037 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 11038 func (x *XTEntryTarget) MarshalBytes(dst []byte) []byte { 11039 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.TargetSize)) 11040 dst = dst[2:] 11041 dst = x.Name.MarshalUnsafe(dst) 11042 dst[0] = byte(x.Revision) 11043 dst = dst[1:] 11044 return dst 11045 } 11046 11047 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 11048 func (x *XTEntryTarget) UnmarshalBytes(src []byte) []byte { 11049 x.TargetSize = uint16(hostarch.ByteOrder.Uint16(src[:2])) 11050 src = src[2:] 11051 src = x.Name.UnmarshalUnsafe(src) 11052 x.Revision = uint8(src[0]) 11053 src = src[1:] 11054 return src 11055 } 11056 11057 // Packed implements marshal.Marshallable.Packed. 11058 //go:nosplit 11059 func (x *XTEntryTarget) Packed() bool { 11060 return x.Name.Packed() 11061 } 11062 11063 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 11064 func (x *XTEntryTarget) MarshalUnsafe(dst []byte) []byte { 11065 if x.Name.Packed() { 11066 size := x.SizeBytes() 11067 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 11068 return dst[size:] 11069 } 11070 // Type XTEntryTarget doesn't have a packed layout in memory, fallback to MarshalBytes. 11071 return x.MarshalBytes(dst) 11072 } 11073 11074 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 11075 func (x *XTEntryTarget) UnmarshalUnsafe(src []byte) []byte { 11076 if x.Name.Packed() { 11077 size := x.SizeBytes() 11078 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 11079 return src[size:] 11080 } 11081 // Type XTEntryTarget doesn't have a packed layout in memory, fallback to UnmarshalBytes. 11082 return x.UnmarshalBytes(src) 11083 } 11084 11085 // CopyOutN implements marshal.Marshallable.CopyOutN. 11086 func (x *XTEntryTarget) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11087 if !x.Name.Packed() { 11088 // Type XTEntryTarget doesn't have a packed layout in memory, fall back to MarshalBytes. 11089 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11090 x.MarshalBytes(buf) // escapes: fallback. 11091 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11092 } 11093 11094 // Construct a slice backed by dst's underlying memory. 11095 var buf []byte 11096 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11097 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11098 hdr.Len = x.SizeBytes() 11099 hdr.Cap = x.SizeBytes() 11100 11101 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11102 // Since we bypassed the compiler's escape analysis, indicate that x 11103 // must live until the use above. 11104 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11105 return length, err 11106 } 11107 11108 // CopyOut implements marshal.Marshallable.CopyOut. 11109 func (x *XTEntryTarget) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11110 return x.CopyOutN(cc, addr, x.SizeBytes()) 11111 } 11112 11113 // CopyInN implements marshal.Marshallable.CopyInN. 11114 func (x *XTEntryTarget) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11115 if !x.Name.Packed() { 11116 // Type XTEntryTarget doesn't have a packed layout in memory, fall back to UnmarshalBytes. 11117 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11118 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11119 // Unmarshal unconditionally. If we had a short copy-in, this results in a 11120 // partially unmarshalled struct. 11121 x.UnmarshalBytes(buf) // escapes: fallback. 11122 return length, err 11123 } 11124 11125 // Construct a slice backed by dst's underlying memory. 11126 var buf []byte 11127 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11128 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11129 hdr.Len = x.SizeBytes() 11130 hdr.Cap = x.SizeBytes() 11131 11132 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11133 // Since we bypassed the compiler's escape analysis, indicate that x 11134 // must live until the use above. 11135 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11136 return length, err 11137 } 11138 11139 // CopyIn implements marshal.Marshallable.CopyIn. 11140 func (x *XTEntryTarget) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11141 return x.CopyInN(cc, addr, x.SizeBytes()) 11142 } 11143 11144 // WriteTo implements io.WriterTo.WriteTo. 11145 func (x *XTEntryTarget) WriteTo(writer io.Writer) (int64, error) { 11146 if !x.Name.Packed() { 11147 // Type XTEntryTarget doesn't have a packed layout in memory, fall back to MarshalBytes. 11148 buf := make([]byte, x.SizeBytes()) 11149 x.MarshalBytes(buf) 11150 length, err := writer.Write(buf) 11151 return int64(length), err 11152 } 11153 11154 // Construct a slice backed by dst's underlying memory. 11155 var buf []byte 11156 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11157 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11158 hdr.Len = x.SizeBytes() 11159 hdr.Cap = x.SizeBytes() 11160 11161 length, err := writer.Write(buf) 11162 // Since we bypassed the compiler's escape analysis, indicate that x 11163 // must live until the use above. 11164 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11165 return int64(length), err 11166 } 11167 11168 // SizeBytes implements marshal.Marshallable.SizeBytes. 11169 func (x *XTErrorTarget) SizeBytes() int { 11170 return 0 + 11171 (*XTEntryTarget)(nil).SizeBytes() + 11172 (*ErrorName)(nil).SizeBytes() + 11173 1*2 11174 } 11175 11176 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 11177 func (x *XTErrorTarget) MarshalBytes(dst []byte) []byte { 11178 dst = x.Target.MarshalUnsafe(dst) 11179 dst = x.Name.MarshalUnsafe(dst) 11180 // Padding: dst[:sizeof(byte)*2] ~= [2]byte{0} 11181 dst = dst[1*(2):] 11182 return dst 11183 } 11184 11185 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 11186 func (x *XTErrorTarget) UnmarshalBytes(src []byte) []byte { 11187 src = x.Target.UnmarshalUnsafe(src) 11188 src = x.Name.UnmarshalUnsafe(src) 11189 // Padding: ~ copy([2]byte(x._), src[:sizeof(byte)*2]) 11190 src = src[1*(2):] 11191 return src 11192 } 11193 11194 // Packed implements marshal.Marshallable.Packed. 11195 //go:nosplit 11196 func (x *XTErrorTarget) Packed() bool { 11197 return x.Name.Packed() && x.Target.Packed() 11198 } 11199 11200 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 11201 func (x *XTErrorTarget) MarshalUnsafe(dst []byte) []byte { 11202 if x.Name.Packed() && x.Target.Packed() { 11203 size := x.SizeBytes() 11204 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 11205 return dst[size:] 11206 } 11207 // Type XTErrorTarget doesn't have a packed layout in memory, fallback to MarshalBytes. 11208 return x.MarshalBytes(dst) 11209 } 11210 11211 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 11212 func (x *XTErrorTarget) UnmarshalUnsafe(src []byte) []byte { 11213 if x.Name.Packed() && x.Target.Packed() { 11214 size := x.SizeBytes() 11215 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 11216 return src[size:] 11217 } 11218 // Type XTErrorTarget doesn't have a packed layout in memory, fallback to UnmarshalBytes. 11219 return x.UnmarshalBytes(src) 11220 } 11221 11222 // CopyOutN implements marshal.Marshallable.CopyOutN. 11223 func (x *XTErrorTarget) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11224 if !x.Name.Packed() && x.Target.Packed() { 11225 // Type XTErrorTarget doesn't have a packed layout in memory, fall back to MarshalBytes. 11226 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11227 x.MarshalBytes(buf) // escapes: fallback. 11228 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11229 } 11230 11231 // Construct a slice backed by dst's underlying memory. 11232 var buf []byte 11233 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11234 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11235 hdr.Len = x.SizeBytes() 11236 hdr.Cap = x.SizeBytes() 11237 11238 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11239 // Since we bypassed the compiler's escape analysis, indicate that x 11240 // must live until the use above. 11241 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11242 return length, err 11243 } 11244 11245 // CopyOut implements marshal.Marshallable.CopyOut. 11246 func (x *XTErrorTarget) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11247 return x.CopyOutN(cc, addr, x.SizeBytes()) 11248 } 11249 11250 // CopyInN implements marshal.Marshallable.CopyInN. 11251 func (x *XTErrorTarget) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11252 if !x.Name.Packed() && x.Target.Packed() { 11253 // Type XTErrorTarget doesn't have a packed layout in memory, fall back to UnmarshalBytes. 11254 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11255 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11256 // Unmarshal unconditionally. If we had a short copy-in, this results in a 11257 // partially unmarshalled struct. 11258 x.UnmarshalBytes(buf) // escapes: fallback. 11259 return length, err 11260 } 11261 11262 // Construct a slice backed by dst's underlying memory. 11263 var buf []byte 11264 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11265 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11266 hdr.Len = x.SizeBytes() 11267 hdr.Cap = x.SizeBytes() 11268 11269 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11270 // Since we bypassed the compiler's escape analysis, indicate that x 11271 // must live until the use above. 11272 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11273 return length, err 11274 } 11275 11276 // CopyIn implements marshal.Marshallable.CopyIn. 11277 func (x *XTErrorTarget) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11278 return x.CopyInN(cc, addr, x.SizeBytes()) 11279 } 11280 11281 // WriteTo implements io.WriterTo.WriteTo. 11282 func (x *XTErrorTarget) WriteTo(writer io.Writer) (int64, error) { 11283 if !x.Name.Packed() && x.Target.Packed() { 11284 // Type XTErrorTarget doesn't have a packed layout in memory, fall back to MarshalBytes. 11285 buf := make([]byte, x.SizeBytes()) 11286 x.MarshalBytes(buf) 11287 length, err := writer.Write(buf) 11288 return int64(length), err 11289 } 11290 11291 // Construct a slice backed by dst's underlying memory. 11292 var buf []byte 11293 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11294 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11295 hdr.Len = x.SizeBytes() 11296 hdr.Cap = x.SizeBytes() 11297 11298 length, err := writer.Write(buf) 11299 // Since we bypassed the compiler's escape analysis, indicate that x 11300 // must live until the use above. 11301 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11302 return int64(length), err 11303 } 11304 11305 // SizeBytes implements marshal.Marshallable.SizeBytes. 11306 func (x *XTGetRevision) SizeBytes() int { 11307 return 1 + 11308 (*ExtensionName)(nil).SizeBytes() 11309 } 11310 11311 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 11312 func (x *XTGetRevision) MarshalBytes(dst []byte) []byte { 11313 dst = x.Name.MarshalUnsafe(dst) 11314 dst[0] = byte(x.Revision) 11315 dst = dst[1:] 11316 return dst 11317 } 11318 11319 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 11320 func (x *XTGetRevision) UnmarshalBytes(src []byte) []byte { 11321 src = x.Name.UnmarshalUnsafe(src) 11322 x.Revision = uint8(src[0]) 11323 src = src[1:] 11324 return src 11325 } 11326 11327 // Packed implements marshal.Marshallable.Packed. 11328 //go:nosplit 11329 func (x *XTGetRevision) Packed() bool { 11330 return x.Name.Packed() 11331 } 11332 11333 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 11334 func (x *XTGetRevision) MarshalUnsafe(dst []byte) []byte { 11335 if x.Name.Packed() { 11336 size := x.SizeBytes() 11337 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 11338 return dst[size:] 11339 } 11340 // Type XTGetRevision doesn't have a packed layout in memory, fallback to MarshalBytes. 11341 return x.MarshalBytes(dst) 11342 } 11343 11344 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 11345 func (x *XTGetRevision) UnmarshalUnsafe(src []byte) []byte { 11346 if x.Name.Packed() { 11347 size := x.SizeBytes() 11348 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 11349 return src[size:] 11350 } 11351 // Type XTGetRevision doesn't have a packed layout in memory, fallback to UnmarshalBytes. 11352 return x.UnmarshalBytes(src) 11353 } 11354 11355 // CopyOutN implements marshal.Marshallable.CopyOutN. 11356 func (x *XTGetRevision) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11357 if !x.Name.Packed() { 11358 // Type XTGetRevision doesn't have a packed layout in memory, fall back to MarshalBytes. 11359 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11360 x.MarshalBytes(buf) // escapes: fallback. 11361 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11362 } 11363 11364 // Construct a slice backed by dst's underlying memory. 11365 var buf []byte 11366 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11367 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11368 hdr.Len = x.SizeBytes() 11369 hdr.Cap = x.SizeBytes() 11370 11371 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11372 // Since we bypassed the compiler's escape analysis, indicate that x 11373 // must live until the use above. 11374 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11375 return length, err 11376 } 11377 11378 // CopyOut implements marshal.Marshallable.CopyOut. 11379 func (x *XTGetRevision) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11380 return x.CopyOutN(cc, addr, x.SizeBytes()) 11381 } 11382 11383 // CopyInN implements marshal.Marshallable.CopyInN. 11384 func (x *XTGetRevision) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11385 if !x.Name.Packed() { 11386 // Type XTGetRevision doesn't have a packed layout in memory, fall back to UnmarshalBytes. 11387 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11388 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11389 // Unmarshal unconditionally. If we had a short copy-in, this results in a 11390 // partially unmarshalled struct. 11391 x.UnmarshalBytes(buf) // escapes: fallback. 11392 return length, err 11393 } 11394 11395 // Construct a slice backed by dst's underlying memory. 11396 var buf []byte 11397 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11398 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11399 hdr.Len = x.SizeBytes() 11400 hdr.Cap = x.SizeBytes() 11401 11402 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11403 // Since we bypassed the compiler's escape analysis, indicate that x 11404 // must live until the use above. 11405 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11406 return length, err 11407 } 11408 11409 // CopyIn implements marshal.Marshallable.CopyIn. 11410 func (x *XTGetRevision) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11411 return x.CopyInN(cc, addr, x.SizeBytes()) 11412 } 11413 11414 // WriteTo implements io.WriterTo.WriteTo. 11415 func (x *XTGetRevision) WriteTo(writer io.Writer) (int64, error) { 11416 if !x.Name.Packed() { 11417 // Type XTGetRevision doesn't have a packed layout in memory, fall back to MarshalBytes. 11418 buf := make([]byte, x.SizeBytes()) 11419 x.MarshalBytes(buf) 11420 length, err := writer.Write(buf) 11421 return int64(length), err 11422 } 11423 11424 // Construct a slice backed by dst's underlying memory. 11425 var buf []byte 11426 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11427 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11428 hdr.Len = x.SizeBytes() 11429 hdr.Cap = x.SizeBytes() 11430 11431 length, err := writer.Write(buf) 11432 // Since we bypassed the compiler's escape analysis, indicate that x 11433 // must live until the use above. 11434 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11435 return int64(length), err 11436 } 11437 11438 // SizeBytes implements marshal.Marshallable.SizeBytes. 11439 func (x *XTNATTargetV0) SizeBytes() int { 11440 return 0 + 11441 (*XTEntryTarget)(nil).SizeBytes() + 11442 (*NfNATIPV4MultiRangeCompat)(nil).SizeBytes() + 11443 1*4 11444 } 11445 11446 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 11447 func (x *XTNATTargetV0) MarshalBytes(dst []byte) []byte { 11448 dst = x.Target.MarshalUnsafe(dst) 11449 dst = x.NfRange.MarshalUnsafe(dst) 11450 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 11451 dst = dst[1*(4):] 11452 return dst 11453 } 11454 11455 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 11456 func (x *XTNATTargetV0) UnmarshalBytes(src []byte) []byte { 11457 src = x.Target.UnmarshalUnsafe(src) 11458 src = x.NfRange.UnmarshalUnsafe(src) 11459 // Padding: ~ copy([4]byte(x._), src[:sizeof(byte)*4]) 11460 src = src[1*(4):] 11461 return src 11462 } 11463 11464 // Packed implements marshal.Marshallable.Packed. 11465 //go:nosplit 11466 func (x *XTNATTargetV0) Packed() bool { 11467 return x.NfRange.Packed() && x.Target.Packed() 11468 } 11469 11470 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 11471 func (x *XTNATTargetV0) MarshalUnsafe(dst []byte) []byte { 11472 if x.NfRange.Packed() && x.Target.Packed() { 11473 size := x.SizeBytes() 11474 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 11475 return dst[size:] 11476 } 11477 // Type XTNATTargetV0 doesn't have a packed layout in memory, fallback to MarshalBytes. 11478 return x.MarshalBytes(dst) 11479 } 11480 11481 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 11482 func (x *XTNATTargetV0) UnmarshalUnsafe(src []byte) []byte { 11483 if x.NfRange.Packed() && x.Target.Packed() { 11484 size := x.SizeBytes() 11485 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 11486 return src[size:] 11487 } 11488 // Type XTNATTargetV0 doesn't have a packed layout in memory, fallback to UnmarshalBytes. 11489 return x.UnmarshalBytes(src) 11490 } 11491 11492 // CopyOutN implements marshal.Marshallable.CopyOutN. 11493 func (x *XTNATTargetV0) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11494 if !x.NfRange.Packed() && x.Target.Packed() { 11495 // Type XTNATTargetV0 doesn't have a packed layout in memory, fall back to MarshalBytes. 11496 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11497 x.MarshalBytes(buf) // escapes: fallback. 11498 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11499 } 11500 11501 // Construct a slice backed by dst's underlying memory. 11502 var buf []byte 11503 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11504 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11505 hdr.Len = x.SizeBytes() 11506 hdr.Cap = x.SizeBytes() 11507 11508 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11509 // Since we bypassed the compiler's escape analysis, indicate that x 11510 // must live until the use above. 11511 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11512 return length, err 11513 } 11514 11515 // CopyOut implements marshal.Marshallable.CopyOut. 11516 func (x *XTNATTargetV0) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11517 return x.CopyOutN(cc, addr, x.SizeBytes()) 11518 } 11519 11520 // CopyInN implements marshal.Marshallable.CopyInN. 11521 func (x *XTNATTargetV0) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11522 if !x.NfRange.Packed() && x.Target.Packed() { 11523 // Type XTNATTargetV0 doesn't have a packed layout in memory, fall back to UnmarshalBytes. 11524 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11525 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11526 // Unmarshal unconditionally. If we had a short copy-in, this results in a 11527 // partially unmarshalled struct. 11528 x.UnmarshalBytes(buf) // escapes: fallback. 11529 return length, err 11530 } 11531 11532 // Construct a slice backed by dst's underlying memory. 11533 var buf []byte 11534 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11535 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11536 hdr.Len = x.SizeBytes() 11537 hdr.Cap = x.SizeBytes() 11538 11539 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11540 // Since we bypassed the compiler's escape analysis, indicate that x 11541 // must live until the use above. 11542 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11543 return length, err 11544 } 11545 11546 // CopyIn implements marshal.Marshallable.CopyIn. 11547 func (x *XTNATTargetV0) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11548 return x.CopyInN(cc, addr, x.SizeBytes()) 11549 } 11550 11551 // WriteTo implements io.WriterTo.WriteTo. 11552 func (x *XTNATTargetV0) WriteTo(writer io.Writer) (int64, error) { 11553 if !x.NfRange.Packed() && x.Target.Packed() { 11554 // Type XTNATTargetV0 doesn't have a packed layout in memory, fall back to MarshalBytes. 11555 buf := make([]byte, x.SizeBytes()) 11556 x.MarshalBytes(buf) 11557 length, err := writer.Write(buf) 11558 return int64(length), err 11559 } 11560 11561 // Construct a slice backed by dst's underlying memory. 11562 var buf []byte 11563 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11564 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11565 hdr.Len = x.SizeBytes() 11566 hdr.Cap = x.SizeBytes() 11567 11568 length, err := writer.Write(buf) 11569 // Since we bypassed the compiler's escape analysis, indicate that x 11570 // must live until the use above. 11571 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11572 return int64(length), err 11573 } 11574 11575 // SizeBytes implements marshal.Marshallable.SizeBytes. 11576 func (x *XTNATTargetV1) SizeBytes() int { 11577 return 0 + 11578 (*XTEntryTarget)(nil).SizeBytes() + 11579 (*NFNATRange)(nil).SizeBytes() 11580 } 11581 11582 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 11583 func (x *XTNATTargetV1) MarshalBytes(dst []byte) []byte { 11584 dst = x.Target.MarshalUnsafe(dst) 11585 dst = x.Range.MarshalUnsafe(dst) 11586 return dst 11587 } 11588 11589 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 11590 func (x *XTNATTargetV1) UnmarshalBytes(src []byte) []byte { 11591 src = x.Target.UnmarshalUnsafe(src) 11592 src = x.Range.UnmarshalUnsafe(src) 11593 return src 11594 } 11595 11596 // Packed implements marshal.Marshallable.Packed. 11597 //go:nosplit 11598 func (x *XTNATTargetV1) Packed() bool { 11599 return x.Range.Packed() && x.Target.Packed() 11600 } 11601 11602 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 11603 func (x *XTNATTargetV1) MarshalUnsafe(dst []byte) []byte { 11604 if x.Range.Packed() && x.Target.Packed() { 11605 size := x.SizeBytes() 11606 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 11607 return dst[size:] 11608 } 11609 // Type XTNATTargetV1 doesn't have a packed layout in memory, fallback to MarshalBytes. 11610 return x.MarshalBytes(dst) 11611 } 11612 11613 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 11614 func (x *XTNATTargetV1) UnmarshalUnsafe(src []byte) []byte { 11615 if x.Range.Packed() && x.Target.Packed() { 11616 size := x.SizeBytes() 11617 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 11618 return src[size:] 11619 } 11620 // Type XTNATTargetV1 doesn't have a packed layout in memory, fallback to UnmarshalBytes. 11621 return x.UnmarshalBytes(src) 11622 } 11623 11624 // CopyOutN implements marshal.Marshallable.CopyOutN. 11625 func (x *XTNATTargetV1) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11626 if !x.Range.Packed() && x.Target.Packed() { 11627 // Type XTNATTargetV1 doesn't have a packed layout in memory, fall back to MarshalBytes. 11628 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11629 x.MarshalBytes(buf) // escapes: fallback. 11630 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11631 } 11632 11633 // Construct a slice backed by dst's underlying memory. 11634 var buf []byte 11635 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11636 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11637 hdr.Len = x.SizeBytes() 11638 hdr.Cap = x.SizeBytes() 11639 11640 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11641 // Since we bypassed the compiler's escape analysis, indicate that x 11642 // must live until the use above. 11643 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11644 return length, err 11645 } 11646 11647 // CopyOut implements marshal.Marshallable.CopyOut. 11648 func (x *XTNATTargetV1) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11649 return x.CopyOutN(cc, addr, x.SizeBytes()) 11650 } 11651 11652 // CopyInN implements marshal.Marshallable.CopyInN. 11653 func (x *XTNATTargetV1) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11654 if !x.Range.Packed() && x.Target.Packed() { 11655 // Type XTNATTargetV1 doesn't have a packed layout in memory, fall back to UnmarshalBytes. 11656 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11657 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11658 // Unmarshal unconditionally. If we had a short copy-in, this results in a 11659 // partially unmarshalled struct. 11660 x.UnmarshalBytes(buf) // escapes: fallback. 11661 return length, err 11662 } 11663 11664 // Construct a slice backed by dst's underlying memory. 11665 var buf []byte 11666 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11667 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11668 hdr.Len = x.SizeBytes() 11669 hdr.Cap = x.SizeBytes() 11670 11671 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11672 // Since we bypassed the compiler's escape analysis, indicate that x 11673 // must live until the use above. 11674 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11675 return length, err 11676 } 11677 11678 // CopyIn implements marshal.Marshallable.CopyIn. 11679 func (x *XTNATTargetV1) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11680 return x.CopyInN(cc, addr, x.SizeBytes()) 11681 } 11682 11683 // WriteTo implements io.WriterTo.WriteTo. 11684 func (x *XTNATTargetV1) WriteTo(writer io.Writer) (int64, error) { 11685 if !x.Range.Packed() && x.Target.Packed() { 11686 // Type XTNATTargetV1 doesn't have a packed layout in memory, fall back to MarshalBytes. 11687 buf := make([]byte, x.SizeBytes()) 11688 x.MarshalBytes(buf) 11689 length, err := writer.Write(buf) 11690 return int64(length), err 11691 } 11692 11693 // Construct a slice backed by dst's underlying memory. 11694 var buf []byte 11695 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11696 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11697 hdr.Len = x.SizeBytes() 11698 hdr.Cap = x.SizeBytes() 11699 11700 length, err := writer.Write(buf) 11701 // Since we bypassed the compiler's escape analysis, indicate that x 11702 // must live until the use above. 11703 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11704 return int64(length), err 11705 } 11706 11707 // SizeBytes implements marshal.Marshallable.SizeBytes. 11708 func (x *XTNATTargetV2) SizeBytes() int { 11709 return 0 + 11710 (*XTEntryTarget)(nil).SizeBytes() + 11711 (*NFNATRange2)(nil).SizeBytes() 11712 } 11713 11714 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 11715 func (x *XTNATTargetV2) MarshalBytes(dst []byte) []byte { 11716 dst = x.Target.MarshalUnsafe(dst) 11717 dst = x.Range.MarshalUnsafe(dst) 11718 return dst 11719 } 11720 11721 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 11722 func (x *XTNATTargetV2) UnmarshalBytes(src []byte) []byte { 11723 src = x.Target.UnmarshalUnsafe(src) 11724 src = x.Range.UnmarshalUnsafe(src) 11725 return src 11726 } 11727 11728 // Packed implements marshal.Marshallable.Packed. 11729 //go:nosplit 11730 func (x *XTNATTargetV2) Packed() bool { 11731 return x.Range.Packed() && x.Target.Packed() 11732 } 11733 11734 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 11735 func (x *XTNATTargetV2) MarshalUnsafe(dst []byte) []byte { 11736 if x.Range.Packed() && x.Target.Packed() { 11737 size := x.SizeBytes() 11738 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 11739 return dst[size:] 11740 } 11741 // Type XTNATTargetV2 doesn't have a packed layout in memory, fallback to MarshalBytes. 11742 return x.MarshalBytes(dst) 11743 } 11744 11745 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 11746 func (x *XTNATTargetV2) UnmarshalUnsafe(src []byte) []byte { 11747 if x.Range.Packed() && x.Target.Packed() { 11748 size := x.SizeBytes() 11749 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 11750 return src[size:] 11751 } 11752 // Type XTNATTargetV2 doesn't have a packed layout in memory, fallback to UnmarshalBytes. 11753 return x.UnmarshalBytes(src) 11754 } 11755 11756 // CopyOutN implements marshal.Marshallable.CopyOutN. 11757 func (x *XTNATTargetV2) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11758 if !x.Range.Packed() && x.Target.Packed() { 11759 // Type XTNATTargetV2 doesn't have a packed layout in memory, fall back to MarshalBytes. 11760 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11761 x.MarshalBytes(buf) // escapes: fallback. 11762 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11763 } 11764 11765 // Construct a slice backed by dst's underlying memory. 11766 var buf []byte 11767 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11768 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11769 hdr.Len = x.SizeBytes() 11770 hdr.Cap = x.SizeBytes() 11771 11772 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11773 // Since we bypassed the compiler's escape analysis, indicate that x 11774 // must live until the use above. 11775 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11776 return length, err 11777 } 11778 11779 // CopyOut implements marshal.Marshallable.CopyOut. 11780 func (x *XTNATTargetV2) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11781 return x.CopyOutN(cc, addr, x.SizeBytes()) 11782 } 11783 11784 // CopyInN implements marshal.Marshallable.CopyInN. 11785 func (x *XTNATTargetV2) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11786 if !x.Range.Packed() && x.Target.Packed() { 11787 // Type XTNATTargetV2 doesn't have a packed layout in memory, fall back to UnmarshalBytes. 11788 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 11789 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11790 // Unmarshal unconditionally. If we had a short copy-in, this results in a 11791 // partially unmarshalled struct. 11792 x.UnmarshalBytes(buf) // escapes: fallback. 11793 return length, err 11794 } 11795 11796 // Construct a slice backed by dst's underlying memory. 11797 var buf []byte 11798 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11799 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11800 hdr.Len = x.SizeBytes() 11801 hdr.Cap = x.SizeBytes() 11802 11803 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11804 // Since we bypassed the compiler's escape analysis, indicate that x 11805 // must live until the use above. 11806 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11807 return length, err 11808 } 11809 11810 // CopyIn implements marshal.Marshallable.CopyIn. 11811 func (x *XTNATTargetV2) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11812 return x.CopyInN(cc, addr, x.SizeBytes()) 11813 } 11814 11815 // WriteTo implements io.WriterTo.WriteTo. 11816 func (x *XTNATTargetV2) WriteTo(writer io.Writer) (int64, error) { 11817 if !x.Range.Packed() && x.Target.Packed() { 11818 // Type XTNATTargetV2 doesn't have a packed layout in memory, fall back to MarshalBytes. 11819 buf := make([]byte, x.SizeBytes()) 11820 x.MarshalBytes(buf) 11821 length, err := writer.Write(buf) 11822 return int64(length), err 11823 } 11824 11825 // Construct a slice backed by dst's underlying memory. 11826 var buf []byte 11827 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11828 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11829 hdr.Len = x.SizeBytes() 11830 hdr.Cap = x.SizeBytes() 11831 11832 length, err := writer.Write(buf) 11833 // Since we bypassed the compiler's escape analysis, indicate that x 11834 // must live until the use above. 11835 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11836 return int64(length), err 11837 } 11838 11839 // SizeBytes implements marshal.Marshallable.SizeBytes. 11840 func (x *XTOwnerMatchInfo) SizeBytes() int { 11841 return 18 + 11842 1*2 11843 } 11844 11845 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 11846 func (x *XTOwnerMatchInfo) MarshalBytes(dst []byte) []byte { 11847 hostarch.ByteOrder.PutUint32(dst[:4], uint32(x.UIDMin)) 11848 dst = dst[4:] 11849 hostarch.ByteOrder.PutUint32(dst[:4], uint32(x.UIDMax)) 11850 dst = dst[4:] 11851 hostarch.ByteOrder.PutUint32(dst[:4], uint32(x.GIDMin)) 11852 dst = dst[4:] 11853 hostarch.ByteOrder.PutUint32(dst[:4], uint32(x.GIDMax)) 11854 dst = dst[4:] 11855 dst[0] = byte(x.Match) 11856 dst = dst[1:] 11857 dst[0] = byte(x.Invert) 11858 dst = dst[1:] 11859 // Padding: dst[:sizeof(byte)*2] ~= [2]byte{0} 11860 dst = dst[1*(2):] 11861 return dst 11862 } 11863 11864 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 11865 func (x *XTOwnerMatchInfo) UnmarshalBytes(src []byte) []byte { 11866 x.UIDMin = uint32(hostarch.ByteOrder.Uint32(src[:4])) 11867 src = src[4:] 11868 x.UIDMax = uint32(hostarch.ByteOrder.Uint32(src[:4])) 11869 src = src[4:] 11870 x.GIDMin = uint32(hostarch.ByteOrder.Uint32(src[:4])) 11871 src = src[4:] 11872 x.GIDMax = uint32(hostarch.ByteOrder.Uint32(src[:4])) 11873 src = src[4:] 11874 x.Match = uint8(src[0]) 11875 src = src[1:] 11876 x.Invert = uint8(src[0]) 11877 src = src[1:] 11878 // Padding: ~ copy([2]byte(x._), src[:sizeof(byte)*2]) 11879 src = src[1*(2):] 11880 return src 11881 } 11882 11883 // Packed implements marshal.Marshallable.Packed. 11884 //go:nosplit 11885 func (x *XTOwnerMatchInfo) Packed() bool { 11886 return true 11887 } 11888 11889 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 11890 func (x *XTOwnerMatchInfo) MarshalUnsafe(dst []byte) []byte { 11891 size := x.SizeBytes() 11892 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 11893 return dst[size:] 11894 } 11895 11896 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 11897 func (x *XTOwnerMatchInfo) UnmarshalUnsafe(src []byte) []byte { 11898 size := x.SizeBytes() 11899 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 11900 return src[size:] 11901 } 11902 11903 // CopyOutN implements marshal.Marshallable.CopyOutN. 11904 func (x *XTOwnerMatchInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11905 // Construct a slice backed by dst's underlying memory. 11906 var buf []byte 11907 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11908 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11909 hdr.Len = x.SizeBytes() 11910 hdr.Cap = x.SizeBytes() 11911 11912 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 11913 // Since we bypassed the compiler's escape analysis, indicate that x 11914 // must live until the use above. 11915 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11916 return length, err 11917 } 11918 11919 // CopyOut implements marshal.Marshallable.CopyOut. 11920 func (x *XTOwnerMatchInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11921 return x.CopyOutN(cc, addr, x.SizeBytes()) 11922 } 11923 11924 // CopyInN implements marshal.Marshallable.CopyInN. 11925 func (x *XTOwnerMatchInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 11926 // Construct a slice backed by dst's underlying memory. 11927 var buf []byte 11928 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11929 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11930 hdr.Len = x.SizeBytes() 11931 hdr.Cap = x.SizeBytes() 11932 11933 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 11934 // Since we bypassed the compiler's escape analysis, indicate that x 11935 // must live until the use above. 11936 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11937 return length, err 11938 } 11939 11940 // CopyIn implements marshal.Marshallable.CopyIn. 11941 func (x *XTOwnerMatchInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 11942 return x.CopyInN(cc, addr, x.SizeBytes()) 11943 } 11944 11945 // WriteTo implements io.WriterTo.WriteTo. 11946 func (x *XTOwnerMatchInfo) WriteTo(writer io.Writer) (int64, error) { 11947 // Construct a slice backed by dst's underlying memory. 11948 var buf []byte 11949 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 11950 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 11951 hdr.Len = x.SizeBytes() 11952 hdr.Cap = x.SizeBytes() 11953 11954 length, err := writer.Write(buf) 11955 // Since we bypassed the compiler's escape analysis, indicate that x 11956 // must live until the use above. 11957 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 11958 return int64(length), err 11959 } 11960 11961 // SizeBytes implements marshal.Marshallable.SizeBytes. 11962 func (x *XTRedirectTarget) SizeBytes() int { 11963 return 0 + 11964 (*XTEntryTarget)(nil).SizeBytes() + 11965 (*NfNATIPV4MultiRangeCompat)(nil).SizeBytes() + 11966 1*4 11967 } 11968 11969 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 11970 func (x *XTRedirectTarget) MarshalBytes(dst []byte) []byte { 11971 dst = x.Target.MarshalUnsafe(dst) 11972 dst = x.NfRange.MarshalUnsafe(dst) 11973 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 11974 dst = dst[1*(4):] 11975 return dst 11976 } 11977 11978 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 11979 func (x *XTRedirectTarget) UnmarshalBytes(src []byte) []byte { 11980 src = x.Target.UnmarshalUnsafe(src) 11981 src = x.NfRange.UnmarshalUnsafe(src) 11982 // Padding: ~ copy([4]byte(x._), src[:sizeof(byte)*4]) 11983 src = src[1*(4):] 11984 return src 11985 } 11986 11987 // Packed implements marshal.Marshallable.Packed. 11988 //go:nosplit 11989 func (x *XTRedirectTarget) Packed() bool { 11990 return x.NfRange.Packed() && x.Target.Packed() 11991 } 11992 11993 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 11994 func (x *XTRedirectTarget) MarshalUnsafe(dst []byte) []byte { 11995 if x.NfRange.Packed() && x.Target.Packed() { 11996 size := x.SizeBytes() 11997 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 11998 return dst[size:] 11999 } 12000 // Type XTRedirectTarget doesn't have a packed layout in memory, fallback to MarshalBytes. 12001 return x.MarshalBytes(dst) 12002 } 12003 12004 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 12005 func (x *XTRedirectTarget) UnmarshalUnsafe(src []byte) []byte { 12006 if x.NfRange.Packed() && x.Target.Packed() { 12007 size := x.SizeBytes() 12008 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 12009 return src[size:] 12010 } 12011 // Type XTRedirectTarget doesn't have a packed layout in memory, fallback to UnmarshalBytes. 12012 return x.UnmarshalBytes(src) 12013 } 12014 12015 // CopyOutN implements marshal.Marshallable.CopyOutN. 12016 func (x *XTRedirectTarget) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12017 if !x.NfRange.Packed() && x.Target.Packed() { 12018 // Type XTRedirectTarget doesn't have a packed layout in memory, fall back to MarshalBytes. 12019 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 12020 x.MarshalBytes(buf) // escapes: fallback. 12021 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12022 } 12023 12024 // Construct a slice backed by dst's underlying memory. 12025 var buf []byte 12026 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12027 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12028 hdr.Len = x.SizeBytes() 12029 hdr.Cap = x.SizeBytes() 12030 12031 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12032 // Since we bypassed the compiler's escape analysis, indicate that x 12033 // must live until the use above. 12034 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12035 return length, err 12036 } 12037 12038 // CopyOut implements marshal.Marshallable.CopyOut. 12039 func (x *XTRedirectTarget) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12040 return x.CopyOutN(cc, addr, x.SizeBytes()) 12041 } 12042 12043 // CopyInN implements marshal.Marshallable.CopyInN. 12044 func (x *XTRedirectTarget) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12045 if !x.NfRange.Packed() && x.Target.Packed() { 12046 // Type XTRedirectTarget doesn't have a packed layout in memory, fall back to UnmarshalBytes. 12047 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 12048 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12049 // Unmarshal unconditionally. If we had a short copy-in, this results in a 12050 // partially unmarshalled struct. 12051 x.UnmarshalBytes(buf) // escapes: fallback. 12052 return length, err 12053 } 12054 12055 // Construct a slice backed by dst's underlying memory. 12056 var buf []byte 12057 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12058 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12059 hdr.Len = x.SizeBytes() 12060 hdr.Cap = x.SizeBytes() 12061 12062 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12063 // Since we bypassed the compiler's escape analysis, indicate that x 12064 // must live until the use above. 12065 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12066 return length, err 12067 } 12068 12069 // CopyIn implements marshal.Marshallable.CopyIn. 12070 func (x *XTRedirectTarget) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12071 return x.CopyInN(cc, addr, x.SizeBytes()) 12072 } 12073 12074 // WriteTo implements io.WriterTo.WriteTo. 12075 func (x *XTRedirectTarget) WriteTo(writer io.Writer) (int64, error) { 12076 if !x.NfRange.Packed() && x.Target.Packed() { 12077 // Type XTRedirectTarget doesn't have a packed layout in memory, fall back to MarshalBytes. 12078 buf := make([]byte, x.SizeBytes()) 12079 x.MarshalBytes(buf) 12080 length, err := writer.Write(buf) 12081 return int64(length), err 12082 } 12083 12084 // Construct a slice backed by dst's underlying memory. 12085 var buf []byte 12086 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12087 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12088 hdr.Len = x.SizeBytes() 12089 hdr.Cap = x.SizeBytes() 12090 12091 length, err := writer.Write(buf) 12092 // Since we bypassed the compiler's escape analysis, indicate that x 12093 // must live until the use above. 12094 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12095 return int64(length), err 12096 } 12097 12098 // SizeBytes implements marshal.Marshallable.SizeBytes. 12099 func (x *XTStandardTarget) SizeBytes() int { 12100 return 4 + 12101 (*XTEntryTarget)(nil).SizeBytes() + 12102 1*4 12103 } 12104 12105 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 12106 func (x *XTStandardTarget) MarshalBytes(dst []byte) []byte { 12107 dst = x.Target.MarshalUnsafe(dst) 12108 hostarch.ByteOrder.PutUint32(dst[:4], uint32(x.Verdict)) 12109 dst = dst[4:] 12110 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 12111 dst = dst[1*(4):] 12112 return dst 12113 } 12114 12115 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 12116 func (x *XTStandardTarget) UnmarshalBytes(src []byte) []byte { 12117 src = x.Target.UnmarshalUnsafe(src) 12118 x.Verdict = int32(hostarch.ByteOrder.Uint32(src[:4])) 12119 src = src[4:] 12120 // Padding: ~ copy([4]byte(x._), src[:sizeof(byte)*4]) 12121 src = src[1*(4):] 12122 return src 12123 } 12124 12125 // Packed implements marshal.Marshallable.Packed. 12126 //go:nosplit 12127 func (x *XTStandardTarget) Packed() bool { 12128 return x.Target.Packed() 12129 } 12130 12131 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 12132 func (x *XTStandardTarget) MarshalUnsafe(dst []byte) []byte { 12133 if x.Target.Packed() { 12134 size := x.SizeBytes() 12135 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 12136 return dst[size:] 12137 } 12138 // Type XTStandardTarget doesn't have a packed layout in memory, fallback to MarshalBytes. 12139 return x.MarshalBytes(dst) 12140 } 12141 12142 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 12143 func (x *XTStandardTarget) UnmarshalUnsafe(src []byte) []byte { 12144 if x.Target.Packed() { 12145 size := x.SizeBytes() 12146 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 12147 return src[size:] 12148 } 12149 // Type XTStandardTarget doesn't have a packed layout in memory, fallback to UnmarshalBytes. 12150 return x.UnmarshalBytes(src) 12151 } 12152 12153 // CopyOutN implements marshal.Marshallable.CopyOutN. 12154 func (x *XTStandardTarget) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12155 if !x.Target.Packed() { 12156 // Type XTStandardTarget doesn't have a packed layout in memory, fall back to MarshalBytes. 12157 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 12158 x.MarshalBytes(buf) // escapes: fallback. 12159 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12160 } 12161 12162 // Construct a slice backed by dst's underlying memory. 12163 var buf []byte 12164 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12165 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12166 hdr.Len = x.SizeBytes() 12167 hdr.Cap = x.SizeBytes() 12168 12169 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12170 // Since we bypassed the compiler's escape analysis, indicate that x 12171 // must live until the use above. 12172 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12173 return length, err 12174 } 12175 12176 // CopyOut implements marshal.Marshallable.CopyOut. 12177 func (x *XTStandardTarget) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12178 return x.CopyOutN(cc, addr, x.SizeBytes()) 12179 } 12180 12181 // CopyInN implements marshal.Marshallable.CopyInN. 12182 func (x *XTStandardTarget) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12183 if !x.Target.Packed() { 12184 // Type XTStandardTarget doesn't have a packed layout in memory, fall back to UnmarshalBytes. 12185 buf := cc.CopyScratchBuffer(x.SizeBytes()) // escapes: okay. 12186 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12187 // Unmarshal unconditionally. If we had a short copy-in, this results in a 12188 // partially unmarshalled struct. 12189 x.UnmarshalBytes(buf) // escapes: fallback. 12190 return length, err 12191 } 12192 12193 // Construct a slice backed by dst's underlying memory. 12194 var buf []byte 12195 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12196 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12197 hdr.Len = x.SizeBytes() 12198 hdr.Cap = x.SizeBytes() 12199 12200 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12201 // Since we bypassed the compiler's escape analysis, indicate that x 12202 // must live until the use above. 12203 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12204 return length, err 12205 } 12206 12207 // CopyIn implements marshal.Marshallable.CopyIn. 12208 func (x *XTStandardTarget) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12209 return x.CopyInN(cc, addr, x.SizeBytes()) 12210 } 12211 12212 // WriteTo implements io.WriterTo.WriteTo. 12213 func (x *XTStandardTarget) WriteTo(writer io.Writer) (int64, error) { 12214 if !x.Target.Packed() { 12215 // Type XTStandardTarget doesn't have a packed layout in memory, fall back to MarshalBytes. 12216 buf := make([]byte, x.SizeBytes()) 12217 x.MarshalBytes(buf) 12218 length, err := writer.Write(buf) 12219 return int64(length), err 12220 } 12221 12222 // Construct a slice backed by dst's underlying memory. 12223 var buf []byte 12224 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12225 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12226 hdr.Len = x.SizeBytes() 12227 hdr.Cap = x.SizeBytes() 12228 12229 length, err := writer.Write(buf) 12230 // Since we bypassed the compiler's escape analysis, indicate that x 12231 // must live until the use above. 12232 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12233 return int64(length), err 12234 } 12235 12236 // SizeBytes implements marshal.Marshallable.SizeBytes. 12237 func (x *XTTCP) SizeBytes() int { 12238 return 12 12239 } 12240 12241 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 12242 func (x *XTTCP) MarshalBytes(dst []byte) []byte { 12243 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.SourcePortStart)) 12244 dst = dst[2:] 12245 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.SourcePortEnd)) 12246 dst = dst[2:] 12247 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.DestinationPortStart)) 12248 dst = dst[2:] 12249 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.DestinationPortEnd)) 12250 dst = dst[2:] 12251 dst[0] = byte(x.Option) 12252 dst = dst[1:] 12253 dst[0] = byte(x.FlagMask) 12254 dst = dst[1:] 12255 dst[0] = byte(x.FlagCompare) 12256 dst = dst[1:] 12257 dst[0] = byte(x.InverseFlags) 12258 dst = dst[1:] 12259 return dst 12260 } 12261 12262 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 12263 func (x *XTTCP) UnmarshalBytes(src []byte) []byte { 12264 x.SourcePortStart = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12265 src = src[2:] 12266 x.SourcePortEnd = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12267 src = src[2:] 12268 x.DestinationPortStart = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12269 src = src[2:] 12270 x.DestinationPortEnd = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12271 src = src[2:] 12272 x.Option = uint8(src[0]) 12273 src = src[1:] 12274 x.FlagMask = uint8(src[0]) 12275 src = src[1:] 12276 x.FlagCompare = uint8(src[0]) 12277 src = src[1:] 12278 x.InverseFlags = uint8(src[0]) 12279 src = src[1:] 12280 return src 12281 } 12282 12283 // Packed implements marshal.Marshallable.Packed. 12284 //go:nosplit 12285 func (x *XTTCP) Packed() bool { 12286 return true 12287 } 12288 12289 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 12290 func (x *XTTCP) MarshalUnsafe(dst []byte) []byte { 12291 size := x.SizeBytes() 12292 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 12293 return dst[size:] 12294 } 12295 12296 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 12297 func (x *XTTCP) UnmarshalUnsafe(src []byte) []byte { 12298 size := x.SizeBytes() 12299 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 12300 return src[size:] 12301 } 12302 12303 // CopyOutN implements marshal.Marshallable.CopyOutN. 12304 func (x *XTTCP) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12305 // Construct a slice backed by dst's underlying memory. 12306 var buf []byte 12307 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12308 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12309 hdr.Len = x.SizeBytes() 12310 hdr.Cap = x.SizeBytes() 12311 12312 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12313 // Since we bypassed the compiler's escape analysis, indicate that x 12314 // must live until the use above. 12315 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12316 return length, err 12317 } 12318 12319 // CopyOut implements marshal.Marshallable.CopyOut. 12320 func (x *XTTCP) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12321 return x.CopyOutN(cc, addr, x.SizeBytes()) 12322 } 12323 12324 // CopyInN implements marshal.Marshallable.CopyInN. 12325 func (x *XTTCP) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12326 // Construct a slice backed by dst's underlying memory. 12327 var buf []byte 12328 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12329 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12330 hdr.Len = x.SizeBytes() 12331 hdr.Cap = x.SizeBytes() 12332 12333 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12334 // Since we bypassed the compiler's escape analysis, indicate that x 12335 // must live until the use above. 12336 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12337 return length, err 12338 } 12339 12340 // CopyIn implements marshal.Marshallable.CopyIn. 12341 func (x *XTTCP) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12342 return x.CopyInN(cc, addr, x.SizeBytes()) 12343 } 12344 12345 // WriteTo implements io.WriterTo.WriteTo. 12346 func (x *XTTCP) WriteTo(writer io.Writer) (int64, error) { 12347 // Construct a slice backed by dst's underlying memory. 12348 var buf []byte 12349 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12350 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12351 hdr.Len = x.SizeBytes() 12352 hdr.Cap = x.SizeBytes() 12353 12354 length, err := writer.Write(buf) 12355 // Since we bypassed the compiler's escape analysis, indicate that x 12356 // must live until the use above. 12357 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12358 return int64(length), err 12359 } 12360 12361 // SizeBytes implements marshal.Marshallable.SizeBytes. 12362 func (x *XTUDP) SizeBytes() int { 12363 return 10 12364 } 12365 12366 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 12367 func (x *XTUDP) MarshalBytes(dst []byte) []byte { 12368 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.SourcePortStart)) 12369 dst = dst[2:] 12370 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.SourcePortEnd)) 12371 dst = dst[2:] 12372 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.DestinationPortStart)) 12373 dst = dst[2:] 12374 hostarch.ByteOrder.PutUint16(dst[:2], uint16(x.DestinationPortEnd)) 12375 dst = dst[2:] 12376 dst[0] = byte(x.InverseFlags) 12377 dst = dst[1:] 12378 // Padding: dst[:sizeof(uint8)] ~= uint8(0) 12379 dst = dst[1:] 12380 return dst 12381 } 12382 12383 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 12384 func (x *XTUDP) UnmarshalBytes(src []byte) []byte { 12385 x.SourcePortStart = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12386 src = src[2:] 12387 x.SourcePortEnd = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12388 src = src[2:] 12389 x.DestinationPortStart = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12390 src = src[2:] 12391 x.DestinationPortEnd = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12392 src = src[2:] 12393 x.InverseFlags = uint8(src[0]) 12394 src = src[1:] 12395 // Padding: var _ uint8 ~= src[:sizeof(uint8)] 12396 src = src[1:] 12397 return src 12398 } 12399 12400 // Packed implements marshal.Marshallable.Packed. 12401 //go:nosplit 12402 func (x *XTUDP) Packed() bool { 12403 return true 12404 } 12405 12406 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 12407 func (x *XTUDP) MarshalUnsafe(dst []byte) []byte { 12408 size := x.SizeBytes() 12409 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(x), uintptr(size)) 12410 return dst[size:] 12411 } 12412 12413 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 12414 func (x *XTUDP) UnmarshalUnsafe(src []byte) []byte { 12415 size := x.SizeBytes() 12416 gohacks.Memmove(unsafe.Pointer(x), unsafe.Pointer(&src[0]), uintptr(size)) 12417 return src[size:] 12418 } 12419 12420 // CopyOutN implements marshal.Marshallable.CopyOutN. 12421 func (x *XTUDP) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12422 // Construct a slice backed by dst's underlying memory. 12423 var buf []byte 12424 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12425 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12426 hdr.Len = x.SizeBytes() 12427 hdr.Cap = x.SizeBytes() 12428 12429 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12430 // Since we bypassed the compiler's escape analysis, indicate that x 12431 // must live until the use above. 12432 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12433 return length, err 12434 } 12435 12436 // CopyOut implements marshal.Marshallable.CopyOut. 12437 func (x *XTUDP) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12438 return x.CopyOutN(cc, addr, x.SizeBytes()) 12439 } 12440 12441 // CopyInN implements marshal.Marshallable.CopyInN. 12442 func (x *XTUDP) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12443 // Construct a slice backed by dst's underlying memory. 12444 var buf []byte 12445 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12446 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12447 hdr.Len = x.SizeBytes() 12448 hdr.Cap = x.SizeBytes() 12449 12450 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12451 // Since we bypassed the compiler's escape analysis, indicate that x 12452 // must live until the use above. 12453 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12454 return length, err 12455 } 12456 12457 // CopyIn implements marshal.Marshallable.CopyIn. 12458 func (x *XTUDP) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12459 return x.CopyInN(cc, addr, x.SizeBytes()) 12460 } 12461 12462 // WriteTo implements io.WriterTo.WriteTo. 12463 func (x *XTUDP) WriteTo(writer io.Writer) (int64, error) { 12464 // Construct a slice backed by dst's underlying memory. 12465 var buf []byte 12466 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12467 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(x))) 12468 hdr.Len = x.SizeBytes() 12469 hdr.Cap = x.SizeBytes() 12470 12471 length, err := writer.Write(buf) 12472 // Since we bypassed the compiler's escape analysis, indicate that x 12473 // must live until the use above. 12474 runtime.KeepAlive(x) // escapes: replaced by intrinsic. 12475 return int64(length), err 12476 } 12477 12478 // SizeBytes implements marshal.Marshallable.SizeBytes. 12479 func (i *IP6TEntry) SizeBytes() int { 12480 return 12 + 12481 (*IP6TIP)(nil).SizeBytes() + 12482 1*4 + 12483 (*XTCounters)(nil).SizeBytes() 12484 } 12485 12486 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 12487 func (i *IP6TEntry) MarshalBytes(dst []byte) []byte { 12488 dst = i.IPv6.MarshalUnsafe(dst) 12489 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NFCache)) 12490 dst = dst[4:] 12491 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.TargetOffset)) 12492 dst = dst[2:] 12493 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.NextOffset)) 12494 dst = dst[2:] 12495 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Comeback)) 12496 dst = dst[4:] 12497 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 12498 dst = dst[1*(4):] 12499 dst = i.Counters.MarshalUnsafe(dst) 12500 return dst 12501 } 12502 12503 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 12504 func (i *IP6TEntry) UnmarshalBytes(src []byte) []byte { 12505 src = i.IPv6.UnmarshalUnsafe(src) 12506 i.NFCache = uint32(hostarch.ByteOrder.Uint32(src[:4])) 12507 src = src[4:] 12508 i.TargetOffset = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12509 src = src[2:] 12510 i.NextOffset = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12511 src = src[2:] 12512 i.Comeback = uint32(hostarch.ByteOrder.Uint32(src[:4])) 12513 src = src[4:] 12514 // Padding: ~ copy([4]byte(i._), src[:sizeof(byte)*4]) 12515 src = src[1*(4):] 12516 src = i.Counters.UnmarshalUnsafe(src) 12517 return src 12518 } 12519 12520 // Packed implements marshal.Marshallable.Packed. 12521 //go:nosplit 12522 func (i *IP6TEntry) Packed() bool { 12523 return i.Counters.Packed() && i.IPv6.Packed() 12524 } 12525 12526 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 12527 func (i *IP6TEntry) MarshalUnsafe(dst []byte) []byte { 12528 if i.Counters.Packed() && i.IPv6.Packed() { 12529 size := i.SizeBytes() 12530 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 12531 return dst[size:] 12532 } 12533 // Type IP6TEntry doesn't have a packed layout in memory, fallback to MarshalBytes. 12534 return i.MarshalBytes(dst) 12535 } 12536 12537 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 12538 func (i *IP6TEntry) UnmarshalUnsafe(src []byte) []byte { 12539 if i.Counters.Packed() && i.IPv6.Packed() { 12540 size := i.SizeBytes() 12541 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 12542 return src[size:] 12543 } 12544 // Type IP6TEntry doesn't have a packed layout in memory, fallback to UnmarshalBytes. 12545 return i.UnmarshalBytes(src) 12546 } 12547 12548 // CopyOutN implements marshal.Marshallable.CopyOutN. 12549 func (i *IP6TEntry) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12550 if !i.Counters.Packed() && i.IPv6.Packed() { 12551 // Type IP6TEntry doesn't have a packed layout in memory, fall back to MarshalBytes. 12552 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 12553 i.MarshalBytes(buf) // escapes: fallback. 12554 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12555 } 12556 12557 // Construct a slice backed by dst's underlying memory. 12558 var buf []byte 12559 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12560 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 12561 hdr.Len = i.SizeBytes() 12562 hdr.Cap = i.SizeBytes() 12563 12564 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12565 // Since we bypassed the compiler's escape analysis, indicate that i 12566 // must live until the use above. 12567 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 12568 return length, err 12569 } 12570 12571 // CopyOut implements marshal.Marshallable.CopyOut. 12572 func (i *IP6TEntry) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12573 return i.CopyOutN(cc, addr, i.SizeBytes()) 12574 } 12575 12576 // CopyInN implements marshal.Marshallable.CopyInN. 12577 func (i *IP6TEntry) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12578 if !i.Counters.Packed() && i.IPv6.Packed() { 12579 // Type IP6TEntry doesn't have a packed layout in memory, fall back to UnmarshalBytes. 12580 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 12581 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12582 // Unmarshal unconditionally. If we had a short copy-in, this results in a 12583 // partially unmarshalled struct. 12584 i.UnmarshalBytes(buf) // escapes: fallback. 12585 return length, err 12586 } 12587 12588 // Construct a slice backed by dst's underlying memory. 12589 var buf []byte 12590 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12591 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 12592 hdr.Len = i.SizeBytes() 12593 hdr.Cap = i.SizeBytes() 12594 12595 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12596 // Since we bypassed the compiler's escape analysis, indicate that i 12597 // must live until the use above. 12598 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 12599 return length, err 12600 } 12601 12602 // CopyIn implements marshal.Marshallable.CopyIn. 12603 func (i *IP6TEntry) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12604 return i.CopyInN(cc, addr, i.SizeBytes()) 12605 } 12606 12607 // WriteTo implements io.WriterTo.WriteTo. 12608 func (i *IP6TEntry) WriteTo(writer io.Writer) (int64, error) { 12609 if !i.Counters.Packed() && i.IPv6.Packed() { 12610 // Type IP6TEntry doesn't have a packed layout in memory, fall back to MarshalBytes. 12611 buf := make([]byte, i.SizeBytes()) 12612 i.MarshalBytes(buf) 12613 length, err := writer.Write(buf) 12614 return int64(length), err 12615 } 12616 12617 // Construct a slice backed by dst's underlying memory. 12618 var buf []byte 12619 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12620 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 12621 hdr.Len = i.SizeBytes() 12622 hdr.Cap = i.SizeBytes() 12623 12624 length, err := writer.Write(buf) 12625 // Since we bypassed the compiler's escape analysis, indicate that i 12626 // must live until the use above. 12627 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 12628 return int64(length), err 12629 } 12630 12631 // SizeBytes implements marshal.Marshallable.SizeBytes. 12632 func (i *IP6TIP) SizeBytes() int { 12633 return 5 + 12634 (*Inet6Addr)(nil).SizeBytes() + 12635 (*Inet6Addr)(nil).SizeBytes() + 12636 (*Inet6Addr)(nil).SizeBytes() + 12637 (*Inet6Addr)(nil).SizeBytes() + 12638 1*IFNAMSIZ + 12639 1*IFNAMSIZ + 12640 1*IFNAMSIZ + 12641 1*IFNAMSIZ + 12642 1*3 12643 } 12644 12645 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 12646 func (i *IP6TIP) MarshalBytes(dst []byte) []byte { 12647 dst = i.Src.MarshalUnsafe(dst) 12648 dst = i.Dst.MarshalUnsafe(dst) 12649 dst = i.SrcMask.MarshalUnsafe(dst) 12650 dst = i.DstMask.MarshalUnsafe(dst) 12651 for idx := 0; idx < IFNAMSIZ; idx++ { 12652 dst[0] = byte(i.InputInterface[idx]) 12653 dst = dst[1:] 12654 } 12655 for idx := 0; idx < IFNAMSIZ; idx++ { 12656 dst[0] = byte(i.OutputInterface[idx]) 12657 dst = dst[1:] 12658 } 12659 for idx := 0; idx < IFNAMSIZ; idx++ { 12660 dst[0] = byte(i.InputInterfaceMask[idx]) 12661 dst = dst[1:] 12662 } 12663 for idx := 0; idx < IFNAMSIZ; idx++ { 12664 dst[0] = byte(i.OutputInterfaceMask[idx]) 12665 dst = dst[1:] 12666 } 12667 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Protocol)) 12668 dst = dst[2:] 12669 dst[0] = byte(i.TOS) 12670 dst = dst[1:] 12671 dst[0] = byte(i.Flags) 12672 dst = dst[1:] 12673 dst[0] = byte(i.InverseFlags) 12674 dst = dst[1:] 12675 // Padding: dst[:sizeof(byte)*3] ~= [3]byte{0} 12676 dst = dst[1*(3):] 12677 return dst 12678 } 12679 12680 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 12681 func (i *IP6TIP) UnmarshalBytes(src []byte) []byte { 12682 src = i.Src.UnmarshalUnsafe(src) 12683 src = i.Dst.UnmarshalUnsafe(src) 12684 src = i.SrcMask.UnmarshalUnsafe(src) 12685 src = i.DstMask.UnmarshalUnsafe(src) 12686 for idx := 0; idx < IFNAMSIZ; idx++ { 12687 i.InputInterface[idx] = src[0] 12688 src = src[1:] 12689 } 12690 for idx := 0; idx < IFNAMSIZ; idx++ { 12691 i.OutputInterface[idx] = src[0] 12692 src = src[1:] 12693 } 12694 for idx := 0; idx < IFNAMSIZ; idx++ { 12695 i.InputInterfaceMask[idx] = src[0] 12696 src = src[1:] 12697 } 12698 for idx := 0; idx < IFNAMSIZ; idx++ { 12699 i.OutputInterfaceMask[idx] = src[0] 12700 src = src[1:] 12701 } 12702 i.Protocol = uint16(hostarch.ByteOrder.Uint16(src[:2])) 12703 src = src[2:] 12704 i.TOS = uint8(src[0]) 12705 src = src[1:] 12706 i.Flags = uint8(src[0]) 12707 src = src[1:] 12708 i.InverseFlags = uint8(src[0]) 12709 src = src[1:] 12710 // Padding: ~ copy([3]byte(i._), src[:sizeof(byte)*3]) 12711 src = src[1*(3):] 12712 return src 12713 } 12714 12715 // Packed implements marshal.Marshallable.Packed. 12716 //go:nosplit 12717 func (i *IP6TIP) Packed() bool { 12718 return i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() 12719 } 12720 12721 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 12722 func (i *IP6TIP) MarshalUnsafe(dst []byte) []byte { 12723 if i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 12724 size := i.SizeBytes() 12725 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 12726 return dst[size:] 12727 } 12728 // Type IP6TIP doesn't have a packed layout in memory, fallback to MarshalBytes. 12729 return i.MarshalBytes(dst) 12730 } 12731 12732 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 12733 func (i *IP6TIP) UnmarshalUnsafe(src []byte) []byte { 12734 if i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 12735 size := i.SizeBytes() 12736 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 12737 return src[size:] 12738 } 12739 // Type IP6TIP doesn't have a packed layout in memory, fallback to UnmarshalBytes. 12740 return i.UnmarshalBytes(src) 12741 } 12742 12743 // CopyOutN implements marshal.Marshallable.CopyOutN. 12744 func (i *IP6TIP) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12745 if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 12746 // Type IP6TIP doesn't have a packed layout in memory, fall back to MarshalBytes. 12747 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 12748 i.MarshalBytes(buf) // escapes: fallback. 12749 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12750 } 12751 12752 // Construct a slice backed by dst's underlying memory. 12753 var buf []byte 12754 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12755 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 12756 hdr.Len = i.SizeBytes() 12757 hdr.Cap = i.SizeBytes() 12758 12759 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12760 // Since we bypassed the compiler's escape analysis, indicate that i 12761 // must live until the use above. 12762 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 12763 return length, err 12764 } 12765 12766 // CopyOut implements marshal.Marshallable.CopyOut. 12767 func (i *IP6TIP) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12768 return i.CopyOutN(cc, addr, i.SizeBytes()) 12769 } 12770 12771 // CopyInN implements marshal.Marshallable.CopyInN. 12772 func (i *IP6TIP) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12773 if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 12774 // Type IP6TIP doesn't have a packed layout in memory, fall back to UnmarshalBytes. 12775 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 12776 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12777 // Unmarshal unconditionally. If we had a short copy-in, this results in a 12778 // partially unmarshalled struct. 12779 i.UnmarshalBytes(buf) // escapes: fallback. 12780 return length, err 12781 } 12782 12783 // Construct a slice backed by dst's underlying memory. 12784 var buf []byte 12785 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12786 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 12787 hdr.Len = i.SizeBytes() 12788 hdr.Cap = i.SizeBytes() 12789 12790 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12791 // Since we bypassed the compiler's escape analysis, indicate that i 12792 // must live until the use above. 12793 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 12794 return length, err 12795 } 12796 12797 // CopyIn implements marshal.Marshallable.CopyIn. 12798 func (i *IP6TIP) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12799 return i.CopyInN(cc, addr, i.SizeBytes()) 12800 } 12801 12802 // WriteTo implements io.WriterTo.WriteTo. 12803 func (i *IP6TIP) WriteTo(writer io.Writer) (int64, error) { 12804 if !i.Dst.Packed() && i.DstMask.Packed() && i.Src.Packed() && i.SrcMask.Packed() { 12805 // Type IP6TIP doesn't have a packed layout in memory, fall back to MarshalBytes. 12806 buf := make([]byte, i.SizeBytes()) 12807 i.MarshalBytes(buf) 12808 length, err := writer.Write(buf) 12809 return int64(length), err 12810 } 12811 12812 // Construct a slice backed by dst's underlying memory. 12813 var buf []byte 12814 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12815 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 12816 hdr.Len = i.SizeBytes() 12817 hdr.Cap = i.SizeBytes() 12818 12819 length, err := writer.Write(buf) 12820 // Since we bypassed the compiler's escape analysis, indicate that i 12821 // must live until the use above. 12822 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 12823 return int64(length), err 12824 } 12825 12826 // SizeBytes implements marshal.Marshallable.SizeBytes. 12827 func (i *IP6TReplace) SizeBytes() int { 12828 return 24 + 12829 (*TableName)(nil).SizeBytes() + 12830 4*NF_INET_NUMHOOKS + 12831 4*NF_INET_NUMHOOKS 12832 } 12833 12834 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 12835 func (i *IP6TReplace) MarshalBytes(dst []byte) []byte { 12836 dst = i.Name.MarshalUnsafe(dst) 12837 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.ValidHooks)) 12838 dst = dst[4:] 12839 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumEntries)) 12840 dst = dst[4:] 12841 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Size)) 12842 dst = dst[4:] 12843 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 12844 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.HookEntry[idx])) 12845 dst = dst[4:] 12846 } 12847 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 12848 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Underflow[idx])) 12849 dst = dst[4:] 12850 } 12851 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.NumCounters)) 12852 dst = dst[4:] 12853 hostarch.ByteOrder.PutUint64(dst[:8], uint64(i.Counters)) 12854 dst = dst[8:] 12855 return dst 12856 } 12857 12858 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 12859 func (i *IP6TReplace) UnmarshalBytes(src []byte) []byte { 12860 src = i.Name.UnmarshalUnsafe(src) 12861 i.ValidHooks = uint32(hostarch.ByteOrder.Uint32(src[:4])) 12862 src = src[4:] 12863 i.NumEntries = uint32(hostarch.ByteOrder.Uint32(src[:4])) 12864 src = src[4:] 12865 i.Size = uint32(hostarch.ByteOrder.Uint32(src[:4])) 12866 src = src[4:] 12867 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 12868 i.HookEntry[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 12869 src = src[4:] 12870 } 12871 for idx := 0; idx < NF_INET_NUMHOOKS; idx++ { 12872 i.Underflow[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 12873 src = src[4:] 12874 } 12875 i.NumCounters = uint32(hostarch.ByteOrder.Uint32(src[:4])) 12876 src = src[4:] 12877 i.Counters = uint64(hostarch.ByteOrder.Uint64(src[:8])) 12878 src = src[8:] 12879 return src 12880 } 12881 12882 // Packed implements marshal.Marshallable.Packed. 12883 //go:nosplit 12884 func (i *IP6TReplace) Packed() bool { 12885 return i.Name.Packed() 12886 } 12887 12888 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 12889 func (i *IP6TReplace) MarshalUnsafe(dst []byte) []byte { 12890 if i.Name.Packed() { 12891 size := i.SizeBytes() 12892 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 12893 return dst[size:] 12894 } 12895 // Type IP6TReplace doesn't have a packed layout in memory, fallback to MarshalBytes. 12896 return i.MarshalBytes(dst) 12897 } 12898 12899 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 12900 func (i *IP6TReplace) UnmarshalUnsafe(src []byte) []byte { 12901 if i.Name.Packed() { 12902 size := i.SizeBytes() 12903 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 12904 return src[size:] 12905 } 12906 // Type IP6TReplace doesn't have a packed layout in memory, fallback to UnmarshalBytes. 12907 return i.UnmarshalBytes(src) 12908 } 12909 12910 // CopyOutN implements marshal.Marshallable.CopyOutN. 12911 func (i *IP6TReplace) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12912 if !i.Name.Packed() { 12913 // Type IP6TReplace doesn't have a packed layout in memory, fall back to MarshalBytes. 12914 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 12915 i.MarshalBytes(buf) // escapes: fallback. 12916 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12917 } 12918 12919 // Construct a slice backed by dst's underlying memory. 12920 var buf []byte 12921 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12922 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 12923 hdr.Len = i.SizeBytes() 12924 hdr.Cap = i.SizeBytes() 12925 12926 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 12927 // Since we bypassed the compiler's escape analysis, indicate that i 12928 // must live until the use above. 12929 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 12930 return length, err 12931 } 12932 12933 // CopyOut implements marshal.Marshallable.CopyOut. 12934 func (i *IP6TReplace) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12935 return i.CopyOutN(cc, addr, i.SizeBytes()) 12936 } 12937 12938 // CopyInN implements marshal.Marshallable.CopyInN. 12939 func (i *IP6TReplace) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 12940 if !i.Name.Packed() { 12941 // Type IP6TReplace doesn't have a packed layout in memory, fall back to UnmarshalBytes. 12942 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 12943 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12944 // Unmarshal unconditionally. If we had a short copy-in, this results in a 12945 // partially unmarshalled struct. 12946 i.UnmarshalBytes(buf) // escapes: fallback. 12947 return length, err 12948 } 12949 12950 // Construct a slice backed by dst's underlying memory. 12951 var buf []byte 12952 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12953 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 12954 hdr.Len = i.SizeBytes() 12955 hdr.Cap = i.SizeBytes() 12956 12957 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 12958 // Since we bypassed the compiler's escape analysis, indicate that i 12959 // must live until the use above. 12960 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 12961 return length, err 12962 } 12963 12964 // CopyIn implements marshal.Marshallable.CopyIn. 12965 func (i *IP6TReplace) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 12966 return i.CopyInN(cc, addr, i.SizeBytes()) 12967 } 12968 12969 // WriteTo implements io.WriterTo.WriteTo. 12970 func (i *IP6TReplace) WriteTo(writer io.Writer) (int64, error) { 12971 if !i.Name.Packed() { 12972 // Type IP6TReplace doesn't have a packed layout in memory, fall back to MarshalBytes. 12973 buf := make([]byte, i.SizeBytes()) 12974 i.MarshalBytes(buf) 12975 length, err := writer.Write(buf) 12976 return int64(length), err 12977 } 12978 12979 // Construct a slice backed by dst's underlying memory. 12980 var buf []byte 12981 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 12982 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 12983 hdr.Len = i.SizeBytes() 12984 hdr.Cap = i.SizeBytes() 12985 12986 length, err := writer.Write(buf) 12987 // Since we bypassed the compiler's escape analysis, indicate that i 12988 // must live until the use above. 12989 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 12990 return int64(length), err 12991 } 12992 12993 // Packed implements marshal.Marshallable.Packed. 12994 //go:nosplit 12995 func (ke *KernelIP6TEntry) Packed() bool { 12996 // Type KernelIP6TEntry is dynamic so it might have slice/string headers. Hence, it is not packed. 12997 return false 12998 } 12999 13000 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 13001 func (ke *KernelIP6TEntry) MarshalUnsafe(dst []byte) []byte { 13002 // Type KernelIP6TEntry doesn't have a packed layout in memory, fallback to MarshalBytes. 13003 return ke.MarshalBytes(dst) 13004 } 13005 13006 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 13007 func (ke *KernelIP6TEntry) UnmarshalUnsafe(src []byte) []byte { 13008 // Type KernelIP6TEntry doesn't have a packed layout in memory, fallback to UnmarshalBytes. 13009 return ke.UnmarshalBytes(src) 13010 } 13011 13012 // CopyOutN implements marshal.Marshallable.CopyOutN. 13013 //go:nosplit 13014 func (ke *KernelIP6TEntry) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13015 // Type KernelIP6TEntry doesn't have a packed layout in memory, fall back to MarshalBytes. 13016 buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. 13017 ke.MarshalBytes(buf) // escapes: fallback. 13018 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13019 } 13020 13021 // CopyOut implements marshal.Marshallable.CopyOut. 13022 func (ke *KernelIP6TEntry) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13023 return ke.CopyOutN(cc, addr, ke.SizeBytes()) 13024 } 13025 13026 // CopyInN implements marshal.Marshallable.CopyInN. 13027 //go:nosplit 13028 func (ke *KernelIP6TEntry) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13029 // Type KernelIP6TEntry doesn't have a packed layout in memory, fall back to UnmarshalBytes. 13030 buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. 13031 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 13032 // Unmarshal unconditionally. If we had a short copy-in, this results in a 13033 // partially unmarshalled struct. 13034 ke.UnmarshalBytes(buf) // escapes: fallback. 13035 return length, err 13036 } 13037 13038 // CopyIn implements marshal.Marshallable.CopyIn. 13039 func (ke *KernelIP6TEntry) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13040 return ke.CopyInN(cc, addr, ke.SizeBytes()) 13041 } 13042 13043 // WriteTo implements io.WriterTo.WriteTo. 13044 func (ke *KernelIP6TEntry) WriteTo(writer io.Writer) (int64, error) { 13045 // Type KernelIP6TEntry doesn't have a packed layout in memory, fall back to MarshalBytes. 13046 buf := make([]byte, ke.SizeBytes()) 13047 ke.MarshalBytes(buf) 13048 length, err := writer.Write(buf) 13049 return int64(length), err 13050 } 13051 13052 // Packed implements marshal.Marshallable.Packed. 13053 //go:nosplit 13054 func (ke *KernelIP6TGetEntries) Packed() bool { 13055 // Type KernelIP6TGetEntries is dynamic so it might have slice/string headers. Hence, it is not packed. 13056 return false 13057 } 13058 13059 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 13060 func (ke *KernelIP6TGetEntries) MarshalUnsafe(dst []byte) []byte { 13061 // Type KernelIP6TGetEntries doesn't have a packed layout in memory, fallback to MarshalBytes. 13062 return ke.MarshalBytes(dst) 13063 } 13064 13065 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 13066 func (ke *KernelIP6TGetEntries) UnmarshalUnsafe(src []byte) []byte { 13067 // Type KernelIP6TGetEntries doesn't have a packed layout in memory, fallback to UnmarshalBytes. 13068 return ke.UnmarshalBytes(src) 13069 } 13070 13071 // CopyOutN implements marshal.Marshallable.CopyOutN. 13072 //go:nosplit 13073 func (ke *KernelIP6TGetEntries) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13074 // Type KernelIP6TGetEntries doesn't have a packed layout in memory, fall back to MarshalBytes. 13075 buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. 13076 ke.MarshalBytes(buf) // escapes: fallback. 13077 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13078 } 13079 13080 // CopyOut implements marshal.Marshallable.CopyOut. 13081 func (ke *KernelIP6TGetEntries) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13082 return ke.CopyOutN(cc, addr, ke.SizeBytes()) 13083 } 13084 13085 // CopyInN implements marshal.Marshallable.CopyInN. 13086 //go:nosplit 13087 func (ke *KernelIP6TGetEntries) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13088 // Type KernelIP6TGetEntries doesn't have a packed layout in memory, fall back to UnmarshalBytes. 13089 buf := cc.CopyScratchBuffer(ke.SizeBytes()) // escapes: okay. 13090 length, err := cc.CopyInBytes(addr, buf) // escapes: okay. 13091 // Unmarshal unconditionally. If we had a short copy-in, this results in a 13092 // partially unmarshalled struct. 13093 ke.UnmarshalBytes(buf) // escapes: fallback. 13094 return length, err 13095 } 13096 13097 // CopyIn implements marshal.Marshallable.CopyIn. 13098 func (ke *KernelIP6TGetEntries) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13099 return ke.CopyInN(cc, addr, ke.SizeBytes()) 13100 } 13101 13102 // WriteTo implements io.WriterTo.WriteTo. 13103 func (ke *KernelIP6TGetEntries) WriteTo(writer io.Writer) (int64, error) { 13104 // Type KernelIP6TGetEntries doesn't have a packed layout in memory, fall back to MarshalBytes. 13105 buf := make([]byte, ke.SizeBytes()) 13106 ke.MarshalBytes(buf) 13107 length, err := writer.Write(buf) 13108 return int64(length), err 13109 } 13110 13111 // SizeBytes implements marshal.Marshallable.SizeBytes. 13112 func (n *NFNATRange) SizeBytes() int { 13113 return 8 + 13114 (*Inet6Addr)(nil).SizeBytes() + 13115 (*Inet6Addr)(nil).SizeBytes() 13116 } 13117 13118 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 13119 func (n *NFNATRange) MarshalBytes(dst []byte) []byte { 13120 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 13121 dst = dst[4:] 13122 dst = n.MinAddr.MarshalUnsafe(dst) 13123 dst = n.MaxAddr.MarshalUnsafe(dst) 13124 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MinProto)) 13125 dst = dst[2:] 13126 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MaxProto)) 13127 dst = dst[2:] 13128 return dst 13129 } 13130 13131 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 13132 func (n *NFNATRange) UnmarshalBytes(src []byte) []byte { 13133 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 13134 src = src[4:] 13135 src = n.MinAddr.UnmarshalUnsafe(src) 13136 src = n.MaxAddr.UnmarshalUnsafe(src) 13137 n.MinProto = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13138 src = src[2:] 13139 n.MaxProto = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13140 src = src[2:] 13141 return src 13142 } 13143 13144 // Packed implements marshal.Marshallable.Packed. 13145 //go:nosplit 13146 func (n *NFNATRange) Packed() bool { 13147 return n.MaxAddr.Packed() && n.MinAddr.Packed() 13148 } 13149 13150 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 13151 func (n *NFNATRange) MarshalUnsafe(dst []byte) []byte { 13152 if n.MaxAddr.Packed() && n.MinAddr.Packed() { 13153 size := n.SizeBytes() 13154 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 13155 return dst[size:] 13156 } 13157 // Type NFNATRange doesn't have a packed layout in memory, fallback to MarshalBytes. 13158 return n.MarshalBytes(dst) 13159 } 13160 13161 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 13162 func (n *NFNATRange) UnmarshalUnsafe(src []byte) []byte { 13163 if n.MaxAddr.Packed() && n.MinAddr.Packed() { 13164 size := n.SizeBytes() 13165 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 13166 return src[size:] 13167 } 13168 // Type NFNATRange doesn't have a packed layout in memory, fallback to UnmarshalBytes. 13169 return n.UnmarshalBytes(src) 13170 } 13171 13172 // CopyOutN implements marshal.Marshallable.CopyOutN. 13173 func (n *NFNATRange) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13174 if !n.MaxAddr.Packed() && n.MinAddr.Packed() { 13175 // Type NFNATRange doesn't have a packed layout in memory, fall back to MarshalBytes. 13176 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 13177 n.MarshalBytes(buf) // escapes: fallback. 13178 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13179 } 13180 13181 // Construct a slice backed by dst's underlying memory. 13182 var buf []byte 13183 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13184 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13185 hdr.Len = n.SizeBytes() 13186 hdr.Cap = n.SizeBytes() 13187 13188 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13189 // Since we bypassed the compiler's escape analysis, indicate that n 13190 // must live until the use above. 13191 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13192 return length, err 13193 } 13194 13195 // CopyOut implements marshal.Marshallable.CopyOut. 13196 func (n *NFNATRange) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13197 return n.CopyOutN(cc, addr, n.SizeBytes()) 13198 } 13199 13200 // CopyInN implements marshal.Marshallable.CopyInN. 13201 func (n *NFNATRange) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13202 if !n.MaxAddr.Packed() && n.MinAddr.Packed() { 13203 // Type NFNATRange doesn't have a packed layout in memory, fall back to UnmarshalBytes. 13204 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 13205 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13206 // Unmarshal unconditionally. If we had a short copy-in, this results in a 13207 // partially unmarshalled struct. 13208 n.UnmarshalBytes(buf) // escapes: fallback. 13209 return length, err 13210 } 13211 13212 // Construct a slice backed by dst's underlying memory. 13213 var buf []byte 13214 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13215 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13216 hdr.Len = n.SizeBytes() 13217 hdr.Cap = n.SizeBytes() 13218 13219 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13220 // Since we bypassed the compiler's escape analysis, indicate that n 13221 // must live until the use above. 13222 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13223 return length, err 13224 } 13225 13226 // CopyIn implements marshal.Marshallable.CopyIn. 13227 func (n *NFNATRange) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13228 return n.CopyInN(cc, addr, n.SizeBytes()) 13229 } 13230 13231 // WriteTo implements io.WriterTo.WriteTo. 13232 func (n *NFNATRange) WriteTo(writer io.Writer) (int64, error) { 13233 if !n.MaxAddr.Packed() && n.MinAddr.Packed() { 13234 // Type NFNATRange doesn't have a packed layout in memory, fall back to MarshalBytes. 13235 buf := make([]byte, n.SizeBytes()) 13236 n.MarshalBytes(buf) 13237 length, err := writer.Write(buf) 13238 return int64(length), err 13239 } 13240 13241 // Construct a slice backed by dst's underlying memory. 13242 var buf []byte 13243 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13244 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13245 hdr.Len = n.SizeBytes() 13246 hdr.Cap = n.SizeBytes() 13247 13248 length, err := writer.Write(buf) 13249 // Since we bypassed the compiler's escape analysis, indicate that n 13250 // must live until the use above. 13251 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13252 return int64(length), err 13253 } 13254 13255 // SizeBytes implements marshal.Marshallable.SizeBytes. 13256 func (n *NFNATRange2) SizeBytes() int { 13257 return 10 + 13258 (*Inet6Addr)(nil).SizeBytes() + 13259 (*Inet6Addr)(nil).SizeBytes() + 13260 1*6 13261 } 13262 13263 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 13264 func (n *NFNATRange2) MarshalBytes(dst []byte) []byte { 13265 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Flags)) 13266 dst = dst[4:] 13267 dst = n.MinAddr.MarshalUnsafe(dst) 13268 dst = n.MaxAddr.MarshalUnsafe(dst) 13269 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MinProto)) 13270 dst = dst[2:] 13271 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.MaxProto)) 13272 dst = dst[2:] 13273 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.BaseProto)) 13274 dst = dst[2:] 13275 // Padding: dst[:sizeof(byte)*6] ~= [6]byte{0} 13276 dst = dst[1*(6):] 13277 return dst 13278 } 13279 13280 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 13281 func (n *NFNATRange2) UnmarshalBytes(src []byte) []byte { 13282 n.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 13283 src = src[4:] 13284 src = n.MinAddr.UnmarshalUnsafe(src) 13285 src = n.MaxAddr.UnmarshalUnsafe(src) 13286 n.MinProto = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13287 src = src[2:] 13288 n.MaxProto = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13289 src = src[2:] 13290 n.BaseProto = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13291 src = src[2:] 13292 // Padding: ~ copy([6]byte(n._), src[:sizeof(byte)*6]) 13293 src = src[1*(6):] 13294 return src 13295 } 13296 13297 // Packed implements marshal.Marshallable.Packed. 13298 //go:nosplit 13299 func (n *NFNATRange2) Packed() bool { 13300 return n.MaxAddr.Packed() && n.MinAddr.Packed() 13301 } 13302 13303 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 13304 func (n *NFNATRange2) MarshalUnsafe(dst []byte) []byte { 13305 if n.MaxAddr.Packed() && n.MinAddr.Packed() { 13306 size := n.SizeBytes() 13307 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 13308 return dst[size:] 13309 } 13310 // Type NFNATRange2 doesn't have a packed layout in memory, fallback to MarshalBytes. 13311 return n.MarshalBytes(dst) 13312 } 13313 13314 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 13315 func (n *NFNATRange2) UnmarshalUnsafe(src []byte) []byte { 13316 if n.MaxAddr.Packed() && n.MinAddr.Packed() { 13317 size := n.SizeBytes() 13318 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 13319 return src[size:] 13320 } 13321 // Type NFNATRange2 doesn't have a packed layout in memory, fallback to UnmarshalBytes. 13322 return n.UnmarshalBytes(src) 13323 } 13324 13325 // CopyOutN implements marshal.Marshallable.CopyOutN. 13326 func (n *NFNATRange2) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13327 if !n.MaxAddr.Packed() && n.MinAddr.Packed() { 13328 // Type NFNATRange2 doesn't have a packed layout in memory, fall back to MarshalBytes. 13329 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 13330 n.MarshalBytes(buf) // escapes: fallback. 13331 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13332 } 13333 13334 // Construct a slice backed by dst's underlying memory. 13335 var buf []byte 13336 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13337 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13338 hdr.Len = n.SizeBytes() 13339 hdr.Cap = n.SizeBytes() 13340 13341 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13342 // Since we bypassed the compiler's escape analysis, indicate that n 13343 // must live until the use above. 13344 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13345 return length, err 13346 } 13347 13348 // CopyOut implements marshal.Marshallable.CopyOut. 13349 func (n *NFNATRange2) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13350 return n.CopyOutN(cc, addr, n.SizeBytes()) 13351 } 13352 13353 // CopyInN implements marshal.Marshallable.CopyInN. 13354 func (n *NFNATRange2) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13355 if !n.MaxAddr.Packed() && n.MinAddr.Packed() { 13356 // Type NFNATRange2 doesn't have a packed layout in memory, fall back to UnmarshalBytes. 13357 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 13358 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13359 // Unmarshal unconditionally. If we had a short copy-in, this results in a 13360 // partially unmarshalled struct. 13361 n.UnmarshalBytes(buf) // escapes: fallback. 13362 return length, err 13363 } 13364 13365 // Construct a slice backed by dst's underlying memory. 13366 var buf []byte 13367 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13368 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13369 hdr.Len = n.SizeBytes() 13370 hdr.Cap = n.SizeBytes() 13371 13372 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13373 // Since we bypassed the compiler's escape analysis, indicate that n 13374 // must live until the use above. 13375 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13376 return length, err 13377 } 13378 13379 // CopyIn implements marshal.Marshallable.CopyIn. 13380 func (n *NFNATRange2) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13381 return n.CopyInN(cc, addr, n.SizeBytes()) 13382 } 13383 13384 // WriteTo implements io.WriterTo.WriteTo. 13385 func (n *NFNATRange2) WriteTo(writer io.Writer) (int64, error) { 13386 if !n.MaxAddr.Packed() && n.MinAddr.Packed() { 13387 // Type NFNATRange2 doesn't have a packed layout in memory, fall back to MarshalBytes. 13388 buf := make([]byte, n.SizeBytes()) 13389 n.MarshalBytes(buf) 13390 length, err := writer.Write(buf) 13391 return int64(length), err 13392 } 13393 13394 // Construct a slice backed by dst's underlying memory. 13395 var buf []byte 13396 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13397 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13398 hdr.Len = n.SizeBytes() 13399 hdr.Cap = n.SizeBytes() 13400 13401 length, err := writer.Write(buf) 13402 // Since we bypassed the compiler's escape analysis, indicate that n 13403 // must live until the use above. 13404 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13405 return int64(length), err 13406 } 13407 13408 // SizeBytes implements marshal.Marshallable.SizeBytes. 13409 func (n *NetlinkAttrHeader) SizeBytes() int { 13410 return 4 13411 } 13412 13413 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 13414 func (n *NetlinkAttrHeader) MarshalBytes(dst []byte) []byte { 13415 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.Length)) 13416 dst = dst[2:] 13417 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.Type)) 13418 dst = dst[2:] 13419 return dst 13420 } 13421 13422 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 13423 func (n *NetlinkAttrHeader) UnmarshalBytes(src []byte) []byte { 13424 n.Length = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13425 src = src[2:] 13426 n.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13427 src = src[2:] 13428 return src 13429 } 13430 13431 // Packed implements marshal.Marshallable.Packed. 13432 //go:nosplit 13433 func (n *NetlinkAttrHeader) Packed() bool { 13434 return true 13435 } 13436 13437 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 13438 func (n *NetlinkAttrHeader) MarshalUnsafe(dst []byte) []byte { 13439 size := n.SizeBytes() 13440 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 13441 return dst[size:] 13442 } 13443 13444 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 13445 func (n *NetlinkAttrHeader) UnmarshalUnsafe(src []byte) []byte { 13446 size := n.SizeBytes() 13447 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 13448 return src[size:] 13449 } 13450 13451 // CopyOutN implements marshal.Marshallable.CopyOutN. 13452 func (n *NetlinkAttrHeader) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13453 // Construct a slice backed by dst's underlying memory. 13454 var buf []byte 13455 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13456 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13457 hdr.Len = n.SizeBytes() 13458 hdr.Cap = n.SizeBytes() 13459 13460 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13461 // Since we bypassed the compiler's escape analysis, indicate that n 13462 // must live until the use above. 13463 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13464 return length, err 13465 } 13466 13467 // CopyOut implements marshal.Marshallable.CopyOut. 13468 func (n *NetlinkAttrHeader) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13469 return n.CopyOutN(cc, addr, n.SizeBytes()) 13470 } 13471 13472 // CopyInN implements marshal.Marshallable.CopyInN. 13473 func (n *NetlinkAttrHeader) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13474 // Construct a slice backed by dst's underlying memory. 13475 var buf []byte 13476 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13477 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13478 hdr.Len = n.SizeBytes() 13479 hdr.Cap = n.SizeBytes() 13480 13481 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13482 // Since we bypassed the compiler's escape analysis, indicate that n 13483 // must live until the use above. 13484 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13485 return length, err 13486 } 13487 13488 // CopyIn implements marshal.Marshallable.CopyIn. 13489 func (n *NetlinkAttrHeader) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13490 return n.CopyInN(cc, addr, n.SizeBytes()) 13491 } 13492 13493 // WriteTo implements io.WriterTo.WriteTo. 13494 func (n *NetlinkAttrHeader) WriteTo(writer io.Writer) (int64, error) { 13495 // Construct a slice backed by dst's underlying memory. 13496 var buf []byte 13497 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13498 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13499 hdr.Len = n.SizeBytes() 13500 hdr.Cap = n.SizeBytes() 13501 13502 length, err := writer.Write(buf) 13503 // Since we bypassed the compiler's escape analysis, indicate that n 13504 // must live until the use above. 13505 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13506 return int64(length), err 13507 } 13508 13509 // SizeBytes implements marshal.Marshallable.SizeBytes. 13510 func (n *NetlinkErrorMessage) SizeBytes() int { 13511 return 4 + 13512 (*NetlinkMessageHeader)(nil).SizeBytes() 13513 } 13514 13515 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 13516 func (n *NetlinkErrorMessage) MarshalBytes(dst []byte) []byte { 13517 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Error)) 13518 dst = dst[4:] 13519 dst = n.Header.MarshalUnsafe(dst) 13520 return dst 13521 } 13522 13523 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 13524 func (n *NetlinkErrorMessage) UnmarshalBytes(src []byte) []byte { 13525 n.Error = int32(hostarch.ByteOrder.Uint32(src[:4])) 13526 src = src[4:] 13527 src = n.Header.UnmarshalUnsafe(src) 13528 return src 13529 } 13530 13531 // Packed implements marshal.Marshallable.Packed. 13532 //go:nosplit 13533 func (n *NetlinkErrorMessage) Packed() bool { 13534 return n.Header.Packed() 13535 } 13536 13537 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 13538 func (n *NetlinkErrorMessage) MarshalUnsafe(dst []byte) []byte { 13539 if n.Header.Packed() { 13540 size := n.SizeBytes() 13541 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 13542 return dst[size:] 13543 } 13544 // Type NetlinkErrorMessage doesn't have a packed layout in memory, fallback to MarshalBytes. 13545 return n.MarshalBytes(dst) 13546 } 13547 13548 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 13549 func (n *NetlinkErrorMessage) UnmarshalUnsafe(src []byte) []byte { 13550 if n.Header.Packed() { 13551 size := n.SizeBytes() 13552 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 13553 return src[size:] 13554 } 13555 // Type NetlinkErrorMessage doesn't have a packed layout in memory, fallback to UnmarshalBytes. 13556 return n.UnmarshalBytes(src) 13557 } 13558 13559 // CopyOutN implements marshal.Marshallable.CopyOutN. 13560 func (n *NetlinkErrorMessage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13561 if !n.Header.Packed() { 13562 // Type NetlinkErrorMessage doesn't have a packed layout in memory, fall back to MarshalBytes. 13563 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 13564 n.MarshalBytes(buf) // escapes: fallback. 13565 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13566 } 13567 13568 // Construct a slice backed by dst's underlying memory. 13569 var buf []byte 13570 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13571 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13572 hdr.Len = n.SizeBytes() 13573 hdr.Cap = n.SizeBytes() 13574 13575 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13576 // Since we bypassed the compiler's escape analysis, indicate that n 13577 // must live until the use above. 13578 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13579 return length, err 13580 } 13581 13582 // CopyOut implements marshal.Marshallable.CopyOut. 13583 func (n *NetlinkErrorMessage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13584 return n.CopyOutN(cc, addr, n.SizeBytes()) 13585 } 13586 13587 // CopyInN implements marshal.Marshallable.CopyInN. 13588 func (n *NetlinkErrorMessage) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13589 if !n.Header.Packed() { 13590 // Type NetlinkErrorMessage doesn't have a packed layout in memory, fall back to UnmarshalBytes. 13591 buf := cc.CopyScratchBuffer(n.SizeBytes()) // escapes: okay. 13592 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13593 // Unmarshal unconditionally. If we had a short copy-in, this results in a 13594 // partially unmarshalled struct. 13595 n.UnmarshalBytes(buf) // escapes: fallback. 13596 return length, err 13597 } 13598 13599 // Construct a slice backed by dst's underlying memory. 13600 var buf []byte 13601 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13602 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13603 hdr.Len = n.SizeBytes() 13604 hdr.Cap = n.SizeBytes() 13605 13606 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13607 // Since we bypassed the compiler's escape analysis, indicate that n 13608 // must live until the use above. 13609 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13610 return length, err 13611 } 13612 13613 // CopyIn implements marshal.Marshallable.CopyIn. 13614 func (n *NetlinkErrorMessage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13615 return n.CopyInN(cc, addr, n.SizeBytes()) 13616 } 13617 13618 // WriteTo implements io.WriterTo.WriteTo. 13619 func (n *NetlinkErrorMessage) WriteTo(writer io.Writer) (int64, error) { 13620 if !n.Header.Packed() { 13621 // Type NetlinkErrorMessage doesn't have a packed layout in memory, fall back to MarshalBytes. 13622 buf := make([]byte, n.SizeBytes()) 13623 n.MarshalBytes(buf) 13624 length, err := writer.Write(buf) 13625 return int64(length), err 13626 } 13627 13628 // Construct a slice backed by dst's underlying memory. 13629 var buf []byte 13630 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13631 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13632 hdr.Len = n.SizeBytes() 13633 hdr.Cap = n.SizeBytes() 13634 13635 length, err := writer.Write(buf) 13636 // Since we bypassed the compiler's escape analysis, indicate that n 13637 // must live until the use above. 13638 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13639 return int64(length), err 13640 } 13641 13642 // SizeBytes implements marshal.Marshallable.SizeBytes. 13643 func (n *NetlinkMessageHeader) SizeBytes() int { 13644 return 16 13645 } 13646 13647 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 13648 func (n *NetlinkMessageHeader) MarshalBytes(dst []byte) []byte { 13649 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Length)) 13650 dst = dst[4:] 13651 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.Type)) 13652 dst = dst[2:] 13653 hostarch.ByteOrder.PutUint16(dst[:2], uint16(n.Flags)) 13654 dst = dst[2:] 13655 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.Seq)) 13656 dst = dst[4:] 13657 hostarch.ByteOrder.PutUint32(dst[:4], uint32(n.PortID)) 13658 dst = dst[4:] 13659 return dst 13660 } 13661 13662 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 13663 func (n *NetlinkMessageHeader) UnmarshalBytes(src []byte) []byte { 13664 n.Length = uint32(hostarch.ByteOrder.Uint32(src[:4])) 13665 src = src[4:] 13666 n.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13667 src = src[2:] 13668 n.Flags = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13669 src = src[2:] 13670 n.Seq = uint32(hostarch.ByteOrder.Uint32(src[:4])) 13671 src = src[4:] 13672 n.PortID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 13673 src = src[4:] 13674 return src 13675 } 13676 13677 // Packed implements marshal.Marshallable.Packed. 13678 //go:nosplit 13679 func (n *NetlinkMessageHeader) Packed() bool { 13680 return true 13681 } 13682 13683 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 13684 func (n *NetlinkMessageHeader) MarshalUnsafe(dst []byte) []byte { 13685 size := n.SizeBytes() 13686 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(n), uintptr(size)) 13687 return dst[size:] 13688 } 13689 13690 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 13691 func (n *NetlinkMessageHeader) UnmarshalUnsafe(src []byte) []byte { 13692 size := n.SizeBytes() 13693 gohacks.Memmove(unsafe.Pointer(n), unsafe.Pointer(&src[0]), uintptr(size)) 13694 return src[size:] 13695 } 13696 13697 // CopyOutN implements marshal.Marshallable.CopyOutN. 13698 func (n *NetlinkMessageHeader) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13699 // Construct a slice backed by dst's underlying memory. 13700 var buf []byte 13701 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13702 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13703 hdr.Len = n.SizeBytes() 13704 hdr.Cap = n.SizeBytes() 13705 13706 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13707 // Since we bypassed the compiler's escape analysis, indicate that n 13708 // must live until the use above. 13709 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13710 return length, err 13711 } 13712 13713 // CopyOut implements marshal.Marshallable.CopyOut. 13714 func (n *NetlinkMessageHeader) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13715 return n.CopyOutN(cc, addr, n.SizeBytes()) 13716 } 13717 13718 // CopyInN implements marshal.Marshallable.CopyInN. 13719 func (n *NetlinkMessageHeader) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13720 // Construct a slice backed by dst's underlying memory. 13721 var buf []byte 13722 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13723 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13724 hdr.Len = n.SizeBytes() 13725 hdr.Cap = n.SizeBytes() 13726 13727 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13728 // Since we bypassed the compiler's escape analysis, indicate that n 13729 // must live until the use above. 13730 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13731 return length, err 13732 } 13733 13734 // CopyIn implements marshal.Marshallable.CopyIn. 13735 func (n *NetlinkMessageHeader) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13736 return n.CopyInN(cc, addr, n.SizeBytes()) 13737 } 13738 13739 // WriteTo implements io.WriterTo.WriteTo. 13740 func (n *NetlinkMessageHeader) WriteTo(writer io.Writer) (int64, error) { 13741 // Construct a slice backed by dst's underlying memory. 13742 var buf []byte 13743 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13744 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(n))) 13745 hdr.Len = n.SizeBytes() 13746 hdr.Cap = n.SizeBytes() 13747 13748 length, err := writer.Write(buf) 13749 // Since we bypassed the compiler's escape analysis, indicate that n 13750 // must live until the use above. 13751 runtime.KeepAlive(n) // escapes: replaced by intrinsic. 13752 return int64(length), err 13753 } 13754 13755 // SizeBytes implements marshal.Marshallable.SizeBytes. 13756 func (s *SockAddrNetlink) SizeBytes() int { 13757 return 12 13758 } 13759 13760 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 13761 func (s *SockAddrNetlink) MarshalBytes(dst []byte) []byte { 13762 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) 13763 dst = dst[2:] 13764 // Padding: dst[:sizeof(uint16)] ~= uint16(0) 13765 dst = dst[2:] 13766 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.PortID)) 13767 dst = dst[4:] 13768 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Groups)) 13769 dst = dst[4:] 13770 return dst 13771 } 13772 13773 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 13774 func (s *SockAddrNetlink) UnmarshalBytes(src []byte) []byte { 13775 s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) 13776 src = src[2:] 13777 // Padding: var _ uint16 ~= src[:sizeof(uint16)] 13778 src = src[2:] 13779 s.PortID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 13780 src = src[4:] 13781 s.Groups = uint32(hostarch.ByteOrder.Uint32(src[:4])) 13782 src = src[4:] 13783 return src 13784 } 13785 13786 // Packed implements marshal.Marshallable.Packed. 13787 //go:nosplit 13788 func (s *SockAddrNetlink) Packed() bool { 13789 return true 13790 } 13791 13792 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 13793 func (s *SockAddrNetlink) MarshalUnsafe(dst []byte) []byte { 13794 size := s.SizeBytes() 13795 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 13796 return dst[size:] 13797 } 13798 13799 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 13800 func (s *SockAddrNetlink) UnmarshalUnsafe(src []byte) []byte { 13801 size := s.SizeBytes() 13802 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 13803 return src[size:] 13804 } 13805 13806 // CopyOutN implements marshal.Marshallable.CopyOutN. 13807 func (s *SockAddrNetlink) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13808 // Construct a slice backed by dst's underlying memory. 13809 var buf []byte 13810 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13811 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 13812 hdr.Len = s.SizeBytes() 13813 hdr.Cap = s.SizeBytes() 13814 13815 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13816 // Since we bypassed the compiler's escape analysis, indicate that s 13817 // must live until the use above. 13818 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 13819 return length, err 13820 } 13821 13822 // CopyOut implements marshal.Marshallable.CopyOut. 13823 func (s *SockAddrNetlink) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13824 return s.CopyOutN(cc, addr, s.SizeBytes()) 13825 } 13826 13827 // CopyInN implements marshal.Marshallable.CopyInN. 13828 func (s *SockAddrNetlink) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13829 // Construct a slice backed by dst's underlying memory. 13830 var buf []byte 13831 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13832 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 13833 hdr.Len = s.SizeBytes() 13834 hdr.Cap = s.SizeBytes() 13835 13836 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13837 // Since we bypassed the compiler's escape analysis, indicate that s 13838 // must live until the use above. 13839 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 13840 return length, err 13841 } 13842 13843 // CopyIn implements marshal.Marshallable.CopyIn. 13844 func (s *SockAddrNetlink) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13845 return s.CopyInN(cc, addr, s.SizeBytes()) 13846 } 13847 13848 // WriteTo implements io.WriterTo.WriteTo. 13849 func (s *SockAddrNetlink) WriteTo(writer io.Writer) (int64, error) { 13850 // Construct a slice backed by dst's underlying memory. 13851 var buf []byte 13852 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13853 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 13854 hdr.Len = s.SizeBytes() 13855 hdr.Cap = s.SizeBytes() 13856 13857 length, err := writer.Write(buf) 13858 // Since we bypassed the compiler's escape analysis, indicate that s 13859 // must live until the use above. 13860 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 13861 return int64(length), err 13862 } 13863 13864 // SizeBytes implements marshal.Marshallable.SizeBytes. 13865 func (i *InterfaceAddrMessage) SizeBytes() int { 13866 return 8 13867 } 13868 13869 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 13870 func (i *InterfaceAddrMessage) MarshalBytes(dst []byte) []byte { 13871 dst[0] = byte(i.Family) 13872 dst = dst[1:] 13873 dst[0] = byte(i.PrefixLen) 13874 dst = dst[1:] 13875 dst[0] = byte(i.Flags) 13876 dst = dst[1:] 13877 dst[0] = byte(i.Scope) 13878 dst = dst[1:] 13879 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Index)) 13880 dst = dst[4:] 13881 return dst 13882 } 13883 13884 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 13885 func (i *InterfaceAddrMessage) UnmarshalBytes(src []byte) []byte { 13886 i.Family = uint8(src[0]) 13887 src = src[1:] 13888 i.PrefixLen = uint8(src[0]) 13889 src = src[1:] 13890 i.Flags = uint8(src[0]) 13891 src = src[1:] 13892 i.Scope = uint8(src[0]) 13893 src = src[1:] 13894 i.Index = uint32(hostarch.ByteOrder.Uint32(src[:4])) 13895 src = src[4:] 13896 return src 13897 } 13898 13899 // Packed implements marshal.Marshallable.Packed. 13900 //go:nosplit 13901 func (i *InterfaceAddrMessage) Packed() bool { 13902 return true 13903 } 13904 13905 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 13906 func (i *InterfaceAddrMessage) MarshalUnsafe(dst []byte) []byte { 13907 size := i.SizeBytes() 13908 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 13909 return dst[size:] 13910 } 13911 13912 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 13913 func (i *InterfaceAddrMessage) UnmarshalUnsafe(src []byte) []byte { 13914 size := i.SizeBytes() 13915 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 13916 return src[size:] 13917 } 13918 13919 // CopyOutN implements marshal.Marshallable.CopyOutN. 13920 func (i *InterfaceAddrMessage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13921 // Construct a slice backed by dst's underlying memory. 13922 var buf []byte 13923 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13924 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 13925 hdr.Len = i.SizeBytes() 13926 hdr.Cap = i.SizeBytes() 13927 13928 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 13929 // Since we bypassed the compiler's escape analysis, indicate that i 13930 // must live until the use above. 13931 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 13932 return length, err 13933 } 13934 13935 // CopyOut implements marshal.Marshallable.CopyOut. 13936 func (i *InterfaceAddrMessage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13937 return i.CopyOutN(cc, addr, i.SizeBytes()) 13938 } 13939 13940 // CopyInN implements marshal.Marshallable.CopyInN. 13941 func (i *InterfaceAddrMessage) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 13942 // Construct a slice backed by dst's underlying memory. 13943 var buf []byte 13944 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13945 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 13946 hdr.Len = i.SizeBytes() 13947 hdr.Cap = i.SizeBytes() 13948 13949 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 13950 // Since we bypassed the compiler's escape analysis, indicate that i 13951 // must live until the use above. 13952 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 13953 return length, err 13954 } 13955 13956 // CopyIn implements marshal.Marshallable.CopyIn. 13957 func (i *InterfaceAddrMessage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 13958 return i.CopyInN(cc, addr, i.SizeBytes()) 13959 } 13960 13961 // WriteTo implements io.WriterTo.WriteTo. 13962 func (i *InterfaceAddrMessage) WriteTo(writer io.Writer) (int64, error) { 13963 // Construct a slice backed by dst's underlying memory. 13964 var buf []byte 13965 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 13966 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 13967 hdr.Len = i.SizeBytes() 13968 hdr.Cap = i.SizeBytes() 13969 13970 length, err := writer.Write(buf) 13971 // Since we bypassed the compiler's escape analysis, indicate that i 13972 // must live until the use above. 13973 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 13974 return int64(length), err 13975 } 13976 13977 // SizeBytes implements marshal.Marshallable.SizeBytes. 13978 func (i *InterfaceInfoMessage) SizeBytes() int { 13979 return 16 13980 } 13981 13982 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 13983 func (i *InterfaceInfoMessage) MarshalBytes(dst []byte) []byte { 13984 dst[0] = byte(i.Family) 13985 dst = dst[1:] 13986 // Padding: dst[:sizeof(uint8)] ~= uint8(0) 13987 dst = dst[1:] 13988 hostarch.ByteOrder.PutUint16(dst[:2], uint16(i.Type)) 13989 dst = dst[2:] 13990 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Index)) 13991 dst = dst[4:] 13992 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Flags)) 13993 dst = dst[4:] 13994 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Change)) 13995 dst = dst[4:] 13996 return dst 13997 } 13998 13999 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 14000 func (i *InterfaceInfoMessage) UnmarshalBytes(src []byte) []byte { 14001 i.Family = uint8(src[0]) 14002 src = src[1:] 14003 // Padding: var _ uint8 ~= src[:sizeof(uint8)] 14004 src = src[1:] 14005 i.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) 14006 src = src[2:] 14007 i.Index = int32(hostarch.ByteOrder.Uint32(src[:4])) 14008 src = src[4:] 14009 i.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 14010 src = src[4:] 14011 i.Change = uint32(hostarch.ByteOrder.Uint32(src[:4])) 14012 src = src[4:] 14013 return src 14014 } 14015 14016 // Packed implements marshal.Marshallable.Packed. 14017 //go:nosplit 14018 func (i *InterfaceInfoMessage) Packed() bool { 14019 return true 14020 } 14021 14022 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 14023 func (i *InterfaceInfoMessage) MarshalUnsafe(dst []byte) []byte { 14024 size := i.SizeBytes() 14025 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 14026 return dst[size:] 14027 } 14028 14029 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 14030 func (i *InterfaceInfoMessage) UnmarshalUnsafe(src []byte) []byte { 14031 size := i.SizeBytes() 14032 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 14033 return src[size:] 14034 } 14035 14036 // CopyOutN implements marshal.Marshallable.CopyOutN. 14037 func (i *InterfaceInfoMessage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14038 // Construct a slice backed by dst's underlying memory. 14039 var buf []byte 14040 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14041 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 14042 hdr.Len = i.SizeBytes() 14043 hdr.Cap = i.SizeBytes() 14044 14045 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14046 // Since we bypassed the compiler's escape analysis, indicate that i 14047 // must live until the use above. 14048 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 14049 return length, err 14050 } 14051 14052 // CopyOut implements marshal.Marshallable.CopyOut. 14053 func (i *InterfaceInfoMessage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14054 return i.CopyOutN(cc, addr, i.SizeBytes()) 14055 } 14056 14057 // CopyInN implements marshal.Marshallable.CopyInN. 14058 func (i *InterfaceInfoMessage) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14059 // Construct a slice backed by dst's underlying memory. 14060 var buf []byte 14061 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14062 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 14063 hdr.Len = i.SizeBytes() 14064 hdr.Cap = i.SizeBytes() 14065 14066 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 14067 // Since we bypassed the compiler's escape analysis, indicate that i 14068 // must live until the use above. 14069 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 14070 return length, err 14071 } 14072 14073 // CopyIn implements marshal.Marshallable.CopyIn. 14074 func (i *InterfaceInfoMessage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14075 return i.CopyInN(cc, addr, i.SizeBytes()) 14076 } 14077 14078 // WriteTo implements io.WriterTo.WriteTo. 14079 func (i *InterfaceInfoMessage) WriteTo(writer io.Writer) (int64, error) { 14080 // Construct a slice backed by dst's underlying memory. 14081 var buf []byte 14082 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14083 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 14084 hdr.Len = i.SizeBytes() 14085 hdr.Cap = i.SizeBytes() 14086 14087 length, err := writer.Write(buf) 14088 // Since we bypassed the compiler's escape analysis, indicate that i 14089 // must live until the use above. 14090 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 14091 return int64(length), err 14092 } 14093 14094 // SizeBytes implements marshal.Marshallable.SizeBytes. 14095 func (r *RouteMessage) SizeBytes() int { 14096 return 12 14097 } 14098 14099 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 14100 func (r *RouteMessage) MarshalBytes(dst []byte) []byte { 14101 dst[0] = byte(r.Family) 14102 dst = dst[1:] 14103 dst[0] = byte(r.DstLen) 14104 dst = dst[1:] 14105 dst[0] = byte(r.SrcLen) 14106 dst = dst[1:] 14107 dst[0] = byte(r.TOS) 14108 dst = dst[1:] 14109 dst[0] = byte(r.Table) 14110 dst = dst[1:] 14111 dst[0] = byte(r.Protocol) 14112 dst = dst[1:] 14113 dst[0] = byte(r.Scope) 14114 dst = dst[1:] 14115 dst[0] = byte(r.Type) 14116 dst = dst[1:] 14117 hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Flags)) 14118 dst = dst[4:] 14119 return dst 14120 } 14121 14122 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 14123 func (r *RouteMessage) UnmarshalBytes(src []byte) []byte { 14124 r.Family = uint8(src[0]) 14125 src = src[1:] 14126 r.DstLen = uint8(src[0]) 14127 src = src[1:] 14128 r.SrcLen = uint8(src[0]) 14129 src = src[1:] 14130 r.TOS = uint8(src[0]) 14131 src = src[1:] 14132 r.Table = uint8(src[0]) 14133 src = src[1:] 14134 r.Protocol = uint8(src[0]) 14135 src = src[1:] 14136 r.Scope = uint8(src[0]) 14137 src = src[1:] 14138 r.Type = uint8(src[0]) 14139 src = src[1:] 14140 r.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 14141 src = src[4:] 14142 return src 14143 } 14144 14145 // Packed implements marshal.Marshallable.Packed. 14146 //go:nosplit 14147 func (r *RouteMessage) Packed() bool { 14148 return true 14149 } 14150 14151 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 14152 func (r *RouteMessage) MarshalUnsafe(dst []byte) []byte { 14153 size := r.SizeBytes() 14154 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) 14155 return dst[size:] 14156 } 14157 14158 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 14159 func (r *RouteMessage) UnmarshalUnsafe(src []byte) []byte { 14160 size := r.SizeBytes() 14161 gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) 14162 return src[size:] 14163 } 14164 14165 // CopyOutN implements marshal.Marshallable.CopyOutN. 14166 func (r *RouteMessage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14167 // Construct a slice backed by dst's underlying memory. 14168 var buf []byte 14169 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14170 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14171 hdr.Len = r.SizeBytes() 14172 hdr.Cap = r.SizeBytes() 14173 14174 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14175 // Since we bypassed the compiler's escape analysis, indicate that r 14176 // must live until the use above. 14177 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14178 return length, err 14179 } 14180 14181 // CopyOut implements marshal.Marshallable.CopyOut. 14182 func (r *RouteMessage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14183 return r.CopyOutN(cc, addr, r.SizeBytes()) 14184 } 14185 14186 // CopyInN implements marshal.Marshallable.CopyInN. 14187 func (r *RouteMessage) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14188 // Construct a slice backed by dst's underlying memory. 14189 var buf []byte 14190 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14191 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14192 hdr.Len = r.SizeBytes() 14193 hdr.Cap = r.SizeBytes() 14194 14195 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 14196 // Since we bypassed the compiler's escape analysis, indicate that r 14197 // must live until the use above. 14198 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14199 return length, err 14200 } 14201 14202 // CopyIn implements marshal.Marshallable.CopyIn. 14203 func (r *RouteMessage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14204 return r.CopyInN(cc, addr, r.SizeBytes()) 14205 } 14206 14207 // WriteTo implements io.WriterTo.WriteTo. 14208 func (r *RouteMessage) WriteTo(writer io.Writer) (int64, error) { 14209 // Construct a slice backed by dst's underlying memory. 14210 var buf []byte 14211 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14212 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14213 hdr.Len = r.SizeBytes() 14214 hdr.Cap = r.SizeBytes() 14215 14216 length, err := writer.Write(buf) 14217 // Since we bypassed the compiler's escape analysis, indicate that r 14218 // must live until the use above. 14219 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14220 return int64(length), err 14221 } 14222 14223 // SizeBytes implements marshal.Marshallable.SizeBytes. 14224 func (r *RtAttr) SizeBytes() int { 14225 return 4 14226 } 14227 14228 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 14229 func (r *RtAttr) MarshalBytes(dst []byte) []byte { 14230 hostarch.ByteOrder.PutUint16(dst[:2], uint16(r.Len)) 14231 dst = dst[2:] 14232 hostarch.ByteOrder.PutUint16(dst[:2], uint16(r.Type)) 14233 dst = dst[2:] 14234 return dst 14235 } 14236 14237 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 14238 func (r *RtAttr) UnmarshalBytes(src []byte) []byte { 14239 r.Len = uint16(hostarch.ByteOrder.Uint16(src[:2])) 14240 src = src[2:] 14241 r.Type = uint16(hostarch.ByteOrder.Uint16(src[:2])) 14242 src = src[2:] 14243 return src 14244 } 14245 14246 // Packed implements marshal.Marshallable.Packed. 14247 //go:nosplit 14248 func (r *RtAttr) Packed() bool { 14249 return true 14250 } 14251 14252 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 14253 func (r *RtAttr) MarshalUnsafe(dst []byte) []byte { 14254 size := r.SizeBytes() 14255 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) 14256 return dst[size:] 14257 } 14258 14259 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 14260 func (r *RtAttr) UnmarshalUnsafe(src []byte) []byte { 14261 size := r.SizeBytes() 14262 gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) 14263 return src[size:] 14264 } 14265 14266 // CopyOutN implements marshal.Marshallable.CopyOutN. 14267 func (r *RtAttr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14268 // Construct a slice backed by dst's underlying memory. 14269 var buf []byte 14270 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14271 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14272 hdr.Len = r.SizeBytes() 14273 hdr.Cap = r.SizeBytes() 14274 14275 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14276 // Since we bypassed the compiler's escape analysis, indicate that r 14277 // must live until the use above. 14278 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14279 return length, err 14280 } 14281 14282 // CopyOut implements marshal.Marshallable.CopyOut. 14283 func (r *RtAttr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14284 return r.CopyOutN(cc, addr, r.SizeBytes()) 14285 } 14286 14287 // CopyInN implements marshal.Marshallable.CopyInN. 14288 func (r *RtAttr) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14289 // Construct a slice backed by dst's underlying memory. 14290 var buf []byte 14291 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14292 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14293 hdr.Len = r.SizeBytes() 14294 hdr.Cap = r.SizeBytes() 14295 14296 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 14297 // Since we bypassed the compiler's escape analysis, indicate that r 14298 // must live until the use above. 14299 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14300 return length, err 14301 } 14302 14303 // CopyIn implements marshal.Marshallable.CopyIn. 14304 func (r *RtAttr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14305 return r.CopyInN(cc, addr, r.SizeBytes()) 14306 } 14307 14308 // WriteTo implements io.WriterTo.WriteTo. 14309 func (r *RtAttr) WriteTo(writer io.Writer) (int64, error) { 14310 // Construct a slice backed by dst's underlying memory. 14311 var buf []byte 14312 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14313 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14314 hdr.Len = r.SizeBytes() 14315 hdr.Cap = r.SizeBytes() 14316 14317 length, err := writer.Write(buf) 14318 // Since we bypassed the compiler's escape analysis, indicate that r 14319 // must live until the use above. 14320 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14321 return int64(length), err 14322 } 14323 14324 // SizeBytes implements marshal.Marshallable.SizeBytes. 14325 func (p *PollFD) SizeBytes() int { 14326 return 8 14327 } 14328 14329 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 14330 func (p *PollFD) MarshalBytes(dst []byte) []byte { 14331 hostarch.ByteOrder.PutUint32(dst[:4], uint32(p.FD)) 14332 dst = dst[4:] 14333 hostarch.ByteOrder.PutUint16(dst[:2], uint16(p.Events)) 14334 dst = dst[2:] 14335 hostarch.ByteOrder.PutUint16(dst[:2], uint16(p.REvents)) 14336 dst = dst[2:] 14337 return dst 14338 } 14339 14340 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 14341 func (p *PollFD) UnmarshalBytes(src []byte) []byte { 14342 p.FD = int32(hostarch.ByteOrder.Uint32(src[:4])) 14343 src = src[4:] 14344 p.Events = int16(hostarch.ByteOrder.Uint16(src[:2])) 14345 src = src[2:] 14346 p.REvents = int16(hostarch.ByteOrder.Uint16(src[:2])) 14347 src = src[2:] 14348 return src 14349 } 14350 14351 // Packed implements marshal.Marshallable.Packed. 14352 //go:nosplit 14353 func (p *PollFD) Packed() bool { 14354 return true 14355 } 14356 14357 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 14358 func (p *PollFD) MarshalUnsafe(dst []byte) []byte { 14359 size := p.SizeBytes() 14360 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(p), uintptr(size)) 14361 return dst[size:] 14362 } 14363 14364 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 14365 func (p *PollFD) UnmarshalUnsafe(src []byte) []byte { 14366 size := p.SizeBytes() 14367 gohacks.Memmove(unsafe.Pointer(p), unsafe.Pointer(&src[0]), uintptr(size)) 14368 return src[size:] 14369 } 14370 14371 // CopyOutN implements marshal.Marshallable.CopyOutN. 14372 func (p *PollFD) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14373 // Construct a slice backed by dst's underlying memory. 14374 var buf []byte 14375 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14376 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 14377 hdr.Len = p.SizeBytes() 14378 hdr.Cap = p.SizeBytes() 14379 14380 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14381 // Since we bypassed the compiler's escape analysis, indicate that p 14382 // must live until the use above. 14383 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 14384 return length, err 14385 } 14386 14387 // CopyOut implements marshal.Marshallable.CopyOut. 14388 func (p *PollFD) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14389 return p.CopyOutN(cc, addr, p.SizeBytes()) 14390 } 14391 14392 // CopyInN implements marshal.Marshallable.CopyInN. 14393 func (p *PollFD) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14394 // Construct a slice backed by dst's underlying memory. 14395 var buf []byte 14396 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14397 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 14398 hdr.Len = p.SizeBytes() 14399 hdr.Cap = p.SizeBytes() 14400 14401 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 14402 // Since we bypassed the compiler's escape analysis, indicate that p 14403 // must live until the use above. 14404 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 14405 return length, err 14406 } 14407 14408 // CopyIn implements marshal.Marshallable.CopyIn. 14409 func (p *PollFD) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14410 return p.CopyInN(cc, addr, p.SizeBytes()) 14411 } 14412 14413 // WriteTo implements io.WriterTo.WriteTo. 14414 func (p *PollFD) WriteTo(writer io.Writer) (int64, error) { 14415 // Construct a slice backed by dst's underlying memory. 14416 var buf []byte 14417 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14418 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(p))) 14419 hdr.Len = p.SizeBytes() 14420 hdr.Cap = p.SizeBytes() 14421 14422 length, err := writer.Write(buf) 14423 // Since we bypassed the compiler's escape analysis, indicate that p 14424 // must live until the use above. 14425 runtime.KeepAlive(p) // escapes: replaced by intrinsic. 14426 return int64(length), err 14427 } 14428 14429 // CopyPollFDSliceIn copies in a slice of PollFD objects from the task's memory. 14430 func CopyPollFDSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []PollFD) (int, error) { 14431 count := len(dst) 14432 if count == 0 { 14433 return 0, nil 14434 } 14435 size := (*PollFD)(nil).SizeBytes() 14436 14437 ptr := unsafe.Pointer(&dst) 14438 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 14439 14440 // Construct a slice backed by dst's underlying memory. 14441 var buf []byte 14442 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14443 hdr.Data = uintptr(val) 14444 hdr.Len = size * count 14445 hdr.Cap = size * count 14446 14447 length, err := cc.CopyInBytes(addr, buf) 14448 // Since we bypassed the compiler's escape analysis, indicate that dst 14449 // must live until the use above. 14450 runtime.KeepAlive(dst) // escapes: replaced by intrinsic. 14451 return length, err 14452 } 14453 14454 // CopyPollFDSliceOut copies a slice of PollFD objects to the task's memory. 14455 func CopyPollFDSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []PollFD) (int, error) { 14456 count := len(src) 14457 if count == 0 { 14458 return 0, nil 14459 } 14460 size := (*PollFD)(nil).SizeBytes() 14461 14462 ptr := unsafe.Pointer(&src) 14463 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 14464 14465 // Construct a slice backed by dst's underlying memory. 14466 var buf []byte 14467 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14468 hdr.Data = uintptr(val) 14469 hdr.Len = size * count 14470 hdr.Cap = size * count 14471 14472 length, err := cc.CopyOutBytes(addr, buf) 14473 // Since we bypassed the compiler's escape analysis, indicate that src 14474 // must live until the use above. 14475 runtime.KeepAlive(src) // escapes: replaced by intrinsic. 14476 return length, err 14477 } 14478 14479 // MarshalUnsafePollFDSlice is like PollFD.MarshalUnsafe, but for a []PollFD. 14480 func MarshalUnsafePollFDSlice(src []PollFD, dst []byte) []byte { 14481 count := len(src) 14482 if count == 0 { 14483 return dst 14484 } 14485 14486 size := (*PollFD)(nil).SizeBytes() 14487 buf := dst[:size*count] 14488 gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) 14489 return dst[size*count:] 14490 } 14491 14492 // UnmarshalUnsafePollFDSlice is like PollFD.UnmarshalUnsafe, but for a []PollFD. 14493 func UnmarshalUnsafePollFDSlice(dst []PollFD, src []byte) []byte { 14494 count := len(dst) 14495 if count == 0 { 14496 return src 14497 } 14498 14499 size := (*PollFD)(nil).SizeBytes() 14500 buf := src[:size*count] 14501 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) 14502 return src[size*count:] 14503 } 14504 14505 // SizeBytes implements marshal.Marshallable.SizeBytes. 14506 func (r *RSeqCriticalSection) SizeBytes() int { 14507 return 32 14508 } 14509 14510 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 14511 func (r *RSeqCriticalSection) MarshalBytes(dst []byte) []byte { 14512 hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Version)) 14513 dst = dst[4:] 14514 hostarch.ByteOrder.PutUint32(dst[:4], uint32(r.Flags)) 14515 dst = dst[4:] 14516 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.Start)) 14517 dst = dst[8:] 14518 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.PostCommitOffset)) 14519 dst = dst[8:] 14520 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.Abort)) 14521 dst = dst[8:] 14522 return dst 14523 } 14524 14525 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 14526 func (r *RSeqCriticalSection) UnmarshalBytes(src []byte) []byte { 14527 r.Version = uint32(hostarch.ByteOrder.Uint32(src[:4])) 14528 src = src[4:] 14529 r.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 14530 src = src[4:] 14531 r.Start = uint64(hostarch.ByteOrder.Uint64(src[:8])) 14532 src = src[8:] 14533 r.PostCommitOffset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 14534 src = src[8:] 14535 r.Abort = uint64(hostarch.ByteOrder.Uint64(src[:8])) 14536 src = src[8:] 14537 return src 14538 } 14539 14540 // Packed implements marshal.Marshallable.Packed. 14541 //go:nosplit 14542 func (r *RSeqCriticalSection) Packed() bool { 14543 return true 14544 } 14545 14546 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 14547 func (r *RSeqCriticalSection) MarshalUnsafe(dst []byte) []byte { 14548 size := r.SizeBytes() 14549 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) 14550 return dst[size:] 14551 } 14552 14553 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 14554 func (r *RSeqCriticalSection) UnmarshalUnsafe(src []byte) []byte { 14555 size := r.SizeBytes() 14556 gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) 14557 return src[size:] 14558 } 14559 14560 // CopyOutN implements marshal.Marshallable.CopyOutN. 14561 func (r *RSeqCriticalSection) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14562 // Construct a slice backed by dst's underlying memory. 14563 var buf []byte 14564 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14565 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14566 hdr.Len = r.SizeBytes() 14567 hdr.Cap = r.SizeBytes() 14568 14569 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14570 // Since we bypassed the compiler's escape analysis, indicate that r 14571 // must live until the use above. 14572 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14573 return length, err 14574 } 14575 14576 // CopyOut implements marshal.Marshallable.CopyOut. 14577 func (r *RSeqCriticalSection) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14578 return r.CopyOutN(cc, addr, r.SizeBytes()) 14579 } 14580 14581 // CopyInN implements marshal.Marshallable.CopyInN. 14582 func (r *RSeqCriticalSection) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14583 // Construct a slice backed by dst's underlying memory. 14584 var buf []byte 14585 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14586 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14587 hdr.Len = r.SizeBytes() 14588 hdr.Cap = r.SizeBytes() 14589 14590 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 14591 // Since we bypassed the compiler's escape analysis, indicate that r 14592 // must live until the use above. 14593 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14594 return length, err 14595 } 14596 14597 // CopyIn implements marshal.Marshallable.CopyIn. 14598 func (r *RSeqCriticalSection) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14599 return r.CopyInN(cc, addr, r.SizeBytes()) 14600 } 14601 14602 // WriteTo implements io.WriterTo.WriteTo. 14603 func (r *RSeqCriticalSection) WriteTo(writer io.Writer) (int64, error) { 14604 // Construct a slice backed by dst's underlying memory. 14605 var buf []byte 14606 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14607 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14608 hdr.Len = r.SizeBytes() 14609 hdr.Cap = r.SizeBytes() 14610 14611 length, err := writer.Write(buf) 14612 // Since we bypassed the compiler's escape analysis, indicate that r 14613 // must live until the use above. 14614 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14615 return int64(length), err 14616 } 14617 14618 // SizeBytes implements marshal.Marshallable.SizeBytes. 14619 func (r *Rusage) SizeBytes() int { 14620 return 112 + 14621 (*Timeval)(nil).SizeBytes() + 14622 (*Timeval)(nil).SizeBytes() 14623 } 14624 14625 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 14626 func (r *Rusage) MarshalBytes(dst []byte) []byte { 14627 dst = r.UTime.MarshalUnsafe(dst) 14628 dst = r.STime.MarshalUnsafe(dst) 14629 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MaxRSS)) 14630 dst = dst[8:] 14631 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.IXRSS)) 14632 dst = dst[8:] 14633 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.IDRSS)) 14634 dst = dst[8:] 14635 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.ISRSS)) 14636 dst = dst[8:] 14637 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MinFlt)) 14638 dst = dst[8:] 14639 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MajFlt)) 14640 dst = dst[8:] 14641 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.NSwap)) 14642 dst = dst[8:] 14643 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.InBlock)) 14644 dst = dst[8:] 14645 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.OuBlock)) 14646 dst = dst[8:] 14647 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MsgSnd)) 14648 dst = dst[8:] 14649 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.MsgRcv)) 14650 dst = dst[8:] 14651 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.NSignals)) 14652 dst = dst[8:] 14653 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.NVCSw)) 14654 dst = dst[8:] 14655 hostarch.ByteOrder.PutUint64(dst[:8], uint64(r.NIvCSw)) 14656 dst = dst[8:] 14657 return dst 14658 } 14659 14660 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 14661 func (r *Rusage) UnmarshalBytes(src []byte) []byte { 14662 src = r.UTime.UnmarshalUnsafe(src) 14663 src = r.STime.UnmarshalUnsafe(src) 14664 r.MaxRSS = int64(hostarch.ByteOrder.Uint64(src[:8])) 14665 src = src[8:] 14666 r.IXRSS = int64(hostarch.ByteOrder.Uint64(src[:8])) 14667 src = src[8:] 14668 r.IDRSS = int64(hostarch.ByteOrder.Uint64(src[:8])) 14669 src = src[8:] 14670 r.ISRSS = int64(hostarch.ByteOrder.Uint64(src[:8])) 14671 src = src[8:] 14672 r.MinFlt = int64(hostarch.ByteOrder.Uint64(src[:8])) 14673 src = src[8:] 14674 r.MajFlt = int64(hostarch.ByteOrder.Uint64(src[:8])) 14675 src = src[8:] 14676 r.NSwap = int64(hostarch.ByteOrder.Uint64(src[:8])) 14677 src = src[8:] 14678 r.InBlock = int64(hostarch.ByteOrder.Uint64(src[:8])) 14679 src = src[8:] 14680 r.OuBlock = int64(hostarch.ByteOrder.Uint64(src[:8])) 14681 src = src[8:] 14682 r.MsgSnd = int64(hostarch.ByteOrder.Uint64(src[:8])) 14683 src = src[8:] 14684 r.MsgRcv = int64(hostarch.ByteOrder.Uint64(src[:8])) 14685 src = src[8:] 14686 r.NSignals = int64(hostarch.ByteOrder.Uint64(src[:8])) 14687 src = src[8:] 14688 r.NVCSw = int64(hostarch.ByteOrder.Uint64(src[:8])) 14689 src = src[8:] 14690 r.NIvCSw = int64(hostarch.ByteOrder.Uint64(src[:8])) 14691 src = src[8:] 14692 return src 14693 } 14694 14695 // Packed implements marshal.Marshallable.Packed. 14696 //go:nosplit 14697 func (r *Rusage) Packed() bool { 14698 return r.STime.Packed() && r.UTime.Packed() 14699 } 14700 14701 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 14702 func (r *Rusage) MarshalUnsafe(dst []byte) []byte { 14703 if r.STime.Packed() && r.UTime.Packed() { 14704 size := r.SizeBytes() 14705 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(r), uintptr(size)) 14706 return dst[size:] 14707 } 14708 // Type Rusage doesn't have a packed layout in memory, fallback to MarshalBytes. 14709 return r.MarshalBytes(dst) 14710 } 14711 14712 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 14713 func (r *Rusage) UnmarshalUnsafe(src []byte) []byte { 14714 if r.STime.Packed() && r.UTime.Packed() { 14715 size := r.SizeBytes() 14716 gohacks.Memmove(unsafe.Pointer(r), unsafe.Pointer(&src[0]), uintptr(size)) 14717 return src[size:] 14718 } 14719 // Type Rusage doesn't have a packed layout in memory, fallback to UnmarshalBytes. 14720 return r.UnmarshalBytes(src) 14721 } 14722 14723 // CopyOutN implements marshal.Marshallable.CopyOutN. 14724 func (r *Rusage) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14725 if !r.STime.Packed() && r.UTime.Packed() { 14726 // Type Rusage doesn't have a packed layout in memory, fall back to MarshalBytes. 14727 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 14728 r.MarshalBytes(buf) // escapes: fallback. 14729 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14730 } 14731 14732 // Construct a slice backed by dst's underlying memory. 14733 var buf []byte 14734 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14735 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14736 hdr.Len = r.SizeBytes() 14737 hdr.Cap = r.SizeBytes() 14738 14739 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14740 // Since we bypassed the compiler's escape analysis, indicate that r 14741 // must live until the use above. 14742 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14743 return length, err 14744 } 14745 14746 // CopyOut implements marshal.Marshallable.CopyOut. 14747 func (r *Rusage) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14748 return r.CopyOutN(cc, addr, r.SizeBytes()) 14749 } 14750 14751 // CopyInN implements marshal.Marshallable.CopyInN. 14752 func (r *Rusage) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14753 if !r.STime.Packed() && r.UTime.Packed() { 14754 // Type Rusage doesn't have a packed layout in memory, fall back to UnmarshalBytes. 14755 buf := cc.CopyScratchBuffer(r.SizeBytes()) // escapes: okay. 14756 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 14757 // Unmarshal unconditionally. If we had a short copy-in, this results in a 14758 // partially unmarshalled struct. 14759 r.UnmarshalBytes(buf) // escapes: fallback. 14760 return length, err 14761 } 14762 14763 // Construct a slice backed by dst's underlying memory. 14764 var buf []byte 14765 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14766 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14767 hdr.Len = r.SizeBytes() 14768 hdr.Cap = r.SizeBytes() 14769 14770 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 14771 // Since we bypassed the compiler's escape analysis, indicate that r 14772 // must live until the use above. 14773 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14774 return length, err 14775 } 14776 14777 // CopyIn implements marshal.Marshallable.CopyIn. 14778 func (r *Rusage) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14779 return r.CopyInN(cc, addr, r.SizeBytes()) 14780 } 14781 14782 // WriteTo implements io.WriterTo.WriteTo. 14783 func (r *Rusage) WriteTo(writer io.Writer) (int64, error) { 14784 if !r.STime.Packed() && r.UTime.Packed() { 14785 // Type Rusage doesn't have a packed layout in memory, fall back to MarshalBytes. 14786 buf := make([]byte, r.SizeBytes()) 14787 r.MarshalBytes(buf) 14788 length, err := writer.Write(buf) 14789 return int64(length), err 14790 } 14791 14792 // Construct a slice backed by dst's underlying memory. 14793 var buf []byte 14794 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14795 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(r))) 14796 hdr.Len = r.SizeBytes() 14797 hdr.Cap = r.SizeBytes() 14798 14799 length, err := writer.Write(buf) 14800 // Since we bypassed the compiler's escape analysis, indicate that r 14801 // must live until the use above. 14802 runtime.KeepAlive(r) // escapes: replaced by intrinsic. 14803 return int64(length), err 14804 } 14805 14806 // SizeBytes implements marshal.Marshallable.SizeBytes. 14807 func (sd *SeccompData) SizeBytes() int { 14808 return 16 + 14809 8*6 14810 } 14811 14812 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 14813 func (sd *SeccompData) MarshalBytes(dst []byte) []byte { 14814 hostarch.ByteOrder.PutUint32(dst[:4], uint32(sd.Nr)) 14815 dst = dst[4:] 14816 hostarch.ByteOrder.PutUint32(dst[:4], uint32(sd.Arch)) 14817 dst = dst[4:] 14818 hostarch.ByteOrder.PutUint64(dst[:8], uint64(sd.InstructionPointer)) 14819 dst = dst[8:] 14820 for idx := 0; idx < 6; idx++ { 14821 hostarch.ByteOrder.PutUint64(dst[:8], uint64(sd.Args[idx])) 14822 dst = dst[8:] 14823 } 14824 return dst 14825 } 14826 14827 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 14828 func (sd *SeccompData) UnmarshalBytes(src []byte) []byte { 14829 sd.Nr = int32(hostarch.ByteOrder.Uint32(src[:4])) 14830 src = src[4:] 14831 sd.Arch = uint32(hostarch.ByteOrder.Uint32(src[:4])) 14832 src = src[4:] 14833 sd.InstructionPointer = uint64(hostarch.ByteOrder.Uint64(src[:8])) 14834 src = src[8:] 14835 for idx := 0; idx < 6; idx++ { 14836 sd.Args[idx] = uint64(hostarch.ByteOrder.Uint64(src[:8])) 14837 src = src[8:] 14838 } 14839 return src 14840 } 14841 14842 // Packed implements marshal.Marshallable.Packed. 14843 //go:nosplit 14844 func (sd *SeccompData) Packed() bool { 14845 return true 14846 } 14847 14848 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 14849 func (sd *SeccompData) MarshalUnsafe(dst []byte) []byte { 14850 size := sd.SizeBytes() 14851 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(sd), uintptr(size)) 14852 return dst[size:] 14853 } 14854 14855 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 14856 func (sd *SeccompData) UnmarshalUnsafe(src []byte) []byte { 14857 size := sd.SizeBytes() 14858 gohacks.Memmove(unsafe.Pointer(sd), unsafe.Pointer(&src[0]), uintptr(size)) 14859 return src[size:] 14860 } 14861 14862 // CopyOutN implements marshal.Marshallable.CopyOutN. 14863 func (sd *SeccompData) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14864 // Construct a slice backed by dst's underlying memory. 14865 var buf []byte 14866 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14867 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(sd))) 14868 hdr.Len = sd.SizeBytes() 14869 hdr.Cap = sd.SizeBytes() 14870 14871 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14872 // Since we bypassed the compiler's escape analysis, indicate that sd 14873 // must live until the use above. 14874 runtime.KeepAlive(sd) // escapes: replaced by intrinsic. 14875 return length, err 14876 } 14877 14878 // CopyOut implements marshal.Marshallable.CopyOut. 14879 func (sd *SeccompData) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14880 return sd.CopyOutN(cc, addr, sd.SizeBytes()) 14881 } 14882 14883 // CopyInN implements marshal.Marshallable.CopyInN. 14884 func (sd *SeccompData) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14885 // Construct a slice backed by dst's underlying memory. 14886 var buf []byte 14887 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14888 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(sd))) 14889 hdr.Len = sd.SizeBytes() 14890 hdr.Cap = sd.SizeBytes() 14891 14892 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 14893 // Since we bypassed the compiler's escape analysis, indicate that sd 14894 // must live until the use above. 14895 runtime.KeepAlive(sd) // escapes: replaced by intrinsic. 14896 return length, err 14897 } 14898 14899 // CopyIn implements marshal.Marshallable.CopyIn. 14900 func (sd *SeccompData) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 14901 return sd.CopyInN(cc, addr, sd.SizeBytes()) 14902 } 14903 14904 // WriteTo implements io.WriterTo.WriteTo. 14905 func (sd *SeccompData) WriteTo(writer io.Writer) (int64, error) { 14906 // Construct a slice backed by dst's underlying memory. 14907 var buf []byte 14908 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14909 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(sd))) 14910 hdr.Len = sd.SizeBytes() 14911 hdr.Cap = sd.SizeBytes() 14912 14913 length, err := writer.Write(buf) 14914 // Since we bypassed the compiler's escape analysis, indicate that sd 14915 // must live until the use above. 14916 runtime.KeepAlive(sd) // escapes: replaced by intrinsic. 14917 return int64(length), err 14918 } 14919 14920 // SizeBytes implements marshal.Marshallable.SizeBytes. 14921 func (s *SeccompNotif) SizeBytes() int { 14922 return 16 + 14923 (*SeccompData)(nil).SizeBytes() 14924 } 14925 14926 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 14927 func (s *SeccompNotif) MarshalBytes(dst []byte) []byte { 14928 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ID)) 14929 dst = dst[8:] 14930 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Pid)) 14931 dst = dst[4:] 14932 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Flags)) 14933 dst = dst[4:] 14934 dst = s.Data.MarshalUnsafe(dst) 14935 return dst 14936 } 14937 14938 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 14939 func (s *SeccompNotif) UnmarshalBytes(src []byte) []byte { 14940 s.ID = uint64(hostarch.ByteOrder.Uint64(src[:8])) 14941 src = src[8:] 14942 s.Pid = int32(hostarch.ByteOrder.Uint32(src[:4])) 14943 src = src[4:] 14944 s.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 14945 src = src[4:] 14946 src = s.Data.UnmarshalUnsafe(src) 14947 return src 14948 } 14949 14950 // Packed implements marshal.Marshallable.Packed. 14951 //go:nosplit 14952 func (s *SeccompNotif) Packed() bool { 14953 return s.Data.Packed() 14954 } 14955 14956 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 14957 func (s *SeccompNotif) MarshalUnsafe(dst []byte) []byte { 14958 if s.Data.Packed() { 14959 size := s.SizeBytes() 14960 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 14961 return dst[size:] 14962 } 14963 // Type SeccompNotif doesn't have a packed layout in memory, fallback to MarshalBytes. 14964 return s.MarshalBytes(dst) 14965 } 14966 14967 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 14968 func (s *SeccompNotif) UnmarshalUnsafe(src []byte) []byte { 14969 if s.Data.Packed() { 14970 size := s.SizeBytes() 14971 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 14972 return src[size:] 14973 } 14974 // Type SeccompNotif doesn't have a packed layout in memory, fallback to UnmarshalBytes. 14975 return s.UnmarshalBytes(src) 14976 } 14977 14978 // CopyOutN implements marshal.Marshallable.CopyOutN. 14979 func (s *SeccompNotif) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 14980 if !s.Data.Packed() { 14981 // Type SeccompNotif doesn't have a packed layout in memory, fall back to MarshalBytes. 14982 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 14983 s.MarshalBytes(buf) // escapes: fallback. 14984 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14985 } 14986 14987 // Construct a slice backed by dst's underlying memory. 14988 var buf []byte 14989 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 14990 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 14991 hdr.Len = s.SizeBytes() 14992 hdr.Cap = s.SizeBytes() 14993 14994 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 14995 // Since we bypassed the compiler's escape analysis, indicate that s 14996 // must live until the use above. 14997 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 14998 return length, err 14999 } 15000 15001 // CopyOut implements marshal.Marshallable.CopyOut. 15002 func (s *SeccompNotif) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15003 return s.CopyOutN(cc, addr, s.SizeBytes()) 15004 } 15005 15006 // CopyInN implements marshal.Marshallable.CopyInN. 15007 func (s *SeccompNotif) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15008 if !s.Data.Packed() { 15009 // Type SeccompNotif doesn't have a packed layout in memory, fall back to UnmarshalBytes. 15010 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 15011 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15012 // Unmarshal unconditionally. If we had a short copy-in, this results in a 15013 // partially unmarshalled struct. 15014 s.UnmarshalBytes(buf) // escapes: fallback. 15015 return length, err 15016 } 15017 15018 // Construct a slice backed by dst's underlying memory. 15019 var buf []byte 15020 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15021 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15022 hdr.Len = s.SizeBytes() 15023 hdr.Cap = s.SizeBytes() 15024 15025 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15026 // Since we bypassed the compiler's escape analysis, indicate that s 15027 // must live until the use above. 15028 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15029 return length, err 15030 } 15031 15032 // CopyIn implements marshal.Marshallable.CopyIn. 15033 func (s *SeccompNotif) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15034 return s.CopyInN(cc, addr, s.SizeBytes()) 15035 } 15036 15037 // WriteTo implements io.WriterTo.WriteTo. 15038 func (s *SeccompNotif) WriteTo(writer io.Writer) (int64, error) { 15039 if !s.Data.Packed() { 15040 // Type SeccompNotif doesn't have a packed layout in memory, fall back to MarshalBytes. 15041 buf := make([]byte, s.SizeBytes()) 15042 s.MarshalBytes(buf) 15043 length, err := writer.Write(buf) 15044 return int64(length), err 15045 } 15046 15047 // Construct a slice backed by dst's underlying memory. 15048 var buf []byte 15049 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15050 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15051 hdr.Len = s.SizeBytes() 15052 hdr.Cap = s.SizeBytes() 15053 15054 length, err := writer.Write(buf) 15055 // Since we bypassed the compiler's escape analysis, indicate that s 15056 // must live until the use above. 15057 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15058 return int64(length), err 15059 } 15060 15061 // SizeBytes implements marshal.Marshallable.SizeBytes. 15062 func (s *SeccompNotifResp) SizeBytes() int { 15063 return 24 15064 } 15065 15066 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 15067 func (s *SeccompNotifResp) MarshalBytes(dst []byte) []byte { 15068 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ID)) 15069 dst = dst[8:] 15070 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Val)) 15071 dst = dst[8:] 15072 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Error)) 15073 dst = dst[4:] 15074 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Flags)) 15075 dst = dst[4:] 15076 return dst 15077 } 15078 15079 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 15080 func (s *SeccompNotifResp) UnmarshalBytes(src []byte) []byte { 15081 s.ID = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15082 src = src[8:] 15083 s.Val = int64(hostarch.ByteOrder.Uint64(src[:8])) 15084 src = src[8:] 15085 s.Error = int32(hostarch.ByteOrder.Uint32(src[:4])) 15086 src = src[4:] 15087 s.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15088 src = src[4:] 15089 return src 15090 } 15091 15092 // Packed implements marshal.Marshallable.Packed. 15093 //go:nosplit 15094 func (s *SeccompNotifResp) Packed() bool { 15095 return true 15096 } 15097 15098 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 15099 func (s *SeccompNotifResp) MarshalUnsafe(dst []byte) []byte { 15100 size := s.SizeBytes() 15101 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 15102 return dst[size:] 15103 } 15104 15105 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 15106 func (s *SeccompNotifResp) UnmarshalUnsafe(src []byte) []byte { 15107 size := s.SizeBytes() 15108 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 15109 return src[size:] 15110 } 15111 15112 // CopyOutN implements marshal.Marshallable.CopyOutN. 15113 func (s *SeccompNotifResp) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15114 // Construct a slice backed by dst's underlying memory. 15115 var buf []byte 15116 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15117 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15118 hdr.Len = s.SizeBytes() 15119 hdr.Cap = s.SizeBytes() 15120 15121 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 15122 // Since we bypassed the compiler's escape analysis, indicate that s 15123 // must live until the use above. 15124 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15125 return length, err 15126 } 15127 15128 // CopyOut implements marshal.Marshallable.CopyOut. 15129 func (s *SeccompNotifResp) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15130 return s.CopyOutN(cc, addr, s.SizeBytes()) 15131 } 15132 15133 // CopyInN implements marshal.Marshallable.CopyInN. 15134 func (s *SeccompNotifResp) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15135 // Construct a slice backed by dst's underlying memory. 15136 var buf []byte 15137 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15138 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15139 hdr.Len = s.SizeBytes() 15140 hdr.Cap = s.SizeBytes() 15141 15142 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15143 // Since we bypassed the compiler's escape analysis, indicate that s 15144 // must live until the use above. 15145 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15146 return length, err 15147 } 15148 15149 // CopyIn implements marshal.Marshallable.CopyIn. 15150 func (s *SeccompNotifResp) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15151 return s.CopyInN(cc, addr, s.SizeBytes()) 15152 } 15153 15154 // WriteTo implements io.WriterTo.WriteTo. 15155 func (s *SeccompNotifResp) WriteTo(writer io.Writer) (int64, error) { 15156 // Construct a slice backed by dst's underlying memory. 15157 var buf []byte 15158 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15159 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15160 hdr.Len = s.SizeBytes() 15161 hdr.Cap = s.SizeBytes() 15162 15163 length, err := writer.Write(buf) 15164 // Since we bypassed the compiler's escape analysis, indicate that s 15165 // must live until the use above. 15166 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15167 return int64(length), err 15168 } 15169 15170 // SizeBytes implements marshal.Marshallable.SizeBytes. 15171 func (s *SeccompNotifSizes) SizeBytes() int { 15172 return 6 15173 } 15174 15175 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 15176 func (s *SeccompNotifSizes) MarshalBytes(dst []byte) []byte { 15177 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Notif)) 15178 dst = dst[2:] 15179 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Notif_resp)) 15180 dst = dst[2:] 15181 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Data)) 15182 dst = dst[2:] 15183 return dst 15184 } 15185 15186 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 15187 func (s *SeccompNotifSizes) UnmarshalBytes(src []byte) []byte { 15188 s.Notif = uint16(hostarch.ByteOrder.Uint16(src[:2])) 15189 src = src[2:] 15190 s.Notif_resp = uint16(hostarch.ByteOrder.Uint16(src[:2])) 15191 src = src[2:] 15192 s.Data = uint16(hostarch.ByteOrder.Uint16(src[:2])) 15193 src = src[2:] 15194 return src 15195 } 15196 15197 // Packed implements marshal.Marshallable.Packed. 15198 //go:nosplit 15199 func (s *SeccompNotifSizes) Packed() bool { 15200 return true 15201 } 15202 15203 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 15204 func (s *SeccompNotifSizes) MarshalUnsafe(dst []byte) []byte { 15205 size := s.SizeBytes() 15206 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 15207 return dst[size:] 15208 } 15209 15210 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 15211 func (s *SeccompNotifSizes) UnmarshalUnsafe(src []byte) []byte { 15212 size := s.SizeBytes() 15213 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 15214 return src[size:] 15215 } 15216 15217 // CopyOutN implements marshal.Marshallable.CopyOutN. 15218 func (s *SeccompNotifSizes) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15219 // Construct a slice backed by dst's underlying memory. 15220 var buf []byte 15221 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15222 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15223 hdr.Len = s.SizeBytes() 15224 hdr.Cap = s.SizeBytes() 15225 15226 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 15227 // Since we bypassed the compiler's escape analysis, indicate that s 15228 // must live until the use above. 15229 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15230 return length, err 15231 } 15232 15233 // CopyOut implements marshal.Marshallable.CopyOut. 15234 func (s *SeccompNotifSizes) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15235 return s.CopyOutN(cc, addr, s.SizeBytes()) 15236 } 15237 15238 // CopyInN implements marshal.Marshallable.CopyInN. 15239 func (s *SeccompNotifSizes) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15240 // Construct a slice backed by dst's underlying memory. 15241 var buf []byte 15242 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15243 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15244 hdr.Len = s.SizeBytes() 15245 hdr.Cap = s.SizeBytes() 15246 15247 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15248 // Since we bypassed the compiler's escape analysis, indicate that s 15249 // must live until the use above. 15250 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15251 return length, err 15252 } 15253 15254 // CopyIn implements marshal.Marshallable.CopyIn. 15255 func (s *SeccompNotifSizes) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15256 return s.CopyInN(cc, addr, s.SizeBytes()) 15257 } 15258 15259 // WriteTo implements io.WriterTo.WriteTo. 15260 func (s *SeccompNotifSizes) WriteTo(writer io.Writer) (int64, error) { 15261 // Construct a slice backed by dst's underlying memory. 15262 var buf []byte 15263 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15264 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15265 hdr.Len = s.SizeBytes() 15266 hdr.Cap = s.SizeBytes() 15267 15268 length, err := writer.Write(buf) 15269 // Since we bypassed the compiler's escape analysis, indicate that s 15270 // must live until the use above. 15271 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15272 return int64(length), err 15273 } 15274 15275 // SizeBytes implements marshal.Marshallable.SizeBytes. 15276 func (s *SemInfo) SizeBytes() int { 15277 return 40 15278 } 15279 15280 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 15281 func (s *SemInfo) MarshalBytes(dst []byte) []byte { 15282 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMap)) 15283 dst = dst[4:] 15284 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMni)) 15285 dst = dst[4:] 15286 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMns)) 15287 dst = dst[4:] 15288 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMnu)) 15289 dst = dst[4:] 15290 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemMsl)) 15291 dst = dst[4:] 15292 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemOpm)) 15293 dst = dst[4:] 15294 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemUme)) 15295 dst = dst[4:] 15296 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemUsz)) 15297 dst = dst[4:] 15298 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemVmx)) 15299 dst = dst[4:] 15300 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.SemAem)) 15301 dst = dst[4:] 15302 return dst 15303 } 15304 15305 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 15306 func (s *SemInfo) UnmarshalBytes(src []byte) []byte { 15307 s.SemMap = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15308 src = src[4:] 15309 s.SemMni = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15310 src = src[4:] 15311 s.SemMns = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15312 src = src[4:] 15313 s.SemMnu = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15314 src = src[4:] 15315 s.SemMsl = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15316 src = src[4:] 15317 s.SemOpm = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15318 src = src[4:] 15319 s.SemUme = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15320 src = src[4:] 15321 s.SemUsz = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15322 src = src[4:] 15323 s.SemVmx = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15324 src = src[4:] 15325 s.SemAem = uint32(hostarch.ByteOrder.Uint32(src[:4])) 15326 src = src[4:] 15327 return src 15328 } 15329 15330 // Packed implements marshal.Marshallable.Packed. 15331 //go:nosplit 15332 func (s *SemInfo) Packed() bool { 15333 return true 15334 } 15335 15336 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 15337 func (s *SemInfo) MarshalUnsafe(dst []byte) []byte { 15338 size := s.SizeBytes() 15339 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 15340 return dst[size:] 15341 } 15342 15343 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 15344 func (s *SemInfo) UnmarshalUnsafe(src []byte) []byte { 15345 size := s.SizeBytes() 15346 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 15347 return src[size:] 15348 } 15349 15350 // CopyOutN implements marshal.Marshallable.CopyOutN. 15351 func (s *SemInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15352 // Construct a slice backed by dst's underlying memory. 15353 var buf []byte 15354 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15355 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15356 hdr.Len = s.SizeBytes() 15357 hdr.Cap = s.SizeBytes() 15358 15359 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 15360 // Since we bypassed the compiler's escape analysis, indicate that s 15361 // must live until the use above. 15362 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15363 return length, err 15364 } 15365 15366 // CopyOut implements marshal.Marshallable.CopyOut. 15367 func (s *SemInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15368 return s.CopyOutN(cc, addr, s.SizeBytes()) 15369 } 15370 15371 // CopyInN implements marshal.Marshallable.CopyInN. 15372 func (s *SemInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15373 // Construct a slice backed by dst's underlying memory. 15374 var buf []byte 15375 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15376 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15377 hdr.Len = s.SizeBytes() 15378 hdr.Cap = s.SizeBytes() 15379 15380 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15381 // Since we bypassed the compiler's escape analysis, indicate that s 15382 // must live until the use above. 15383 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15384 return length, err 15385 } 15386 15387 // CopyIn implements marshal.Marshallable.CopyIn. 15388 func (s *SemInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15389 return s.CopyInN(cc, addr, s.SizeBytes()) 15390 } 15391 15392 // WriteTo implements io.WriterTo.WriteTo. 15393 func (s *SemInfo) WriteTo(writer io.Writer) (int64, error) { 15394 // Construct a slice backed by dst's underlying memory. 15395 var buf []byte 15396 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15397 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15398 hdr.Len = s.SizeBytes() 15399 hdr.Cap = s.SizeBytes() 15400 15401 length, err := writer.Write(buf) 15402 // Since we bypassed the compiler's escape analysis, indicate that s 15403 // must live until the use above. 15404 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15405 return int64(length), err 15406 } 15407 15408 // SizeBytes implements marshal.Marshallable.SizeBytes. 15409 func (s *Sembuf) SizeBytes() int { 15410 return 6 15411 } 15412 15413 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 15414 func (s *Sembuf) MarshalBytes(dst []byte) []byte { 15415 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.SemNum)) 15416 dst = dst[2:] 15417 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.SemOp)) 15418 dst = dst[2:] 15419 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.SemFlg)) 15420 dst = dst[2:] 15421 return dst 15422 } 15423 15424 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 15425 func (s *Sembuf) UnmarshalBytes(src []byte) []byte { 15426 s.SemNum = uint16(hostarch.ByteOrder.Uint16(src[:2])) 15427 src = src[2:] 15428 s.SemOp = int16(hostarch.ByteOrder.Uint16(src[:2])) 15429 src = src[2:] 15430 s.SemFlg = int16(hostarch.ByteOrder.Uint16(src[:2])) 15431 src = src[2:] 15432 return src 15433 } 15434 15435 // Packed implements marshal.Marshallable.Packed. 15436 //go:nosplit 15437 func (s *Sembuf) Packed() bool { 15438 return true 15439 } 15440 15441 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 15442 func (s *Sembuf) MarshalUnsafe(dst []byte) []byte { 15443 size := s.SizeBytes() 15444 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 15445 return dst[size:] 15446 } 15447 15448 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 15449 func (s *Sembuf) UnmarshalUnsafe(src []byte) []byte { 15450 size := s.SizeBytes() 15451 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 15452 return src[size:] 15453 } 15454 15455 // CopyOutN implements marshal.Marshallable.CopyOutN. 15456 func (s *Sembuf) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15457 // Construct a slice backed by dst's underlying memory. 15458 var buf []byte 15459 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15460 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15461 hdr.Len = s.SizeBytes() 15462 hdr.Cap = s.SizeBytes() 15463 15464 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 15465 // Since we bypassed the compiler's escape analysis, indicate that s 15466 // must live until the use above. 15467 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15468 return length, err 15469 } 15470 15471 // CopyOut implements marshal.Marshallable.CopyOut. 15472 func (s *Sembuf) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15473 return s.CopyOutN(cc, addr, s.SizeBytes()) 15474 } 15475 15476 // CopyInN implements marshal.Marshallable.CopyInN. 15477 func (s *Sembuf) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15478 // Construct a slice backed by dst's underlying memory. 15479 var buf []byte 15480 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15481 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15482 hdr.Len = s.SizeBytes() 15483 hdr.Cap = s.SizeBytes() 15484 15485 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15486 // Since we bypassed the compiler's escape analysis, indicate that s 15487 // must live until the use above. 15488 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15489 return length, err 15490 } 15491 15492 // CopyIn implements marshal.Marshallable.CopyIn. 15493 func (s *Sembuf) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15494 return s.CopyInN(cc, addr, s.SizeBytes()) 15495 } 15496 15497 // WriteTo implements io.WriterTo.WriteTo. 15498 func (s *Sembuf) WriteTo(writer io.Writer) (int64, error) { 15499 // Construct a slice backed by dst's underlying memory. 15500 var buf []byte 15501 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15502 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15503 hdr.Len = s.SizeBytes() 15504 hdr.Cap = s.SizeBytes() 15505 15506 length, err := writer.Write(buf) 15507 // Since we bypassed the compiler's escape analysis, indicate that s 15508 // must live until the use above. 15509 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15510 return int64(length), err 15511 } 15512 15513 // CopySembufSliceIn copies in a slice of Sembuf objects from the task's memory. 15514 func CopySembufSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []Sembuf) (int, error) { 15515 count := len(dst) 15516 if count == 0 { 15517 return 0, nil 15518 } 15519 size := (*Sembuf)(nil).SizeBytes() 15520 15521 ptr := unsafe.Pointer(&dst) 15522 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 15523 15524 // Construct a slice backed by dst's underlying memory. 15525 var buf []byte 15526 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15527 hdr.Data = uintptr(val) 15528 hdr.Len = size * count 15529 hdr.Cap = size * count 15530 15531 length, err := cc.CopyInBytes(addr, buf) 15532 // Since we bypassed the compiler's escape analysis, indicate that dst 15533 // must live until the use above. 15534 runtime.KeepAlive(dst) // escapes: replaced by intrinsic. 15535 return length, err 15536 } 15537 15538 // CopySembufSliceOut copies a slice of Sembuf objects to the task's memory. 15539 func CopySembufSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []Sembuf) (int, error) { 15540 count := len(src) 15541 if count == 0 { 15542 return 0, nil 15543 } 15544 size := (*Sembuf)(nil).SizeBytes() 15545 15546 ptr := unsafe.Pointer(&src) 15547 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 15548 15549 // Construct a slice backed by dst's underlying memory. 15550 var buf []byte 15551 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15552 hdr.Data = uintptr(val) 15553 hdr.Len = size * count 15554 hdr.Cap = size * count 15555 15556 length, err := cc.CopyOutBytes(addr, buf) 15557 // Since we bypassed the compiler's escape analysis, indicate that src 15558 // must live until the use above. 15559 runtime.KeepAlive(src) // escapes: replaced by intrinsic. 15560 return length, err 15561 } 15562 15563 // MarshalUnsafeSembufSlice is like Sembuf.MarshalUnsafe, but for a []Sembuf. 15564 func MarshalUnsafeSembufSlice(src []Sembuf, dst []byte) []byte { 15565 count := len(src) 15566 if count == 0 { 15567 return dst 15568 } 15569 15570 size := (*Sembuf)(nil).SizeBytes() 15571 buf := dst[:size*count] 15572 gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) 15573 return dst[size*count:] 15574 } 15575 15576 // UnmarshalUnsafeSembufSlice is like Sembuf.UnmarshalUnsafe, but for a []Sembuf. 15577 func UnmarshalUnsafeSembufSlice(dst []Sembuf, src []byte) []byte { 15578 count := len(dst) 15579 if count == 0 { 15580 return src 15581 } 15582 15583 size := (*Sembuf)(nil).SizeBytes() 15584 buf := src[:size*count] 15585 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) 15586 return src[size*count:] 15587 } 15588 15589 // SizeBytes implements marshal.Marshallable.SizeBytes. 15590 func (s *ShmInfo) SizeBytes() int { 15591 return 44 + 15592 1*4 15593 } 15594 15595 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 15596 func (s *ShmInfo) MarshalBytes(dst []byte) []byte { 15597 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.UsedIDs)) 15598 dst = dst[4:] 15599 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 15600 dst = dst[1*(4):] 15601 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmTot)) 15602 dst = dst[8:] 15603 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmRss)) 15604 dst = dst[8:] 15605 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmSwp)) 15606 dst = dst[8:] 15607 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.SwapAttempts)) 15608 dst = dst[8:] 15609 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.SwapSuccesses)) 15610 dst = dst[8:] 15611 return dst 15612 } 15613 15614 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 15615 func (s *ShmInfo) UnmarshalBytes(src []byte) []byte { 15616 s.UsedIDs = int32(hostarch.ByteOrder.Uint32(src[:4])) 15617 src = src[4:] 15618 // Padding: ~ copy([4]byte(s._), src[:sizeof(byte)*4]) 15619 src = src[1*(4):] 15620 s.ShmTot = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15621 src = src[8:] 15622 s.ShmRss = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15623 src = src[8:] 15624 s.ShmSwp = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15625 src = src[8:] 15626 s.SwapAttempts = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15627 src = src[8:] 15628 s.SwapSuccesses = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15629 src = src[8:] 15630 return src 15631 } 15632 15633 // Packed implements marshal.Marshallable.Packed. 15634 //go:nosplit 15635 func (s *ShmInfo) Packed() bool { 15636 return true 15637 } 15638 15639 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 15640 func (s *ShmInfo) MarshalUnsafe(dst []byte) []byte { 15641 size := s.SizeBytes() 15642 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 15643 return dst[size:] 15644 } 15645 15646 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 15647 func (s *ShmInfo) UnmarshalUnsafe(src []byte) []byte { 15648 size := s.SizeBytes() 15649 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 15650 return src[size:] 15651 } 15652 15653 // CopyOutN implements marshal.Marshallable.CopyOutN. 15654 func (s *ShmInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15655 // Construct a slice backed by dst's underlying memory. 15656 var buf []byte 15657 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15658 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15659 hdr.Len = s.SizeBytes() 15660 hdr.Cap = s.SizeBytes() 15661 15662 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 15663 // Since we bypassed the compiler's escape analysis, indicate that s 15664 // must live until the use above. 15665 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15666 return length, err 15667 } 15668 15669 // CopyOut implements marshal.Marshallable.CopyOut. 15670 func (s *ShmInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15671 return s.CopyOutN(cc, addr, s.SizeBytes()) 15672 } 15673 15674 // CopyInN implements marshal.Marshallable.CopyInN. 15675 func (s *ShmInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15676 // Construct a slice backed by dst's underlying memory. 15677 var buf []byte 15678 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15679 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15680 hdr.Len = s.SizeBytes() 15681 hdr.Cap = s.SizeBytes() 15682 15683 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15684 // Since we bypassed the compiler's escape analysis, indicate that s 15685 // must live until the use above. 15686 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15687 return length, err 15688 } 15689 15690 // CopyIn implements marshal.Marshallable.CopyIn. 15691 func (s *ShmInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15692 return s.CopyInN(cc, addr, s.SizeBytes()) 15693 } 15694 15695 // WriteTo implements io.WriterTo.WriteTo. 15696 func (s *ShmInfo) WriteTo(writer io.Writer) (int64, error) { 15697 // Construct a slice backed by dst's underlying memory. 15698 var buf []byte 15699 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15700 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15701 hdr.Len = s.SizeBytes() 15702 hdr.Cap = s.SizeBytes() 15703 15704 length, err := writer.Write(buf) 15705 // Since we bypassed the compiler's escape analysis, indicate that s 15706 // must live until the use above. 15707 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15708 return int64(length), err 15709 } 15710 15711 // SizeBytes implements marshal.Marshallable.SizeBytes. 15712 func (s *ShmParams) SizeBytes() int { 15713 return 40 15714 } 15715 15716 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 15717 func (s *ShmParams) MarshalBytes(dst []byte) []byte { 15718 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmMax)) 15719 dst = dst[8:] 15720 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmMin)) 15721 dst = dst[8:] 15722 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmMni)) 15723 dst = dst[8:] 15724 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmSeg)) 15725 dst = dst[8:] 15726 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmAll)) 15727 dst = dst[8:] 15728 return dst 15729 } 15730 15731 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 15732 func (s *ShmParams) UnmarshalBytes(src []byte) []byte { 15733 s.ShmMax = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15734 src = src[8:] 15735 s.ShmMin = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15736 src = src[8:] 15737 s.ShmMni = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15738 src = src[8:] 15739 s.ShmSeg = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15740 src = src[8:] 15741 s.ShmAll = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15742 src = src[8:] 15743 return src 15744 } 15745 15746 // Packed implements marshal.Marshallable.Packed. 15747 //go:nosplit 15748 func (s *ShmParams) Packed() bool { 15749 return true 15750 } 15751 15752 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 15753 func (s *ShmParams) MarshalUnsafe(dst []byte) []byte { 15754 size := s.SizeBytes() 15755 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 15756 return dst[size:] 15757 } 15758 15759 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 15760 func (s *ShmParams) UnmarshalUnsafe(src []byte) []byte { 15761 size := s.SizeBytes() 15762 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 15763 return src[size:] 15764 } 15765 15766 // CopyOutN implements marshal.Marshallable.CopyOutN. 15767 func (s *ShmParams) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15768 // Construct a slice backed by dst's underlying memory. 15769 var buf []byte 15770 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15771 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15772 hdr.Len = s.SizeBytes() 15773 hdr.Cap = s.SizeBytes() 15774 15775 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 15776 // Since we bypassed the compiler's escape analysis, indicate that s 15777 // must live until the use above. 15778 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15779 return length, err 15780 } 15781 15782 // CopyOut implements marshal.Marshallable.CopyOut. 15783 func (s *ShmParams) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15784 return s.CopyOutN(cc, addr, s.SizeBytes()) 15785 } 15786 15787 // CopyInN implements marshal.Marshallable.CopyInN. 15788 func (s *ShmParams) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15789 // Construct a slice backed by dst's underlying memory. 15790 var buf []byte 15791 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15792 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15793 hdr.Len = s.SizeBytes() 15794 hdr.Cap = s.SizeBytes() 15795 15796 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15797 // Since we bypassed the compiler's escape analysis, indicate that s 15798 // must live until the use above. 15799 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15800 return length, err 15801 } 15802 15803 // CopyIn implements marshal.Marshallable.CopyIn. 15804 func (s *ShmParams) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15805 return s.CopyInN(cc, addr, s.SizeBytes()) 15806 } 15807 15808 // WriteTo implements io.WriterTo.WriteTo. 15809 func (s *ShmParams) WriteTo(writer io.Writer) (int64, error) { 15810 // Construct a slice backed by dst's underlying memory. 15811 var buf []byte 15812 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15813 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15814 hdr.Len = s.SizeBytes() 15815 hdr.Cap = s.SizeBytes() 15816 15817 length, err := writer.Write(buf) 15818 // Since we bypassed the compiler's escape analysis, indicate that s 15819 // must live until the use above. 15820 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15821 return int64(length), err 15822 } 15823 15824 // SizeBytes implements marshal.Marshallable.SizeBytes. 15825 func (s *ShmidDS) SizeBytes() int { 15826 return 40 + 15827 (*IPCPerm)(nil).SizeBytes() + 15828 (*TimeT)(nil).SizeBytes() + 15829 (*TimeT)(nil).SizeBytes() + 15830 (*TimeT)(nil).SizeBytes() 15831 } 15832 15833 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 15834 func (s *ShmidDS) MarshalBytes(dst []byte) []byte { 15835 dst = s.ShmPerm.MarshalUnsafe(dst) 15836 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmSegsz)) 15837 dst = dst[8:] 15838 dst = s.ShmAtime.MarshalUnsafe(dst) 15839 dst = s.ShmDtime.MarshalUnsafe(dst) 15840 dst = s.ShmCtime.MarshalUnsafe(dst) 15841 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.ShmCpid)) 15842 dst = dst[4:] 15843 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.ShmLpid)) 15844 dst = dst[4:] 15845 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.ShmNattach)) 15846 dst = dst[8:] 15847 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Unused4)) 15848 dst = dst[8:] 15849 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Unused5)) 15850 dst = dst[8:] 15851 return dst 15852 } 15853 15854 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 15855 func (s *ShmidDS) UnmarshalBytes(src []byte) []byte { 15856 src = s.ShmPerm.UnmarshalUnsafe(src) 15857 s.ShmSegsz = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15858 src = src[8:] 15859 src = s.ShmAtime.UnmarshalUnsafe(src) 15860 src = s.ShmDtime.UnmarshalUnsafe(src) 15861 src = s.ShmCtime.UnmarshalUnsafe(src) 15862 s.ShmCpid = int32(hostarch.ByteOrder.Uint32(src[:4])) 15863 src = src[4:] 15864 s.ShmLpid = int32(hostarch.ByteOrder.Uint32(src[:4])) 15865 src = src[4:] 15866 s.ShmNattach = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15867 src = src[8:] 15868 s.Unused4 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15869 src = src[8:] 15870 s.Unused5 = uint64(hostarch.ByteOrder.Uint64(src[:8])) 15871 src = src[8:] 15872 return src 15873 } 15874 15875 // Packed implements marshal.Marshallable.Packed. 15876 //go:nosplit 15877 func (s *ShmidDS) Packed() bool { 15878 return s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() 15879 } 15880 15881 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 15882 func (s *ShmidDS) MarshalUnsafe(dst []byte) []byte { 15883 if s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { 15884 size := s.SizeBytes() 15885 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 15886 return dst[size:] 15887 } 15888 // Type ShmidDS doesn't have a packed layout in memory, fallback to MarshalBytes. 15889 return s.MarshalBytes(dst) 15890 } 15891 15892 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 15893 func (s *ShmidDS) UnmarshalUnsafe(src []byte) []byte { 15894 if s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { 15895 size := s.SizeBytes() 15896 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 15897 return src[size:] 15898 } 15899 // Type ShmidDS doesn't have a packed layout in memory, fallback to UnmarshalBytes. 15900 return s.UnmarshalBytes(src) 15901 } 15902 15903 // CopyOutN implements marshal.Marshallable.CopyOutN. 15904 func (s *ShmidDS) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15905 if !s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { 15906 // Type ShmidDS doesn't have a packed layout in memory, fall back to MarshalBytes. 15907 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 15908 s.MarshalBytes(buf) // escapes: fallback. 15909 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 15910 } 15911 15912 // Construct a slice backed by dst's underlying memory. 15913 var buf []byte 15914 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15915 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15916 hdr.Len = s.SizeBytes() 15917 hdr.Cap = s.SizeBytes() 15918 15919 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 15920 // Since we bypassed the compiler's escape analysis, indicate that s 15921 // must live until the use above. 15922 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15923 return length, err 15924 } 15925 15926 // CopyOut implements marshal.Marshallable.CopyOut. 15927 func (s *ShmidDS) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15928 return s.CopyOutN(cc, addr, s.SizeBytes()) 15929 } 15930 15931 // CopyInN implements marshal.Marshallable.CopyInN. 15932 func (s *ShmidDS) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 15933 if !s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { 15934 // Type ShmidDS doesn't have a packed layout in memory, fall back to UnmarshalBytes. 15935 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 15936 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15937 // Unmarshal unconditionally. If we had a short copy-in, this results in a 15938 // partially unmarshalled struct. 15939 s.UnmarshalBytes(buf) // escapes: fallback. 15940 return length, err 15941 } 15942 15943 // Construct a slice backed by dst's underlying memory. 15944 var buf []byte 15945 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15946 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15947 hdr.Len = s.SizeBytes() 15948 hdr.Cap = s.SizeBytes() 15949 15950 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 15951 // Since we bypassed the compiler's escape analysis, indicate that s 15952 // must live until the use above. 15953 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15954 return length, err 15955 } 15956 15957 // CopyIn implements marshal.Marshallable.CopyIn. 15958 func (s *ShmidDS) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 15959 return s.CopyInN(cc, addr, s.SizeBytes()) 15960 } 15961 15962 // WriteTo implements io.WriterTo.WriteTo. 15963 func (s *ShmidDS) WriteTo(writer io.Writer) (int64, error) { 15964 if !s.ShmAtime.Packed() && s.ShmCtime.Packed() && s.ShmDtime.Packed() && s.ShmPerm.Packed() { 15965 // Type ShmidDS doesn't have a packed layout in memory, fall back to MarshalBytes. 15966 buf := make([]byte, s.SizeBytes()) 15967 s.MarshalBytes(buf) 15968 length, err := writer.Write(buf) 15969 return int64(length), err 15970 } 15971 15972 // Construct a slice backed by dst's underlying memory. 15973 var buf []byte 15974 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 15975 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 15976 hdr.Len = s.SizeBytes() 15977 hdr.Cap = s.SizeBytes() 15978 15979 length, err := writer.Write(buf) 15980 // Since we bypassed the compiler's escape analysis, indicate that s 15981 // must live until the use above. 15982 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 15983 return int64(length), err 15984 } 15985 15986 // SizeBytes implements marshal.Marshallable.SizeBytes. 15987 func (s *SigAction) SizeBytes() int { 15988 return 24 + 15989 (*SignalSet)(nil).SizeBytes() 15990 } 15991 15992 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 15993 func (s *SigAction) MarshalBytes(dst []byte) []byte { 15994 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Handler)) 15995 dst = dst[8:] 15996 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Flags)) 15997 dst = dst[8:] 15998 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Restorer)) 15999 dst = dst[8:] 16000 dst = s.Mask.MarshalUnsafe(dst) 16001 return dst 16002 } 16003 16004 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 16005 func (s *SigAction) UnmarshalBytes(src []byte) []byte { 16006 s.Handler = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16007 src = src[8:] 16008 s.Flags = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16009 src = src[8:] 16010 s.Restorer = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16011 src = src[8:] 16012 src = s.Mask.UnmarshalUnsafe(src) 16013 return src 16014 } 16015 16016 // Packed implements marshal.Marshallable.Packed. 16017 //go:nosplit 16018 func (s *SigAction) Packed() bool { 16019 return s.Mask.Packed() 16020 } 16021 16022 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 16023 func (s *SigAction) MarshalUnsafe(dst []byte) []byte { 16024 if s.Mask.Packed() { 16025 size := s.SizeBytes() 16026 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 16027 return dst[size:] 16028 } 16029 // Type SigAction doesn't have a packed layout in memory, fallback to MarshalBytes. 16030 return s.MarshalBytes(dst) 16031 } 16032 16033 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 16034 func (s *SigAction) UnmarshalUnsafe(src []byte) []byte { 16035 if s.Mask.Packed() { 16036 size := s.SizeBytes() 16037 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 16038 return src[size:] 16039 } 16040 // Type SigAction doesn't have a packed layout in memory, fallback to UnmarshalBytes. 16041 return s.UnmarshalBytes(src) 16042 } 16043 16044 // CopyOutN implements marshal.Marshallable.CopyOutN. 16045 func (s *SigAction) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16046 if !s.Mask.Packed() { 16047 // Type SigAction doesn't have a packed layout in memory, fall back to MarshalBytes. 16048 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 16049 s.MarshalBytes(buf) // escapes: fallback. 16050 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16051 } 16052 16053 // Construct a slice backed by dst's underlying memory. 16054 var buf []byte 16055 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16056 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16057 hdr.Len = s.SizeBytes() 16058 hdr.Cap = s.SizeBytes() 16059 16060 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16061 // Since we bypassed the compiler's escape analysis, indicate that s 16062 // must live until the use above. 16063 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16064 return length, err 16065 } 16066 16067 // CopyOut implements marshal.Marshallable.CopyOut. 16068 func (s *SigAction) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16069 return s.CopyOutN(cc, addr, s.SizeBytes()) 16070 } 16071 16072 // CopyInN implements marshal.Marshallable.CopyInN. 16073 func (s *SigAction) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16074 if !s.Mask.Packed() { 16075 // Type SigAction doesn't have a packed layout in memory, fall back to UnmarshalBytes. 16076 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 16077 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 16078 // Unmarshal unconditionally. If we had a short copy-in, this results in a 16079 // partially unmarshalled struct. 16080 s.UnmarshalBytes(buf) // escapes: fallback. 16081 return length, err 16082 } 16083 16084 // Construct a slice backed by dst's underlying memory. 16085 var buf []byte 16086 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16087 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16088 hdr.Len = s.SizeBytes() 16089 hdr.Cap = s.SizeBytes() 16090 16091 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 16092 // Since we bypassed the compiler's escape analysis, indicate that s 16093 // must live until the use above. 16094 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16095 return length, err 16096 } 16097 16098 // CopyIn implements marshal.Marshallable.CopyIn. 16099 func (s *SigAction) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16100 return s.CopyInN(cc, addr, s.SizeBytes()) 16101 } 16102 16103 // WriteTo implements io.WriterTo.WriteTo. 16104 func (s *SigAction) WriteTo(writer io.Writer) (int64, error) { 16105 if !s.Mask.Packed() { 16106 // Type SigAction doesn't have a packed layout in memory, fall back to MarshalBytes. 16107 buf := make([]byte, s.SizeBytes()) 16108 s.MarshalBytes(buf) 16109 length, err := writer.Write(buf) 16110 return int64(length), err 16111 } 16112 16113 // Construct a slice backed by dst's underlying memory. 16114 var buf []byte 16115 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16116 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16117 hdr.Len = s.SizeBytes() 16118 hdr.Cap = s.SizeBytes() 16119 16120 length, err := writer.Write(buf) 16121 // Since we bypassed the compiler's escape analysis, indicate that s 16122 // must live until the use above. 16123 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16124 return int64(length), err 16125 } 16126 16127 // SizeBytes implements marshal.Marshallable.SizeBytes. 16128 func (s *Sigevent) SizeBytes() int { 16129 return 20 + 16130 1*44 16131 } 16132 16133 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 16134 func (s *Sigevent) MarshalBytes(dst []byte) []byte { 16135 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Value)) 16136 dst = dst[8:] 16137 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Signo)) 16138 dst = dst[4:] 16139 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Notify)) 16140 dst = dst[4:] 16141 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Tid)) 16142 dst = dst[4:] 16143 for idx := 0; idx < 44; idx++ { 16144 dst[0] = byte(s.UnRemainder[idx]) 16145 dst = dst[1:] 16146 } 16147 return dst 16148 } 16149 16150 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 16151 func (s *Sigevent) UnmarshalBytes(src []byte) []byte { 16152 s.Value = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16153 src = src[8:] 16154 s.Signo = int32(hostarch.ByteOrder.Uint32(src[:4])) 16155 src = src[4:] 16156 s.Notify = int32(hostarch.ByteOrder.Uint32(src[:4])) 16157 src = src[4:] 16158 s.Tid = int32(hostarch.ByteOrder.Uint32(src[:4])) 16159 src = src[4:] 16160 for idx := 0; idx < 44; idx++ { 16161 s.UnRemainder[idx] = src[0] 16162 src = src[1:] 16163 } 16164 return src 16165 } 16166 16167 // Packed implements marshal.Marshallable.Packed. 16168 //go:nosplit 16169 func (s *Sigevent) Packed() bool { 16170 return true 16171 } 16172 16173 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 16174 func (s *Sigevent) MarshalUnsafe(dst []byte) []byte { 16175 size := s.SizeBytes() 16176 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 16177 return dst[size:] 16178 } 16179 16180 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 16181 func (s *Sigevent) UnmarshalUnsafe(src []byte) []byte { 16182 size := s.SizeBytes() 16183 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 16184 return src[size:] 16185 } 16186 16187 // CopyOutN implements marshal.Marshallable.CopyOutN. 16188 func (s *Sigevent) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16189 // Construct a slice backed by dst's underlying memory. 16190 var buf []byte 16191 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16192 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16193 hdr.Len = s.SizeBytes() 16194 hdr.Cap = s.SizeBytes() 16195 16196 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16197 // Since we bypassed the compiler's escape analysis, indicate that s 16198 // must live until the use above. 16199 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16200 return length, err 16201 } 16202 16203 // CopyOut implements marshal.Marshallable.CopyOut. 16204 func (s *Sigevent) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16205 return s.CopyOutN(cc, addr, s.SizeBytes()) 16206 } 16207 16208 // CopyInN implements marshal.Marshallable.CopyInN. 16209 func (s *Sigevent) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16210 // Construct a slice backed by dst's underlying memory. 16211 var buf []byte 16212 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16213 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16214 hdr.Len = s.SizeBytes() 16215 hdr.Cap = s.SizeBytes() 16216 16217 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 16218 // Since we bypassed the compiler's escape analysis, indicate that s 16219 // must live until the use above. 16220 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16221 return length, err 16222 } 16223 16224 // CopyIn implements marshal.Marshallable.CopyIn. 16225 func (s *Sigevent) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16226 return s.CopyInN(cc, addr, s.SizeBytes()) 16227 } 16228 16229 // WriteTo implements io.WriterTo.WriteTo. 16230 func (s *Sigevent) WriteTo(writer io.Writer) (int64, error) { 16231 // Construct a slice backed by dst's underlying memory. 16232 var buf []byte 16233 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16234 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16235 hdr.Len = s.SizeBytes() 16236 hdr.Cap = s.SizeBytes() 16237 16238 length, err := writer.Write(buf) 16239 // Since we bypassed the compiler's escape analysis, indicate that s 16240 // must live until the use above. 16241 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16242 return int64(length), err 16243 } 16244 16245 // SizeBytes implements marshal.Marshallable.SizeBytes. 16246 func (s *SignalInfo) SizeBytes() int { 16247 return 16 + 16248 1*(128-16) 16249 } 16250 16251 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 16252 func (s *SignalInfo) MarshalBytes(dst []byte) []byte { 16253 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Signo)) 16254 dst = dst[4:] 16255 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Errno)) 16256 dst = dst[4:] 16257 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Code)) 16258 dst = dst[4:] 16259 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 16260 dst = dst[4:] 16261 for idx := 0; idx < (128-16); idx++ { 16262 dst[0] = byte(s.Fields[idx]) 16263 dst = dst[1:] 16264 } 16265 return dst 16266 } 16267 16268 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 16269 func (s *SignalInfo) UnmarshalBytes(src []byte) []byte { 16270 s.Signo = int32(hostarch.ByteOrder.Uint32(src[:4])) 16271 src = src[4:] 16272 s.Errno = int32(hostarch.ByteOrder.Uint32(src[:4])) 16273 src = src[4:] 16274 s.Code = int32(hostarch.ByteOrder.Uint32(src[:4])) 16275 src = src[4:] 16276 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 16277 src = src[4:] 16278 for idx := 0; idx < (128-16); idx++ { 16279 s.Fields[idx] = src[0] 16280 src = src[1:] 16281 } 16282 return src 16283 } 16284 16285 // Packed implements marshal.Marshallable.Packed. 16286 //go:nosplit 16287 func (s *SignalInfo) Packed() bool { 16288 return true 16289 } 16290 16291 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 16292 func (s *SignalInfo) MarshalUnsafe(dst []byte) []byte { 16293 size := s.SizeBytes() 16294 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 16295 return dst[size:] 16296 } 16297 16298 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 16299 func (s *SignalInfo) UnmarshalUnsafe(src []byte) []byte { 16300 size := s.SizeBytes() 16301 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 16302 return src[size:] 16303 } 16304 16305 // CopyOutN implements marshal.Marshallable.CopyOutN. 16306 func (s *SignalInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16307 // Construct a slice backed by dst's underlying memory. 16308 var buf []byte 16309 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16310 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16311 hdr.Len = s.SizeBytes() 16312 hdr.Cap = s.SizeBytes() 16313 16314 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16315 // Since we bypassed the compiler's escape analysis, indicate that s 16316 // must live until the use above. 16317 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16318 return length, err 16319 } 16320 16321 // CopyOut implements marshal.Marshallable.CopyOut. 16322 func (s *SignalInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16323 return s.CopyOutN(cc, addr, s.SizeBytes()) 16324 } 16325 16326 // CopyInN implements marshal.Marshallable.CopyInN. 16327 func (s *SignalInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16328 // Construct a slice backed by dst's underlying memory. 16329 var buf []byte 16330 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16331 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16332 hdr.Len = s.SizeBytes() 16333 hdr.Cap = s.SizeBytes() 16334 16335 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 16336 // Since we bypassed the compiler's escape analysis, indicate that s 16337 // must live until the use above. 16338 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16339 return length, err 16340 } 16341 16342 // CopyIn implements marshal.Marshallable.CopyIn. 16343 func (s *SignalInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16344 return s.CopyInN(cc, addr, s.SizeBytes()) 16345 } 16346 16347 // WriteTo implements io.WriterTo.WriteTo. 16348 func (s *SignalInfo) WriteTo(writer io.Writer) (int64, error) { 16349 // Construct a slice backed by dst's underlying memory. 16350 var buf []byte 16351 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16352 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16353 hdr.Len = s.SizeBytes() 16354 hdr.Cap = s.SizeBytes() 16355 16356 length, err := writer.Write(buf) 16357 // Since we bypassed the compiler's escape analysis, indicate that s 16358 // must live until the use above. 16359 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16360 return int64(length), err 16361 } 16362 16363 // SizeBytes implements marshal.Marshallable.SizeBytes. 16364 //go:nosplit 16365 func (s *SignalSet) SizeBytes() int { 16366 return 8 16367 } 16368 16369 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 16370 func (s *SignalSet) MarshalBytes(dst []byte) []byte { 16371 hostarch.ByteOrder.PutUint64(dst[:8], uint64(*s)) 16372 return dst[8:] 16373 } 16374 16375 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 16376 func (s *SignalSet) UnmarshalBytes(src []byte) []byte { 16377 *s = SignalSet(uint64(hostarch.ByteOrder.Uint64(src[:8]))) 16378 return src[8:] 16379 } 16380 16381 // Packed implements marshal.Marshallable.Packed. 16382 //go:nosplit 16383 func (s *SignalSet) Packed() bool { 16384 // Scalar newtypes are always packed. 16385 return true 16386 } 16387 16388 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 16389 func (s *SignalSet) MarshalUnsafe(dst []byte) []byte { 16390 size := s.SizeBytes() 16391 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 16392 return dst[size:] 16393 } 16394 16395 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 16396 func (s *SignalSet) UnmarshalUnsafe(src []byte) []byte { 16397 size := s.SizeBytes() 16398 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 16399 return src[size:] 16400 } 16401 16402 // CopyOutN implements marshal.Marshallable.CopyOutN. 16403 func (s *SignalSet) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16404 // Construct a slice backed by dst's underlying memory. 16405 var buf []byte 16406 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16407 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16408 hdr.Len = s.SizeBytes() 16409 hdr.Cap = s.SizeBytes() 16410 16411 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16412 // Since we bypassed the compiler's escape analysis, indicate that s 16413 // must live until the use above. 16414 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16415 return length, err 16416 } 16417 16418 // CopyOut implements marshal.Marshallable.CopyOut. 16419 func (s *SignalSet) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16420 return s.CopyOutN(cc, addr, s.SizeBytes()) 16421 } 16422 16423 // CopyInN implements marshal.Marshallable.CopyInN. 16424 func (s *SignalSet) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16425 // Construct a slice backed by dst's underlying memory. 16426 var buf []byte 16427 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16428 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16429 hdr.Len = s.SizeBytes() 16430 hdr.Cap = s.SizeBytes() 16431 16432 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 16433 // Since we bypassed the compiler's escape analysis, indicate that s 16434 // must live until the use above. 16435 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16436 return length, err 16437 } 16438 16439 // CopyIn implements marshal.Marshallable.CopyIn. 16440 func (s *SignalSet) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16441 return s.CopyInN(cc, addr, s.SizeBytes()) 16442 } 16443 16444 // WriteTo implements io.WriterTo.WriteTo. 16445 func (s *SignalSet) WriteTo(writer io.Writer) (int64, error) { 16446 // Construct a slice backed by dst's underlying memory. 16447 var buf []byte 16448 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16449 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16450 hdr.Len = s.SizeBytes() 16451 hdr.Cap = s.SizeBytes() 16452 16453 length, err := writer.Write(buf) 16454 // Since we bypassed the compiler's escape analysis, indicate that s 16455 // must live until the use above. 16456 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16457 return int64(length), err 16458 } 16459 16460 // SizeBytes implements marshal.Marshallable.SizeBytes. 16461 func (s *SignalStack) SizeBytes() int { 16462 return 24 16463 } 16464 16465 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 16466 func (s *SignalStack) MarshalBytes(dst []byte) []byte { 16467 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Addr)) 16468 dst = dst[8:] 16469 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Flags)) 16470 dst = dst[4:] 16471 // Padding: dst[:sizeof(uint32)] ~= uint32(0) 16472 dst = dst[4:] 16473 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Size)) 16474 dst = dst[8:] 16475 return dst 16476 } 16477 16478 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 16479 func (s *SignalStack) UnmarshalBytes(src []byte) []byte { 16480 s.Addr = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16481 src = src[8:] 16482 s.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16483 src = src[4:] 16484 // Padding: var _ uint32 ~= src[:sizeof(uint32)] 16485 src = src[4:] 16486 s.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16487 src = src[8:] 16488 return src 16489 } 16490 16491 // Packed implements marshal.Marshallable.Packed. 16492 //go:nosplit 16493 func (s *SignalStack) Packed() bool { 16494 return true 16495 } 16496 16497 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 16498 func (s *SignalStack) MarshalUnsafe(dst []byte) []byte { 16499 size := s.SizeBytes() 16500 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 16501 return dst[size:] 16502 } 16503 16504 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 16505 func (s *SignalStack) UnmarshalUnsafe(src []byte) []byte { 16506 size := s.SizeBytes() 16507 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 16508 return src[size:] 16509 } 16510 16511 // CopyOutN implements marshal.Marshallable.CopyOutN. 16512 func (s *SignalStack) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16513 // Construct a slice backed by dst's underlying memory. 16514 var buf []byte 16515 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16516 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16517 hdr.Len = s.SizeBytes() 16518 hdr.Cap = s.SizeBytes() 16519 16520 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16521 // Since we bypassed the compiler's escape analysis, indicate that s 16522 // must live until the use above. 16523 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16524 return length, err 16525 } 16526 16527 // CopyOut implements marshal.Marshallable.CopyOut. 16528 func (s *SignalStack) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16529 return s.CopyOutN(cc, addr, s.SizeBytes()) 16530 } 16531 16532 // CopyInN implements marshal.Marshallable.CopyInN. 16533 func (s *SignalStack) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16534 // Construct a slice backed by dst's underlying memory. 16535 var buf []byte 16536 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16537 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16538 hdr.Len = s.SizeBytes() 16539 hdr.Cap = s.SizeBytes() 16540 16541 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 16542 // Since we bypassed the compiler's escape analysis, indicate that s 16543 // must live until the use above. 16544 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16545 return length, err 16546 } 16547 16548 // CopyIn implements marshal.Marshallable.CopyIn. 16549 func (s *SignalStack) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16550 return s.CopyInN(cc, addr, s.SizeBytes()) 16551 } 16552 16553 // WriteTo implements io.WriterTo.WriteTo. 16554 func (s *SignalStack) WriteTo(writer io.Writer) (int64, error) { 16555 // Construct a slice backed by dst's underlying memory. 16556 var buf []byte 16557 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16558 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 16559 hdr.Len = s.SizeBytes() 16560 hdr.Cap = s.SizeBytes() 16561 16562 length, err := writer.Write(buf) 16563 // Since we bypassed the compiler's escape analysis, indicate that s 16564 // must live until the use above. 16565 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 16566 return int64(length), err 16567 } 16568 16569 // SizeBytes implements marshal.Marshallable.SizeBytes. 16570 func (s *SignalfdSiginfo) SizeBytes() int { 16571 return 82 + 16572 1*48 16573 } 16574 16575 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 16576 func (s *SignalfdSiginfo) MarshalBytes(dst []byte) []byte { 16577 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Signo)) 16578 dst = dst[4:] 16579 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Errno)) 16580 dst = dst[4:] 16581 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Code)) 16582 dst = dst[4:] 16583 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.PID)) 16584 dst = dst[4:] 16585 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.UID)) 16586 dst = dst[4:] 16587 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.FD)) 16588 dst = dst[4:] 16589 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.TID)) 16590 dst = dst[4:] 16591 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Band)) 16592 dst = dst[4:] 16593 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Overrun)) 16594 dst = dst[4:] 16595 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.TrapNo)) 16596 dst = dst[4:] 16597 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Status)) 16598 dst = dst[4:] 16599 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Int)) 16600 dst = dst[4:] 16601 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Ptr)) 16602 dst = dst[8:] 16603 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.UTime)) 16604 dst = dst[8:] 16605 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.STime)) 16606 dst = dst[8:] 16607 hostarch.ByteOrder.PutUint64(dst[:8], uint64(s.Addr)) 16608 dst = dst[8:] 16609 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.AddrLSB)) 16610 dst = dst[2:] 16611 // Padding: dst[:sizeof(uint8)*48] ~= [48]uint8{0} 16612 dst = dst[1*(48):] 16613 return dst 16614 } 16615 16616 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 16617 func (s *SignalfdSiginfo) UnmarshalBytes(src []byte) []byte { 16618 s.Signo = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16619 src = src[4:] 16620 s.Errno = int32(hostarch.ByteOrder.Uint32(src[:4])) 16621 src = src[4:] 16622 s.Code = int32(hostarch.ByteOrder.Uint32(src[:4])) 16623 src = src[4:] 16624 s.PID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16625 src = src[4:] 16626 s.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16627 src = src[4:] 16628 s.FD = int32(hostarch.ByteOrder.Uint32(src[:4])) 16629 src = src[4:] 16630 s.TID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16631 src = src[4:] 16632 s.Band = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16633 src = src[4:] 16634 s.Overrun = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16635 src = src[4:] 16636 s.TrapNo = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16637 src = src[4:] 16638 s.Status = int32(hostarch.ByteOrder.Uint32(src[:4])) 16639 src = src[4:] 16640 s.Int = int32(hostarch.ByteOrder.Uint32(src[:4])) 16641 src = src[4:] 16642 s.Ptr = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16643 src = src[8:] 16644 s.UTime = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16645 src = src[8:] 16646 s.STime = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16647 src = src[8:] 16648 s.Addr = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16649 src = src[8:] 16650 s.AddrLSB = uint16(hostarch.ByteOrder.Uint16(src[:2])) 16651 src = src[2:] 16652 // Padding: ~ copy([48]uint8(s._), src[:sizeof(uint8)*48]) 16653 src = src[1*(48):] 16654 return src 16655 } 16656 16657 // Packed implements marshal.Marshallable.Packed. 16658 //go:nosplit 16659 func (s *SignalfdSiginfo) Packed() bool { 16660 return false 16661 } 16662 16663 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 16664 func (s *SignalfdSiginfo) MarshalUnsafe(dst []byte) []byte { 16665 // Type SignalfdSiginfo doesn't have a packed layout in memory, fallback to MarshalBytes. 16666 return s.MarshalBytes(dst) 16667 } 16668 16669 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 16670 func (s *SignalfdSiginfo) UnmarshalUnsafe(src []byte) []byte { 16671 // Type SignalfdSiginfo doesn't have a packed layout in memory, fallback to UnmarshalBytes. 16672 return s.UnmarshalBytes(src) 16673 } 16674 16675 // CopyOutN implements marshal.Marshallable.CopyOutN. 16676 func (s *SignalfdSiginfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16677 // Type SignalfdSiginfo doesn't have a packed layout in memory, fall back to MarshalBytes. 16678 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 16679 s.MarshalBytes(buf) // escapes: fallback. 16680 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16681 } 16682 16683 // CopyOut implements marshal.Marshallable.CopyOut. 16684 func (s *SignalfdSiginfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16685 return s.CopyOutN(cc, addr, s.SizeBytes()) 16686 } 16687 16688 // CopyInN implements marshal.Marshallable.CopyInN. 16689 func (s *SignalfdSiginfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16690 // Type SignalfdSiginfo doesn't have a packed layout in memory, fall back to UnmarshalBytes. 16691 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 16692 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 16693 // Unmarshal unconditionally. If we had a short copy-in, this results in a 16694 // partially unmarshalled struct. 16695 s.UnmarshalBytes(buf) // escapes: fallback. 16696 return length, err 16697 } 16698 16699 // CopyIn implements marshal.Marshallable.CopyIn. 16700 func (s *SignalfdSiginfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16701 return s.CopyInN(cc, addr, s.SizeBytes()) 16702 } 16703 16704 // WriteTo implements io.WriterTo.WriteTo. 16705 func (s *SignalfdSiginfo) WriteTo(writer io.Writer) (int64, error) { 16706 // Type SignalfdSiginfo doesn't have a packed layout in memory, fall back to MarshalBytes. 16707 buf := make([]byte, s.SizeBytes()) 16708 s.MarshalBytes(buf) 16709 length, err := writer.Write(buf) 16710 return int64(length), err 16711 } 16712 16713 // SizeBytes implements marshal.Marshallable.SizeBytes. 16714 func (c *ControlMessageCredentials) SizeBytes() int { 16715 return 12 16716 } 16717 16718 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 16719 func (c *ControlMessageCredentials) MarshalBytes(dst []byte) []byte { 16720 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.PID)) 16721 dst = dst[4:] 16722 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.UID)) 16723 dst = dst[4:] 16724 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.GID)) 16725 dst = dst[4:] 16726 return dst 16727 } 16728 16729 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 16730 func (c *ControlMessageCredentials) UnmarshalBytes(src []byte) []byte { 16731 c.PID = int32(hostarch.ByteOrder.Uint32(src[:4])) 16732 src = src[4:] 16733 c.UID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16734 src = src[4:] 16735 c.GID = uint32(hostarch.ByteOrder.Uint32(src[:4])) 16736 src = src[4:] 16737 return src 16738 } 16739 16740 // Packed implements marshal.Marshallable.Packed. 16741 //go:nosplit 16742 func (c *ControlMessageCredentials) Packed() bool { 16743 return true 16744 } 16745 16746 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 16747 func (c *ControlMessageCredentials) MarshalUnsafe(dst []byte) []byte { 16748 size := c.SizeBytes() 16749 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) 16750 return dst[size:] 16751 } 16752 16753 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 16754 func (c *ControlMessageCredentials) UnmarshalUnsafe(src []byte) []byte { 16755 size := c.SizeBytes() 16756 gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) 16757 return src[size:] 16758 } 16759 16760 // CopyOutN implements marshal.Marshallable.CopyOutN. 16761 func (c *ControlMessageCredentials) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16762 // Construct a slice backed by dst's underlying memory. 16763 var buf []byte 16764 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16765 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 16766 hdr.Len = c.SizeBytes() 16767 hdr.Cap = c.SizeBytes() 16768 16769 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16770 // Since we bypassed the compiler's escape analysis, indicate that c 16771 // must live until the use above. 16772 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 16773 return length, err 16774 } 16775 16776 // CopyOut implements marshal.Marshallable.CopyOut. 16777 func (c *ControlMessageCredentials) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16778 return c.CopyOutN(cc, addr, c.SizeBytes()) 16779 } 16780 16781 // CopyInN implements marshal.Marshallable.CopyInN. 16782 func (c *ControlMessageCredentials) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16783 // Construct a slice backed by dst's underlying memory. 16784 var buf []byte 16785 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16786 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 16787 hdr.Len = c.SizeBytes() 16788 hdr.Cap = c.SizeBytes() 16789 16790 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 16791 // Since we bypassed the compiler's escape analysis, indicate that c 16792 // must live until the use above. 16793 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 16794 return length, err 16795 } 16796 16797 // CopyIn implements marshal.Marshallable.CopyIn. 16798 func (c *ControlMessageCredentials) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16799 return c.CopyInN(cc, addr, c.SizeBytes()) 16800 } 16801 16802 // WriteTo implements io.WriterTo.WriteTo. 16803 func (c *ControlMessageCredentials) WriteTo(writer io.Writer) (int64, error) { 16804 // Construct a slice backed by dst's underlying memory. 16805 var buf []byte 16806 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16807 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 16808 hdr.Len = c.SizeBytes() 16809 hdr.Cap = c.SizeBytes() 16810 16811 length, err := writer.Write(buf) 16812 // Since we bypassed the compiler's escape analysis, indicate that c 16813 // must live until the use above. 16814 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 16815 return int64(length), err 16816 } 16817 16818 // SizeBytes implements marshal.Marshallable.SizeBytes. 16819 func (c *ControlMessageHeader) SizeBytes() int { 16820 return 16 16821 } 16822 16823 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 16824 func (c *ControlMessageHeader) MarshalBytes(dst []byte) []byte { 16825 hostarch.ByteOrder.PutUint64(dst[:8], uint64(c.Length)) 16826 dst = dst[8:] 16827 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Level)) 16828 dst = dst[4:] 16829 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.Type)) 16830 dst = dst[4:] 16831 return dst 16832 } 16833 16834 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 16835 func (c *ControlMessageHeader) UnmarshalBytes(src []byte) []byte { 16836 c.Length = uint64(hostarch.ByteOrder.Uint64(src[:8])) 16837 src = src[8:] 16838 c.Level = int32(hostarch.ByteOrder.Uint32(src[:4])) 16839 src = src[4:] 16840 c.Type = int32(hostarch.ByteOrder.Uint32(src[:4])) 16841 src = src[4:] 16842 return src 16843 } 16844 16845 // Packed implements marshal.Marshallable.Packed. 16846 //go:nosplit 16847 func (c *ControlMessageHeader) Packed() bool { 16848 return true 16849 } 16850 16851 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 16852 func (c *ControlMessageHeader) MarshalUnsafe(dst []byte) []byte { 16853 size := c.SizeBytes() 16854 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) 16855 return dst[size:] 16856 } 16857 16858 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 16859 func (c *ControlMessageHeader) UnmarshalUnsafe(src []byte) []byte { 16860 size := c.SizeBytes() 16861 gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) 16862 return src[size:] 16863 } 16864 16865 // CopyOutN implements marshal.Marshallable.CopyOutN. 16866 func (c *ControlMessageHeader) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16867 // Construct a slice backed by dst's underlying memory. 16868 var buf []byte 16869 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16870 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 16871 hdr.Len = c.SizeBytes() 16872 hdr.Cap = c.SizeBytes() 16873 16874 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16875 // Since we bypassed the compiler's escape analysis, indicate that c 16876 // must live until the use above. 16877 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 16878 return length, err 16879 } 16880 16881 // CopyOut implements marshal.Marshallable.CopyOut. 16882 func (c *ControlMessageHeader) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16883 return c.CopyOutN(cc, addr, c.SizeBytes()) 16884 } 16885 16886 // CopyInN implements marshal.Marshallable.CopyInN. 16887 func (c *ControlMessageHeader) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16888 // Construct a slice backed by dst's underlying memory. 16889 var buf []byte 16890 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16891 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 16892 hdr.Len = c.SizeBytes() 16893 hdr.Cap = c.SizeBytes() 16894 16895 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 16896 // Since we bypassed the compiler's escape analysis, indicate that c 16897 // must live until the use above. 16898 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 16899 return length, err 16900 } 16901 16902 // CopyIn implements marshal.Marshallable.CopyIn. 16903 func (c *ControlMessageHeader) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 16904 return c.CopyInN(cc, addr, c.SizeBytes()) 16905 } 16906 16907 // WriteTo implements io.WriterTo.WriteTo. 16908 func (c *ControlMessageHeader) WriteTo(writer io.Writer) (int64, error) { 16909 // Construct a slice backed by dst's underlying memory. 16910 var buf []byte 16911 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16912 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 16913 hdr.Len = c.SizeBytes() 16914 hdr.Cap = c.SizeBytes() 16915 16916 length, err := writer.Write(buf) 16917 // Since we bypassed the compiler's escape analysis, indicate that c 16918 // must live until the use above. 16919 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 16920 return int64(length), err 16921 } 16922 16923 // SizeBytes implements marshal.Marshallable.SizeBytes. 16924 func (c *ControlMessageIPPacketInfo) SizeBytes() int { 16925 return 4 + 16926 (*InetAddr)(nil).SizeBytes() + 16927 (*InetAddr)(nil).SizeBytes() 16928 } 16929 16930 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 16931 func (c *ControlMessageIPPacketInfo) MarshalBytes(dst []byte) []byte { 16932 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.NIC)) 16933 dst = dst[4:] 16934 dst = c.LocalAddr.MarshalUnsafe(dst) 16935 dst = c.DestinationAddr.MarshalUnsafe(dst) 16936 return dst 16937 } 16938 16939 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 16940 func (c *ControlMessageIPPacketInfo) UnmarshalBytes(src []byte) []byte { 16941 c.NIC = int32(hostarch.ByteOrder.Uint32(src[:4])) 16942 src = src[4:] 16943 src = c.LocalAddr.UnmarshalUnsafe(src) 16944 src = c.DestinationAddr.UnmarshalUnsafe(src) 16945 return src 16946 } 16947 16948 // Packed implements marshal.Marshallable.Packed. 16949 //go:nosplit 16950 func (c *ControlMessageIPPacketInfo) Packed() bool { 16951 return c.DestinationAddr.Packed() && c.LocalAddr.Packed() 16952 } 16953 16954 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 16955 func (c *ControlMessageIPPacketInfo) MarshalUnsafe(dst []byte) []byte { 16956 if c.DestinationAddr.Packed() && c.LocalAddr.Packed() { 16957 size := c.SizeBytes() 16958 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) 16959 return dst[size:] 16960 } 16961 // Type ControlMessageIPPacketInfo doesn't have a packed layout in memory, fallback to MarshalBytes. 16962 return c.MarshalBytes(dst) 16963 } 16964 16965 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 16966 func (c *ControlMessageIPPacketInfo) UnmarshalUnsafe(src []byte) []byte { 16967 if c.DestinationAddr.Packed() && c.LocalAddr.Packed() { 16968 size := c.SizeBytes() 16969 gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) 16970 return src[size:] 16971 } 16972 // Type ControlMessageIPPacketInfo doesn't have a packed layout in memory, fallback to UnmarshalBytes. 16973 return c.UnmarshalBytes(src) 16974 } 16975 16976 // CopyOutN implements marshal.Marshallable.CopyOutN. 16977 func (c *ControlMessageIPPacketInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 16978 if !c.DestinationAddr.Packed() && c.LocalAddr.Packed() { 16979 // Type ControlMessageIPPacketInfo doesn't have a packed layout in memory, fall back to MarshalBytes. 16980 buf := cc.CopyScratchBuffer(c.SizeBytes()) // escapes: okay. 16981 c.MarshalBytes(buf) // escapes: fallback. 16982 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16983 } 16984 16985 // Construct a slice backed by dst's underlying memory. 16986 var buf []byte 16987 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 16988 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 16989 hdr.Len = c.SizeBytes() 16990 hdr.Cap = c.SizeBytes() 16991 16992 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 16993 // Since we bypassed the compiler's escape analysis, indicate that c 16994 // must live until the use above. 16995 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 16996 return length, err 16997 } 16998 16999 // CopyOut implements marshal.Marshallable.CopyOut. 17000 func (c *ControlMessageIPPacketInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17001 return c.CopyOutN(cc, addr, c.SizeBytes()) 17002 } 17003 17004 // CopyInN implements marshal.Marshallable.CopyInN. 17005 func (c *ControlMessageIPPacketInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17006 if !c.DestinationAddr.Packed() && c.LocalAddr.Packed() { 17007 // Type ControlMessageIPPacketInfo doesn't have a packed layout in memory, fall back to UnmarshalBytes. 17008 buf := cc.CopyScratchBuffer(c.SizeBytes()) // escapes: okay. 17009 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17010 // Unmarshal unconditionally. If we had a short copy-in, this results in a 17011 // partially unmarshalled struct. 17012 c.UnmarshalBytes(buf) // escapes: fallback. 17013 return length, err 17014 } 17015 17016 // Construct a slice backed by dst's underlying memory. 17017 var buf []byte 17018 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17019 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 17020 hdr.Len = c.SizeBytes() 17021 hdr.Cap = c.SizeBytes() 17022 17023 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17024 // Since we bypassed the compiler's escape analysis, indicate that c 17025 // must live until the use above. 17026 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 17027 return length, err 17028 } 17029 17030 // CopyIn implements marshal.Marshallable.CopyIn. 17031 func (c *ControlMessageIPPacketInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17032 return c.CopyInN(cc, addr, c.SizeBytes()) 17033 } 17034 17035 // WriteTo implements io.WriterTo.WriteTo. 17036 func (c *ControlMessageIPPacketInfo) WriteTo(writer io.Writer) (int64, error) { 17037 if !c.DestinationAddr.Packed() && c.LocalAddr.Packed() { 17038 // Type ControlMessageIPPacketInfo doesn't have a packed layout in memory, fall back to MarshalBytes. 17039 buf := make([]byte, c.SizeBytes()) 17040 c.MarshalBytes(buf) 17041 length, err := writer.Write(buf) 17042 return int64(length), err 17043 } 17044 17045 // Construct a slice backed by dst's underlying memory. 17046 var buf []byte 17047 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17048 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 17049 hdr.Len = c.SizeBytes() 17050 hdr.Cap = c.SizeBytes() 17051 17052 length, err := writer.Write(buf) 17053 // Since we bypassed the compiler's escape analysis, indicate that c 17054 // must live until the use above. 17055 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 17056 return int64(length), err 17057 } 17058 17059 // SizeBytes implements marshal.Marshallable.SizeBytes. 17060 func (c *ControlMessageIPv6PacketInfo) SizeBytes() int { 17061 return 4 + 17062 (*Inet6Addr)(nil).SizeBytes() 17063 } 17064 17065 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 17066 func (c *ControlMessageIPv6PacketInfo) MarshalBytes(dst []byte) []byte { 17067 dst = c.Addr.MarshalUnsafe(dst) 17068 hostarch.ByteOrder.PutUint32(dst[:4], uint32(c.NIC)) 17069 dst = dst[4:] 17070 return dst 17071 } 17072 17073 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 17074 func (c *ControlMessageIPv6PacketInfo) UnmarshalBytes(src []byte) []byte { 17075 src = c.Addr.UnmarshalUnsafe(src) 17076 c.NIC = uint32(hostarch.ByteOrder.Uint32(src[:4])) 17077 src = src[4:] 17078 return src 17079 } 17080 17081 // Packed implements marshal.Marshallable.Packed. 17082 //go:nosplit 17083 func (c *ControlMessageIPv6PacketInfo) Packed() bool { 17084 return c.Addr.Packed() 17085 } 17086 17087 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 17088 func (c *ControlMessageIPv6PacketInfo) MarshalUnsafe(dst []byte) []byte { 17089 if c.Addr.Packed() { 17090 size := c.SizeBytes() 17091 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) 17092 return dst[size:] 17093 } 17094 // Type ControlMessageIPv6PacketInfo doesn't have a packed layout in memory, fallback to MarshalBytes. 17095 return c.MarshalBytes(dst) 17096 } 17097 17098 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 17099 func (c *ControlMessageIPv6PacketInfo) UnmarshalUnsafe(src []byte) []byte { 17100 if c.Addr.Packed() { 17101 size := c.SizeBytes() 17102 gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) 17103 return src[size:] 17104 } 17105 // Type ControlMessageIPv6PacketInfo doesn't have a packed layout in memory, fallback to UnmarshalBytes. 17106 return c.UnmarshalBytes(src) 17107 } 17108 17109 // CopyOutN implements marshal.Marshallable.CopyOutN. 17110 func (c *ControlMessageIPv6PacketInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17111 if !c.Addr.Packed() { 17112 // Type ControlMessageIPv6PacketInfo doesn't have a packed layout in memory, fall back to MarshalBytes. 17113 buf := cc.CopyScratchBuffer(c.SizeBytes()) // escapes: okay. 17114 c.MarshalBytes(buf) // escapes: fallback. 17115 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17116 } 17117 17118 // Construct a slice backed by dst's underlying memory. 17119 var buf []byte 17120 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17121 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 17122 hdr.Len = c.SizeBytes() 17123 hdr.Cap = c.SizeBytes() 17124 17125 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17126 // Since we bypassed the compiler's escape analysis, indicate that c 17127 // must live until the use above. 17128 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 17129 return length, err 17130 } 17131 17132 // CopyOut implements marshal.Marshallable.CopyOut. 17133 func (c *ControlMessageIPv6PacketInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17134 return c.CopyOutN(cc, addr, c.SizeBytes()) 17135 } 17136 17137 // CopyInN implements marshal.Marshallable.CopyInN. 17138 func (c *ControlMessageIPv6PacketInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17139 if !c.Addr.Packed() { 17140 // Type ControlMessageIPv6PacketInfo doesn't have a packed layout in memory, fall back to UnmarshalBytes. 17141 buf := cc.CopyScratchBuffer(c.SizeBytes()) // escapes: okay. 17142 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17143 // Unmarshal unconditionally. If we had a short copy-in, this results in a 17144 // partially unmarshalled struct. 17145 c.UnmarshalBytes(buf) // escapes: fallback. 17146 return length, err 17147 } 17148 17149 // Construct a slice backed by dst's underlying memory. 17150 var buf []byte 17151 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17152 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 17153 hdr.Len = c.SizeBytes() 17154 hdr.Cap = c.SizeBytes() 17155 17156 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17157 // Since we bypassed the compiler's escape analysis, indicate that c 17158 // must live until the use above. 17159 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 17160 return length, err 17161 } 17162 17163 // CopyIn implements marshal.Marshallable.CopyIn. 17164 func (c *ControlMessageIPv6PacketInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17165 return c.CopyInN(cc, addr, c.SizeBytes()) 17166 } 17167 17168 // WriteTo implements io.WriterTo.WriteTo. 17169 func (c *ControlMessageIPv6PacketInfo) WriteTo(writer io.Writer) (int64, error) { 17170 if !c.Addr.Packed() { 17171 // Type ControlMessageIPv6PacketInfo doesn't have a packed layout in memory, fall back to MarshalBytes. 17172 buf := make([]byte, c.SizeBytes()) 17173 c.MarshalBytes(buf) 17174 length, err := writer.Write(buf) 17175 return int64(length), err 17176 } 17177 17178 // Construct a slice backed by dst's underlying memory. 17179 var buf []byte 17180 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17181 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 17182 hdr.Len = c.SizeBytes() 17183 hdr.Cap = c.SizeBytes() 17184 17185 length, err := writer.Write(buf) 17186 // Since we bypassed the compiler's escape analysis, indicate that c 17187 // must live until the use above. 17188 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 17189 return int64(length), err 17190 } 17191 17192 // SizeBytes implements marshal.Marshallable.SizeBytes. 17193 func (i *ICMP6Filter) SizeBytes() int { 17194 return 0 + 17195 4*8 17196 } 17197 17198 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 17199 func (i *ICMP6Filter) MarshalBytes(dst []byte) []byte { 17200 for idx := 0; idx < 8; idx++ { 17201 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.Filter[idx])) 17202 dst = dst[4:] 17203 } 17204 return dst 17205 } 17206 17207 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 17208 func (i *ICMP6Filter) UnmarshalBytes(src []byte) []byte { 17209 for idx := 0; idx < 8; idx++ { 17210 i.Filter[idx] = uint32(hostarch.ByteOrder.Uint32(src[:4])) 17211 src = src[4:] 17212 } 17213 return src 17214 } 17215 17216 // Packed implements marshal.Marshallable.Packed. 17217 //go:nosplit 17218 func (i *ICMP6Filter) Packed() bool { 17219 return true 17220 } 17221 17222 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 17223 func (i *ICMP6Filter) MarshalUnsafe(dst []byte) []byte { 17224 size := i.SizeBytes() 17225 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 17226 return dst[size:] 17227 } 17228 17229 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 17230 func (i *ICMP6Filter) UnmarshalUnsafe(src []byte) []byte { 17231 size := i.SizeBytes() 17232 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 17233 return src[size:] 17234 } 17235 17236 // CopyOutN implements marshal.Marshallable.CopyOutN. 17237 func (i *ICMP6Filter) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17238 // Construct a slice backed by dst's underlying memory. 17239 var buf []byte 17240 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17241 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17242 hdr.Len = i.SizeBytes() 17243 hdr.Cap = i.SizeBytes() 17244 17245 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17246 // Since we bypassed the compiler's escape analysis, indicate that i 17247 // must live until the use above. 17248 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17249 return length, err 17250 } 17251 17252 // CopyOut implements marshal.Marshallable.CopyOut. 17253 func (i *ICMP6Filter) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17254 return i.CopyOutN(cc, addr, i.SizeBytes()) 17255 } 17256 17257 // CopyInN implements marshal.Marshallable.CopyInN. 17258 func (i *ICMP6Filter) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17259 // Construct a slice backed by dst's underlying memory. 17260 var buf []byte 17261 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17262 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17263 hdr.Len = i.SizeBytes() 17264 hdr.Cap = i.SizeBytes() 17265 17266 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17267 // Since we bypassed the compiler's escape analysis, indicate that i 17268 // must live until the use above. 17269 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17270 return length, err 17271 } 17272 17273 // CopyIn implements marshal.Marshallable.CopyIn. 17274 func (i *ICMP6Filter) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17275 return i.CopyInN(cc, addr, i.SizeBytes()) 17276 } 17277 17278 // WriteTo implements io.WriterTo.WriteTo. 17279 func (i *ICMP6Filter) WriteTo(writer io.Writer) (int64, error) { 17280 // Construct a slice backed by dst's underlying memory. 17281 var buf []byte 17282 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17283 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17284 hdr.Len = i.SizeBytes() 17285 hdr.Cap = i.SizeBytes() 17286 17287 length, err := writer.Write(buf) 17288 // Since we bypassed the compiler's escape analysis, indicate that i 17289 // must live until the use above. 17290 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17291 return int64(length), err 17292 } 17293 17294 // SizeBytes implements marshal.Marshallable.SizeBytes. 17295 //go:nosplit 17296 func (i *Inet6Addr) SizeBytes() int { 17297 return 1 * 16 17298 } 17299 17300 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 17301 func (i *Inet6Addr) MarshalBytes(dst []byte) []byte { 17302 for idx := 0; idx < 16; idx++ { 17303 dst[0] = byte(i[idx]) 17304 dst = dst[1:] 17305 } 17306 return dst 17307 } 17308 17309 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 17310 func (i *Inet6Addr) UnmarshalBytes(src []byte) []byte { 17311 for idx := 0; idx < 16; idx++ { 17312 i[idx] = src[0] 17313 src = src[1:] 17314 } 17315 return src 17316 } 17317 17318 // Packed implements marshal.Marshallable.Packed. 17319 //go:nosplit 17320 func (i *Inet6Addr) Packed() bool { 17321 // Array newtypes are always packed. 17322 return true 17323 } 17324 17325 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 17326 func (i *Inet6Addr) MarshalUnsafe(dst []byte) []byte { 17327 size := i.SizeBytes() 17328 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&i[0]), uintptr(size)) 17329 return dst[size:] 17330 } 17331 17332 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 17333 func (i *Inet6Addr) UnmarshalUnsafe(src []byte) []byte { 17334 size := i.SizeBytes() 17335 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 17336 return src[size:] 17337 } 17338 17339 // CopyOutN implements marshal.Marshallable.CopyOutN. 17340 func (i *Inet6Addr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17341 // Construct a slice backed by dst's underlying memory. 17342 var buf []byte 17343 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17344 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17345 hdr.Len = i.SizeBytes() 17346 hdr.Cap = i.SizeBytes() 17347 17348 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17349 // Since we bypassed the compiler's escape analysis, indicate that i 17350 // must live until the use above. 17351 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17352 return length, err 17353 } 17354 17355 // CopyOut implements marshal.Marshallable.CopyOut. 17356 func (i *Inet6Addr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17357 return i.CopyOutN(cc, addr, i.SizeBytes()) 17358 } 17359 17360 // CopyInN implements marshal.Marshallable.CopyInN. 17361 func (i *Inet6Addr) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17362 // Construct a slice backed by dst's underlying memory. 17363 var buf []byte 17364 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17365 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17366 hdr.Len = i.SizeBytes() 17367 hdr.Cap = i.SizeBytes() 17368 17369 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17370 // Since we bypassed the compiler's escape analysis, indicate that i 17371 // must live until the use above. 17372 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17373 return length, err 17374 } 17375 17376 // CopyIn implements marshal.Marshallable.CopyIn. 17377 func (i *Inet6Addr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17378 return i.CopyInN(cc, addr, i.SizeBytes()) 17379 } 17380 17381 // WriteTo implements io.WriterTo.WriteTo. 17382 func (i *Inet6Addr) WriteTo(writer io.Writer) (int64, error) { 17383 // Construct a slice backed by dst's underlying memory. 17384 var buf []byte 17385 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17386 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17387 hdr.Len = i.SizeBytes() 17388 hdr.Cap = i.SizeBytes() 17389 17390 length, err := writer.Write(buf) 17391 // Since we bypassed the compiler's escape analysis, indicate that i 17392 // must live until the use above. 17393 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17394 return int64(length), err 17395 } 17396 17397 // SizeBytes implements marshal.Marshallable.SizeBytes. 17398 func (i *Inet6MulticastRequest) SizeBytes() int { 17399 return 4 + 17400 (*Inet6Addr)(nil).SizeBytes() 17401 } 17402 17403 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 17404 func (i *Inet6MulticastRequest) MarshalBytes(dst []byte) []byte { 17405 dst = i.MulticastAddr.MarshalUnsafe(dst) 17406 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.InterfaceIndex)) 17407 dst = dst[4:] 17408 return dst 17409 } 17410 17411 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 17412 func (i *Inet6MulticastRequest) UnmarshalBytes(src []byte) []byte { 17413 src = i.MulticastAddr.UnmarshalUnsafe(src) 17414 i.InterfaceIndex = int32(hostarch.ByteOrder.Uint32(src[:4])) 17415 src = src[4:] 17416 return src 17417 } 17418 17419 // Packed implements marshal.Marshallable.Packed. 17420 //go:nosplit 17421 func (i *Inet6MulticastRequest) Packed() bool { 17422 return i.MulticastAddr.Packed() 17423 } 17424 17425 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 17426 func (i *Inet6MulticastRequest) MarshalUnsafe(dst []byte) []byte { 17427 if i.MulticastAddr.Packed() { 17428 size := i.SizeBytes() 17429 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 17430 return dst[size:] 17431 } 17432 // Type Inet6MulticastRequest doesn't have a packed layout in memory, fallback to MarshalBytes. 17433 return i.MarshalBytes(dst) 17434 } 17435 17436 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 17437 func (i *Inet6MulticastRequest) UnmarshalUnsafe(src []byte) []byte { 17438 if i.MulticastAddr.Packed() { 17439 size := i.SizeBytes() 17440 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 17441 return src[size:] 17442 } 17443 // Type Inet6MulticastRequest doesn't have a packed layout in memory, fallback to UnmarshalBytes. 17444 return i.UnmarshalBytes(src) 17445 } 17446 17447 // CopyOutN implements marshal.Marshallable.CopyOutN. 17448 func (i *Inet6MulticastRequest) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17449 if !i.MulticastAddr.Packed() { 17450 // Type Inet6MulticastRequest doesn't have a packed layout in memory, fall back to MarshalBytes. 17451 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 17452 i.MarshalBytes(buf) // escapes: fallback. 17453 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17454 } 17455 17456 // Construct a slice backed by dst's underlying memory. 17457 var buf []byte 17458 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17459 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17460 hdr.Len = i.SizeBytes() 17461 hdr.Cap = i.SizeBytes() 17462 17463 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17464 // Since we bypassed the compiler's escape analysis, indicate that i 17465 // must live until the use above. 17466 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17467 return length, err 17468 } 17469 17470 // CopyOut implements marshal.Marshallable.CopyOut. 17471 func (i *Inet6MulticastRequest) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17472 return i.CopyOutN(cc, addr, i.SizeBytes()) 17473 } 17474 17475 // CopyInN implements marshal.Marshallable.CopyInN. 17476 func (i *Inet6MulticastRequest) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17477 if !i.MulticastAddr.Packed() { 17478 // Type Inet6MulticastRequest doesn't have a packed layout in memory, fall back to UnmarshalBytes. 17479 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 17480 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17481 // Unmarshal unconditionally. If we had a short copy-in, this results in a 17482 // partially unmarshalled struct. 17483 i.UnmarshalBytes(buf) // escapes: fallback. 17484 return length, err 17485 } 17486 17487 // Construct a slice backed by dst's underlying memory. 17488 var buf []byte 17489 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17490 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17491 hdr.Len = i.SizeBytes() 17492 hdr.Cap = i.SizeBytes() 17493 17494 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17495 // Since we bypassed the compiler's escape analysis, indicate that i 17496 // must live until the use above. 17497 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17498 return length, err 17499 } 17500 17501 // CopyIn implements marshal.Marshallable.CopyIn. 17502 func (i *Inet6MulticastRequest) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17503 return i.CopyInN(cc, addr, i.SizeBytes()) 17504 } 17505 17506 // WriteTo implements io.WriterTo.WriteTo. 17507 func (i *Inet6MulticastRequest) WriteTo(writer io.Writer) (int64, error) { 17508 if !i.MulticastAddr.Packed() { 17509 // Type Inet6MulticastRequest doesn't have a packed layout in memory, fall back to MarshalBytes. 17510 buf := make([]byte, i.SizeBytes()) 17511 i.MarshalBytes(buf) 17512 length, err := writer.Write(buf) 17513 return int64(length), err 17514 } 17515 17516 // Construct a slice backed by dst's underlying memory. 17517 var buf []byte 17518 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17519 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17520 hdr.Len = i.SizeBytes() 17521 hdr.Cap = i.SizeBytes() 17522 17523 length, err := writer.Write(buf) 17524 // Since we bypassed the compiler's escape analysis, indicate that i 17525 // must live until the use above. 17526 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17527 return int64(length), err 17528 } 17529 17530 // SizeBytes implements marshal.Marshallable.SizeBytes. 17531 //go:nosplit 17532 func (i *InetAddr) SizeBytes() int { 17533 return 1 * 4 17534 } 17535 17536 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 17537 func (i *InetAddr) MarshalBytes(dst []byte) []byte { 17538 for idx := 0; idx < 4; idx++ { 17539 dst[0] = byte(i[idx]) 17540 dst = dst[1:] 17541 } 17542 return dst 17543 } 17544 17545 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 17546 func (i *InetAddr) UnmarshalBytes(src []byte) []byte { 17547 for idx := 0; idx < 4; idx++ { 17548 i[idx] = src[0] 17549 src = src[1:] 17550 } 17551 return src 17552 } 17553 17554 // Packed implements marshal.Marshallable.Packed. 17555 //go:nosplit 17556 func (i *InetAddr) Packed() bool { 17557 // Array newtypes are always packed. 17558 return true 17559 } 17560 17561 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 17562 func (i *InetAddr) MarshalUnsafe(dst []byte) []byte { 17563 size := i.SizeBytes() 17564 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&i[0]), uintptr(size)) 17565 return dst[size:] 17566 } 17567 17568 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 17569 func (i *InetAddr) UnmarshalUnsafe(src []byte) []byte { 17570 size := i.SizeBytes() 17571 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 17572 return src[size:] 17573 } 17574 17575 // CopyOutN implements marshal.Marshallable.CopyOutN. 17576 func (i *InetAddr) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17577 // Construct a slice backed by dst's underlying memory. 17578 var buf []byte 17579 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17580 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17581 hdr.Len = i.SizeBytes() 17582 hdr.Cap = i.SizeBytes() 17583 17584 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17585 // Since we bypassed the compiler's escape analysis, indicate that i 17586 // must live until the use above. 17587 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17588 return length, err 17589 } 17590 17591 // CopyOut implements marshal.Marshallable.CopyOut. 17592 func (i *InetAddr) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17593 return i.CopyOutN(cc, addr, i.SizeBytes()) 17594 } 17595 17596 // CopyInN implements marshal.Marshallable.CopyInN. 17597 func (i *InetAddr) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17598 // Construct a slice backed by dst's underlying memory. 17599 var buf []byte 17600 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17601 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17602 hdr.Len = i.SizeBytes() 17603 hdr.Cap = i.SizeBytes() 17604 17605 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17606 // Since we bypassed the compiler's escape analysis, indicate that i 17607 // must live until the use above. 17608 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17609 return length, err 17610 } 17611 17612 // CopyIn implements marshal.Marshallable.CopyIn. 17613 func (i *InetAddr) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17614 return i.CopyInN(cc, addr, i.SizeBytes()) 17615 } 17616 17617 // WriteTo implements io.WriterTo.WriteTo. 17618 func (i *InetAddr) WriteTo(writer io.Writer) (int64, error) { 17619 // Construct a slice backed by dst's underlying memory. 17620 var buf []byte 17621 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17622 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17623 hdr.Len = i.SizeBytes() 17624 hdr.Cap = i.SizeBytes() 17625 17626 length, err := writer.Write(buf) 17627 // Since we bypassed the compiler's escape analysis, indicate that i 17628 // must live until the use above. 17629 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17630 return int64(length), err 17631 } 17632 17633 // SizeBytes implements marshal.Marshallable.SizeBytes. 17634 func (i *InetMulticastRequest) SizeBytes() int { 17635 return 0 + 17636 (*InetAddr)(nil).SizeBytes() + 17637 (*InetAddr)(nil).SizeBytes() 17638 } 17639 17640 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 17641 func (i *InetMulticastRequest) MarshalBytes(dst []byte) []byte { 17642 dst = i.MulticastAddr.MarshalUnsafe(dst) 17643 dst = i.InterfaceAddr.MarshalUnsafe(dst) 17644 return dst 17645 } 17646 17647 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 17648 func (i *InetMulticastRequest) UnmarshalBytes(src []byte) []byte { 17649 src = i.MulticastAddr.UnmarshalUnsafe(src) 17650 src = i.InterfaceAddr.UnmarshalUnsafe(src) 17651 return src 17652 } 17653 17654 // Packed implements marshal.Marshallable.Packed. 17655 //go:nosplit 17656 func (i *InetMulticastRequest) Packed() bool { 17657 return i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() 17658 } 17659 17660 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 17661 func (i *InetMulticastRequest) MarshalUnsafe(dst []byte) []byte { 17662 if i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { 17663 size := i.SizeBytes() 17664 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 17665 return dst[size:] 17666 } 17667 // Type InetMulticastRequest doesn't have a packed layout in memory, fallback to MarshalBytes. 17668 return i.MarshalBytes(dst) 17669 } 17670 17671 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 17672 func (i *InetMulticastRequest) UnmarshalUnsafe(src []byte) []byte { 17673 if i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { 17674 size := i.SizeBytes() 17675 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 17676 return src[size:] 17677 } 17678 // Type InetMulticastRequest doesn't have a packed layout in memory, fallback to UnmarshalBytes. 17679 return i.UnmarshalBytes(src) 17680 } 17681 17682 // CopyOutN implements marshal.Marshallable.CopyOutN. 17683 func (i *InetMulticastRequest) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17684 if !i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { 17685 // Type InetMulticastRequest doesn't have a packed layout in memory, fall back to MarshalBytes. 17686 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 17687 i.MarshalBytes(buf) // escapes: fallback. 17688 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17689 } 17690 17691 // Construct a slice backed by dst's underlying memory. 17692 var buf []byte 17693 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17694 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17695 hdr.Len = i.SizeBytes() 17696 hdr.Cap = i.SizeBytes() 17697 17698 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17699 // Since we bypassed the compiler's escape analysis, indicate that i 17700 // must live until the use above. 17701 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17702 return length, err 17703 } 17704 17705 // CopyOut implements marshal.Marshallable.CopyOut. 17706 func (i *InetMulticastRequest) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17707 return i.CopyOutN(cc, addr, i.SizeBytes()) 17708 } 17709 17710 // CopyInN implements marshal.Marshallable.CopyInN. 17711 func (i *InetMulticastRequest) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17712 if !i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { 17713 // Type InetMulticastRequest doesn't have a packed layout in memory, fall back to UnmarshalBytes. 17714 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 17715 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17716 // Unmarshal unconditionally. If we had a short copy-in, this results in a 17717 // partially unmarshalled struct. 17718 i.UnmarshalBytes(buf) // escapes: fallback. 17719 return length, err 17720 } 17721 17722 // Construct a slice backed by dst's underlying memory. 17723 var buf []byte 17724 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17725 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17726 hdr.Len = i.SizeBytes() 17727 hdr.Cap = i.SizeBytes() 17728 17729 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17730 // Since we bypassed the compiler's escape analysis, indicate that i 17731 // must live until the use above. 17732 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17733 return length, err 17734 } 17735 17736 // CopyIn implements marshal.Marshallable.CopyIn. 17737 func (i *InetMulticastRequest) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17738 return i.CopyInN(cc, addr, i.SizeBytes()) 17739 } 17740 17741 // WriteTo implements io.WriterTo.WriteTo. 17742 func (i *InetMulticastRequest) WriteTo(writer io.Writer) (int64, error) { 17743 if !i.InterfaceAddr.Packed() && i.MulticastAddr.Packed() { 17744 // Type InetMulticastRequest doesn't have a packed layout in memory, fall back to MarshalBytes. 17745 buf := make([]byte, i.SizeBytes()) 17746 i.MarshalBytes(buf) 17747 length, err := writer.Write(buf) 17748 return int64(length), err 17749 } 17750 17751 // Construct a slice backed by dst's underlying memory. 17752 var buf []byte 17753 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17754 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17755 hdr.Len = i.SizeBytes() 17756 hdr.Cap = i.SizeBytes() 17757 17758 length, err := writer.Write(buf) 17759 // Since we bypassed the compiler's escape analysis, indicate that i 17760 // must live until the use above. 17761 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17762 return int64(length), err 17763 } 17764 17765 // SizeBytes implements marshal.Marshallable.SizeBytes. 17766 func (i *InetMulticastRequestWithNIC) SizeBytes() int { 17767 return 4 + 17768 (*InetMulticastRequest)(nil).SizeBytes() 17769 } 17770 17771 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 17772 func (i *InetMulticastRequestWithNIC) MarshalBytes(dst []byte) []byte { 17773 dst = i.InetMulticastRequest.MarshalUnsafe(dst) 17774 hostarch.ByteOrder.PutUint32(dst[:4], uint32(i.InterfaceIndex)) 17775 dst = dst[4:] 17776 return dst 17777 } 17778 17779 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 17780 func (i *InetMulticastRequestWithNIC) UnmarshalBytes(src []byte) []byte { 17781 src = i.InetMulticastRequest.UnmarshalUnsafe(src) 17782 i.InterfaceIndex = int32(hostarch.ByteOrder.Uint32(src[:4])) 17783 src = src[4:] 17784 return src 17785 } 17786 17787 // Packed implements marshal.Marshallable.Packed. 17788 //go:nosplit 17789 func (i *InetMulticastRequestWithNIC) Packed() bool { 17790 return i.InetMulticastRequest.Packed() 17791 } 17792 17793 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 17794 func (i *InetMulticastRequestWithNIC) MarshalUnsafe(dst []byte) []byte { 17795 if i.InetMulticastRequest.Packed() { 17796 size := i.SizeBytes() 17797 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 17798 return dst[size:] 17799 } 17800 // Type InetMulticastRequestWithNIC doesn't have a packed layout in memory, fallback to MarshalBytes. 17801 return i.MarshalBytes(dst) 17802 } 17803 17804 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 17805 func (i *InetMulticastRequestWithNIC) UnmarshalUnsafe(src []byte) []byte { 17806 if i.InetMulticastRequest.Packed() { 17807 size := i.SizeBytes() 17808 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 17809 return src[size:] 17810 } 17811 // Type InetMulticastRequestWithNIC doesn't have a packed layout in memory, fallback to UnmarshalBytes. 17812 return i.UnmarshalBytes(src) 17813 } 17814 17815 // CopyOutN implements marshal.Marshallable.CopyOutN. 17816 func (i *InetMulticastRequestWithNIC) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17817 if !i.InetMulticastRequest.Packed() { 17818 // Type InetMulticastRequestWithNIC doesn't have a packed layout in memory, fall back to MarshalBytes. 17819 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 17820 i.MarshalBytes(buf) // escapes: fallback. 17821 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17822 } 17823 17824 // Construct a slice backed by dst's underlying memory. 17825 var buf []byte 17826 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17827 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17828 hdr.Len = i.SizeBytes() 17829 hdr.Cap = i.SizeBytes() 17830 17831 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17832 // Since we bypassed the compiler's escape analysis, indicate that i 17833 // must live until the use above. 17834 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17835 return length, err 17836 } 17837 17838 // CopyOut implements marshal.Marshallable.CopyOut. 17839 func (i *InetMulticastRequestWithNIC) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17840 return i.CopyOutN(cc, addr, i.SizeBytes()) 17841 } 17842 17843 // CopyInN implements marshal.Marshallable.CopyInN. 17844 func (i *InetMulticastRequestWithNIC) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17845 if !i.InetMulticastRequest.Packed() { 17846 // Type InetMulticastRequestWithNIC doesn't have a packed layout in memory, fall back to UnmarshalBytes. 17847 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 17848 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17849 // Unmarshal unconditionally. If we had a short copy-in, this results in a 17850 // partially unmarshalled struct. 17851 i.UnmarshalBytes(buf) // escapes: fallback. 17852 return length, err 17853 } 17854 17855 // Construct a slice backed by dst's underlying memory. 17856 var buf []byte 17857 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17858 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17859 hdr.Len = i.SizeBytes() 17860 hdr.Cap = i.SizeBytes() 17861 17862 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17863 // Since we bypassed the compiler's escape analysis, indicate that i 17864 // must live until the use above. 17865 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17866 return length, err 17867 } 17868 17869 // CopyIn implements marshal.Marshallable.CopyIn. 17870 func (i *InetMulticastRequestWithNIC) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17871 return i.CopyInN(cc, addr, i.SizeBytes()) 17872 } 17873 17874 // WriteTo implements io.WriterTo.WriteTo. 17875 func (i *InetMulticastRequestWithNIC) WriteTo(writer io.Writer) (int64, error) { 17876 if !i.InetMulticastRequest.Packed() { 17877 // Type InetMulticastRequestWithNIC doesn't have a packed layout in memory, fall back to MarshalBytes. 17878 buf := make([]byte, i.SizeBytes()) 17879 i.MarshalBytes(buf) 17880 length, err := writer.Write(buf) 17881 return int64(length), err 17882 } 17883 17884 // Construct a slice backed by dst's underlying memory. 17885 var buf []byte 17886 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17887 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 17888 hdr.Len = i.SizeBytes() 17889 hdr.Cap = i.SizeBytes() 17890 17891 length, err := writer.Write(buf) 17892 // Since we bypassed the compiler's escape analysis, indicate that i 17893 // must live until the use above. 17894 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 17895 return int64(length), err 17896 } 17897 17898 // SizeBytes implements marshal.Marshallable.SizeBytes. 17899 func (l *Linger) SizeBytes() int { 17900 return 8 17901 } 17902 17903 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 17904 func (l *Linger) MarshalBytes(dst []byte) []byte { 17905 hostarch.ByteOrder.PutUint32(dst[:4], uint32(l.OnOff)) 17906 dst = dst[4:] 17907 hostarch.ByteOrder.PutUint32(dst[:4], uint32(l.Linger)) 17908 dst = dst[4:] 17909 return dst 17910 } 17911 17912 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 17913 func (l *Linger) UnmarshalBytes(src []byte) []byte { 17914 l.OnOff = int32(hostarch.ByteOrder.Uint32(src[:4])) 17915 src = src[4:] 17916 l.Linger = int32(hostarch.ByteOrder.Uint32(src[:4])) 17917 src = src[4:] 17918 return src 17919 } 17920 17921 // Packed implements marshal.Marshallable.Packed. 17922 //go:nosplit 17923 func (l *Linger) Packed() bool { 17924 return true 17925 } 17926 17927 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 17928 func (l *Linger) MarshalUnsafe(dst []byte) []byte { 17929 size := l.SizeBytes() 17930 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(l), uintptr(size)) 17931 return dst[size:] 17932 } 17933 17934 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 17935 func (l *Linger) UnmarshalUnsafe(src []byte) []byte { 17936 size := l.SizeBytes() 17937 gohacks.Memmove(unsafe.Pointer(l), unsafe.Pointer(&src[0]), uintptr(size)) 17938 return src[size:] 17939 } 17940 17941 // CopyOutN implements marshal.Marshallable.CopyOutN. 17942 func (l *Linger) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17943 // Construct a slice backed by dst's underlying memory. 17944 var buf []byte 17945 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17946 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(l))) 17947 hdr.Len = l.SizeBytes() 17948 hdr.Cap = l.SizeBytes() 17949 17950 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 17951 // Since we bypassed the compiler's escape analysis, indicate that l 17952 // must live until the use above. 17953 runtime.KeepAlive(l) // escapes: replaced by intrinsic. 17954 return length, err 17955 } 17956 17957 // CopyOut implements marshal.Marshallable.CopyOut. 17958 func (l *Linger) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17959 return l.CopyOutN(cc, addr, l.SizeBytes()) 17960 } 17961 17962 // CopyInN implements marshal.Marshallable.CopyInN. 17963 func (l *Linger) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 17964 // Construct a slice backed by dst's underlying memory. 17965 var buf []byte 17966 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17967 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(l))) 17968 hdr.Len = l.SizeBytes() 17969 hdr.Cap = l.SizeBytes() 17970 17971 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 17972 // Since we bypassed the compiler's escape analysis, indicate that l 17973 // must live until the use above. 17974 runtime.KeepAlive(l) // escapes: replaced by intrinsic. 17975 return length, err 17976 } 17977 17978 // CopyIn implements marshal.Marshallable.CopyIn. 17979 func (l *Linger) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 17980 return l.CopyInN(cc, addr, l.SizeBytes()) 17981 } 17982 17983 // WriteTo implements io.WriterTo.WriteTo. 17984 func (l *Linger) WriteTo(writer io.Writer) (int64, error) { 17985 // Construct a slice backed by dst's underlying memory. 17986 var buf []byte 17987 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 17988 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(l))) 17989 hdr.Len = l.SizeBytes() 17990 hdr.Cap = l.SizeBytes() 17991 17992 length, err := writer.Write(buf) 17993 // Since we bypassed the compiler's escape analysis, indicate that l 17994 // must live until the use above. 17995 runtime.KeepAlive(l) // escapes: replaced by intrinsic. 17996 return int64(length), err 17997 } 17998 17999 // SizeBytes implements marshal.Marshallable.SizeBytes. 18000 func (s *SockAddrInet) SizeBytes() int { 18001 return 4 + 18002 (*InetAddr)(nil).SizeBytes() + 18003 1*8 18004 } 18005 18006 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 18007 func (s *SockAddrInet) MarshalBytes(dst []byte) []byte { 18008 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) 18009 dst = dst[2:] 18010 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Port)) 18011 dst = dst[2:] 18012 dst = s.Addr.MarshalUnsafe(dst) 18013 // Padding: dst[:sizeof(uint8)*8] ~= [8]uint8{0} 18014 dst = dst[1*(8):] 18015 return dst 18016 } 18017 18018 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 18019 func (s *SockAddrInet) UnmarshalBytes(src []byte) []byte { 18020 s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) 18021 src = src[2:] 18022 s.Port = uint16(hostarch.ByteOrder.Uint16(src[:2])) 18023 src = src[2:] 18024 src = s.Addr.UnmarshalUnsafe(src) 18025 // Padding: ~ copy([8]uint8(s._), src[:sizeof(uint8)*8]) 18026 src = src[1*(8):] 18027 return src 18028 } 18029 18030 // Packed implements marshal.Marshallable.Packed. 18031 //go:nosplit 18032 func (s *SockAddrInet) Packed() bool { 18033 return s.Addr.Packed() 18034 } 18035 18036 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 18037 func (s *SockAddrInet) MarshalUnsafe(dst []byte) []byte { 18038 if s.Addr.Packed() { 18039 size := s.SizeBytes() 18040 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 18041 return dst[size:] 18042 } 18043 // Type SockAddrInet doesn't have a packed layout in memory, fallback to MarshalBytes. 18044 return s.MarshalBytes(dst) 18045 } 18046 18047 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 18048 func (s *SockAddrInet) UnmarshalUnsafe(src []byte) []byte { 18049 if s.Addr.Packed() { 18050 size := s.SizeBytes() 18051 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 18052 return src[size:] 18053 } 18054 // Type SockAddrInet doesn't have a packed layout in memory, fallback to UnmarshalBytes. 18055 return s.UnmarshalBytes(src) 18056 } 18057 18058 // CopyOutN implements marshal.Marshallable.CopyOutN. 18059 func (s *SockAddrInet) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18060 if !s.Addr.Packed() { 18061 // Type SockAddrInet doesn't have a packed layout in memory, fall back to MarshalBytes. 18062 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 18063 s.MarshalBytes(buf) // escapes: fallback. 18064 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 18065 } 18066 18067 // Construct a slice backed by dst's underlying memory. 18068 var buf []byte 18069 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18070 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18071 hdr.Len = s.SizeBytes() 18072 hdr.Cap = s.SizeBytes() 18073 18074 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 18075 // Since we bypassed the compiler's escape analysis, indicate that s 18076 // must live until the use above. 18077 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18078 return length, err 18079 } 18080 18081 // CopyOut implements marshal.Marshallable.CopyOut. 18082 func (s *SockAddrInet) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18083 return s.CopyOutN(cc, addr, s.SizeBytes()) 18084 } 18085 18086 // CopyInN implements marshal.Marshallable.CopyInN. 18087 func (s *SockAddrInet) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18088 if !s.Addr.Packed() { 18089 // Type SockAddrInet doesn't have a packed layout in memory, fall back to UnmarshalBytes. 18090 buf := cc.CopyScratchBuffer(s.SizeBytes()) // escapes: okay. 18091 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 18092 // Unmarshal unconditionally. If we had a short copy-in, this results in a 18093 // partially unmarshalled struct. 18094 s.UnmarshalBytes(buf) // escapes: fallback. 18095 return length, err 18096 } 18097 18098 // Construct a slice backed by dst's underlying memory. 18099 var buf []byte 18100 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18101 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18102 hdr.Len = s.SizeBytes() 18103 hdr.Cap = s.SizeBytes() 18104 18105 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 18106 // Since we bypassed the compiler's escape analysis, indicate that s 18107 // must live until the use above. 18108 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18109 return length, err 18110 } 18111 18112 // CopyIn implements marshal.Marshallable.CopyIn. 18113 func (s *SockAddrInet) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18114 return s.CopyInN(cc, addr, s.SizeBytes()) 18115 } 18116 18117 // WriteTo implements io.WriterTo.WriteTo. 18118 func (s *SockAddrInet) WriteTo(writer io.Writer) (int64, error) { 18119 if !s.Addr.Packed() { 18120 // Type SockAddrInet doesn't have a packed layout in memory, fall back to MarshalBytes. 18121 buf := make([]byte, s.SizeBytes()) 18122 s.MarshalBytes(buf) 18123 length, err := writer.Write(buf) 18124 return int64(length), err 18125 } 18126 18127 // Construct a slice backed by dst's underlying memory. 18128 var buf []byte 18129 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18130 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18131 hdr.Len = s.SizeBytes() 18132 hdr.Cap = s.SizeBytes() 18133 18134 length, err := writer.Write(buf) 18135 // Since we bypassed the compiler's escape analysis, indicate that s 18136 // must live until the use above. 18137 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18138 return int64(length), err 18139 } 18140 18141 // SizeBytes implements marshal.Marshallable.SizeBytes. 18142 func (s *SockAddrInet6) SizeBytes() int { 18143 return 12 + 18144 1*16 18145 } 18146 18147 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 18148 func (s *SockAddrInet6) MarshalBytes(dst []byte) []byte { 18149 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) 18150 dst = dst[2:] 18151 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Port)) 18152 dst = dst[2:] 18153 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Flowinfo)) 18154 dst = dst[4:] 18155 for idx := 0; idx < 16; idx++ { 18156 dst[0] = byte(s.Addr[idx]) 18157 dst = dst[1:] 18158 } 18159 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.Scope_id)) 18160 dst = dst[4:] 18161 return dst 18162 } 18163 18164 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 18165 func (s *SockAddrInet6) UnmarshalBytes(src []byte) []byte { 18166 s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) 18167 src = src[2:] 18168 s.Port = uint16(hostarch.ByteOrder.Uint16(src[:2])) 18169 src = src[2:] 18170 s.Flowinfo = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18171 src = src[4:] 18172 for idx := 0; idx < 16; idx++ { 18173 s.Addr[idx] = src[0] 18174 src = src[1:] 18175 } 18176 s.Scope_id = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18177 src = src[4:] 18178 return src 18179 } 18180 18181 // Packed implements marshal.Marshallable.Packed. 18182 //go:nosplit 18183 func (s *SockAddrInet6) Packed() bool { 18184 return true 18185 } 18186 18187 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 18188 func (s *SockAddrInet6) MarshalUnsafe(dst []byte) []byte { 18189 size := s.SizeBytes() 18190 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 18191 return dst[size:] 18192 } 18193 18194 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 18195 func (s *SockAddrInet6) UnmarshalUnsafe(src []byte) []byte { 18196 size := s.SizeBytes() 18197 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 18198 return src[size:] 18199 } 18200 18201 // CopyOutN implements marshal.Marshallable.CopyOutN. 18202 func (s *SockAddrInet6) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18203 // Construct a slice backed by dst's underlying memory. 18204 var buf []byte 18205 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18206 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18207 hdr.Len = s.SizeBytes() 18208 hdr.Cap = s.SizeBytes() 18209 18210 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 18211 // Since we bypassed the compiler's escape analysis, indicate that s 18212 // must live until the use above. 18213 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18214 return length, err 18215 } 18216 18217 // CopyOut implements marshal.Marshallable.CopyOut. 18218 func (s *SockAddrInet6) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18219 return s.CopyOutN(cc, addr, s.SizeBytes()) 18220 } 18221 18222 // CopyInN implements marshal.Marshallable.CopyInN. 18223 func (s *SockAddrInet6) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18224 // Construct a slice backed by dst's underlying memory. 18225 var buf []byte 18226 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18227 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18228 hdr.Len = s.SizeBytes() 18229 hdr.Cap = s.SizeBytes() 18230 18231 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 18232 // Since we bypassed the compiler's escape analysis, indicate that s 18233 // must live until the use above. 18234 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18235 return length, err 18236 } 18237 18238 // CopyIn implements marshal.Marshallable.CopyIn. 18239 func (s *SockAddrInet6) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18240 return s.CopyInN(cc, addr, s.SizeBytes()) 18241 } 18242 18243 // WriteTo implements io.WriterTo.WriteTo. 18244 func (s *SockAddrInet6) WriteTo(writer io.Writer) (int64, error) { 18245 // Construct a slice backed by dst's underlying memory. 18246 var buf []byte 18247 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18248 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18249 hdr.Len = s.SizeBytes() 18250 hdr.Cap = s.SizeBytes() 18251 18252 length, err := writer.Write(buf) 18253 // Since we bypassed the compiler's escape analysis, indicate that s 18254 // must live until the use above. 18255 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18256 return int64(length), err 18257 } 18258 18259 // SizeBytes implements marshal.Marshallable.SizeBytes. 18260 func (s *SockAddrLink) SizeBytes() int { 18261 return 12 + 18262 1*8 18263 } 18264 18265 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 18266 func (s *SockAddrLink) MarshalBytes(dst []byte) []byte { 18267 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) 18268 dst = dst[2:] 18269 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Protocol)) 18270 dst = dst[2:] 18271 hostarch.ByteOrder.PutUint32(dst[:4], uint32(s.InterfaceIndex)) 18272 dst = dst[4:] 18273 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.ARPHardwareType)) 18274 dst = dst[2:] 18275 dst[0] = byte(s.PacketType) 18276 dst = dst[1:] 18277 dst[0] = byte(s.HardwareAddrLen) 18278 dst = dst[1:] 18279 for idx := 0; idx < 8; idx++ { 18280 dst[0] = byte(s.HardwareAddr[idx]) 18281 dst = dst[1:] 18282 } 18283 return dst 18284 } 18285 18286 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 18287 func (s *SockAddrLink) UnmarshalBytes(src []byte) []byte { 18288 s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) 18289 src = src[2:] 18290 s.Protocol = uint16(hostarch.ByteOrder.Uint16(src[:2])) 18291 src = src[2:] 18292 s.InterfaceIndex = int32(hostarch.ByteOrder.Uint32(src[:4])) 18293 src = src[4:] 18294 s.ARPHardwareType = uint16(hostarch.ByteOrder.Uint16(src[:2])) 18295 src = src[2:] 18296 s.PacketType = src[0] 18297 src = src[1:] 18298 s.HardwareAddrLen = src[0] 18299 src = src[1:] 18300 for idx := 0; idx < 8; idx++ { 18301 s.HardwareAddr[idx] = src[0] 18302 src = src[1:] 18303 } 18304 return src 18305 } 18306 18307 // Packed implements marshal.Marshallable.Packed. 18308 //go:nosplit 18309 func (s *SockAddrLink) Packed() bool { 18310 return true 18311 } 18312 18313 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 18314 func (s *SockAddrLink) MarshalUnsafe(dst []byte) []byte { 18315 size := s.SizeBytes() 18316 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 18317 return dst[size:] 18318 } 18319 18320 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 18321 func (s *SockAddrLink) UnmarshalUnsafe(src []byte) []byte { 18322 size := s.SizeBytes() 18323 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 18324 return src[size:] 18325 } 18326 18327 // CopyOutN implements marshal.Marshallable.CopyOutN. 18328 func (s *SockAddrLink) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18329 // Construct a slice backed by dst's underlying memory. 18330 var buf []byte 18331 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18332 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18333 hdr.Len = s.SizeBytes() 18334 hdr.Cap = s.SizeBytes() 18335 18336 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 18337 // Since we bypassed the compiler's escape analysis, indicate that s 18338 // must live until the use above. 18339 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18340 return length, err 18341 } 18342 18343 // CopyOut implements marshal.Marshallable.CopyOut. 18344 func (s *SockAddrLink) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18345 return s.CopyOutN(cc, addr, s.SizeBytes()) 18346 } 18347 18348 // CopyInN implements marshal.Marshallable.CopyInN. 18349 func (s *SockAddrLink) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18350 // Construct a slice backed by dst's underlying memory. 18351 var buf []byte 18352 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18353 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18354 hdr.Len = s.SizeBytes() 18355 hdr.Cap = s.SizeBytes() 18356 18357 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 18358 // Since we bypassed the compiler's escape analysis, indicate that s 18359 // must live until the use above. 18360 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18361 return length, err 18362 } 18363 18364 // CopyIn implements marshal.Marshallable.CopyIn. 18365 func (s *SockAddrLink) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18366 return s.CopyInN(cc, addr, s.SizeBytes()) 18367 } 18368 18369 // WriteTo implements io.WriterTo.WriteTo. 18370 func (s *SockAddrLink) WriteTo(writer io.Writer) (int64, error) { 18371 // Construct a slice backed by dst's underlying memory. 18372 var buf []byte 18373 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18374 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18375 hdr.Len = s.SizeBytes() 18376 hdr.Cap = s.SizeBytes() 18377 18378 length, err := writer.Write(buf) 18379 // Since we bypassed the compiler's escape analysis, indicate that s 18380 // must live until the use above. 18381 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18382 return int64(length), err 18383 } 18384 18385 // SizeBytes implements marshal.Marshallable.SizeBytes. 18386 func (s *SockAddrUnix) SizeBytes() int { 18387 return 2 + 18388 1*UnixPathMax 18389 } 18390 18391 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 18392 func (s *SockAddrUnix) MarshalBytes(dst []byte) []byte { 18393 hostarch.ByteOrder.PutUint16(dst[:2], uint16(s.Family)) 18394 dst = dst[2:] 18395 for idx := 0; idx < UnixPathMax; idx++ { 18396 dst[0] = byte(s.Path[idx]) 18397 dst = dst[1:] 18398 } 18399 return dst 18400 } 18401 18402 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 18403 func (s *SockAddrUnix) UnmarshalBytes(src []byte) []byte { 18404 s.Family = uint16(hostarch.ByteOrder.Uint16(src[:2])) 18405 src = src[2:] 18406 for idx := 0; idx < UnixPathMax; idx++ { 18407 s.Path[idx] = int8(src[0]) 18408 src = src[1:] 18409 } 18410 return src 18411 } 18412 18413 // Packed implements marshal.Marshallable.Packed. 18414 //go:nosplit 18415 func (s *SockAddrUnix) Packed() bool { 18416 return true 18417 } 18418 18419 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 18420 func (s *SockAddrUnix) MarshalUnsafe(dst []byte) []byte { 18421 size := s.SizeBytes() 18422 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(s), uintptr(size)) 18423 return dst[size:] 18424 } 18425 18426 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 18427 func (s *SockAddrUnix) UnmarshalUnsafe(src []byte) []byte { 18428 size := s.SizeBytes() 18429 gohacks.Memmove(unsafe.Pointer(s), unsafe.Pointer(&src[0]), uintptr(size)) 18430 return src[size:] 18431 } 18432 18433 // CopyOutN implements marshal.Marshallable.CopyOutN. 18434 func (s *SockAddrUnix) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18435 // Construct a slice backed by dst's underlying memory. 18436 var buf []byte 18437 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18438 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18439 hdr.Len = s.SizeBytes() 18440 hdr.Cap = s.SizeBytes() 18441 18442 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 18443 // Since we bypassed the compiler's escape analysis, indicate that s 18444 // must live until the use above. 18445 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18446 return length, err 18447 } 18448 18449 // CopyOut implements marshal.Marshallable.CopyOut. 18450 func (s *SockAddrUnix) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18451 return s.CopyOutN(cc, addr, s.SizeBytes()) 18452 } 18453 18454 // CopyInN implements marshal.Marshallable.CopyInN. 18455 func (s *SockAddrUnix) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18456 // Construct a slice backed by dst's underlying memory. 18457 var buf []byte 18458 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18459 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18460 hdr.Len = s.SizeBytes() 18461 hdr.Cap = s.SizeBytes() 18462 18463 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 18464 // Since we bypassed the compiler's escape analysis, indicate that s 18465 // must live until the use above. 18466 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18467 return length, err 18468 } 18469 18470 // CopyIn implements marshal.Marshallable.CopyIn. 18471 func (s *SockAddrUnix) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18472 return s.CopyInN(cc, addr, s.SizeBytes()) 18473 } 18474 18475 // WriteTo implements io.WriterTo.WriteTo. 18476 func (s *SockAddrUnix) WriteTo(writer io.Writer) (int64, error) { 18477 // Construct a slice backed by dst's underlying memory. 18478 var buf []byte 18479 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18480 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(s))) 18481 hdr.Len = s.SizeBytes() 18482 hdr.Cap = s.SizeBytes() 18483 18484 length, err := writer.Write(buf) 18485 // Since we bypassed the compiler's escape analysis, indicate that s 18486 // must live until the use above. 18487 runtime.KeepAlive(s) // escapes: replaced by intrinsic. 18488 return int64(length), err 18489 } 18490 18491 // SizeBytes implements marshal.Marshallable.SizeBytes. 18492 func (t *TCPInfo) SizeBytes() int { 18493 return 224 18494 } 18495 18496 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 18497 func (t *TCPInfo) MarshalBytes(dst []byte) []byte { 18498 dst[0] = byte(t.State) 18499 dst = dst[1:] 18500 dst[0] = byte(t.CaState) 18501 dst = dst[1:] 18502 dst[0] = byte(t.Retransmits) 18503 dst = dst[1:] 18504 dst[0] = byte(t.Probes) 18505 dst = dst[1:] 18506 dst[0] = byte(t.Backoff) 18507 dst = dst[1:] 18508 dst[0] = byte(t.Options) 18509 dst = dst[1:] 18510 dst[0] = byte(t.WindowScale) 18511 dst = dst[1:] 18512 dst[0] = byte(t.DeliveryRateAppLimited) 18513 dst = dst[1:] 18514 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RTO)) 18515 dst = dst[4:] 18516 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.ATO)) 18517 dst = dst[4:] 18518 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SndMss)) 18519 dst = dst[4:] 18520 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RcvMss)) 18521 dst = dst[4:] 18522 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Unacked)) 18523 dst = dst[4:] 18524 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Sacked)) 18525 dst = dst[4:] 18526 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Lost)) 18527 dst = dst[4:] 18528 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Retrans)) 18529 dst = dst[4:] 18530 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Fackets)) 18531 dst = dst[4:] 18532 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LastDataSent)) 18533 dst = dst[4:] 18534 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LastAckSent)) 18535 dst = dst[4:] 18536 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LastDataRecv)) 18537 dst = dst[4:] 18538 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LastAckRecv)) 18539 dst = dst[4:] 18540 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.PMTU)) 18541 dst = dst[4:] 18542 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RcvSsthresh)) 18543 dst = dst[4:] 18544 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RTT)) 18545 dst = dst[4:] 18546 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RTTVar)) 18547 dst = dst[4:] 18548 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SndSsthresh)) 18549 dst = dst[4:] 18550 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SndCwnd)) 18551 dst = dst[4:] 18552 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Advmss)) 18553 dst = dst[4:] 18554 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Reordering)) 18555 dst = dst[4:] 18556 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RcvRTT)) 18557 dst = dst[4:] 18558 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.RcvSpace)) 18559 dst = dst[4:] 18560 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.TotalRetrans)) 18561 dst = dst[4:] 18562 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.PacingRate)) 18563 dst = dst[8:] 18564 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.MaxPacingRate)) 18565 dst = dst[8:] 18566 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BytesAcked)) 18567 dst = dst[8:] 18568 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BytesReceived)) 18569 dst = dst[8:] 18570 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SegsOut)) 18571 dst = dst[4:] 18572 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.SegsIn)) 18573 dst = dst[4:] 18574 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.NotSentBytes)) 18575 dst = dst[4:] 18576 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.MinRTT)) 18577 dst = dst[4:] 18578 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.DataSegsIn)) 18579 dst = dst[4:] 18580 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.DataSegsOut)) 18581 dst = dst[4:] 18582 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.DeliveryRate)) 18583 dst = dst[8:] 18584 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BusyTime)) 18585 dst = dst[8:] 18586 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.RwndLimited)) 18587 dst = dst[8:] 18588 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.SndBufLimited)) 18589 dst = dst[8:] 18590 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.Delivered)) 18591 dst = dst[4:] 18592 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.DeliveredCE)) 18593 dst = dst[4:] 18594 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BytesSent)) 18595 dst = dst[8:] 18596 hostarch.ByteOrder.PutUint64(dst[:8], uint64(t.BytesRetrans)) 18597 dst = dst[8:] 18598 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.DSACKDups)) 18599 dst = dst[4:] 18600 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.ReordSeen)) 18601 dst = dst[4:] 18602 return dst 18603 } 18604 18605 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 18606 func (t *TCPInfo) UnmarshalBytes(src []byte) []byte { 18607 t.State = uint8(src[0]) 18608 src = src[1:] 18609 t.CaState = uint8(src[0]) 18610 src = src[1:] 18611 t.Retransmits = uint8(src[0]) 18612 src = src[1:] 18613 t.Probes = uint8(src[0]) 18614 src = src[1:] 18615 t.Backoff = uint8(src[0]) 18616 src = src[1:] 18617 t.Options = uint8(src[0]) 18618 src = src[1:] 18619 t.WindowScale = uint8(src[0]) 18620 src = src[1:] 18621 t.DeliveryRateAppLimited = uint8(src[0]) 18622 src = src[1:] 18623 t.RTO = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18624 src = src[4:] 18625 t.ATO = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18626 src = src[4:] 18627 t.SndMss = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18628 src = src[4:] 18629 t.RcvMss = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18630 src = src[4:] 18631 t.Unacked = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18632 src = src[4:] 18633 t.Sacked = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18634 src = src[4:] 18635 t.Lost = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18636 src = src[4:] 18637 t.Retrans = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18638 src = src[4:] 18639 t.Fackets = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18640 src = src[4:] 18641 t.LastDataSent = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18642 src = src[4:] 18643 t.LastAckSent = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18644 src = src[4:] 18645 t.LastDataRecv = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18646 src = src[4:] 18647 t.LastAckRecv = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18648 src = src[4:] 18649 t.PMTU = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18650 src = src[4:] 18651 t.RcvSsthresh = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18652 src = src[4:] 18653 t.RTT = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18654 src = src[4:] 18655 t.RTTVar = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18656 src = src[4:] 18657 t.SndSsthresh = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18658 src = src[4:] 18659 t.SndCwnd = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18660 src = src[4:] 18661 t.Advmss = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18662 src = src[4:] 18663 t.Reordering = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18664 src = src[4:] 18665 t.RcvRTT = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18666 src = src[4:] 18667 t.RcvSpace = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18668 src = src[4:] 18669 t.TotalRetrans = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18670 src = src[4:] 18671 t.PacingRate = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18672 src = src[8:] 18673 t.MaxPacingRate = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18674 src = src[8:] 18675 t.BytesAcked = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18676 src = src[8:] 18677 t.BytesReceived = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18678 src = src[8:] 18679 t.SegsOut = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18680 src = src[4:] 18681 t.SegsIn = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18682 src = src[4:] 18683 t.NotSentBytes = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18684 src = src[4:] 18685 t.MinRTT = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18686 src = src[4:] 18687 t.DataSegsIn = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18688 src = src[4:] 18689 t.DataSegsOut = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18690 src = src[4:] 18691 t.DeliveryRate = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18692 src = src[8:] 18693 t.BusyTime = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18694 src = src[8:] 18695 t.RwndLimited = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18696 src = src[8:] 18697 t.SndBufLimited = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18698 src = src[8:] 18699 t.Delivered = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18700 src = src[4:] 18701 t.DeliveredCE = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18702 src = src[4:] 18703 t.BytesSent = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18704 src = src[8:] 18705 t.BytesRetrans = uint64(hostarch.ByteOrder.Uint64(src[:8])) 18706 src = src[8:] 18707 t.DSACKDups = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18708 src = src[4:] 18709 t.ReordSeen = uint32(hostarch.ByteOrder.Uint32(src[:4])) 18710 src = src[4:] 18711 return src 18712 } 18713 18714 // Packed implements marshal.Marshallable.Packed. 18715 //go:nosplit 18716 func (t *TCPInfo) Packed() bool { 18717 return true 18718 } 18719 18720 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 18721 func (t *TCPInfo) MarshalUnsafe(dst []byte) []byte { 18722 size := t.SizeBytes() 18723 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) 18724 return dst[size:] 18725 } 18726 18727 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 18728 func (t *TCPInfo) UnmarshalUnsafe(src []byte) []byte { 18729 size := t.SizeBytes() 18730 gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) 18731 return src[size:] 18732 } 18733 18734 // CopyOutN implements marshal.Marshallable.CopyOutN. 18735 func (t *TCPInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18736 // Construct a slice backed by dst's underlying memory. 18737 var buf []byte 18738 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18739 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 18740 hdr.Len = t.SizeBytes() 18741 hdr.Cap = t.SizeBytes() 18742 18743 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 18744 // Since we bypassed the compiler's escape analysis, indicate that t 18745 // must live until the use above. 18746 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 18747 return length, err 18748 } 18749 18750 // CopyOut implements marshal.Marshallable.CopyOut. 18751 func (t *TCPInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18752 return t.CopyOutN(cc, addr, t.SizeBytes()) 18753 } 18754 18755 // CopyInN implements marshal.Marshallable.CopyInN. 18756 func (t *TCPInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18757 // Construct a slice backed by dst's underlying memory. 18758 var buf []byte 18759 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18760 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 18761 hdr.Len = t.SizeBytes() 18762 hdr.Cap = t.SizeBytes() 18763 18764 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 18765 // Since we bypassed the compiler's escape analysis, indicate that t 18766 // must live until the use above. 18767 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 18768 return length, err 18769 } 18770 18771 // CopyIn implements marshal.Marshallable.CopyIn. 18772 func (t *TCPInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18773 return t.CopyInN(cc, addr, t.SizeBytes()) 18774 } 18775 18776 // WriteTo implements io.WriterTo.WriteTo. 18777 func (t *TCPInfo) WriteTo(writer io.Writer) (int64, error) { 18778 // Construct a slice backed by dst's underlying memory. 18779 var buf []byte 18780 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18781 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 18782 hdr.Len = t.SizeBytes() 18783 hdr.Cap = t.SizeBytes() 18784 18785 length, err := writer.Write(buf) 18786 // Since we bypassed the compiler's escape analysis, indicate that t 18787 // must live until the use above. 18788 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 18789 return int64(length), err 18790 } 18791 18792 // SizeBytes implements marshal.Marshallable.SizeBytes. 18793 //go:nosplit 18794 func (c *ClockT) SizeBytes() int { 18795 return 8 18796 } 18797 18798 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 18799 func (c *ClockT) MarshalBytes(dst []byte) []byte { 18800 hostarch.ByteOrder.PutUint64(dst[:8], uint64(*c)) 18801 return dst[8:] 18802 } 18803 18804 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 18805 func (c *ClockT) UnmarshalBytes(src []byte) []byte { 18806 *c = ClockT(int64(hostarch.ByteOrder.Uint64(src[:8]))) 18807 return src[8:] 18808 } 18809 18810 // Packed implements marshal.Marshallable.Packed. 18811 //go:nosplit 18812 func (c *ClockT) Packed() bool { 18813 // Scalar newtypes are always packed. 18814 return true 18815 } 18816 18817 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 18818 func (c *ClockT) MarshalUnsafe(dst []byte) []byte { 18819 size := c.SizeBytes() 18820 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(c), uintptr(size)) 18821 return dst[size:] 18822 } 18823 18824 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 18825 func (c *ClockT) UnmarshalUnsafe(src []byte) []byte { 18826 size := c.SizeBytes() 18827 gohacks.Memmove(unsafe.Pointer(c), unsafe.Pointer(&src[0]), uintptr(size)) 18828 return src[size:] 18829 } 18830 18831 // CopyOutN implements marshal.Marshallable.CopyOutN. 18832 func (c *ClockT) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18833 // Construct a slice backed by dst's underlying memory. 18834 var buf []byte 18835 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18836 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 18837 hdr.Len = c.SizeBytes() 18838 hdr.Cap = c.SizeBytes() 18839 18840 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 18841 // Since we bypassed the compiler's escape analysis, indicate that c 18842 // must live until the use above. 18843 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 18844 return length, err 18845 } 18846 18847 // CopyOut implements marshal.Marshallable.CopyOut. 18848 func (c *ClockT) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18849 return c.CopyOutN(cc, addr, c.SizeBytes()) 18850 } 18851 18852 // CopyInN implements marshal.Marshallable.CopyInN. 18853 func (c *ClockT) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18854 // Construct a slice backed by dst's underlying memory. 18855 var buf []byte 18856 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18857 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 18858 hdr.Len = c.SizeBytes() 18859 hdr.Cap = c.SizeBytes() 18860 18861 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 18862 // Since we bypassed the compiler's escape analysis, indicate that c 18863 // must live until the use above. 18864 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 18865 return length, err 18866 } 18867 18868 // CopyIn implements marshal.Marshallable.CopyIn. 18869 func (c *ClockT) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18870 return c.CopyInN(cc, addr, c.SizeBytes()) 18871 } 18872 18873 // WriteTo implements io.WriterTo.WriteTo. 18874 func (c *ClockT) WriteTo(writer io.Writer) (int64, error) { 18875 // Construct a slice backed by dst's underlying memory. 18876 var buf []byte 18877 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18878 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(c))) 18879 hdr.Len = c.SizeBytes() 18880 hdr.Cap = c.SizeBytes() 18881 18882 length, err := writer.Write(buf) 18883 // Since we bypassed the compiler's escape analysis, indicate that c 18884 // must live until the use above. 18885 runtime.KeepAlive(c) // escapes: replaced by intrinsic. 18886 return int64(length), err 18887 } 18888 18889 // SizeBytes implements marshal.Marshallable.SizeBytes. 18890 func (i *ItimerVal) SizeBytes() int { 18891 return 0 + 18892 (*Timeval)(nil).SizeBytes() + 18893 (*Timeval)(nil).SizeBytes() 18894 } 18895 18896 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 18897 func (i *ItimerVal) MarshalBytes(dst []byte) []byte { 18898 dst = i.Interval.MarshalUnsafe(dst) 18899 dst = i.Value.MarshalUnsafe(dst) 18900 return dst 18901 } 18902 18903 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 18904 func (i *ItimerVal) UnmarshalBytes(src []byte) []byte { 18905 src = i.Interval.UnmarshalUnsafe(src) 18906 src = i.Value.UnmarshalUnsafe(src) 18907 return src 18908 } 18909 18910 // Packed implements marshal.Marshallable.Packed. 18911 //go:nosplit 18912 func (i *ItimerVal) Packed() bool { 18913 return i.Interval.Packed() && i.Value.Packed() 18914 } 18915 18916 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 18917 func (i *ItimerVal) MarshalUnsafe(dst []byte) []byte { 18918 if i.Interval.Packed() && i.Value.Packed() { 18919 size := i.SizeBytes() 18920 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 18921 return dst[size:] 18922 } 18923 // Type ItimerVal doesn't have a packed layout in memory, fallback to MarshalBytes. 18924 return i.MarshalBytes(dst) 18925 } 18926 18927 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 18928 func (i *ItimerVal) UnmarshalUnsafe(src []byte) []byte { 18929 if i.Interval.Packed() && i.Value.Packed() { 18930 size := i.SizeBytes() 18931 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 18932 return src[size:] 18933 } 18934 // Type ItimerVal doesn't have a packed layout in memory, fallback to UnmarshalBytes. 18935 return i.UnmarshalBytes(src) 18936 } 18937 18938 // CopyOutN implements marshal.Marshallable.CopyOutN. 18939 func (i *ItimerVal) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18940 if !i.Interval.Packed() && i.Value.Packed() { 18941 // Type ItimerVal doesn't have a packed layout in memory, fall back to MarshalBytes. 18942 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 18943 i.MarshalBytes(buf) // escapes: fallback. 18944 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 18945 } 18946 18947 // Construct a slice backed by dst's underlying memory. 18948 var buf []byte 18949 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18950 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 18951 hdr.Len = i.SizeBytes() 18952 hdr.Cap = i.SizeBytes() 18953 18954 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 18955 // Since we bypassed the compiler's escape analysis, indicate that i 18956 // must live until the use above. 18957 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 18958 return length, err 18959 } 18960 18961 // CopyOut implements marshal.Marshallable.CopyOut. 18962 func (i *ItimerVal) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18963 return i.CopyOutN(cc, addr, i.SizeBytes()) 18964 } 18965 18966 // CopyInN implements marshal.Marshallable.CopyInN. 18967 func (i *ItimerVal) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 18968 if !i.Interval.Packed() && i.Value.Packed() { 18969 // Type ItimerVal doesn't have a packed layout in memory, fall back to UnmarshalBytes. 18970 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 18971 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 18972 // Unmarshal unconditionally. If we had a short copy-in, this results in a 18973 // partially unmarshalled struct. 18974 i.UnmarshalBytes(buf) // escapes: fallback. 18975 return length, err 18976 } 18977 18978 // Construct a slice backed by dst's underlying memory. 18979 var buf []byte 18980 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 18981 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 18982 hdr.Len = i.SizeBytes() 18983 hdr.Cap = i.SizeBytes() 18984 18985 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 18986 // Since we bypassed the compiler's escape analysis, indicate that i 18987 // must live until the use above. 18988 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 18989 return length, err 18990 } 18991 18992 // CopyIn implements marshal.Marshallable.CopyIn. 18993 func (i *ItimerVal) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 18994 return i.CopyInN(cc, addr, i.SizeBytes()) 18995 } 18996 18997 // WriteTo implements io.WriterTo.WriteTo. 18998 func (i *ItimerVal) WriteTo(writer io.Writer) (int64, error) { 18999 if !i.Interval.Packed() && i.Value.Packed() { 19000 // Type ItimerVal doesn't have a packed layout in memory, fall back to MarshalBytes. 19001 buf := make([]byte, i.SizeBytes()) 19002 i.MarshalBytes(buf) 19003 length, err := writer.Write(buf) 19004 return int64(length), err 19005 } 19006 19007 // Construct a slice backed by dst's underlying memory. 19008 var buf []byte 19009 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19010 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 19011 hdr.Len = i.SizeBytes() 19012 hdr.Cap = i.SizeBytes() 19013 19014 length, err := writer.Write(buf) 19015 // Since we bypassed the compiler's escape analysis, indicate that i 19016 // must live until the use above. 19017 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 19018 return int64(length), err 19019 } 19020 19021 // SizeBytes implements marshal.Marshallable.SizeBytes. 19022 func (i *Itimerspec) SizeBytes() int { 19023 return 0 + 19024 (*Timespec)(nil).SizeBytes() + 19025 (*Timespec)(nil).SizeBytes() 19026 } 19027 19028 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 19029 func (i *Itimerspec) MarshalBytes(dst []byte) []byte { 19030 dst = i.Interval.MarshalUnsafe(dst) 19031 dst = i.Value.MarshalUnsafe(dst) 19032 return dst 19033 } 19034 19035 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 19036 func (i *Itimerspec) UnmarshalBytes(src []byte) []byte { 19037 src = i.Interval.UnmarshalUnsafe(src) 19038 src = i.Value.UnmarshalUnsafe(src) 19039 return src 19040 } 19041 19042 // Packed implements marshal.Marshallable.Packed. 19043 //go:nosplit 19044 func (i *Itimerspec) Packed() bool { 19045 return i.Interval.Packed() && i.Value.Packed() 19046 } 19047 19048 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 19049 func (i *Itimerspec) MarshalUnsafe(dst []byte) []byte { 19050 if i.Interval.Packed() && i.Value.Packed() { 19051 size := i.SizeBytes() 19052 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(i), uintptr(size)) 19053 return dst[size:] 19054 } 19055 // Type Itimerspec doesn't have a packed layout in memory, fallback to MarshalBytes. 19056 return i.MarshalBytes(dst) 19057 } 19058 19059 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 19060 func (i *Itimerspec) UnmarshalUnsafe(src []byte) []byte { 19061 if i.Interval.Packed() && i.Value.Packed() { 19062 size := i.SizeBytes() 19063 gohacks.Memmove(unsafe.Pointer(i), unsafe.Pointer(&src[0]), uintptr(size)) 19064 return src[size:] 19065 } 19066 // Type Itimerspec doesn't have a packed layout in memory, fallback to UnmarshalBytes. 19067 return i.UnmarshalBytes(src) 19068 } 19069 19070 // CopyOutN implements marshal.Marshallable.CopyOutN. 19071 func (i *Itimerspec) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19072 if !i.Interval.Packed() && i.Value.Packed() { 19073 // Type Itimerspec doesn't have a packed layout in memory, fall back to MarshalBytes. 19074 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 19075 i.MarshalBytes(buf) // escapes: fallback. 19076 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19077 } 19078 19079 // Construct a slice backed by dst's underlying memory. 19080 var buf []byte 19081 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19082 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 19083 hdr.Len = i.SizeBytes() 19084 hdr.Cap = i.SizeBytes() 19085 19086 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19087 // Since we bypassed the compiler's escape analysis, indicate that i 19088 // must live until the use above. 19089 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 19090 return length, err 19091 } 19092 19093 // CopyOut implements marshal.Marshallable.CopyOut. 19094 func (i *Itimerspec) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19095 return i.CopyOutN(cc, addr, i.SizeBytes()) 19096 } 19097 19098 // CopyInN implements marshal.Marshallable.CopyInN. 19099 func (i *Itimerspec) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19100 if !i.Interval.Packed() && i.Value.Packed() { 19101 // Type Itimerspec doesn't have a packed layout in memory, fall back to UnmarshalBytes. 19102 buf := cc.CopyScratchBuffer(i.SizeBytes()) // escapes: okay. 19103 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 19104 // Unmarshal unconditionally. If we had a short copy-in, this results in a 19105 // partially unmarshalled struct. 19106 i.UnmarshalBytes(buf) // escapes: fallback. 19107 return length, err 19108 } 19109 19110 // Construct a slice backed by dst's underlying memory. 19111 var buf []byte 19112 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19113 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 19114 hdr.Len = i.SizeBytes() 19115 hdr.Cap = i.SizeBytes() 19116 19117 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 19118 // Since we bypassed the compiler's escape analysis, indicate that i 19119 // must live until the use above. 19120 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 19121 return length, err 19122 } 19123 19124 // CopyIn implements marshal.Marshallable.CopyIn. 19125 func (i *Itimerspec) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19126 return i.CopyInN(cc, addr, i.SizeBytes()) 19127 } 19128 19129 // WriteTo implements io.WriterTo.WriteTo. 19130 func (i *Itimerspec) WriteTo(writer io.Writer) (int64, error) { 19131 if !i.Interval.Packed() && i.Value.Packed() { 19132 // Type Itimerspec doesn't have a packed layout in memory, fall back to MarshalBytes. 19133 buf := make([]byte, i.SizeBytes()) 19134 i.MarshalBytes(buf) 19135 length, err := writer.Write(buf) 19136 return int64(length), err 19137 } 19138 19139 // Construct a slice backed by dst's underlying memory. 19140 var buf []byte 19141 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19142 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(i))) 19143 hdr.Len = i.SizeBytes() 19144 hdr.Cap = i.SizeBytes() 19145 19146 length, err := writer.Write(buf) 19147 // Since we bypassed the compiler's escape analysis, indicate that i 19148 // must live until the use above. 19149 runtime.KeepAlive(i) // escapes: replaced by intrinsic. 19150 return int64(length), err 19151 } 19152 19153 // SizeBytes implements marshal.Marshallable.SizeBytes. 19154 func (sxts *StatxTimestamp) SizeBytes() int { 19155 return 16 19156 } 19157 19158 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 19159 func (sxts *StatxTimestamp) MarshalBytes(dst []byte) []byte { 19160 hostarch.ByteOrder.PutUint64(dst[:8], uint64(sxts.Sec)) 19161 dst = dst[8:] 19162 hostarch.ByteOrder.PutUint32(dst[:4], uint32(sxts.Nsec)) 19163 dst = dst[4:] 19164 // Padding: dst[:sizeof(int32)] ~= int32(0) 19165 dst = dst[4:] 19166 return dst 19167 } 19168 19169 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 19170 func (sxts *StatxTimestamp) UnmarshalBytes(src []byte) []byte { 19171 sxts.Sec = int64(hostarch.ByteOrder.Uint64(src[:8])) 19172 src = src[8:] 19173 sxts.Nsec = uint32(hostarch.ByteOrder.Uint32(src[:4])) 19174 src = src[4:] 19175 // Padding: var _ int32 ~= src[:sizeof(int32)] 19176 src = src[4:] 19177 return src 19178 } 19179 19180 // Packed implements marshal.Marshallable.Packed. 19181 //go:nosplit 19182 func (sxts *StatxTimestamp) Packed() bool { 19183 return true 19184 } 19185 19186 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 19187 func (sxts *StatxTimestamp) MarshalUnsafe(dst []byte) []byte { 19188 size := sxts.SizeBytes() 19189 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(sxts), uintptr(size)) 19190 return dst[size:] 19191 } 19192 19193 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 19194 func (sxts *StatxTimestamp) UnmarshalUnsafe(src []byte) []byte { 19195 size := sxts.SizeBytes() 19196 gohacks.Memmove(unsafe.Pointer(sxts), unsafe.Pointer(&src[0]), uintptr(size)) 19197 return src[size:] 19198 } 19199 19200 // CopyOutN implements marshal.Marshallable.CopyOutN. 19201 func (sxts *StatxTimestamp) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19202 // Construct a slice backed by dst's underlying memory. 19203 var buf []byte 19204 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19205 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(sxts))) 19206 hdr.Len = sxts.SizeBytes() 19207 hdr.Cap = sxts.SizeBytes() 19208 19209 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19210 // Since we bypassed the compiler's escape analysis, indicate that sxts 19211 // must live until the use above. 19212 runtime.KeepAlive(sxts) // escapes: replaced by intrinsic. 19213 return length, err 19214 } 19215 19216 // CopyOut implements marshal.Marshallable.CopyOut. 19217 func (sxts *StatxTimestamp) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19218 return sxts.CopyOutN(cc, addr, sxts.SizeBytes()) 19219 } 19220 19221 // CopyInN implements marshal.Marshallable.CopyInN. 19222 func (sxts *StatxTimestamp) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19223 // Construct a slice backed by dst's underlying memory. 19224 var buf []byte 19225 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19226 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(sxts))) 19227 hdr.Len = sxts.SizeBytes() 19228 hdr.Cap = sxts.SizeBytes() 19229 19230 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 19231 // Since we bypassed the compiler's escape analysis, indicate that sxts 19232 // must live until the use above. 19233 runtime.KeepAlive(sxts) // escapes: replaced by intrinsic. 19234 return length, err 19235 } 19236 19237 // CopyIn implements marshal.Marshallable.CopyIn. 19238 func (sxts *StatxTimestamp) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19239 return sxts.CopyInN(cc, addr, sxts.SizeBytes()) 19240 } 19241 19242 // WriteTo implements io.WriterTo.WriteTo. 19243 func (sxts *StatxTimestamp) WriteTo(writer io.Writer) (int64, error) { 19244 // Construct a slice backed by dst's underlying memory. 19245 var buf []byte 19246 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19247 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(sxts))) 19248 hdr.Len = sxts.SizeBytes() 19249 hdr.Cap = sxts.SizeBytes() 19250 19251 length, err := writer.Write(buf) 19252 // Since we bypassed the compiler's escape analysis, indicate that sxts 19253 // must live until the use above. 19254 runtime.KeepAlive(sxts) // escapes: replaced by intrinsic. 19255 return int64(length), err 19256 } 19257 19258 // SizeBytes implements marshal.Marshallable.SizeBytes. 19259 //go:nosplit 19260 func (t *TimeT) SizeBytes() int { 19261 return 8 19262 } 19263 19264 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 19265 func (t *TimeT) MarshalBytes(dst []byte) []byte { 19266 hostarch.ByteOrder.PutUint64(dst[:8], uint64(*t)) 19267 return dst[8:] 19268 } 19269 19270 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 19271 func (t *TimeT) UnmarshalBytes(src []byte) []byte { 19272 *t = TimeT(int64(hostarch.ByteOrder.Uint64(src[:8]))) 19273 return src[8:] 19274 } 19275 19276 // Packed implements marshal.Marshallable.Packed. 19277 //go:nosplit 19278 func (t *TimeT) Packed() bool { 19279 // Scalar newtypes are always packed. 19280 return true 19281 } 19282 19283 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 19284 func (t *TimeT) MarshalUnsafe(dst []byte) []byte { 19285 size := t.SizeBytes() 19286 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) 19287 return dst[size:] 19288 } 19289 19290 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 19291 func (t *TimeT) UnmarshalUnsafe(src []byte) []byte { 19292 size := t.SizeBytes() 19293 gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) 19294 return src[size:] 19295 } 19296 19297 // CopyOutN implements marshal.Marshallable.CopyOutN. 19298 func (t *TimeT) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19299 // Construct a slice backed by dst's underlying memory. 19300 var buf []byte 19301 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19302 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 19303 hdr.Len = t.SizeBytes() 19304 hdr.Cap = t.SizeBytes() 19305 19306 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19307 // Since we bypassed the compiler's escape analysis, indicate that t 19308 // must live until the use above. 19309 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 19310 return length, err 19311 } 19312 19313 // CopyOut implements marshal.Marshallable.CopyOut. 19314 func (t *TimeT) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19315 return t.CopyOutN(cc, addr, t.SizeBytes()) 19316 } 19317 19318 // CopyInN implements marshal.Marshallable.CopyInN. 19319 func (t *TimeT) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19320 // Construct a slice backed by dst's underlying memory. 19321 var buf []byte 19322 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19323 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 19324 hdr.Len = t.SizeBytes() 19325 hdr.Cap = t.SizeBytes() 19326 19327 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 19328 // Since we bypassed the compiler's escape analysis, indicate that t 19329 // must live until the use above. 19330 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 19331 return length, err 19332 } 19333 19334 // CopyIn implements marshal.Marshallable.CopyIn. 19335 func (t *TimeT) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19336 return t.CopyInN(cc, addr, t.SizeBytes()) 19337 } 19338 19339 // WriteTo implements io.WriterTo.WriteTo. 19340 func (t *TimeT) WriteTo(writer io.Writer) (int64, error) { 19341 // Construct a slice backed by dst's underlying memory. 19342 var buf []byte 19343 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19344 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 19345 hdr.Len = t.SizeBytes() 19346 hdr.Cap = t.SizeBytes() 19347 19348 length, err := writer.Write(buf) 19349 // Since we bypassed the compiler's escape analysis, indicate that t 19350 // must live until the use above. 19351 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 19352 return int64(length), err 19353 } 19354 19355 // SizeBytes implements marshal.Marshallable.SizeBytes. 19356 //go:nosplit 19357 func (t *TimerID) SizeBytes() int { 19358 return 4 19359 } 19360 19361 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 19362 func (t *TimerID) MarshalBytes(dst []byte) []byte { 19363 hostarch.ByteOrder.PutUint32(dst[:4], uint32(*t)) 19364 return dst[4:] 19365 } 19366 19367 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 19368 func (t *TimerID) UnmarshalBytes(src []byte) []byte { 19369 *t = TimerID(int32(hostarch.ByteOrder.Uint32(src[:4]))) 19370 return src[4:] 19371 } 19372 19373 // Packed implements marshal.Marshallable.Packed. 19374 //go:nosplit 19375 func (t *TimerID) Packed() bool { 19376 // Scalar newtypes are always packed. 19377 return true 19378 } 19379 19380 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 19381 func (t *TimerID) MarshalUnsafe(dst []byte) []byte { 19382 size := t.SizeBytes() 19383 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) 19384 return dst[size:] 19385 } 19386 19387 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 19388 func (t *TimerID) UnmarshalUnsafe(src []byte) []byte { 19389 size := t.SizeBytes() 19390 gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) 19391 return src[size:] 19392 } 19393 19394 // CopyOutN implements marshal.Marshallable.CopyOutN. 19395 func (t *TimerID) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19396 // Construct a slice backed by dst's underlying memory. 19397 var buf []byte 19398 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19399 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 19400 hdr.Len = t.SizeBytes() 19401 hdr.Cap = t.SizeBytes() 19402 19403 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19404 // Since we bypassed the compiler's escape analysis, indicate that t 19405 // must live until the use above. 19406 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 19407 return length, err 19408 } 19409 19410 // CopyOut implements marshal.Marshallable.CopyOut. 19411 func (t *TimerID) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19412 return t.CopyOutN(cc, addr, t.SizeBytes()) 19413 } 19414 19415 // CopyInN implements marshal.Marshallable.CopyInN. 19416 func (t *TimerID) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19417 // Construct a slice backed by dst's underlying memory. 19418 var buf []byte 19419 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19420 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 19421 hdr.Len = t.SizeBytes() 19422 hdr.Cap = t.SizeBytes() 19423 19424 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 19425 // Since we bypassed the compiler's escape analysis, indicate that t 19426 // must live until the use above. 19427 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 19428 return length, err 19429 } 19430 19431 // CopyIn implements marshal.Marshallable.CopyIn. 19432 func (t *TimerID) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19433 return t.CopyInN(cc, addr, t.SizeBytes()) 19434 } 19435 19436 // WriteTo implements io.WriterTo.WriteTo. 19437 func (t *TimerID) WriteTo(writer io.Writer) (int64, error) { 19438 // Construct a slice backed by dst's underlying memory. 19439 var buf []byte 19440 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19441 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 19442 hdr.Len = t.SizeBytes() 19443 hdr.Cap = t.SizeBytes() 19444 19445 length, err := writer.Write(buf) 19446 // Since we bypassed the compiler's escape analysis, indicate that t 19447 // must live until the use above. 19448 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 19449 return int64(length), err 19450 } 19451 19452 // SizeBytes implements marshal.Marshallable.SizeBytes. 19453 func (ts *Timespec) SizeBytes() int { 19454 return 16 19455 } 19456 19457 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 19458 func (ts *Timespec) MarshalBytes(dst []byte) []byte { 19459 hostarch.ByteOrder.PutUint64(dst[:8], uint64(ts.Sec)) 19460 dst = dst[8:] 19461 hostarch.ByteOrder.PutUint64(dst[:8], uint64(ts.Nsec)) 19462 dst = dst[8:] 19463 return dst 19464 } 19465 19466 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 19467 func (ts *Timespec) UnmarshalBytes(src []byte) []byte { 19468 ts.Sec = int64(hostarch.ByteOrder.Uint64(src[:8])) 19469 src = src[8:] 19470 ts.Nsec = int64(hostarch.ByteOrder.Uint64(src[:8])) 19471 src = src[8:] 19472 return src 19473 } 19474 19475 // Packed implements marshal.Marshallable.Packed. 19476 //go:nosplit 19477 func (ts *Timespec) Packed() bool { 19478 return true 19479 } 19480 19481 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 19482 func (ts *Timespec) MarshalUnsafe(dst []byte) []byte { 19483 size := ts.SizeBytes() 19484 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(ts), uintptr(size)) 19485 return dst[size:] 19486 } 19487 19488 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 19489 func (ts *Timespec) UnmarshalUnsafe(src []byte) []byte { 19490 size := ts.SizeBytes() 19491 gohacks.Memmove(unsafe.Pointer(ts), unsafe.Pointer(&src[0]), uintptr(size)) 19492 return src[size:] 19493 } 19494 19495 // CopyOutN implements marshal.Marshallable.CopyOutN. 19496 func (ts *Timespec) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19497 // Construct a slice backed by dst's underlying memory. 19498 var buf []byte 19499 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19500 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ts))) 19501 hdr.Len = ts.SizeBytes() 19502 hdr.Cap = ts.SizeBytes() 19503 19504 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19505 // Since we bypassed the compiler's escape analysis, indicate that ts 19506 // must live until the use above. 19507 runtime.KeepAlive(ts) // escapes: replaced by intrinsic. 19508 return length, err 19509 } 19510 19511 // CopyOut implements marshal.Marshallable.CopyOut. 19512 func (ts *Timespec) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19513 return ts.CopyOutN(cc, addr, ts.SizeBytes()) 19514 } 19515 19516 // CopyInN implements marshal.Marshallable.CopyInN. 19517 func (ts *Timespec) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19518 // Construct a slice backed by dst's underlying memory. 19519 var buf []byte 19520 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19521 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ts))) 19522 hdr.Len = ts.SizeBytes() 19523 hdr.Cap = ts.SizeBytes() 19524 19525 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 19526 // Since we bypassed the compiler's escape analysis, indicate that ts 19527 // must live until the use above. 19528 runtime.KeepAlive(ts) // escapes: replaced by intrinsic. 19529 return length, err 19530 } 19531 19532 // CopyIn implements marshal.Marshallable.CopyIn. 19533 func (ts *Timespec) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19534 return ts.CopyInN(cc, addr, ts.SizeBytes()) 19535 } 19536 19537 // WriteTo implements io.WriterTo.WriteTo. 19538 func (ts *Timespec) WriteTo(writer io.Writer) (int64, error) { 19539 // Construct a slice backed by dst's underlying memory. 19540 var buf []byte 19541 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19542 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(ts))) 19543 hdr.Len = ts.SizeBytes() 19544 hdr.Cap = ts.SizeBytes() 19545 19546 length, err := writer.Write(buf) 19547 // Since we bypassed the compiler's escape analysis, indicate that ts 19548 // must live until the use above. 19549 runtime.KeepAlive(ts) // escapes: replaced by intrinsic. 19550 return int64(length), err 19551 } 19552 19553 // CopyTimespecSliceIn copies in a slice of Timespec objects from the task's memory. 19554 func CopyTimespecSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []Timespec) (int, error) { 19555 count := len(dst) 19556 if count == 0 { 19557 return 0, nil 19558 } 19559 size := (*Timespec)(nil).SizeBytes() 19560 19561 ptr := unsafe.Pointer(&dst) 19562 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 19563 19564 // Construct a slice backed by dst's underlying memory. 19565 var buf []byte 19566 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19567 hdr.Data = uintptr(val) 19568 hdr.Len = size * count 19569 hdr.Cap = size * count 19570 19571 length, err := cc.CopyInBytes(addr, buf) 19572 // Since we bypassed the compiler's escape analysis, indicate that dst 19573 // must live until the use above. 19574 runtime.KeepAlive(dst) // escapes: replaced by intrinsic. 19575 return length, err 19576 } 19577 19578 // CopyTimespecSliceOut copies a slice of Timespec objects to the task's memory. 19579 func CopyTimespecSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []Timespec) (int, error) { 19580 count := len(src) 19581 if count == 0 { 19582 return 0, nil 19583 } 19584 size := (*Timespec)(nil).SizeBytes() 19585 19586 ptr := unsafe.Pointer(&src) 19587 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 19588 19589 // Construct a slice backed by dst's underlying memory. 19590 var buf []byte 19591 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19592 hdr.Data = uintptr(val) 19593 hdr.Len = size * count 19594 hdr.Cap = size * count 19595 19596 length, err := cc.CopyOutBytes(addr, buf) 19597 // Since we bypassed the compiler's escape analysis, indicate that src 19598 // must live until the use above. 19599 runtime.KeepAlive(src) // escapes: replaced by intrinsic. 19600 return length, err 19601 } 19602 19603 // MarshalUnsafeTimespecSlice is like Timespec.MarshalUnsafe, but for a []Timespec. 19604 func MarshalUnsafeTimespecSlice(src []Timespec, dst []byte) []byte { 19605 count := len(src) 19606 if count == 0 { 19607 return dst 19608 } 19609 19610 size := (*Timespec)(nil).SizeBytes() 19611 buf := dst[:size*count] 19612 gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) 19613 return dst[size*count:] 19614 } 19615 19616 // UnmarshalUnsafeTimespecSlice is like Timespec.UnmarshalUnsafe, but for a []Timespec. 19617 func UnmarshalUnsafeTimespecSlice(dst []Timespec, src []byte) []byte { 19618 count := len(dst) 19619 if count == 0 { 19620 return src 19621 } 19622 19623 size := (*Timespec)(nil).SizeBytes() 19624 buf := src[:size*count] 19625 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) 19626 return src[size*count:] 19627 } 19628 19629 // SizeBytes implements marshal.Marshallable.SizeBytes. 19630 func (tv *Timeval) SizeBytes() int { 19631 return 16 19632 } 19633 19634 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 19635 func (tv *Timeval) MarshalBytes(dst []byte) []byte { 19636 hostarch.ByteOrder.PutUint64(dst[:8], uint64(tv.Sec)) 19637 dst = dst[8:] 19638 hostarch.ByteOrder.PutUint64(dst[:8], uint64(tv.Usec)) 19639 dst = dst[8:] 19640 return dst 19641 } 19642 19643 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 19644 func (tv *Timeval) UnmarshalBytes(src []byte) []byte { 19645 tv.Sec = int64(hostarch.ByteOrder.Uint64(src[:8])) 19646 src = src[8:] 19647 tv.Usec = int64(hostarch.ByteOrder.Uint64(src[:8])) 19648 src = src[8:] 19649 return src 19650 } 19651 19652 // Packed implements marshal.Marshallable.Packed. 19653 //go:nosplit 19654 func (tv *Timeval) Packed() bool { 19655 return true 19656 } 19657 19658 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 19659 func (tv *Timeval) MarshalUnsafe(dst []byte) []byte { 19660 size := tv.SizeBytes() 19661 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(tv), uintptr(size)) 19662 return dst[size:] 19663 } 19664 19665 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 19666 func (tv *Timeval) UnmarshalUnsafe(src []byte) []byte { 19667 size := tv.SizeBytes() 19668 gohacks.Memmove(unsafe.Pointer(tv), unsafe.Pointer(&src[0]), uintptr(size)) 19669 return src[size:] 19670 } 19671 19672 // CopyOutN implements marshal.Marshallable.CopyOutN. 19673 func (tv *Timeval) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19674 // Construct a slice backed by dst's underlying memory. 19675 var buf []byte 19676 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19677 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tv))) 19678 hdr.Len = tv.SizeBytes() 19679 hdr.Cap = tv.SizeBytes() 19680 19681 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19682 // Since we bypassed the compiler's escape analysis, indicate that tv 19683 // must live until the use above. 19684 runtime.KeepAlive(tv) // escapes: replaced by intrinsic. 19685 return length, err 19686 } 19687 19688 // CopyOut implements marshal.Marshallable.CopyOut. 19689 func (tv *Timeval) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19690 return tv.CopyOutN(cc, addr, tv.SizeBytes()) 19691 } 19692 19693 // CopyInN implements marshal.Marshallable.CopyInN. 19694 func (tv *Timeval) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19695 // Construct a slice backed by dst's underlying memory. 19696 var buf []byte 19697 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19698 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tv))) 19699 hdr.Len = tv.SizeBytes() 19700 hdr.Cap = tv.SizeBytes() 19701 19702 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 19703 // Since we bypassed the compiler's escape analysis, indicate that tv 19704 // must live until the use above. 19705 runtime.KeepAlive(tv) // escapes: replaced by intrinsic. 19706 return length, err 19707 } 19708 19709 // CopyIn implements marshal.Marshallable.CopyIn. 19710 func (tv *Timeval) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19711 return tv.CopyInN(cc, addr, tv.SizeBytes()) 19712 } 19713 19714 // WriteTo implements io.WriterTo.WriteTo. 19715 func (tv *Timeval) WriteTo(writer io.Writer) (int64, error) { 19716 // Construct a slice backed by dst's underlying memory. 19717 var buf []byte 19718 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19719 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(tv))) 19720 hdr.Len = tv.SizeBytes() 19721 hdr.Cap = tv.SizeBytes() 19722 19723 length, err := writer.Write(buf) 19724 // Since we bypassed the compiler's escape analysis, indicate that tv 19725 // must live until the use above. 19726 runtime.KeepAlive(tv) // escapes: replaced by intrinsic. 19727 return int64(length), err 19728 } 19729 19730 // CopyTimevalSliceIn copies in a slice of Timeval objects from the task's memory. 19731 func CopyTimevalSliceIn(cc marshal.CopyContext, addr hostarch.Addr, dst []Timeval) (int, error) { 19732 count := len(dst) 19733 if count == 0 { 19734 return 0, nil 19735 } 19736 size := (*Timeval)(nil).SizeBytes() 19737 19738 ptr := unsafe.Pointer(&dst) 19739 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 19740 19741 // Construct a slice backed by dst's underlying memory. 19742 var buf []byte 19743 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19744 hdr.Data = uintptr(val) 19745 hdr.Len = size * count 19746 hdr.Cap = size * count 19747 19748 length, err := cc.CopyInBytes(addr, buf) 19749 // Since we bypassed the compiler's escape analysis, indicate that dst 19750 // must live until the use above. 19751 runtime.KeepAlive(dst) // escapes: replaced by intrinsic. 19752 return length, err 19753 } 19754 19755 // CopyTimevalSliceOut copies a slice of Timeval objects to the task's memory. 19756 func CopyTimevalSliceOut(cc marshal.CopyContext, addr hostarch.Addr, src []Timeval) (int, error) { 19757 count := len(src) 19758 if count == 0 { 19759 return 0, nil 19760 } 19761 size := (*Timeval)(nil).SizeBytes() 19762 19763 ptr := unsafe.Pointer(&src) 19764 val := gohacks.Noescape(unsafe.Pointer((*reflect.SliceHeader)(ptr).Data)) 19765 19766 // Construct a slice backed by dst's underlying memory. 19767 var buf []byte 19768 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19769 hdr.Data = uintptr(val) 19770 hdr.Len = size * count 19771 hdr.Cap = size * count 19772 19773 length, err := cc.CopyOutBytes(addr, buf) 19774 // Since we bypassed the compiler's escape analysis, indicate that src 19775 // must live until the use above. 19776 runtime.KeepAlive(src) // escapes: replaced by intrinsic. 19777 return length, err 19778 } 19779 19780 // MarshalUnsafeTimevalSlice is like Timeval.MarshalUnsafe, but for a []Timeval. 19781 func MarshalUnsafeTimevalSlice(src []Timeval, dst []byte) []byte { 19782 count := len(src) 19783 if count == 0 { 19784 return dst 19785 } 19786 19787 size := (*Timeval)(nil).SizeBytes() 19788 buf := dst[:size*count] 19789 gohacks.Memmove(unsafe.Pointer(&buf[0]), unsafe.Pointer(&src[0]), uintptr(len(buf))) 19790 return dst[size*count:] 19791 } 19792 19793 // UnmarshalUnsafeTimevalSlice is like Timeval.UnmarshalUnsafe, but for a []Timeval. 19794 func UnmarshalUnsafeTimevalSlice(dst []Timeval, src []byte) []byte { 19795 count := len(dst) 19796 if count == 0 { 19797 return src 19798 } 19799 19800 size := (*Timeval)(nil).SizeBytes() 19801 buf := src[:size*count] 19802 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(&buf[0]), uintptr(len(buf))) 19803 return src[size*count:] 19804 } 19805 19806 // SizeBytes implements marshal.Marshallable.SizeBytes. 19807 func (t *Tms) SizeBytes() int { 19808 return 0 + 19809 (*ClockT)(nil).SizeBytes() + 19810 (*ClockT)(nil).SizeBytes() + 19811 (*ClockT)(nil).SizeBytes() + 19812 (*ClockT)(nil).SizeBytes() 19813 } 19814 19815 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 19816 func (t *Tms) MarshalBytes(dst []byte) []byte { 19817 dst = t.UTime.MarshalUnsafe(dst) 19818 dst = t.STime.MarshalUnsafe(dst) 19819 dst = t.CUTime.MarshalUnsafe(dst) 19820 dst = t.CSTime.MarshalUnsafe(dst) 19821 return dst 19822 } 19823 19824 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 19825 func (t *Tms) UnmarshalBytes(src []byte) []byte { 19826 src = t.UTime.UnmarshalUnsafe(src) 19827 src = t.STime.UnmarshalUnsafe(src) 19828 src = t.CUTime.UnmarshalUnsafe(src) 19829 src = t.CSTime.UnmarshalUnsafe(src) 19830 return src 19831 } 19832 19833 // Packed implements marshal.Marshallable.Packed. 19834 //go:nosplit 19835 func (t *Tms) Packed() bool { 19836 return t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() 19837 } 19838 19839 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 19840 func (t *Tms) MarshalUnsafe(dst []byte) []byte { 19841 if t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { 19842 size := t.SizeBytes() 19843 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) 19844 return dst[size:] 19845 } 19846 // Type Tms doesn't have a packed layout in memory, fallback to MarshalBytes. 19847 return t.MarshalBytes(dst) 19848 } 19849 19850 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 19851 func (t *Tms) UnmarshalUnsafe(src []byte) []byte { 19852 if t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { 19853 size := t.SizeBytes() 19854 gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) 19855 return src[size:] 19856 } 19857 // Type Tms doesn't have a packed layout in memory, fallback to UnmarshalBytes. 19858 return t.UnmarshalBytes(src) 19859 } 19860 19861 // CopyOutN implements marshal.Marshallable.CopyOutN. 19862 func (t *Tms) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19863 if !t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { 19864 // Type Tms doesn't have a packed layout in memory, fall back to MarshalBytes. 19865 buf := cc.CopyScratchBuffer(t.SizeBytes()) // escapes: okay. 19866 t.MarshalBytes(buf) // escapes: fallback. 19867 return cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19868 } 19869 19870 // Construct a slice backed by dst's underlying memory. 19871 var buf []byte 19872 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19873 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 19874 hdr.Len = t.SizeBytes() 19875 hdr.Cap = t.SizeBytes() 19876 19877 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19878 // Since we bypassed the compiler's escape analysis, indicate that t 19879 // must live until the use above. 19880 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 19881 return length, err 19882 } 19883 19884 // CopyOut implements marshal.Marshallable.CopyOut. 19885 func (t *Tms) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19886 return t.CopyOutN(cc, addr, t.SizeBytes()) 19887 } 19888 19889 // CopyInN implements marshal.Marshallable.CopyInN. 19890 func (t *Tms) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19891 if !t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { 19892 // Type Tms doesn't have a packed layout in memory, fall back to UnmarshalBytes. 19893 buf := cc.CopyScratchBuffer(t.SizeBytes()) // escapes: okay. 19894 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 19895 // Unmarshal unconditionally. If we had a short copy-in, this results in a 19896 // partially unmarshalled struct. 19897 t.UnmarshalBytes(buf) // escapes: fallback. 19898 return length, err 19899 } 19900 19901 // Construct a slice backed by dst's underlying memory. 19902 var buf []byte 19903 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19904 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 19905 hdr.Len = t.SizeBytes() 19906 hdr.Cap = t.SizeBytes() 19907 19908 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 19909 // Since we bypassed the compiler's escape analysis, indicate that t 19910 // must live until the use above. 19911 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 19912 return length, err 19913 } 19914 19915 // CopyIn implements marshal.Marshallable.CopyIn. 19916 func (t *Tms) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 19917 return t.CopyInN(cc, addr, t.SizeBytes()) 19918 } 19919 19920 // WriteTo implements io.WriterTo.WriteTo. 19921 func (t *Tms) WriteTo(writer io.Writer) (int64, error) { 19922 if !t.CSTime.Packed() && t.CUTime.Packed() && t.STime.Packed() && t.UTime.Packed() { 19923 // Type Tms doesn't have a packed layout in memory, fall back to MarshalBytes. 19924 buf := make([]byte, t.SizeBytes()) 19925 t.MarshalBytes(buf) 19926 length, err := writer.Write(buf) 19927 return int64(length), err 19928 } 19929 19930 // Construct a slice backed by dst's underlying memory. 19931 var buf []byte 19932 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19933 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 19934 hdr.Len = t.SizeBytes() 19935 hdr.Cap = t.SizeBytes() 19936 19937 length, err := writer.Write(buf) 19938 // Since we bypassed the compiler's escape analysis, indicate that t 19939 // must live until the use above. 19940 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 19941 return int64(length), err 19942 } 19943 19944 // SizeBytes implements marshal.Marshallable.SizeBytes. 19945 func (u *Utime) SizeBytes() int { 19946 return 16 19947 } 19948 19949 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 19950 func (u *Utime) MarshalBytes(dst []byte) []byte { 19951 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Actime)) 19952 dst = dst[8:] 19953 hostarch.ByteOrder.PutUint64(dst[:8], uint64(u.Modtime)) 19954 dst = dst[8:] 19955 return dst 19956 } 19957 19958 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 19959 func (u *Utime) UnmarshalBytes(src []byte) []byte { 19960 u.Actime = int64(hostarch.ByteOrder.Uint64(src[:8])) 19961 src = src[8:] 19962 u.Modtime = int64(hostarch.ByteOrder.Uint64(src[:8])) 19963 src = src[8:] 19964 return src 19965 } 19966 19967 // Packed implements marshal.Marshallable.Packed. 19968 //go:nosplit 19969 func (u *Utime) Packed() bool { 19970 return true 19971 } 19972 19973 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 19974 func (u *Utime) MarshalUnsafe(dst []byte) []byte { 19975 size := u.SizeBytes() 19976 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 19977 return dst[size:] 19978 } 19979 19980 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 19981 func (u *Utime) UnmarshalUnsafe(src []byte) []byte { 19982 size := u.SizeBytes() 19983 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 19984 return src[size:] 19985 } 19986 19987 // CopyOutN implements marshal.Marshallable.CopyOutN. 19988 func (u *Utime) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 19989 // Construct a slice backed by dst's underlying memory. 19990 var buf []byte 19991 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 19992 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 19993 hdr.Len = u.SizeBytes() 19994 hdr.Cap = u.SizeBytes() 19995 19996 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 19997 // Since we bypassed the compiler's escape analysis, indicate that u 19998 // must live until the use above. 19999 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 20000 return length, err 20001 } 20002 20003 // CopyOut implements marshal.Marshallable.CopyOut. 20004 func (u *Utime) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20005 return u.CopyOutN(cc, addr, u.SizeBytes()) 20006 } 20007 20008 // CopyInN implements marshal.Marshallable.CopyInN. 20009 func (u *Utime) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20010 // Construct a slice backed by dst's underlying memory. 20011 var buf []byte 20012 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20013 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 20014 hdr.Len = u.SizeBytes() 20015 hdr.Cap = u.SizeBytes() 20016 20017 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 20018 // Since we bypassed the compiler's escape analysis, indicate that u 20019 // must live until the use above. 20020 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 20021 return length, err 20022 } 20023 20024 // CopyIn implements marshal.Marshallable.CopyIn. 20025 func (u *Utime) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20026 return u.CopyInN(cc, addr, u.SizeBytes()) 20027 } 20028 20029 // WriteTo implements io.WriterTo.WriteTo. 20030 func (u *Utime) WriteTo(writer io.Writer) (int64, error) { 20031 // Construct a slice backed by dst's underlying memory. 20032 var buf []byte 20033 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20034 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 20035 hdr.Len = u.SizeBytes() 20036 hdr.Cap = u.SizeBytes() 20037 20038 length, err := writer.Write(buf) 20039 // Since we bypassed the compiler's escape analysis, indicate that u 20040 // must live until the use above. 20041 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 20042 return int64(length), err 20043 } 20044 20045 // SizeBytes implements marshal.Marshallable.SizeBytes. 20046 func (t *Termios) SizeBytes() int { 20047 return 17 + 20048 1*NumControlCharacters 20049 } 20050 20051 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 20052 func (t *Termios) MarshalBytes(dst []byte) []byte { 20053 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.InputFlags)) 20054 dst = dst[4:] 20055 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.OutputFlags)) 20056 dst = dst[4:] 20057 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.ControlFlags)) 20058 dst = dst[4:] 20059 hostarch.ByteOrder.PutUint32(dst[:4], uint32(t.LocalFlags)) 20060 dst = dst[4:] 20061 dst[0] = byte(t.LineDiscipline) 20062 dst = dst[1:] 20063 for idx := 0; idx < NumControlCharacters; idx++ { 20064 dst[0] = byte(t.ControlCharacters[idx]) 20065 dst = dst[1:] 20066 } 20067 return dst 20068 } 20069 20070 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 20071 func (t *Termios) UnmarshalBytes(src []byte) []byte { 20072 t.InputFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20073 src = src[4:] 20074 t.OutputFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20075 src = src[4:] 20076 t.ControlFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20077 src = src[4:] 20078 t.LocalFlags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20079 src = src[4:] 20080 t.LineDiscipline = uint8(src[0]) 20081 src = src[1:] 20082 for idx := 0; idx < NumControlCharacters; idx++ { 20083 t.ControlCharacters[idx] = uint8(src[0]) 20084 src = src[1:] 20085 } 20086 return src 20087 } 20088 20089 // Packed implements marshal.Marshallable.Packed. 20090 //go:nosplit 20091 func (t *Termios) Packed() bool { 20092 return true 20093 } 20094 20095 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 20096 func (t *Termios) MarshalUnsafe(dst []byte) []byte { 20097 size := t.SizeBytes() 20098 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(t), uintptr(size)) 20099 return dst[size:] 20100 } 20101 20102 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 20103 func (t *Termios) UnmarshalUnsafe(src []byte) []byte { 20104 size := t.SizeBytes() 20105 gohacks.Memmove(unsafe.Pointer(t), unsafe.Pointer(&src[0]), uintptr(size)) 20106 return src[size:] 20107 } 20108 20109 // CopyOutN implements marshal.Marshallable.CopyOutN. 20110 func (t *Termios) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20111 // Construct a slice backed by dst's underlying memory. 20112 var buf []byte 20113 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20114 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 20115 hdr.Len = t.SizeBytes() 20116 hdr.Cap = t.SizeBytes() 20117 20118 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 20119 // Since we bypassed the compiler's escape analysis, indicate that t 20120 // must live until the use above. 20121 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 20122 return length, err 20123 } 20124 20125 // CopyOut implements marshal.Marshallable.CopyOut. 20126 func (t *Termios) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20127 return t.CopyOutN(cc, addr, t.SizeBytes()) 20128 } 20129 20130 // CopyInN implements marshal.Marshallable.CopyInN. 20131 func (t *Termios) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20132 // Construct a slice backed by dst's underlying memory. 20133 var buf []byte 20134 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20135 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 20136 hdr.Len = t.SizeBytes() 20137 hdr.Cap = t.SizeBytes() 20138 20139 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 20140 // Since we bypassed the compiler's escape analysis, indicate that t 20141 // must live until the use above. 20142 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 20143 return length, err 20144 } 20145 20146 // CopyIn implements marshal.Marshallable.CopyIn. 20147 func (t *Termios) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20148 return t.CopyInN(cc, addr, t.SizeBytes()) 20149 } 20150 20151 // WriteTo implements io.WriterTo.WriteTo. 20152 func (t *Termios) WriteTo(writer io.Writer) (int64, error) { 20153 // Construct a slice backed by dst's underlying memory. 20154 var buf []byte 20155 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20156 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(t))) 20157 hdr.Len = t.SizeBytes() 20158 hdr.Cap = t.SizeBytes() 20159 20160 length, err := writer.Write(buf) 20161 // Since we bypassed the compiler's escape analysis, indicate that t 20162 // must live until the use above. 20163 runtime.KeepAlive(t) // escapes: replaced by intrinsic. 20164 return int64(length), err 20165 } 20166 20167 // SizeBytes implements marshal.Marshallable.SizeBytes. 20168 func (w *WindowSize) SizeBytes() int { 20169 return 4 + 20170 1*4 20171 } 20172 20173 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 20174 func (w *WindowSize) MarshalBytes(dst []byte) []byte { 20175 hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Rows)) 20176 dst = dst[2:] 20177 hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Cols)) 20178 dst = dst[2:] 20179 // Padding: dst[:sizeof(byte)*4] ~= [4]byte{0} 20180 dst = dst[1*(4):] 20181 return dst 20182 } 20183 20184 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 20185 func (w *WindowSize) UnmarshalBytes(src []byte) []byte { 20186 w.Rows = uint16(hostarch.ByteOrder.Uint16(src[:2])) 20187 src = src[2:] 20188 w.Cols = uint16(hostarch.ByteOrder.Uint16(src[:2])) 20189 src = src[2:] 20190 // Padding: ~ copy([4]byte(w._), src[:sizeof(byte)*4]) 20191 src = src[1*(4):] 20192 return src 20193 } 20194 20195 // Packed implements marshal.Marshallable.Packed. 20196 //go:nosplit 20197 func (w *WindowSize) Packed() bool { 20198 return true 20199 } 20200 20201 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 20202 func (w *WindowSize) MarshalUnsafe(dst []byte) []byte { 20203 size := w.SizeBytes() 20204 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(w), uintptr(size)) 20205 return dst[size:] 20206 } 20207 20208 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 20209 func (w *WindowSize) UnmarshalUnsafe(src []byte) []byte { 20210 size := w.SizeBytes() 20211 gohacks.Memmove(unsafe.Pointer(w), unsafe.Pointer(&src[0]), uintptr(size)) 20212 return src[size:] 20213 } 20214 20215 // CopyOutN implements marshal.Marshallable.CopyOutN. 20216 func (w *WindowSize) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20217 // Construct a slice backed by dst's underlying memory. 20218 var buf []byte 20219 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20220 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) 20221 hdr.Len = w.SizeBytes() 20222 hdr.Cap = w.SizeBytes() 20223 20224 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 20225 // Since we bypassed the compiler's escape analysis, indicate that w 20226 // must live until the use above. 20227 runtime.KeepAlive(w) // escapes: replaced by intrinsic. 20228 return length, err 20229 } 20230 20231 // CopyOut implements marshal.Marshallable.CopyOut. 20232 func (w *WindowSize) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20233 return w.CopyOutN(cc, addr, w.SizeBytes()) 20234 } 20235 20236 // CopyInN implements marshal.Marshallable.CopyInN. 20237 func (w *WindowSize) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20238 // Construct a slice backed by dst's underlying memory. 20239 var buf []byte 20240 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20241 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) 20242 hdr.Len = w.SizeBytes() 20243 hdr.Cap = w.SizeBytes() 20244 20245 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 20246 // Since we bypassed the compiler's escape analysis, indicate that w 20247 // must live until the use above. 20248 runtime.KeepAlive(w) // escapes: replaced by intrinsic. 20249 return length, err 20250 } 20251 20252 // CopyIn implements marshal.Marshallable.CopyIn. 20253 func (w *WindowSize) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20254 return w.CopyInN(cc, addr, w.SizeBytes()) 20255 } 20256 20257 // WriteTo implements io.WriterTo.WriteTo. 20258 func (w *WindowSize) WriteTo(writer io.Writer) (int64, error) { 20259 // Construct a slice backed by dst's underlying memory. 20260 var buf []byte 20261 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20262 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) 20263 hdr.Len = w.SizeBytes() 20264 hdr.Cap = w.SizeBytes() 20265 20266 length, err := writer.Write(buf) 20267 // Since we bypassed the compiler's escape analysis, indicate that w 20268 // must live until the use above. 20269 runtime.KeepAlive(w) // escapes: replaced by intrinsic. 20270 return int64(length), err 20271 } 20272 20273 // SizeBytes implements marshal.Marshallable.SizeBytes. 20274 func (w *Winsize) SizeBytes() int { 20275 return 8 20276 } 20277 20278 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 20279 func (w *Winsize) MarshalBytes(dst []byte) []byte { 20280 hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Row)) 20281 dst = dst[2:] 20282 hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Col)) 20283 dst = dst[2:] 20284 hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Xpixel)) 20285 dst = dst[2:] 20286 hostarch.ByteOrder.PutUint16(dst[:2], uint16(w.Ypixel)) 20287 dst = dst[2:] 20288 return dst 20289 } 20290 20291 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 20292 func (w *Winsize) UnmarshalBytes(src []byte) []byte { 20293 w.Row = uint16(hostarch.ByteOrder.Uint16(src[:2])) 20294 src = src[2:] 20295 w.Col = uint16(hostarch.ByteOrder.Uint16(src[:2])) 20296 src = src[2:] 20297 w.Xpixel = uint16(hostarch.ByteOrder.Uint16(src[:2])) 20298 src = src[2:] 20299 w.Ypixel = uint16(hostarch.ByteOrder.Uint16(src[:2])) 20300 src = src[2:] 20301 return src 20302 } 20303 20304 // Packed implements marshal.Marshallable.Packed. 20305 //go:nosplit 20306 func (w *Winsize) Packed() bool { 20307 return true 20308 } 20309 20310 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 20311 func (w *Winsize) MarshalUnsafe(dst []byte) []byte { 20312 size := w.SizeBytes() 20313 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(w), uintptr(size)) 20314 return dst[size:] 20315 } 20316 20317 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 20318 func (w *Winsize) UnmarshalUnsafe(src []byte) []byte { 20319 size := w.SizeBytes() 20320 gohacks.Memmove(unsafe.Pointer(w), unsafe.Pointer(&src[0]), uintptr(size)) 20321 return src[size:] 20322 } 20323 20324 // CopyOutN implements marshal.Marshallable.CopyOutN. 20325 func (w *Winsize) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20326 // Construct a slice backed by dst's underlying memory. 20327 var buf []byte 20328 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20329 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) 20330 hdr.Len = w.SizeBytes() 20331 hdr.Cap = w.SizeBytes() 20332 20333 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 20334 // Since we bypassed the compiler's escape analysis, indicate that w 20335 // must live until the use above. 20336 runtime.KeepAlive(w) // escapes: replaced by intrinsic. 20337 return length, err 20338 } 20339 20340 // CopyOut implements marshal.Marshallable.CopyOut. 20341 func (w *Winsize) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20342 return w.CopyOutN(cc, addr, w.SizeBytes()) 20343 } 20344 20345 // CopyInN implements marshal.Marshallable.CopyInN. 20346 func (w *Winsize) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20347 // Construct a slice backed by dst's underlying memory. 20348 var buf []byte 20349 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20350 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) 20351 hdr.Len = w.SizeBytes() 20352 hdr.Cap = w.SizeBytes() 20353 20354 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 20355 // Since we bypassed the compiler's escape analysis, indicate that w 20356 // must live until the use above. 20357 runtime.KeepAlive(w) // escapes: replaced by intrinsic. 20358 return length, err 20359 } 20360 20361 // CopyIn implements marshal.Marshallable.CopyIn. 20362 func (w *Winsize) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20363 return w.CopyInN(cc, addr, w.SizeBytes()) 20364 } 20365 20366 // WriteTo implements io.WriterTo.WriteTo. 20367 func (w *Winsize) WriteTo(writer io.Writer) (int64, error) { 20368 // Construct a slice backed by dst's underlying memory. 20369 var buf []byte 20370 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20371 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(w))) 20372 hdr.Len = w.SizeBytes() 20373 hdr.Cap = w.SizeBytes() 20374 20375 length, err := writer.Write(buf) 20376 // Since we bypassed the compiler's escape analysis, indicate that w 20377 // must live until the use above. 20378 runtime.KeepAlive(w) // escapes: replaced by intrinsic. 20379 return int64(length), err 20380 } 20381 20382 // SizeBytes implements marshal.Marshallable.SizeBytes. 20383 func (u *UtsName) SizeBytes() int { 20384 return 0 + 20385 1*(UTSLen+1) + 20386 1*(UTSLen+1) + 20387 1*(UTSLen+1) + 20388 1*(UTSLen+1) + 20389 1*(UTSLen+1) + 20390 1*(UTSLen+1) 20391 } 20392 20393 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 20394 func (u *UtsName) MarshalBytes(dst []byte) []byte { 20395 for idx := 0; idx < (UTSLen+1); idx++ { 20396 dst[0] = byte(u.Sysname[idx]) 20397 dst = dst[1:] 20398 } 20399 for idx := 0; idx < (UTSLen+1); idx++ { 20400 dst[0] = byte(u.Nodename[idx]) 20401 dst = dst[1:] 20402 } 20403 for idx := 0; idx < (UTSLen+1); idx++ { 20404 dst[0] = byte(u.Release[idx]) 20405 dst = dst[1:] 20406 } 20407 for idx := 0; idx < (UTSLen+1); idx++ { 20408 dst[0] = byte(u.Version[idx]) 20409 dst = dst[1:] 20410 } 20411 for idx := 0; idx < (UTSLen+1); idx++ { 20412 dst[0] = byte(u.Machine[idx]) 20413 dst = dst[1:] 20414 } 20415 for idx := 0; idx < (UTSLen+1); idx++ { 20416 dst[0] = byte(u.Domainname[idx]) 20417 dst = dst[1:] 20418 } 20419 return dst 20420 } 20421 20422 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 20423 func (u *UtsName) UnmarshalBytes(src []byte) []byte { 20424 for idx := 0; idx < (UTSLen+1); idx++ { 20425 u.Sysname[idx] = src[0] 20426 src = src[1:] 20427 } 20428 for idx := 0; idx < (UTSLen+1); idx++ { 20429 u.Nodename[idx] = src[0] 20430 src = src[1:] 20431 } 20432 for idx := 0; idx < (UTSLen+1); idx++ { 20433 u.Release[idx] = src[0] 20434 src = src[1:] 20435 } 20436 for idx := 0; idx < (UTSLen+1); idx++ { 20437 u.Version[idx] = src[0] 20438 src = src[1:] 20439 } 20440 for idx := 0; idx < (UTSLen+1); idx++ { 20441 u.Machine[idx] = src[0] 20442 src = src[1:] 20443 } 20444 for idx := 0; idx < (UTSLen+1); idx++ { 20445 u.Domainname[idx] = src[0] 20446 src = src[1:] 20447 } 20448 return src 20449 } 20450 20451 // Packed implements marshal.Marshallable.Packed. 20452 //go:nosplit 20453 func (u *UtsName) Packed() bool { 20454 return true 20455 } 20456 20457 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 20458 func (u *UtsName) MarshalUnsafe(dst []byte) []byte { 20459 size := u.SizeBytes() 20460 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(u), uintptr(size)) 20461 return dst[size:] 20462 } 20463 20464 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 20465 func (u *UtsName) UnmarshalUnsafe(src []byte) []byte { 20466 size := u.SizeBytes() 20467 gohacks.Memmove(unsafe.Pointer(u), unsafe.Pointer(&src[0]), uintptr(size)) 20468 return src[size:] 20469 } 20470 20471 // CopyOutN implements marshal.Marshallable.CopyOutN. 20472 func (u *UtsName) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20473 // Construct a slice backed by dst's underlying memory. 20474 var buf []byte 20475 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20476 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 20477 hdr.Len = u.SizeBytes() 20478 hdr.Cap = u.SizeBytes() 20479 20480 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 20481 // Since we bypassed the compiler's escape analysis, indicate that u 20482 // must live until the use above. 20483 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 20484 return length, err 20485 } 20486 20487 // CopyOut implements marshal.Marshallable.CopyOut. 20488 func (u *UtsName) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20489 return u.CopyOutN(cc, addr, u.SizeBytes()) 20490 } 20491 20492 // CopyInN implements marshal.Marshallable.CopyInN. 20493 func (u *UtsName) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20494 // Construct a slice backed by dst's underlying memory. 20495 var buf []byte 20496 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20497 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 20498 hdr.Len = u.SizeBytes() 20499 hdr.Cap = u.SizeBytes() 20500 20501 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 20502 // Since we bypassed the compiler's escape analysis, indicate that u 20503 // must live until the use above. 20504 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 20505 return length, err 20506 } 20507 20508 // CopyIn implements marshal.Marshallable.CopyIn. 20509 func (u *UtsName) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20510 return u.CopyInN(cc, addr, u.SizeBytes()) 20511 } 20512 20513 // WriteTo implements io.WriterTo.WriteTo. 20514 func (u *UtsName) WriteTo(writer io.Writer) (int64, error) { 20515 // Construct a slice backed by dst's underlying memory. 20516 var buf []byte 20517 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20518 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(u))) 20519 hdr.Len = u.SizeBytes() 20520 hdr.Cap = u.SizeBytes() 20521 20522 length, err := writer.Write(buf) 20523 // Since we bypassed the compiler's escape analysis, indicate that u 20524 // must live until the use above. 20525 runtime.KeepAlive(u) // escapes: replaced by intrinsic. 20526 return int64(length), err 20527 } 20528 20529 // SizeBytes implements marshal.Marshallable.SizeBytes. 20530 func (v *VFIODeviceInfo) SizeBytes() int { 20531 return 24 20532 } 20533 20534 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 20535 func (v *VFIODeviceInfo) MarshalBytes(dst []byte) []byte { 20536 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Argsz)) 20537 dst = dst[4:] 20538 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Flags)) 20539 dst = dst[4:] 20540 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.NumRegions)) 20541 dst = dst[4:] 20542 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.NumIrqs)) 20543 dst = dst[4:] 20544 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.CapOffset)) 20545 dst = dst[4:] 20546 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.pad)) 20547 dst = dst[4:] 20548 return dst 20549 } 20550 20551 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 20552 func (v *VFIODeviceInfo) UnmarshalBytes(src []byte) []byte { 20553 v.Argsz = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20554 src = src[4:] 20555 v.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20556 src = src[4:] 20557 v.NumRegions = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20558 src = src[4:] 20559 v.NumIrqs = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20560 src = src[4:] 20561 v.CapOffset = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20562 src = src[4:] 20563 v.pad = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20564 src = src[4:] 20565 return src 20566 } 20567 20568 // Packed implements marshal.Marshallable.Packed. 20569 //go:nosplit 20570 func (v *VFIODeviceInfo) Packed() bool { 20571 return true 20572 } 20573 20574 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 20575 func (v *VFIODeviceInfo) MarshalUnsafe(dst []byte) []byte { 20576 size := v.SizeBytes() 20577 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(v), uintptr(size)) 20578 return dst[size:] 20579 } 20580 20581 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 20582 func (v *VFIODeviceInfo) UnmarshalUnsafe(src []byte) []byte { 20583 size := v.SizeBytes() 20584 gohacks.Memmove(unsafe.Pointer(v), unsafe.Pointer(&src[0]), uintptr(size)) 20585 return src[size:] 20586 } 20587 20588 // CopyOutN implements marshal.Marshallable.CopyOutN. 20589 func (v *VFIODeviceInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20590 // Construct a slice backed by dst's underlying memory. 20591 var buf []byte 20592 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20593 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20594 hdr.Len = v.SizeBytes() 20595 hdr.Cap = v.SizeBytes() 20596 20597 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 20598 // Since we bypassed the compiler's escape analysis, indicate that v 20599 // must live until the use above. 20600 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20601 return length, err 20602 } 20603 20604 // CopyOut implements marshal.Marshallable.CopyOut. 20605 func (v *VFIODeviceInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20606 return v.CopyOutN(cc, addr, v.SizeBytes()) 20607 } 20608 20609 // CopyInN implements marshal.Marshallable.CopyInN. 20610 func (v *VFIODeviceInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20611 // Construct a slice backed by dst's underlying memory. 20612 var buf []byte 20613 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20614 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20615 hdr.Len = v.SizeBytes() 20616 hdr.Cap = v.SizeBytes() 20617 20618 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 20619 // Since we bypassed the compiler's escape analysis, indicate that v 20620 // must live until the use above. 20621 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20622 return length, err 20623 } 20624 20625 // CopyIn implements marshal.Marshallable.CopyIn. 20626 func (v *VFIODeviceInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20627 return v.CopyInN(cc, addr, v.SizeBytes()) 20628 } 20629 20630 // WriteTo implements io.WriterTo.WriteTo. 20631 func (v *VFIODeviceInfo) WriteTo(writer io.Writer) (int64, error) { 20632 // Construct a slice backed by dst's underlying memory. 20633 var buf []byte 20634 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20635 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20636 hdr.Len = v.SizeBytes() 20637 hdr.Cap = v.SizeBytes() 20638 20639 length, err := writer.Write(buf) 20640 // Since we bypassed the compiler's escape analysis, indicate that v 20641 // must live until the use above. 20642 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20643 return int64(length), err 20644 } 20645 20646 // SizeBytes implements marshal.Marshallable.SizeBytes. 20647 func (v *VFIOIommuType1DmaMap) SizeBytes() int { 20648 return 32 20649 } 20650 20651 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 20652 func (v *VFIOIommuType1DmaMap) MarshalBytes(dst []byte) []byte { 20653 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Argsz)) 20654 dst = dst[4:] 20655 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Flags)) 20656 dst = dst[4:] 20657 hostarch.ByteOrder.PutUint64(dst[:8], uint64(v.Vaddr)) 20658 dst = dst[8:] 20659 hostarch.ByteOrder.PutUint64(dst[:8], uint64(v.IOVa)) 20660 dst = dst[8:] 20661 hostarch.ByteOrder.PutUint64(dst[:8], uint64(v.Size)) 20662 dst = dst[8:] 20663 return dst 20664 } 20665 20666 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 20667 func (v *VFIOIommuType1DmaMap) UnmarshalBytes(src []byte) []byte { 20668 v.Argsz = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20669 src = src[4:] 20670 v.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20671 src = src[4:] 20672 v.Vaddr = uint64(hostarch.ByteOrder.Uint64(src[:8])) 20673 src = src[8:] 20674 v.IOVa = uint64(hostarch.ByteOrder.Uint64(src[:8])) 20675 src = src[8:] 20676 v.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) 20677 src = src[8:] 20678 return src 20679 } 20680 20681 // Packed implements marshal.Marshallable.Packed. 20682 //go:nosplit 20683 func (v *VFIOIommuType1DmaMap) Packed() bool { 20684 return true 20685 } 20686 20687 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 20688 func (v *VFIOIommuType1DmaMap) MarshalUnsafe(dst []byte) []byte { 20689 size := v.SizeBytes() 20690 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(v), uintptr(size)) 20691 return dst[size:] 20692 } 20693 20694 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 20695 func (v *VFIOIommuType1DmaMap) UnmarshalUnsafe(src []byte) []byte { 20696 size := v.SizeBytes() 20697 gohacks.Memmove(unsafe.Pointer(v), unsafe.Pointer(&src[0]), uintptr(size)) 20698 return src[size:] 20699 } 20700 20701 // CopyOutN implements marshal.Marshallable.CopyOutN. 20702 func (v *VFIOIommuType1DmaMap) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20703 // Construct a slice backed by dst's underlying memory. 20704 var buf []byte 20705 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20706 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20707 hdr.Len = v.SizeBytes() 20708 hdr.Cap = v.SizeBytes() 20709 20710 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 20711 // Since we bypassed the compiler's escape analysis, indicate that v 20712 // must live until the use above. 20713 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20714 return length, err 20715 } 20716 20717 // CopyOut implements marshal.Marshallable.CopyOut. 20718 func (v *VFIOIommuType1DmaMap) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20719 return v.CopyOutN(cc, addr, v.SizeBytes()) 20720 } 20721 20722 // CopyInN implements marshal.Marshallable.CopyInN. 20723 func (v *VFIOIommuType1DmaMap) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20724 // Construct a slice backed by dst's underlying memory. 20725 var buf []byte 20726 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20727 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20728 hdr.Len = v.SizeBytes() 20729 hdr.Cap = v.SizeBytes() 20730 20731 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 20732 // Since we bypassed the compiler's escape analysis, indicate that v 20733 // must live until the use above. 20734 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20735 return length, err 20736 } 20737 20738 // CopyIn implements marshal.Marshallable.CopyIn. 20739 func (v *VFIOIommuType1DmaMap) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20740 return v.CopyInN(cc, addr, v.SizeBytes()) 20741 } 20742 20743 // WriteTo implements io.WriterTo.WriteTo. 20744 func (v *VFIOIommuType1DmaMap) WriteTo(writer io.Writer) (int64, error) { 20745 // Construct a slice backed by dst's underlying memory. 20746 var buf []byte 20747 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20748 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20749 hdr.Len = v.SizeBytes() 20750 hdr.Cap = v.SizeBytes() 20751 20752 length, err := writer.Write(buf) 20753 // Since we bypassed the compiler's escape analysis, indicate that v 20754 // must live until the use above. 20755 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20756 return int64(length), err 20757 } 20758 20759 // SizeBytes implements marshal.Marshallable.SizeBytes. 20760 func (v *VFIOIommuType1DmaUnmap) SizeBytes() int { 20761 return 24 20762 } 20763 20764 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 20765 func (v *VFIOIommuType1DmaUnmap) MarshalBytes(dst []byte) []byte { 20766 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Argsz)) 20767 dst = dst[4:] 20768 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Flags)) 20769 dst = dst[4:] 20770 hostarch.ByteOrder.PutUint64(dst[:8], uint64(v.IOVa)) 20771 dst = dst[8:] 20772 hostarch.ByteOrder.PutUint64(dst[:8], uint64(v.Size)) 20773 dst = dst[8:] 20774 return dst 20775 } 20776 20777 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 20778 func (v *VFIOIommuType1DmaUnmap) UnmarshalBytes(src []byte) []byte { 20779 v.Argsz = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20780 src = src[4:] 20781 v.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20782 src = src[4:] 20783 v.IOVa = uint64(hostarch.ByteOrder.Uint64(src[:8])) 20784 src = src[8:] 20785 v.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) 20786 src = src[8:] 20787 return src 20788 } 20789 20790 // Packed implements marshal.Marshallable.Packed. 20791 //go:nosplit 20792 func (v *VFIOIommuType1DmaUnmap) Packed() bool { 20793 return true 20794 } 20795 20796 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 20797 func (v *VFIOIommuType1DmaUnmap) MarshalUnsafe(dst []byte) []byte { 20798 size := v.SizeBytes() 20799 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(v), uintptr(size)) 20800 return dst[size:] 20801 } 20802 20803 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 20804 func (v *VFIOIommuType1DmaUnmap) UnmarshalUnsafe(src []byte) []byte { 20805 size := v.SizeBytes() 20806 gohacks.Memmove(unsafe.Pointer(v), unsafe.Pointer(&src[0]), uintptr(size)) 20807 return src[size:] 20808 } 20809 20810 // CopyOutN implements marshal.Marshallable.CopyOutN. 20811 func (v *VFIOIommuType1DmaUnmap) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20812 // Construct a slice backed by dst's underlying memory. 20813 var buf []byte 20814 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20815 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20816 hdr.Len = v.SizeBytes() 20817 hdr.Cap = v.SizeBytes() 20818 20819 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 20820 // Since we bypassed the compiler's escape analysis, indicate that v 20821 // must live until the use above. 20822 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20823 return length, err 20824 } 20825 20826 // CopyOut implements marshal.Marshallable.CopyOut. 20827 func (v *VFIOIommuType1DmaUnmap) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20828 return v.CopyOutN(cc, addr, v.SizeBytes()) 20829 } 20830 20831 // CopyInN implements marshal.Marshallable.CopyInN. 20832 func (v *VFIOIommuType1DmaUnmap) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20833 // Construct a slice backed by dst's underlying memory. 20834 var buf []byte 20835 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20836 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20837 hdr.Len = v.SizeBytes() 20838 hdr.Cap = v.SizeBytes() 20839 20840 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 20841 // Since we bypassed the compiler's escape analysis, indicate that v 20842 // must live until the use above. 20843 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20844 return length, err 20845 } 20846 20847 // CopyIn implements marshal.Marshallable.CopyIn. 20848 func (v *VFIOIommuType1DmaUnmap) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20849 return v.CopyInN(cc, addr, v.SizeBytes()) 20850 } 20851 20852 // WriteTo implements io.WriterTo.WriteTo. 20853 func (v *VFIOIommuType1DmaUnmap) WriteTo(writer io.Writer) (int64, error) { 20854 // Construct a slice backed by dst's underlying memory. 20855 var buf []byte 20856 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20857 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20858 hdr.Len = v.SizeBytes() 20859 hdr.Cap = v.SizeBytes() 20860 20861 length, err := writer.Write(buf) 20862 // Since we bypassed the compiler's escape analysis, indicate that v 20863 // must live until the use above. 20864 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20865 return int64(length), err 20866 } 20867 20868 // SizeBytes implements marshal.Marshallable.SizeBytes. 20869 func (v *VFIOIrqInfo) SizeBytes() int { 20870 return 16 20871 } 20872 20873 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 20874 func (v *VFIOIrqInfo) MarshalBytes(dst []byte) []byte { 20875 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Argsz)) 20876 dst = dst[4:] 20877 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Flags)) 20878 dst = dst[4:] 20879 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Index)) 20880 dst = dst[4:] 20881 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Count)) 20882 dst = dst[4:] 20883 return dst 20884 } 20885 20886 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 20887 func (v *VFIOIrqInfo) UnmarshalBytes(src []byte) []byte { 20888 v.Argsz = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20889 src = src[4:] 20890 v.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20891 src = src[4:] 20892 v.Index = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20893 src = src[4:] 20894 v.Count = uint32(hostarch.ByteOrder.Uint32(src[:4])) 20895 src = src[4:] 20896 return src 20897 } 20898 20899 // Packed implements marshal.Marshallable.Packed. 20900 //go:nosplit 20901 func (v *VFIOIrqInfo) Packed() bool { 20902 return true 20903 } 20904 20905 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 20906 func (v *VFIOIrqInfo) MarshalUnsafe(dst []byte) []byte { 20907 size := v.SizeBytes() 20908 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(v), uintptr(size)) 20909 return dst[size:] 20910 } 20911 20912 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 20913 func (v *VFIOIrqInfo) UnmarshalUnsafe(src []byte) []byte { 20914 size := v.SizeBytes() 20915 gohacks.Memmove(unsafe.Pointer(v), unsafe.Pointer(&src[0]), uintptr(size)) 20916 return src[size:] 20917 } 20918 20919 // CopyOutN implements marshal.Marshallable.CopyOutN. 20920 func (v *VFIOIrqInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20921 // Construct a slice backed by dst's underlying memory. 20922 var buf []byte 20923 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20924 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20925 hdr.Len = v.SizeBytes() 20926 hdr.Cap = v.SizeBytes() 20927 20928 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 20929 // Since we bypassed the compiler's escape analysis, indicate that v 20930 // must live until the use above. 20931 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20932 return length, err 20933 } 20934 20935 // CopyOut implements marshal.Marshallable.CopyOut. 20936 func (v *VFIOIrqInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20937 return v.CopyOutN(cc, addr, v.SizeBytes()) 20938 } 20939 20940 // CopyInN implements marshal.Marshallable.CopyInN. 20941 func (v *VFIOIrqInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 20942 // Construct a slice backed by dst's underlying memory. 20943 var buf []byte 20944 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20945 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20946 hdr.Len = v.SizeBytes() 20947 hdr.Cap = v.SizeBytes() 20948 20949 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 20950 // Since we bypassed the compiler's escape analysis, indicate that v 20951 // must live until the use above. 20952 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20953 return length, err 20954 } 20955 20956 // CopyIn implements marshal.Marshallable.CopyIn. 20957 func (v *VFIOIrqInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 20958 return v.CopyInN(cc, addr, v.SizeBytes()) 20959 } 20960 20961 // WriteTo implements io.WriterTo.WriteTo. 20962 func (v *VFIOIrqInfo) WriteTo(writer io.Writer) (int64, error) { 20963 // Construct a slice backed by dst's underlying memory. 20964 var buf []byte 20965 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 20966 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 20967 hdr.Len = v.SizeBytes() 20968 hdr.Cap = v.SizeBytes() 20969 20970 length, err := writer.Write(buf) 20971 // Since we bypassed the compiler's escape analysis, indicate that v 20972 // must live until the use above. 20973 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 20974 return int64(length), err 20975 } 20976 20977 // SizeBytes implements marshal.Marshallable.SizeBytes. 20978 func (v *VFIOIrqSet) SizeBytes() int { 20979 return 20 20980 } 20981 20982 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 20983 func (v *VFIOIrqSet) MarshalBytes(dst []byte) []byte { 20984 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Argsz)) 20985 dst = dst[4:] 20986 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Flags)) 20987 dst = dst[4:] 20988 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Index)) 20989 dst = dst[4:] 20990 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Start)) 20991 dst = dst[4:] 20992 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Count)) 20993 dst = dst[4:] 20994 return dst 20995 } 20996 20997 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 20998 func (v *VFIOIrqSet) UnmarshalBytes(src []byte) []byte { 20999 v.Argsz = uint32(hostarch.ByteOrder.Uint32(src[:4])) 21000 src = src[4:] 21001 v.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 21002 src = src[4:] 21003 v.Index = uint32(hostarch.ByteOrder.Uint32(src[:4])) 21004 src = src[4:] 21005 v.Start = uint32(hostarch.ByteOrder.Uint32(src[:4])) 21006 src = src[4:] 21007 v.Count = uint32(hostarch.ByteOrder.Uint32(src[:4])) 21008 src = src[4:] 21009 return src 21010 } 21011 21012 // Packed implements marshal.Marshallable.Packed. 21013 //go:nosplit 21014 func (v *VFIOIrqSet) Packed() bool { 21015 return true 21016 } 21017 21018 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 21019 func (v *VFIOIrqSet) MarshalUnsafe(dst []byte) []byte { 21020 size := v.SizeBytes() 21021 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(v), uintptr(size)) 21022 return dst[size:] 21023 } 21024 21025 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 21026 func (v *VFIOIrqSet) UnmarshalUnsafe(src []byte) []byte { 21027 size := v.SizeBytes() 21028 gohacks.Memmove(unsafe.Pointer(v), unsafe.Pointer(&src[0]), uintptr(size)) 21029 return src[size:] 21030 } 21031 21032 // CopyOutN implements marshal.Marshallable.CopyOutN. 21033 func (v *VFIOIrqSet) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 21034 // Construct a slice backed by dst's underlying memory. 21035 var buf []byte 21036 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 21037 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 21038 hdr.Len = v.SizeBytes() 21039 hdr.Cap = v.SizeBytes() 21040 21041 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 21042 // Since we bypassed the compiler's escape analysis, indicate that v 21043 // must live until the use above. 21044 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 21045 return length, err 21046 } 21047 21048 // CopyOut implements marshal.Marshallable.CopyOut. 21049 func (v *VFIOIrqSet) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 21050 return v.CopyOutN(cc, addr, v.SizeBytes()) 21051 } 21052 21053 // CopyInN implements marshal.Marshallable.CopyInN. 21054 func (v *VFIOIrqSet) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 21055 // Construct a slice backed by dst's underlying memory. 21056 var buf []byte 21057 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 21058 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 21059 hdr.Len = v.SizeBytes() 21060 hdr.Cap = v.SizeBytes() 21061 21062 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 21063 // Since we bypassed the compiler's escape analysis, indicate that v 21064 // must live until the use above. 21065 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 21066 return length, err 21067 } 21068 21069 // CopyIn implements marshal.Marshallable.CopyIn. 21070 func (v *VFIOIrqSet) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 21071 return v.CopyInN(cc, addr, v.SizeBytes()) 21072 } 21073 21074 // WriteTo implements io.WriterTo.WriteTo. 21075 func (v *VFIOIrqSet) WriteTo(writer io.Writer) (int64, error) { 21076 // Construct a slice backed by dst's underlying memory. 21077 var buf []byte 21078 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 21079 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 21080 hdr.Len = v.SizeBytes() 21081 hdr.Cap = v.SizeBytes() 21082 21083 length, err := writer.Write(buf) 21084 // Since we bypassed the compiler's escape analysis, indicate that v 21085 // must live until the use above. 21086 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 21087 return int64(length), err 21088 } 21089 21090 // SizeBytes implements marshal.Marshallable.SizeBytes. 21091 func (v *VFIORegionInfo) SizeBytes() int { 21092 return 32 21093 } 21094 21095 // MarshalBytes implements marshal.Marshallable.MarshalBytes. 21096 func (v *VFIORegionInfo) MarshalBytes(dst []byte) []byte { 21097 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Argsz)) 21098 dst = dst[4:] 21099 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Flags)) 21100 dst = dst[4:] 21101 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.Index)) 21102 dst = dst[4:] 21103 hostarch.ByteOrder.PutUint32(dst[:4], uint32(v.capOffset)) 21104 dst = dst[4:] 21105 hostarch.ByteOrder.PutUint64(dst[:8], uint64(v.Size)) 21106 dst = dst[8:] 21107 hostarch.ByteOrder.PutUint64(dst[:8], uint64(v.Offset)) 21108 dst = dst[8:] 21109 return dst 21110 } 21111 21112 // UnmarshalBytes implements marshal.Marshallable.UnmarshalBytes. 21113 func (v *VFIORegionInfo) UnmarshalBytes(src []byte) []byte { 21114 v.Argsz = uint32(hostarch.ByteOrder.Uint32(src[:4])) 21115 src = src[4:] 21116 v.Flags = uint32(hostarch.ByteOrder.Uint32(src[:4])) 21117 src = src[4:] 21118 v.Index = uint32(hostarch.ByteOrder.Uint32(src[:4])) 21119 src = src[4:] 21120 v.capOffset = uint32(hostarch.ByteOrder.Uint32(src[:4])) 21121 src = src[4:] 21122 v.Size = uint64(hostarch.ByteOrder.Uint64(src[:8])) 21123 src = src[8:] 21124 v.Offset = uint64(hostarch.ByteOrder.Uint64(src[:8])) 21125 src = src[8:] 21126 return src 21127 } 21128 21129 // Packed implements marshal.Marshallable.Packed. 21130 //go:nosplit 21131 func (v *VFIORegionInfo) Packed() bool { 21132 return true 21133 } 21134 21135 // MarshalUnsafe implements marshal.Marshallable.MarshalUnsafe. 21136 func (v *VFIORegionInfo) MarshalUnsafe(dst []byte) []byte { 21137 size := v.SizeBytes() 21138 gohacks.Memmove(unsafe.Pointer(&dst[0]), unsafe.Pointer(v), uintptr(size)) 21139 return dst[size:] 21140 } 21141 21142 // UnmarshalUnsafe implements marshal.Marshallable.UnmarshalUnsafe. 21143 func (v *VFIORegionInfo) UnmarshalUnsafe(src []byte) []byte { 21144 size := v.SizeBytes() 21145 gohacks.Memmove(unsafe.Pointer(v), unsafe.Pointer(&src[0]), uintptr(size)) 21146 return src[size:] 21147 } 21148 21149 // CopyOutN implements marshal.Marshallable.CopyOutN. 21150 func (v *VFIORegionInfo) CopyOutN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 21151 // Construct a slice backed by dst's underlying memory. 21152 var buf []byte 21153 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 21154 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 21155 hdr.Len = v.SizeBytes() 21156 hdr.Cap = v.SizeBytes() 21157 21158 length, err := cc.CopyOutBytes(addr, buf[:limit]) // escapes: okay. 21159 // Since we bypassed the compiler's escape analysis, indicate that v 21160 // must live until the use above. 21161 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 21162 return length, err 21163 } 21164 21165 // CopyOut implements marshal.Marshallable.CopyOut. 21166 func (v *VFIORegionInfo) CopyOut(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 21167 return v.CopyOutN(cc, addr, v.SizeBytes()) 21168 } 21169 21170 // CopyInN implements marshal.Marshallable.CopyInN. 21171 func (v *VFIORegionInfo) CopyInN(cc marshal.CopyContext, addr hostarch.Addr, limit int) (int, error) { 21172 // Construct a slice backed by dst's underlying memory. 21173 var buf []byte 21174 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 21175 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 21176 hdr.Len = v.SizeBytes() 21177 hdr.Cap = v.SizeBytes() 21178 21179 length, err := cc.CopyInBytes(addr, buf[:limit]) // escapes: okay. 21180 // Since we bypassed the compiler's escape analysis, indicate that v 21181 // must live until the use above. 21182 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 21183 return length, err 21184 } 21185 21186 // CopyIn implements marshal.Marshallable.CopyIn. 21187 func (v *VFIORegionInfo) CopyIn(cc marshal.CopyContext, addr hostarch.Addr) (int, error) { 21188 return v.CopyInN(cc, addr, v.SizeBytes()) 21189 } 21190 21191 // WriteTo implements io.WriterTo.WriteTo. 21192 func (v *VFIORegionInfo) WriteTo(writer io.Writer) (int64, error) { 21193 // Construct a slice backed by dst's underlying memory. 21194 var buf []byte 21195 hdr := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) 21196 hdr.Data = uintptr(gohacks.Noescape(unsafe.Pointer(v))) 21197 hdr.Len = v.SizeBytes() 21198 hdr.Cap = v.SizeBytes() 21199 21200 length, err := writer.Write(buf) 21201 // Since we bypassed the compiler's escape analysis, indicate that v 21202 // must live until the use above. 21203 runtime.KeepAlive(v) // escapes: replaced by intrinsic. 21204 return int64(length), err 21205 } 21206