github.com/ii64/gouring@v0.4.1/hdr_struct.go (about) 1 package gouring 2 3 import "unsafe" 4 5 const ( 6 SizeofUnsigned = unsafe.Sizeof(uint32(0)) 7 SizeofUint32 = unsafe.Sizeof(uint32(0)) 8 SizeofIoUringSqe = unsafe.Sizeof(IoUringSqe{}) 9 SizeofIoUringCqe = unsafe.Sizeof(IoUringCqe{}) 10 ) 11 12 type IoUring struct { 13 Sq IoUringSq 14 Cq IoUringCq 15 Flags uint32 16 RingFd int 17 18 Features uint32 19 EnterRingFd int 20 IntFlags uint8 21 22 pad [3]uint8 23 pad2 uint32 24 } 25 26 type IoUringSq struct { 27 head unsafe.Pointer // *uint32 28 tail unsafe.Pointer // *uint32 29 ringMask unsafe.Pointer // *uint32 30 ringEntries unsafe.Pointer // *uint32 31 flags unsafe.Pointer // *uint32 32 dropped unsafe.Pointer // *uint32 33 34 Array uint32Array //ptr arith 35 Sqes ioUringSqeArray //ptr arith 36 37 SqeHead uint32 38 SqeTail uint32 39 40 RingSz uint32 41 RingPtr unsafe.Pointer 42 43 pad [4]uint32 44 } 45 46 func (sq *IoUringSq) _Head() *uint32 { return (*uint32)(sq.head) } 47 func (sq *IoUringSq) _Tail() *uint32 { return (*uint32)(sq.tail) } 48 func (sq *IoUringSq) _RingMask() *uint32 { return (*uint32)(sq.ringMask) } 49 func (sq *IoUringSq) _RingEntries() *uint32 { return (*uint32)(sq.ringEntries) } 50 func (sq *IoUringSq) _Flags() *uint32 { return (*uint32)(sq.flags) } 51 func (sq *IoUringSq) _Dropped() *uint32 { return (*uint32)(sq.dropped) } 52 53 type IoUringCq struct { 54 head unsafe.Pointer // *uint32 55 tail unsafe.Pointer // *uint32 56 ringMask unsafe.Pointer // *uint32 57 ringEntries unsafe.Pointer // *uint32 58 flags unsafe.Pointer // *uint32 59 overflow unsafe.Pointer // *uint32 60 61 Cqes ioUringCqeArray //ptr arith 62 63 RingSz uint32 64 RingPtr unsafe.Pointer 65 66 pad [4]uint32 67 } 68 69 func (cq *IoUringCq) _Head() *uint32 { return (*uint32)(cq.head) } 70 func (cq *IoUringCq) _Tail() *uint32 { return (*uint32)(cq.tail) } 71 func (cq *IoUringCq) _RingMask() *uint32 { return (*uint32)(cq.ringMask) } 72 func (cq *IoUringCq) _RingEntries() *uint32 { return (*uint32)(cq.ringEntries) } 73 func (cq *IoUringCq) _Flags() *uint32 { return (*uint32)(cq.flags) } 74 func (cq *IoUringCq) _Overflow() *uint32 { return (*uint32)(cq.overflow) }