Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/gpu/driver/chan/dma.om # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / gpu / driver / chan / dma.om` 44 lines ยท 1098 bytes Raw Blame History 1 note chan/dma.om: production whole-window VFIO DMA transport for chan/gmmu.om. 2 note Linux include/uapi/linux/vfio.h struct vfio_iommu_type1_dma_map/unmap. 3 note Compiler397e6704 validates a live RW handle in vaddr and substitutes its base/whole size. 4 note No open, close, reset, container adoption or authorization is performed here. 5 note mmdmaop 1 maps; 2 unmaps. mmduout is actual unmapped bytes, only meaningful after rc0. 6 global mmduout ulong 1 7 fn mmdput b edit uchar 32 off ulong v ulong to void 8 for i ulong 8 9 put b add off i uchar and shr v mul i 8 255 10 end 11 end 12 fn mmdget b view uchar 32 off ulong to ulong 13 v = ulong 0 14 for i ulong 8 15 v = or v shl ulong get b add off i mul i 8 16 end 17 ret v 18 end 19 fn mmdmaop op ulong fd int h long iova ulong size ulong to long 20 b = new uchar 32 0 21 put mmduout 0 0 22 if eq op 1 23 put b 0 32 24 put b 4 3 25 mmdput b 8 ulong h 26 mmdput b 16 iova 27 mmdput b 24 size 28 ret vfioctl fd 15217 b 0 32 29 end 30 if ne op 2 31 ret -22 32 end 33 put b 0 24 34 mmdput b 8 iova 35 mmdput b 16 size 36 r = vfioctl fd 15218 b 0 24 37 if eq r 0 38 put mmduout 0 mmdget b 16 39 end 40 ret r 41 end 42 fn mmdrop h long to long 43 ret mapdrop h 44 end